简体   繁体   English

如何在 Wix Toolkit 的 MSI 项目的模板摘要中插入 Intel64 或 x64?

[英]How can I insert Intel64 or x64 in Template Summary in an MSI project of Wix Toolkit?

I am writing a simple code to install a file in the Program Files folder, NOT Program Files (x86)我正在编写一个简单的代码来在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>

Basically it should create a folder del in Program Files and in it, it should create folder MyFolder which would contain FirstFile.txt基本上它应该在Program Files创建一个文件夹del并在其中创建文件夹MyFolder ,其中将包含FirstFile.txt

If I do it for Id = ProgramFilesFolder , it works by installing in Program Files (x86)如果我为Id = ProgramFilesFolder做它,它通过安装在Program Files (x86)

Changing it to ProgramFiles64Folder gives the following error将其更改为ProgramFiles64Folder会出现以下错误

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

My Question is from where or how can I change the Template Summary property ?我的问题是从哪里或如何更改模板摘要属性?

Thanks in Advance提前致谢

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

Specify the -arch switch at the candle.exe command line or the InstallerPlatform property in a .wixproj MSBuild project.在candle.exe 命令行或.wixproj MSBuild 项目中的InstallerPlatform 属性中指定-arch 开关。 When you specify x64 or intel64, Candle automatically sets the package and components in the file being compiled as 64-bit.当您指定 x64 或 intel64 时,Candle 会自动将正在编译的文件中的包和组件设置为 64 位。

Arnson's Approach : Do check out the answer from Bob Arnson . Arnson 的方法:请查看Bob Arnson的答案。 Here is an extract from his blog: "It's typical to want to produce both 32-bit and 64-bit packages from the same WiX source, so a common approach is to make the @Win64 attribute value a preprocessor variable ."以下是他博客的摘录: “通常希望从同一个 WiX 源生成 32 位和 64 位包,因此常用方法是将 @Win64 属性值设为预处理器变量。” Hence he uses a compiler switch to compile either x32 or x64-bit version MSI files from the same source.因此,他使用编译器开关来编译来自同一源的 x32 或 x64 位版本的 MSI 文件。

And no: you can not support both with architectures with one MSI.不:您不能同时支持具有一个 MSI 的架构。 See this blog from Heath Stewart : Different Packages are Required for Different Processor Architectures .请参阅Heath Stewart 的这篇博客: 不同的处理器架构需要不同的包


"Hard Coded" Way : Here is an old sample you can try: https://github.com/glytzhkof/WiXBitnessX64 “硬编码”方式:这是您可以尝试的旧示例: https : //github.com/glytzhkof/WiXBitnessX64

Some extracts:部分摘录:

Package element :包装元素

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

Component element :组件元素

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何为Windows 7 x64构建Git 2.4.5? - How can I build Git 2.4.5 for Windows 7 x64? 为x86和x64体系结构注册.msi(安装项目) - Register .msi (setup project) for both x86 and x64 architectures 如何在xamlx Designer中使用来自第三方x64 dll的类型? - How can I use types from a third party x64 dll in xamlx designer? 如何构建 RDKits C# Wrappers — Visual Studio 2019 x64 - How can I build RDKits C# Wrappers — Visual Studio 2019 x64 如何在64位pc下的Visual Studio中默认使用x64平台创建项目 - How to create a project with x64 platform by default in the Visual Studio under 64 bit pc 如何在我的开发环境中从Windows 7 x64上的C#连接到Oracle数据库 - How can I connect to an Oracle Database from C# on Windows 7 x64 in my development environment 将 x86 项目转换为 x64 时如何解决错误 LNK1112? - How to solve error LNK1112 when converting a x86 project to x64? 我可以在x86机器上测试我的应用程序的x64版本吗? - Can I test an x64 version of my application on an x86 machine? Sgen和x64项目配置以创建XML Serializers程序集 - Sgen and x64 project configuration to create XML Serializers assembly 将x64平台配置添加到VC ++项目 - Adding x64 platform configuration to VC++ project
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM