GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix MSI creation errors, and capture wixpdb for later patch creation by TravisEz13 · Pull Request #6221 · PowerShell/PowerShell

fix MSI creation errors, and capture wixpdb for later patch creation #6221

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Sign up for GitHub

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Travis Plunk (TravisEz13) merged 16 commits into PowerShell:master from TravisEz13:msp_creation4
Feb 26, 2018

Uh oh!

There was an error while loading. Please reload this page.

Merged

fix MSI creation errors, and capture wixpdb for later patch creation #6221

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
9986858
include wixpdb as artifact in build
TravisEz13 Feb 22, 2018
aeaed31
ignore wix symbols
TravisEz13 Feb 22, 2018
167a588
remove unused dialog
TravisEz13 Feb 22, 2018
e55ab3f
cleanup anything left behind from previous runs
TravisEz13 Feb 23, 2018
b102ebb
suppress ICE61, about same version upgrades being allowed
TravisEz13 Feb 23, 2018
5981025
start returning wixpdb output when building msi
TravisEz13 Feb 23, 2018
e9e82e1
fix ICE18 error with wxs
TravisEz13 Feb 22, 2018
085aeac
resolve two ice errors
TravisEz13 Feb 22, 2018
b2968b0
add functionality to log output only on error
TravisEz13 Feb 22, 2018
3e80787
Add wixpdb output when build msi
TravisEz13 Feb 23, 2018
49875e2
suppress ICE57, caused by the shortcut not being installed per user
TravisEz13 Feb 23, 2018
3e3d472
use start-nativeexcution for error handling
TravisEz13 Feb 23, 2018
ae1e970
add comment explaining HKMU
TravisEz13 Feb 23, 2018
3e18994
change logOutputOnError to VerboseOutputOnError
TravisEz13 Feb 23, 2018
c78cc85
address PR feedback
TravisEz13 Feb 23, 2018
88b4378
Address PR Comments
TravisEz13 Feb 23, 2018
File filter
Filter by extension

Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Diff view
Diff view

There are no files selected for viewing

1 change: 1 addition & 0 deletions 1 .gitignore
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ dotnet-uninstall-debian-packages.sh
# Ignore binaries and symbols
*.pdb
*.dll
*.wixpdb

# Ignore packages
*.deb
Expand Down
15 changes: 9 additions & 6 deletions 15 assets/Product.wxs
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
</RegistryKey>
</Component>
<!-- add ourselves to %PATH% so pwsh.exe can be started from Windows PowerShell or cmd.exe -->
<Component Id="SetPath" Guid="{9dbb7763-7baf-48e7-b025-3bdedcb0632f}">
<Component Id="SetPath" Guid="{9dbb7763-7baf-48e7-b025-3bdedcb0632f}" KeyPath="yes">
<Environment Id="PATH" Action="set" Name="PATH" Part="last" Permanent="no" System="yes" Value="[$(var.ProductVersionWithName)]"/>
</Component>
<!-- Explorer context menu with 2 submenus to open PowerShell normally or as an Administator.
Expand Down Expand Up @@ -211,10 +211,15 @@
<Directory Id="ProgramMenuFolder">
<Directory Id="ApplicationProgramsFolder" Name="$(var.ProductName)">
<Component Id="ApplicationProgramsMenuShortcut" Guid="{A77507A7-F970-4618-AC30-20AFE36EE2EB}">
<Shortcut Id="PowerShell_ProgramsMenuShortcut" Name="$(var.ProductSemanticVersionWithNameAndOptionalArchitecture)" Description="$(var.ProductSemanticVersionWithNameAndOptionalArchitecture)" Target="[$(var.ProductVersionWithName)]pwsh.exe" WorkingDirectory="$(var.ProductVersionWithName)"
Icon = "PowerShellExe.ico" />
<Shortcut Id="PowerShell_ProgramsMenuShortcut"
Name="$(var.ProductSemanticVersionWithNameAndOptionalArchitecture)"
Description="$(var.ProductSemanticVersionWithNameAndOptionalArchitecture)"
Target="[$(var.ProductVersionWithName)]pwsh.exe"
WorkingDirectory="$(var.ProductVersionWithName)"
Icon = "PowerShellExe.ico" />
<RemoveFolder Id="ApplicationProgramsFolder" On="uninstall"/>
<RegistryValue Root="HKLM" Key="Software\Microsoft\$(var.ProductSemanticVersionWithNameAndOptionalArchitecture)\ProgramsMenuShortcut" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
<!-- HKMU is HKLM when installing perMachine and HKCU when installing perUser-->
<RegistryValue Root="HKMU" Key="Software\Microsoft\$(var.ProductSemanticVersionWithNameAndOptionalArchitecture)\ProgramsMenuShortcut" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
</Component>
</Directory>
</Directory>
Expand Down Expand Up @@ -289,8 +294,6 @@
<Publish Dialog="BrowseDlg" Control="OK" Event="DoAction" Value="WixUIValidatePath" Order="3">1</Publish>
<Publish Dialog="BrowseDlg" Control="OK" Event="SpawnDialog" Value="InvalidDirDlg" Order="4"><![CDATA[NOT WIXUI_DONTVALIDATEPATH AND WIXUI_INSTALLDIR_VALID<>"1"]]></Publish>

<Publish Dialog="ExitDialog" Control="Finish" Event="EndDialog" Value="Return" Order="999">1</Publish>

<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="LicenseAgreementDlg">NOT Installed</Publish>
<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg">Installed AND PATCH</Publish>

Expand Down
39 changes: 37 additions & 2 deletions 39 build.psm1
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -2023,15 +2023,50 @@ function script:precheck([string]$command, [string]$missedMessage) {

# this function wraps native command Execution
# for more information, read https://mnaoumov.wordpress.com/2015/01/11/execution-of-external-commands-in-powershell-done-right/
function script:Start-NativeExecution([scriptblock]$sb, [switch]$IgnoreExitcode)
function script:Start-NativeExecution
{
param(
[scriptblock]$sb,
[switch]$IgnoreExitcode,
[switch]$VerboseOutputOnError
)
$backupEAP = $script:ErrorActionPreference
$script:ErrorActionPreference = "Continue"
try {
& $sb
if($VerboseOutputOnError.IsPresent)
{
$output = & $sb
}
else
{
& $sb
}

# 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)
{
$output | Out-String | Write-Verbose -Verbose
}

# Get caller location for easier debugging
$caller = Get-PSCallStack -ErrorAction SilentlyContinue
if($caller)
{
$callerLocationParts = $caller[1].Location -split ":\s*line\s*"
$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 $errorMessage
}
throw "Execution of {$sb} failed with exit code $LASTEXITCODE"
}
} finally {
Expand Down
31 changes: 22 additions & 9 deletions 31 tools/packaging/packaging.psm1
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -1542,36 +1542,49 @@ 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"
}
$msiLocationPath = Join-Path $pwd "$packageName.msi"
$msiPdbLocationPath = Join-Path $pwd "$packageName.wixpdb"

if(!$Force.IsPresent -and (Test-Path -Path $msiLocationPath))
{
Write-Error -Message "Package already exists, use -Force to overwrite, path: $msiLocationPath" -ErrorAction Stop
}

$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
log "running heat..."
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 -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 -VerboseOutputOnError {& $wixLightExePath -sice:ICE61 -sice:ICE57 -out $msiLocationPath -pdbout $msiPdbLocationPath $wixObjProductPath $wixObjFragmentPath -ext WixUIExtension -ext WixUtilExtension -dWixUILicenseRtf="$LicenseFilePath"}
Comment thread Outdated

@daxian-dbw Dongbo Wang (daxian-dbw) Feb 23, 2018

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-v is missing at the end. Is it supposed to be added back?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@TravisEz13 Travis Plunk (TravisEz13) Feb 23, 2018

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no... it produces a lot of not very useful information. I don't recommend adding it. It makes the logs unreadable.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@daxian-dbw Dongbo Wang (daxian-dbw) Feb 23, 2018

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK. #Closed

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

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
{
$WiXHeatLog | Out-String | Write-Verbose -Verbose
$WiXCandleLog | Out-String | Write-Verbose -Verbose
$WiXLightLog | Out-String | Write-Verbose -Verbose
$errorMessage = "Failed to create $msiLocationPath"
if ($null -ne $env:CI)
{
Expand Down
2 changes: 1 addition & 1 deletion 2 tools/releaseBuild/Images/microsoft_powershell_windowsservercore/PowerShellPackage.ps1
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.