mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Make the build output the WiX compilation log if it failed. (#4831)
* 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 * PR 4831: Use -Verbose option on Write-Verbose to force output in build as suggested in review.
This commit is contained in:
committed by
Aditya Patwardhan
parent
a9db9ba482
commit
d804d7fd30
+6
-3
@@ -1840,9 +1840,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
|
||||
|
||||
@@ -1853,6 +1853,9 @@ function New-MSIPackage
|
||||
}
|
||||
else
|
||||
{
|
||||
$WiXHeatLog | Out-String | Write-Verbose -Verbose
|
||||
$WiXCandleLog | Out-String | Write-Verbose -Verbose
|
||||
$WiXLightLog | Out-String | Write-Verbose -Verbose
|
||||
throw "Failed to create $msiLocationPath"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user