From 9986858c03174cdf5e1789f1f056483a5b2162ad Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Thu, 22 Feb 2018 11:23:44 -0800 Subject: [PATCH 01/16] include wixpdb as artifact in build --- .../PowerShellPackage.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/releaseBuild/Images/microsoft_powershell_windowsservercore/PowerShellPackage.ps1 b/tools/releaseBuild/Images/microsoft_powershell_windowsservercore/PowerShellPackage.ps1 index 1ff7ba872cc..b725a75fe3d 100644 --- a/tools/releaseBuild/Images/microsoft_powershell_windowsservercore/PowerShellPackage.ps1 +++ b/tools/releaseBuild/Images/microsoft_powershell_windowsservercore/PowerShellPackage.ps1 @@ -105,7 +105,7 @@ try{ Write-Verbose "Exporting packages ..." -verbose - Get-ChildItem $location\*.msi,$location\*.zip | ForEach-Object { + Get-ChildItem $location\*.msi,$location\*.zip,$location\*.wixpdb | ForEach-Object { $file = $_.FullName Write-Verbose "Copying $file to $destination" -verbose Copy-Item -Path $file -Destination "$destination\" -Force From aeaed3158fb9ca5d4bbe3aafdf6360017e2676ee Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Thu, 22 Feb 2018 11:06:59 -0800 Subject: [PATCH 02/16] ignore wix symbols --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 5900f796f96..942123b261d 100644 --- a/.gitignore +++ b/.gitignore @@ -35,6 +35,7 @@ dotnet-uninstall-debian-packages.sh # Ignore binaries and symbols *.pdb *.dll +*.wixpdb # Ignore packages *.deb From 167a5886f5dcf2ef94c530c6cc4d4d577a061515 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Thu, 22 Feb 2018 11:08:11 -0800 Subject: [PATCH 03/16] remove unused dialog --- assets/Product.wxs | 2 -- 1 file changed, 2 deletions(-) diff --git a/assets/Product.wxs b/assets/Product.wxs index db6cbbed5c5..63e4e3c3125 100644 --- a/assets/Product.wxs +++ b/assets/Product.wxs @@ -289,8 +289,6 @@ 1 "1"]]> - 1 - NOT Installed Installed AND PATCH From e55ab3f07fe42dc21168214ffde65b5685fb7344 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Thu, 22 Feb 2018 16:03:13 -0800 Subject: [PATCH 04/16] cleanup anything left behind from previous runs --- tools/packaging/packaging.psm1 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/packaging/packaging.psm1 b/tools/packaging/packaging.psm1 index 885c62e1cba..32d67ee28d0 100644 --- a/tools/packaging/packaging.psm1 +++ b/tools/packaging/packaging.psm1 @@ -1542,6 +1542,11 @@ function New-MSIPackage $wixObjProductPath = Join-Path $env:Temp "Product.wixobj" $wixObjFragmentPath = Join-Path $env:Temp "Fragment.wixobj" + # cleanup any garbage on the system + Remove-Item -ErrorAction SilentlyContinue $wixFragmentPath -Force + Remove-Item -ErrorAction SilentlyContinue $wixObjProductPath -Force + Remove-Item -ErrorAction SilentlyContinue $wixObjFragmentPath -Force + $packageName = $productSemanticVersionWithName if ($ProductNameSuffix) { $packageName += "-$ProductNameSuffix" From b102ebbd1f8dd7894d69cbf46f47d0c2dc35903c Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Thu, 22 Feb 2018 16:04:06 -0800 Subject: [PATCH 05/16] suppress ICE61, about same version upgrades being allowed --- tools/packaging/packaging.psm1 | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tools/packaging/packaging.psm1 b/tools/packaging/packaging.psm1 index 32d67ee28d0..219c0646b70 100644 --- a/tools/packaging/packaging.psm1 +++ b/tools/packaging/packaging.psm1 @@ -1560,7 +1560,16 @@ function New-MSIPackage $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 $ProductTargetArchitecture -v - $WiXLightLog = & $wixLightExePath -out $msiLocationPath $wixObjProductPath $wixObjFragmentPath -ext WixUIExtension -ext WixUtilExtension -dWixUILicenseRtf="$LicenseFilePath" -v + # fail early if candle failed + if(!(Test-path -Path $wixObjProductPath)) + { + $WiXCandleLog | Out-String | Write-Verbose -Verbose + throw "$wixObjProductPath was not produced" + } + + log "running light..." + # suppress ICE61, because we allow same version upgreades + $WiXLightLog = & $wixLightExePath -sice:ICE61 -out $msiLocationPath $wixObjProductPath $wixObjFragmentPath -ext WixUIExtension -ext WixUtilExtension -dWixUILicenseRtf="$LicenseFilePath" -v Remove-Item -ErrorAction SilentlyContinue *.wixpdb -Force Remove-Item -ErrorAction SilentlyContinue $wixFragmentPath -Force From 598102583a34e111a6ae213c818a1ecceeea770f Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Thu, 22 Feb 2018 16:08:52 -0800 Subject: [PATCH 06/16] start returning wixpdb output when building msi --- tools/packaging/packaging.psm1 | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tools/packaging/packaging.psm1 b/tools/packaging/packaging.psm1 index 219c0646b70..bc34939810e 100644 --- a/tools/packaging/packaging.psm1 +++ b/tools/packaging/packaging.psm1 @@ -1552,6 +1552,7 @@ function New-MSIPackage $packageName += "-$ProductNameSuffix" } $msiLocationPath = Join-Path $pwd "$packageName.msi" + $msiPdbLocationPath = Join-Path $pwd "$packageName.wixpdb" if(!$Force.IsPresent -and (Test-Path -Path $msiLocationPath)) { @@ -1569,17 +1570,21 @@ function New-MSIPackage log "running light..." # suppress ICE61, because we allow same version upgreades - $WiXLightLog = & $wixLightExePath -sice:ICE61 -out $msiLocationPath $wixObjProductPath $wixObjFragmentPath -ext WixUIExtension -ext WixUtilExtension -dWixUILicenseRtf="$LicenseFilePath" -v + $WiXLightLog = & $wixLightExePath -sice:ICE61 -out $msiLocationPath -pdbout $msiPdbLocationPath $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) + if ((Test-Path $msiLocationPath) -and (Test-Path $msiPdbLocationPath)) { + Write-Verbose "You can find the WixPdb @ $msiPdbLocationPath" -Verbose Write-Verbose "You can find the MSI @ $msiLocationPath" -Verbose - $msiLocationPath + [pscustomobject]@{ + msi=$msiLocationPath + wixpdb=$msiPdbLocationPath + } } else { From e9e82e181dea1270a4c2fd5923d6da5b89949e9a Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Thu, 22 Feb 2018 13:05:56 -0800 Subject: [PATCH 07/16] fix ICE18 error with wxs --- assets/Product.wxs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/Product.wxs b/assets/Product.wxs index 63e4e3c3125..5f121f8d15c 100644 --- a/assets/Product.wxs +++ b/assets/Product.wxs @@ -157,7 +157,7 @@ - + From 3e1899451cc1603d1d084a9454fea47c40d03454 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Thu, 22 Feb 2018 17:09:09 -0800 Subject: [PATCH 14/16] change logOutputOnError to VerboseOutputOnError --- build.psm1 | 6 +++--- tools/packaging/packaging.psm1 | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/build.psm1 b/build.psm1 index 48127bedfb0..4c91bcd2e11 100644 --- a/build.psm1 +++ b/build.psm1 @@ -2028,12 +2028,12 @@ function script:Start-NativeExecution param( [scriptblock]$sb, [switch]$IgnoreExitcode, - [switch]$LogOutputOnError + [switch]$VerboseOutputOnError ) $backupEAP = $script:ErrorActionPreference $script:ErrorActionPreference = "Continue" try { - if($LogOutputOnError.IsPresent) + if($VerboseOutputOnError.IsPresent) { $output = & $sb } @@ -2045,7 +2045,7 @@ function script:Start-NativeExecution # note, if $sb doesn't have a native invocation, $LASTEXITCODE will # point to the obsolete value if ($LASTEXITCODE -ne 0 -and -not $IgnoreExitcode) { - if($LogOutputOnError.IsPresent -and $Output) + if($VerboseOutputOnError.IsPresent -and $Output) { $output | Out-String | Write-Verbose -Verbose } diff --git a/tools/packaging/packaging.psm1 b/tools/packaging/packaging.psm1 index 05b280a2517..533feedbeb6 100644 --- a/tools/packaging/packaging.psm1 +++ b/tools/packaging/packaging.psm1 @@ -1560,15 +1560,15 @@ function New-MSIPackage } log "running heat..." - Start-NativeExecution -LogOutputOnError { & $wixHeatExePath dir $ProductSourcePath -dr $productVersionWithName -cg $productVersionWithName -gg -sfrag -srd -scom -sreg -out $wixFragmentPath -var env.ProductSourcePath -v} + Start-NativeExecution -VerboseOutputOnError { & $wixHeatExePath dir $ProductSourcePath -dr $productVersionWithName -cg $productVersionWithName -gg -sfrag -srd -scom -sreg -out $wixFragmentPath -var env.ProductSourcePath -v} log "running candle..." - Start-NativeExecution -LogOutputOnError { & $wixCandleExePath "$ProductWxsPath" "$wixFragmentPath" -out (Join-Path "$env:Temp" "\\") -ext WixUIExtension -ext WixUtilExtension -arch $ProductTargetArchitecture -v} + Start-NativeExecution -VerboseOutputOnError { & $wixCandleExePath "$ProductWxsPath" "$wixFragmentPath" -out (Join-Path "$env:Temp" "\\") -ext WixUIExtension -ext WixUtilExtension -arch $ProductTargetArchitecture -v} log "running light..." # suppress ICE61, because we allow same version upgrades # suppress ICE57, this suppresses an error caused by our shortcut not being installed per user - Start-NativeExecution -LogOutputOnError {& $wixLightExePath -sice:ICE61 -sice:ICE57 -out $msiLocationPath -pdbout $msiPdbLocationPath $wixObjProductPath $wixObjFragmentPath -ext WixUIExtension -ext WixUtilExtension -dWixUILicenseRtf="$LicenseFilePath"} + Start-NativeExecution -VerboseOutputOnError {& $wixLightExePath -sice:ICE61 -sice:ICE57 -out $msiLocationPath -pdbout $msiPdbLocationPath $wixObjProductPath $wixObjFragmentPath -ext WixUIExtension -ext WixUtilExtension -dWixUILicenseRtf="$LicenseFilePath"} Remove-Item -ErrorAction SilentlyContinue $wixFragmentPath -Force Remove-Item -ErrorAction SilentlyContinue $wixObjProductPath -Force From c78cc8513a0205e380d2d468bc7b9fb86e8cbcc9 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Fri, 23 Feb 2018 11:01:52 -0800 Subject: [PATCH 15/16] address PR feedback --- build.psm1 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/build.psm1 b/build.psm1 index 4c91bcd2e11..953919eb6e5 100644 --- a/build.psm1 +++ b/build.psm1 @@ -2045,7 +2045,7 @@ function script:Start-NativeExecution # note, if $sb doesn't have a native invocation, $LASTEXITCODE will # point to the obsolete value if ($LASTEXITCODE -ne 0 -and -not $IgnoreExitcode) { - if($VerboseOutputOnError.IsPresent -and $Output) + if($VerboseOutputOnError.IsPresent -and $output) { $output | Out-String | Write-Verbose -Verbose } @@ -2058,12 +2058,14 @@ function script:Start-NativeExecution $callerFile = $callerLocationParts[0] $callerLine = $callerLocationParts[1] + $errorMessage = "Execution of {$sb} by ${callerFile}: line $callerLine failed with exit code $LASTEXITCODE" + if ($null -ne $env:CI) { Add-AppveyorCompilationMessage $errorMessage -Category Error -FileName $callerFile -Line $callerLine } - throw "Execution of {$sb} by ${callerFile}: line $callerLine failed with exit code $LASTEXITCODE" + throw $errorMessage } throw "Execution of {$sb} failed with exit code $LASTEXITCODE" } From 88b4378422a781bd2b82daa6a899d1155d94279a Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Fri, 23 Feb 2018 15:11:35 -0800 Subject: [PATCH 16/16] Address PR Comments --- build.psm1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build.psm1 b/build.psm1 index 953919eb6e5..0f8a98b77ce 100644 --- a/build.psm1 +++ b/build.psm1 @@ -2051,10 +2051,10 @@ function script:Start-NativeExecution } # Get caller location for easier debugging - $callerLocation = (Get-PSCallStack -ErrorAction SilentlyContinue)[1].Location - if($callerLocation) + $caller = Get-PSCallStack -ErrorAction SilentlyContinue + if($caller) { - $callerLocationParts = $callerLocation -split ":\s*line\s*" + $callerLocationParts = $caller[1].Location -split ":\s*line\s*" $callerFile = $callerLocationParts[0] $callerLine = $callerLocationParts[1]