【问题标题】:Wix MSI default installation location is 32bit instead of 64bit "Program Files (x86)"Wix MSI 默认安装位置是 32 位而不是 64 位“Program Files (x86)”
【发布时间】:2020-08-06 10:48:00
【问题描述】:

我使用 WIx 安装程序创建了一个 MSI,其默认安装位置显示为程序文件而不是程序文件 (x86)

在 Visual Studio 发布模式 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”,它应该放在 Program Files (x86) 中,我错过了什么

【问题讨论】:

  • 以下解决了您的问题吗?

标签: visual-studio wix windows-installer


【解决方案1】:

下面的示例,确保您的组件标记为 64 位:

构造:$(env.SystemRoot) - 在下面的 WiX 源中 - 获取环境变量 %SystemRoot% - 解析为 C:\ 在大多数系统上(列出环境变量打开 cmd.exe 并键入 set 并按 Enter)。因此,以下来源应 无需修改即可在所有系统上编译:

<?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>

链接

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2010-10-19
    • 1970-01-01
    • 1970-01-01
    • 2015-03-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多