From 238ff90d72c0e9be732f80a65fdd76a11726bfee Mon Sep 17 00:00:00 2001 From: Chris Date: Tue, 2 Jan 2018 19:33:43 +0000 Subject: [PATCH] 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. --- build.psm1 | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/build.psm1 b/build.psm1 index 0fed7d091..06e34e0b3 100644 --- a/build.psm1 +++ b/build.psm1 @@ -2148,9 +2148,9 @@ function New-MSIPackage } [Environment]::SetEnvironmentVariable("ProductProgFilesDir", $ProductProgFilesDir, "Process") - $wixFragmentPath = (Join-path $env:Temp "Fragment.wxs") - $wixObjProductPath = (Join-path $env:Temp "Product.wixobj") - $wixObjFragmentPath = (Join-path $env:Temp "Fragment.wixobj") + $wixFragmentPath = Join-Path $env:Temp "Fragment.wxs" + $wixObjProductPath = Join-Path $env:Temp "Product.wixobj" + $wixObjFragmentPath = Join-Path $env:Temp "Fragment.wixobj" $packageName = $productSemanticVersionWithName if ($ProductNameSuffix) { @@ -2168,6 +2168,9 @@ function New-MSIPackage $WiXLightLog = & $wixLightExePath -out $msiLocationPath $wixObjProductPath $wixObjFragmentPath -ext WixUIExtension -ext WixUtilExtension -dWixUILicenseRtf="$LicenseFilePath" -v Remove-Item -ErrorAction SilentlyContinue *.wixpdb -Force + Remove-Item -ErrorAction SilentlyContinue $wixFragmentPath -Force + Remove-Item -ErrorAction SilentlyContinue $wixObjProductPath -Force + Remove-Item -ErrorAction SilentlyContinue $wixObjFragmentPath -Force if (Test-Path $msiLocationPath) {