Wix MSI 默认安装位置是 32 位而不是 64 位“Program Files (x86)"; [英] Wix MSI default installation location is 32bit instead of 64bit "Program Files (x86)"
问题描述
我使用 WIx 安装程序创建了一个 MSI,其默认安装位置显示为程序文件而不是程序文件 (x86)
I created an MSI using WIx installer and its default installation location is showing as Program files instead of Program Files (x86)
在 Visual Studio Release 模式 x64 中创建的应用
App created in Visual studio Release mode x64
Wix Code snippet
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" Manufacturer="X Tec" Description="Version 1.0" Comments="(C) 2020 X Tec" Platform="x64"/>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFiles64Folder">
<Directory Id="MANUFACTURERDIR" Name="X Tec">
作为ProgramFiles64Folder"是给它应该放在程序文件(x86)中,我错过了什么
As "ProgramFiles64Folder" is give it should go in Program Files (x86), Do i miss something
推荐答案
以下示例,请确保您的组件标记为 64 位:
Sample below, make sure your component is marked as 64-bit:
构造:$(env.SystemRoot)
- 在下面的 WiX 源代码中 -获取环境变量 %SystemRoot%
- 解析为C:\
在大多数系统上(要列出环境变量,请打开一个 cmd.exe
并输入 set
并按 Enter
).因此,以下来源应无需修改即可在所有系统上编译:
The construct:
$(env.SystemRoot)
- in the WiX source below - gets the environment variable%SystemRoot%
- which resolves toC:\
on most systems (to list environment variables open acmd.exe
and typeset
and pressEnter
). The below source should hence compile on all systems without modifications:
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="Sample" Language="1033" Version="1.0.0"
Manufacturer="." UpgradeCode="PUT-GUID-HERE">
<Package InstallerVersion="200" Compressed="yes"
InstallScope="perMachine" Platform="x64" />
<MediaTemplate EmbedCab="yes" />
<Feature Id="MainFeature" Title="MainFeature" Level="1" />
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFiles64Folder">
<Directory Id="MainApplicationFolder" Name="Main Application Folder">
<!-- Using notepad.exe as sample file should compile on all systems -->
<Component Feature="MainFeature" Win64="yes">
<File Source="$(env.SystemRoot)\notepad.exe" />
</Component>
</Directory>
</Directory>
</Directory>
</Product>
</Wix>
链接:
- 编译 x86 和 x64 位版本.
- https://helgeklein.com/blog/2014/09/real-world-example-wix-msi-application-installer/
这篇关于Wix MSI 默认安装位置是 32 位而不是 64 位“Program Files (x86)";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!