Skip to content

Directory id collisions with internal properties #2

Open

Description

@GermanDarknes

When creating an installer that includes a Time folder, the directory id collides with the internal properties and the installer won't work:
Image

ResolveWildCards will use the folder name as id.

IDs that should be avoided: https://learn.microsoft.com/en-us/windows/win32/msi/property-reference

The problem is decribed here: https://learn.microsoft.com/en-us/windows/win32/msi/directory-table

Note that when the directories are resolved during the CostFinalize action, the keys in the Directory table become properties set to directory paths.

This can be reproduced with PortableGit and the following config:

[general]
guid = "26a654c2-be1b-42e4-b9a6-12ba147a5078"
name = "PortableGit"
platform = "x64"
allow_downgrades = false
allow_same_version_upgrades = true
install_scope = "machine"

[install]
source_dirs = [".\\PortableGit\\*.*"]
source_dirs_are_recursive = true

[[install.env_vars]]
name = "PATH"
value = "@\\cmd"
part = "suffix"

Solution for this would be to add SIMPLEMSI_ as Prefix for every directory id.

_msi = new(config.Metadata?.DisplayName ?? config.General.Name, installDir)
{
    ...
    CustomIdAlgorithm =
        entity =>
        {
            if (entity is Dir)
            {
                return $"SIMPLEMSI_{WixEntity.IncrementalIdFor(entity)}";
            }
            return null;
        }
};

I got a PR ready for this: #4

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions