private string GetStandardDirectoryParent(string directoryId)
        {
            switch (directoryId)
            {
            case "TARGETDIR":
                return(null);

            case "CommonFiles6432Folder":
            case "ProgramFiles6432Folder":
            case "System6432Folder":
                return(WindowsInstallerStandard.GetPlatformSpecificDirectoryId(directoryId, this.Platform));

            default:
                return("TARGETDIR");
            }
        }
        public string GetCanonicalDirectoryPath(Dictionary <string, IResolvedDirectory> directories, Dictionary <string, string> componentIdGenSeeds, string directory, Platform platform)
        {
            if (!directories.TryGetValue(directory, out var resolvedDirectory))
            {
                throw new WixException(ErrorMessages.ExpectedDirectory(directory));
            }

            if (null == resolvedDirectory.Path)
            {
                if (null != componentIdGenSeeds && componentIdGenSeeds.ContainsKey(directory))
                {
                    resolvedDirectory.Path = componentIdGenSeeds[directory];
                }
                else if (WindowsInstallerStandard.IsStandardDirectory(directory))
                {
                    resolvedDirectory.Path = WindowsInstallerStandard.GetPlatformSpecificDirectoryId(directory, platform);
                }
                else
                {
                    var name = resolvedDirectory.Name?.ToLowerInvariant();

                    if (String.IsNullOrEmpty(resolvedDirectory.DirectoryParent))
                    {
                        resolvedDirectory.Path = name;
                    }
                    else
                    {
                        var parentPath = this.GetCanonicalDirectoryPath(directories, componentIdGenSeeds, resolvedDirectory.DirectoryParent, platform);

                        if (null != resolvedDirectory.Name)
                        {
                            resolvedDirectory.Path = Path.Combine(parentPath, name);
                        }
                        else
                        {
                            resolvedDirectory.Path = parentPath;
                        }
                    }
                }
            }

            return(resolvedDirectory.Path);
        }