[英]Wix MSI default installation location is 32bit instead of 64bit "Program Files (x86)"
我使用 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”應該在程序文件(x86)中給出 go,我錯過了什么嗎
下面的示例,確保您的組件被標記為 64 位:
構造:
$(env.SystemRoot)
- 在下面的 WiX 源中 - 獲取環境變量%SystemRoot%
- 在大多數系統上解析為C:\
(列出環境變量打開一個cmd.exe
並按Enter
)並set
DA 452Z.exe 66 . 因此,以下源代碼應無需修改即可在所有系統上編譯:
<?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>
鏈接:
這正是它應該如何工作的。 在 64 位 Windows 安裝中,“Program Files”目錄是應安裝 64 位應用程序的位置。 “Program Files (x86)”目錄用於 32 位應用程序。 32 位應用程序應安裝到“程序文件”目錄中的唯一一次是在 32 位 Windows 安裝上。 在這種情況下,因為所有應用程序都是 32 位的,所以不需要“Program Files (x86)”目錄。
總之:
操作系統版本 | 64 位應用程序 | 32 位應用程序 |
---|---|---|
64位Windows | C:\Program Files | C:\Program 文件 (x86) |
32位Windows | (不適用) | C:\Program Files |
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.