WiX ProgramFiles64Folder 的行为类似于 ProgramFilesFolder (x86)

发布于 2024-10-14 07:57:26 字数 1199 浏览 4 评论 0原文

我构建了一个简单的安装程序,将文件复制到 Program Files 下的文件夹中。尽管将组件定义为 Win64,将目录定义为 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>

I building a simple installer that copies files to a folder under Program Files. In spite of defining the Component as Win64 and Directory to be ProgramFiles64Folder, the MSI at runtime changes the install path . I ran it using verbose log mode and I get the following message

 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).

Below is my snippet (use registry to populate 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>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

蒗幽 2024-10-21 07:57:26

这是椅子和键盘之间的问题。我将包平台错误地定义为“ia64”而不是“x64”。问题解决了!

This is a problem between chair and keyboard. I defined the package platform incorrectly as "ia64" instead of "x64". Problem solved!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文