wix - 我可以将自动生成的 GUIDS 与合并模块一起使用吗?

标签 wix windows-installer wix3.7 merge-module

我在 <Product> 中使用自动引导但无法弄清楚如何将它们与 <Module> 一起使用.我只得到这个错误:

The component X has a key file with path 'TARGETDIR\company...'. Since this path is not rooted in one of the standard directories (like ProgramFiles Folder), the component does not meet the criteria for having an automatically generated guid.

以上,company是映射到 !(loc.ProductManufacturerFolderName) 的值.

唯一的问题是事实并非如此。我的目录就像我的产品一样 Root 于 ProgramFiles,并且我的产品运行良好:

<Directory Id="TARGETDIR" Name="SourceDir">
    <Directory Id="ProgramFiles64Folder">
        <Directory Id="MODULEINSTALLLOCATION" Name="!(loc.ProductManufacturerFolderName)">
            <Directory Id="Data" Name="Data">

我所有的组件声明大致如下所示:

<Component Id="DocumentationParty_Business_TestCases_v1xlsx.component" Guid="{YOURGUID-1234-1234-84B3-C595A63428AD}" MultiInstance="yes">
    <File Source="../../Development/Integration/SSIS/Documentation/Party_Business_Test Cases_v1.xlsx" KeyPath="yes" Id="DocumentationParty_Business_TestCases_v1xlsx.file" />
</Component>

破解很简单,你只需要将 GUID 更改为 *以及上述错误结果。这是坏的:

<Component Id="DocumentationParty_Business_TestCases_v1xlsx.component" Guid="*" MultiInstance="yes">
    <File Source="../../Development/ClaimsIntegration/SSIS/Documentation/Party_Business_Test Cases_v1.xlsx" KeyPath="yes" Id="DocumentationParty_Business_TestCases_v1xlsx.file" />
</Component>

我为要安装组件的每个目录都有一个 .wxs 文件。我所有的组件持有 .wxs 文件都具有以下结构:

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
  <Fragment>
    <ComponentGroup Id="DatabasePolicy_Files">
      <ComponentRef Id="DatabasePolicyCreateDatabasecmdtemplate.component" />
    </ComponentGroup>
    <DirectoryRef Id="DataPolicy">
      <Component Id="DatabasePolicyCreateDatabasecmdtemplate.component" Guid="*" MultiInstance="yes">
        <File Source="../../Development/Database/Policy/CreateDatabase.cmd.template" KeyPath="yes" Id="DatabasePolicyCreateDatabasecmdtemplate.file" />
      </Component>
    </DirectoryRef>
  </Fragment>
</Wix>

每个<ComponentGroup>通过 <ComponentGroupRef> 包含在我的主 .wxs 文件中.这适用于我所有的 MSI 项目,并且只有在我开始使用合并模块后才会中断。此外,我已经尝试注释掉所有组件,除了符合上述定义的组件,它仍然会因相同的错误而中断。

问题是什么?

最佳答案

我自己也遇到过类似的问题,根据您的错误消息,它可能是一样的。 尝试添加一个 ComponentGuidGenerationSeed,这应该可以解决您的问题。 ComponentGuidGenerationSeed 也作用于所有子文件夹,因此顶层的一个就足够了。

例子:

<Directory Id="DOCUMENTATIONFOLDER" Name="Documentation" ComponentGuidGenerationSeed="a9f690d3-22b3-488f-bdac-bb665c25933c"/>

http://wixtoolset.org/documentation/manual/v3/xsd/wix/directory.html

The Component Guid Generation Seed is a guid that must be used when a Component with the generate guid directive ("*") is not rooted in a standard Windows Installer directory (for example, ProgramFilesFolder or CommonFilesFolder).

关于wix - 我可以将自动生成的 GUIDS 与合并模块一起使用吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34424365/

相关文章:

wix - 检查 wix Bootstrapper RegistrySearch bal :Condition only at time of installation

windows - 如何确定计算机是否运行 XP Service pack 3

c++ - 在安装过程中如何设置对MSI中当前登录用户(或任何其他本地用户)的文件夹共享访问权限?

wix - 使用提升的权限但不作为 LocalSystem 调用自定义操作

wix - 如何使用 Wix 工具集检查 ini 文件是否存在

.net - 在 WiX Burn 自定义托管 Bootstrap 中将 WIC 作为 .NET 4.0 之前的要求添加

windows-installer - 无法在Visual Studio 2017中为安装项目设置64位目标

wix - 是否可以使用 wix bootstrapper 自动下载先决条件

wix - 如何判断WIX Bootstrapper中是否安装了dotnet和VSTORuntime

wix - 新的 IsWiX 安装项目无法构建 - 未定义的预处理器变量