From d05c7259ef8781bf69141d4189cb5275593154b2 Mon Sep 17 00:00:00 2001 From: Christoph Bergmeister Date: Wed, 13 Sep 2017 19:48:24 +0100 Subject: [PATCH 1/2] Make the build output the WiX compilation log if it failed. Before it was not outputting it not at all because the build output is an array that was piped directly to 'Write-Verbose' instead of converting it to a string using 'Out-String' Because the WiX log is usually quite verbose (around 250 lines), the log is only shown if there must have been a compilation error due to the missing MSI --- build.psm1 | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/build.psm1 b/build.psm1 index c7f593ed580..4ac328df9a7 100644 --- a/build.psm1 +++ b/build.psm1 @@ -1831,9 +1831,9 @@ function New-MSIPackage Write-Error -Message "Package already exists, use -Force to overwrite, path: $msiLocationPath" -ErrorAction Stop } - & $wixHeatExePath dir $ProductSourcePath -dr $productVersionWithName -cg $productVersionWithName -gg -sfrag -srd -scom -sreg -out $wixFragmentPath -var env.ProductSourcePath -v | Write-Verbose - & $wixCandleExePath "$ProductWxsPath" "$wixFragmentPath" -out (Join-Path "$env:Temp" "\\") -ext WixUIExtension -ext WixUtilExtension -arch x64 -v | Write-Verbose - & $wixLightExePath -out $msiLocationPath $wixObjProductPath $wixObjFragmentPath -ext WixUIExtension -ext WixUtilExtension -dWixUILicenseRtf="$LicenseFilePath" -v | Write-Verbose + $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 + $WiXLightLog = & $wixLightExePath -out $msiLocationPath $wixObjProductPath $wixObjFragmentPath -ext WixUIExtension -ext WixUtilExtension -dWixUILicenseRtf="$LicenseFilePath" -v Remove-Item -ErrorAction SilentlyContinue *.wixpdb -Force @@ -1844,6 +1844,9 @@ function New-MSIPackage } else { + $WiXHeatLog | Out-String | Write-Verbose + $WiXCandleLog | Out-String | Write-Verbose + $WiXLightLog | Out-String | Write-Verbose throw "Failed to create $msiLocationPath" } } From b9281826ce1ea690873860e198b9d9450dd11eb4 Mon Sep 17 00:00:00 2001 From: Christoph Bergmeister Date: Wed, 13 Sep 2017 20:35:59 +0100 Subject: [PATCH 2/2] PR 4831: Use -Verbose option on Write-Verbose to force output in build as suggested in review. --- build.psm1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build.psm1 b/build.psm1 index 4ac328df9a7..5f0e3d8d607 100644 --- a/build.psm1 +++ b/build.psm1 @@ -1844,9 +1844,9 @@ function New-MSIPackage } else { - $WiXHeatLog | Out-String | Write-Verbose - $WiXCandleLog | Out-String | Write-Verbose - $WiXLightLog | Out-String | Write-Verbose + $WiXHeatLog | Out-String | Write-Verbose -Verbose + $WiXCandleLog | Out-String | Write-Verbose -Verbose + $WiXLightLog | Out-String | Write-Verbose -Verbose throw "Failed to create $msiLocationPath" } }