diff --git a/assets/files.wxs b/assets/files.wxs index aae18df13f..a61bee0800 100644 --- a/assets/files.wxs +++ b/assets/files.wxs @@ -1,6 +1,7 @@  + @@ -127,7 +128,7 @@ - + @@ -418,7 +419,7 @@ - + @@ -649,7 +650,7 @@ - + diff --git a/tools/packaging/packaging.psm1 b/tools/packaging/packaging.psm1 index de8303c4dc..576355131b 100644 --- a/tools/packaging/packaging.psm1 +++ b/tools/packaging/packaging.psm1 @@ -1542,12 +1542,15 @@ function New-MSIPackage [Environment]::SetEnvironmentVariable("ProductVersion", $ProductVersion, "Process") [Environment]::SetEnvironmentVariable("ProductSemanticVersion", $ProductSemanticVersion, "Process") [Environment]::SetEnvironmentVariable("ProductVersionWithName", $productVersionWithName, "Process") + $fileArchitecture = 'amd64' $ProductProgFilesDir = "ProgramFiles64Folder" if ($ProductTargetArchitecture -eq "x86") { + $fileArchitecture = 'x86' $ProductProgFilesDir = "ProgramFilesFolder" } [Environment]::SetEnvironmentVariable("ProductProgFilesDir", $ProductProgFilesDir, "Process") + [Environment]::SetEnvironmentVariable("FileArchitecture", $fileArchitecture, "Process") $wixFragmentPath = Join-Path $env:Temp "Fragment.wxs" $wixObjProductPath = Join-Path $env:Temp "Product.wixobj" @@ -1624,7 +1627,9 @@ function Test-FileWxs [string] $HeatFilesWxsPath ) - [xml] $filesAssetXml = Get-Content -Raw -Path $FilesWxsPath + $filesAssetString = (Get-Content -Raw -Path $FilesWxsPath).Replace('$(var.FileArchitecture)',$env:FileArchitecture) + + [xml] $filesAssetXml = $filesAssetString [xml] $heatFilesXml = Get-Content -Raw -Path $HeatFilesWxsPath $assetFiles = $filesAssetXml.GetElementsByTagName('File') $heatFiles = $heatFilesXml.GetElementsByTagName('File')