From f8a5fc1f19dd473f5e390f70bdfaabc2ff74baa8 Mon Sep 17 00:00:00 2001 From: Christoph Bergmeister Date: Mon, 8 Jan 2018 20:32:38 +0000 Subject: [PATCH] packaging: x86 package gets installed as an x64 component and has the same UpgradeCode as the x64 installer leading to an uninstallation of an x64 installation (and vice versa) (#5812) Fix bug #5597: x86/x64 installer are uninstalling each other when installing either of them: -Make x86 installer to be installed as an x86 component (-arch argument to candle.exe, which sets the `sys.BUILDARCH` variable) -Make the UpgradeCode unique per platform -Replace `var.ProductTargetArchitecture` variable with sys.BUILDARCH use to have only 1 variable for the architecture -Additionally, the architecture was appended to the package name to be able to distinguish the installations. --- assets/Product.wxs | 15 +++++++++------ build.psm1 | 3 +-- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/assets/Product.wxs b/assets/Product.wxs index f656ddd19f..d5434ce809 100644 --- a/assets/Product.wxs +++ b/assets/Product.wxs @@ -6,21 +6,24 @@ + + + + + + - - - - - + + - + diff --git a/build.psm1 b/build.psm1 index 772623b7dc..b17a39842a 100644 --- a/build.psm1 +++ b/build.psm1 @@ -2141,7 +2141,6 @@ function New-MSIPackage [Environment]::SetEnvironmentVariable("ProductVersion", $ProductVersion, "Process") [Environment]::SetEnvironmentVariable("ProductSemanticVersion", $ProductSemanticVersion, "Process") [Environment]::SetEnvironmentVariable("ProductVersionWithName", $productVersionWithName, "Process") - [Environment]::SetEnvironmentVariable("ProductTargetArchitecture", $ProductTargetArchitecture, "Process") $ProductProgFilesDir = "ProgramFiles64Folder" if ($ProductTargetArchitecture -eq "x86") { @@ -2165,7 +2164,7 @@ function New-MSIPackage } $WiXHeatLog = & $wixHeatExePath dir $ProductSourcePath -dr $productVersionWithName -cg $productVersionWithName -gg -sfrag -srd -scom -sreg -out $wixFragmentPath -var env.ProductSourcePath -v - $WiXCandleLog = & $wixCandleExePath "$ProductWxsPath" "$wixFragmentPath" -out (Join-Path "$env:Temp" "\\") -ext WixUIExtension -ext WixUtilExtension -arch x64 -v + $WiXCandleLog = & $wixCandleExePath "$ProductWxsPath" "$wixFragmentPath" -out (Join-Path "$env:Temp" "\\") -ext WixUIExtension -ext WixUtilExtension -arch $ProductTargetArchitecture -v $WiXLightLog = & $wixLightExePath -out $msiLocationPath $wixObjProductPath $wixObjFragmentPath -ext WixUIExtension -ext WixUtilExtension -dWixUILicenseRtf="$LicenseFilePath" -v Remove-Item -ErrorAction SilentlyContinue *.wixpdb -Force