我构建了一个简单的安装程序,可以将文件复制到Program Files下的文件夹中。尽管将Component定义为Win64,将Directory定义为ProgramFiles64Folder,但运行时的MSI会更改安装路径。我使用详细日志模式运行它,我得到以下消息
WIN64DUALFOLDERS: 'C:\Program Files (x86)\' will substitute 17 characters in 'C:\Program Files\' folder path. (mask argument = 0, the folder pair's iSwapAttrib member = 0).
下面是我的代码片段(使用注册表来填充INSTALLDIR)
<Property Id="INSTALLDIR">
<RegistrySearch
Id="AsteaRegistryKeys"
Type="raw"
Root="HKLM"
Key="Software\MyCompany\1.0\MyApplication"
Name="InstallDir" />
</Property>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFiles64Folder">
<Directory Id="MyCompany">
<Directory Id="INSTALLDIR">
<Component
Id="MainExecutable"
Guid="1537B67F-6D49-4bbc-89DC-20A1FB7E07E0" Win64="yes">
<File
Id="EXE"
Name="MyApp.exe"
DiskId="1"
Source="Source_Bin\MyApp.exe"
KeyPath="no" />
</Directory>
</Directory>
</Directory>
</Directory>
答案 0 :(得分:1)
这是椅子和键盘之间的问题。我将包平台错误地定义为“ia64”而不是“x64”。问题解决了!