[英]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.