【问题标题】:How can I insert Intel64 or x64 in Template Summary in an MSI project of Wix Toolkit?如何在 Wix Toolkit 的 MSI 项目的模板摘要中插入 Intel64 或 x64?
【发布时间】:2021-07-27 14:56:37
【问题描述】:

我正在编写一个简单的代码来在Program Files 文件夹中安装一个文件,而不是Program Files (x86)

<Fragment>
    <Directory Id="TARGETDIR" Name="SourceDir">
        <Directory Id="ProgramFiles64Folder">
            <Directory Id="INSTALLFOLDER" Name="Del">
                <Directory Id="MyFolder" Name="MyFolder"/>
            </Directory>
        </Directory>
    </Directory>
</Fragment>

<Fragment>
    <Component Id="Component1" Directory="MyFolder" Win64="yes">
       <File Id="FirstFile.txt"/>
    </Component>
</Fragment>

基本上它应该在Program Files 中创建一个文件夹del,并在其中创建一个文件夹MyFolder,其中包含FirstFile.txt

如果我为 Id = ProgramFilesFolder 这样做,它可以通过安装在 Program Files (x86) 中工作

将其更改为 ProgramFiles64Folder 会出现以下错误

ICE80: This package contains 64 bit component 'Component1' but the Template Summary Property does not contain Intel64 or x64.   

我的问题是从哪里或如何更改模板摘要属性?

提前致谢

【问题讨论】:

    标签: visual-studio wix windows-installer x86-64 program-files


    【解决方案1】:

    来自https://www.joyofsetup.com/2010/05/14/working-hard-or-hardly-working/#manually-marking-package-and-component-bitness

    在candle.exe 命令行或.wixproj MSBuild 项目中的InstallerPlatform 属性中指定-arch 开关。当您指定 x64 或 intel64 时,Candle 会自动将正在编译的文件中的包和组件设置为 64 位。

    【讨论】:

      【解决方案2】:

      Arnson 的方法:请查看Bob Arnson 的答案。以下是他博客的摘录:“通常希望从同一个 WiX 源生成 32 位和 64 位软件包,因此一种常见的方法是将 @Win64 属性值设置为 preprocessor variable。 " 因此,他使用编译器开关来编译来自同一源的 x32 或 x64 位版本的 MSI 文件。

      不:你不能同时支持一个 MSI 的架构。请参阅来自Heath Stewart 的此博客:Different Packages are Required for Different Processor Architectures


      “硬编码”方式:这是一个您可以尝试的旧示例: https://github.com/glytzhkof/WiXBitnessX64

      部分摘录:

      包元素

      <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" Platform="x64" />
      

      组件元素

      <Component Feature="ProductFeature" Win64="yes">
        <File Source="$(env.SystemRoot)\notepad.exe" />
      </Component>
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2013-09-08
        • 1970-01-01
        • 1970-01-01
        • 2013-07-21
        • 1970-01-01
        相关资源
        最近更新 更多