Skip to content

Fix MSIX build logic and make the debug package be self-signed#1409

Open
andyleejordan wants to merge 1 commit intoPowerShell:mainfrom
andyleejordan:appx
Open

Fix MSIX build logic and make the debug package be self-signed#1409
andyleejordan wants to merge 1 commit intoPowerShell:mainfrom
andyleejordan:appx

Conversation

@andyleejordan
Copy link
Member

The logic here was a little wrong, and then in order to test, I had to add self-signed logic to the debug build (and left a note on how to install that for testing).

@SteveL-MSFT
Copy link
Member

@andyleejordan pick up latest from main to get the CI fix. Also, update the release pipeline to use this instead of the legacy file to validate it works. Don't delete the old packging.ps1 yet until we know it works completely.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR corrects MSIX packaging behavior in the PowerShell build module by fixing the Windows gating logic and adjusting MSIX manifest publisher/output messaging to better support local debug installation.

Changes:

  • Fix the OS check so Build-DscMsixPackage errors only when not on Windows.
  • Set MSIX manifest publisher differently for Release vs debug builds (Microsoft publisher vs a developer/unsigned identity).
  • Update the post-build message to print an Add-AppxPackage -AllowUnsigned install command for debug builds.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +1894 to +1897
# For debug builds, use a self-signed developer identity per
# https://learn.microsoft.com/en-us/windows/msix/package/unsigned-package
$publisher = 'CN=AppModelSamples, OID.2.25.311729368913984317654407730594956997722=1'
}
Copy link

Copilot AI Mar 1, 2026

Choose a reason for hiding this comment

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

The debug branch comment says “self-signed developer identity”, but this code still produces an unsigned package (and the printed install command uses -AllowUnsigned). To avoid confusion (and mismatch with the PR title/intent), consider updating the comment/output text to explicitly say “unsigned” (or actually add a signing step with a generated self-signed cert if the goal is truly self-signed).

Copilot uses AI. Check for mistakes.
if ($Release) {
Write-Host -ForegroundColor Green "`nMSIX package is created at $packageName"
} else {
Write-Host -ForegroundColor Green "`nInstall the debug MSIX package with:`nAdd-AppxPackage -AllowUnsigned -Path $packageName"
Copy link

Copilot AI Mar 1, 2026

Choose a reason for hiding this comment

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

The suggested Add-AppxPackage command interpolates $packageName without quotes; if the path contains spaces, copy/paste install will fail. Consider quoting the path (and/or using -LiteralPath) in the message so it’s robust.

Suggested change
Write-Host -ForegroundColor Green "`nInstall the debug MSIX package with:`nAdd-AppxPackage -AllowUnsigned -Path $packageName"
Write-Host -ForegroundColor Green "`nInstall the debug MSIX package with:`nAdd-AppxPackage -AllowUnsigned -LiteralPath `"$packageName`""

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants