Skip to content

Commit 238ff90

Browse files
bergmeisterTravisEz13
authored andcommitted
Cleanup temporarily created WiX files after compilation to be able to have a clean re-build (#5757)
When changing the WiX installer locally and rebuilding the MSI one can get into the terrible situation whereby a code change does not get compiled into the new MSI. This PR fixes the root cause of it, which is due to temporary WiX files that are created but not deleted after compilation and WiX then somehow decides to not recompile properly. I also removed redundant parenthesis of surrounding code.
1 parent 359a3f0 commit 238ff90

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

build.psm1

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2148,9 +2148,9 @@ function New-MSIPackage
21482148
}
21492149
[Environment]::SetEnvironmentVariable("ProductProgFilesDir", $ProductProgFilesDir, "Process")
21502150

2151-
$wixFragmentPath = (Join-path $env:Temp "Fragment.wxs")
2152-
$wixObjProductPath = (Join-path $env:Temp "Product.wixobj")
2153-
$wixObjFragmentPath = (Join-path $env:Temp "Fragment.wixobj")
2151+
$wixFragmentPath = Join-Path $env:Temp "Fragment.wxs"
2152+
$wixObjProductPath = Join-Path $env:Temp "Product.wixobj"
2153+
$wixObjFragmentPath = Join-Path $env:Temp "Fragment.wixobj"
21542154

21552155
$packageName = $productSemanticVersionWithName
21562156
if ($ProductNameSuffix) {
@@ -2168,6 +2168,9 @@ function New-MSIPackage
21682168
$WiXLightLog = & $wixLightExePath -out $msiLocationPath $wixObjProductPath $wixObjFragmentPath -ext WixUIExtension -ext WixUtilExtension -dWixUILicenseRtf="$LicenseFilePath" -v
21692169

21702170
Remove-Item -ErrorAction SilentlyContinue *.wixpdb -Force
2171+
Remove-Item -ErrorAction SilentlyContinue $wixFragmentPath -Force
2172+
Remove-Item -ErrorAction SilentlyContinue $wixObjProductPath -Force
2173+
Remove-Item -ErrorAction SilentlyContinue $wixObjFragmentPath -Force
21712174

21722175
if (Test-Path $msiLocationPath)
21732176
{

0 commit comments

Comments
 (0)