-
Notifications
You must be signed in to change notification settings - Fork 57
Fix MSIX build logic and make the debug package be self-signed #1409
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.
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
Open
andyleejordan
wants to merge
1
commit into
PowerShell:main
Choose a base branch
from
andyleejordan:appx
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+17
−6
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -1812,7 +1812,7 @@ function Build-DscMsixPackage { | |||||
| ) | ||||||
|
|
||||||
| begin { | ||||||
| if ($IsWindows) { | ||||||
| if (-not $IsWindows) { | ||||||
| throw "MSIX packaging is only supported on Windows" | ||||||
| } | ||||||
| if ($null -eq $BuildData) { | ||||||
|
|
@@ -1884,12 +1884,18 @@ function Build-DscMsixPackage { | |||||
| $arch = ($architecture -eq 'aarch64-pc-windows-msvc') ? 'arm64' : 'x64' | ||||||
|
|
||||||
| # Appx manifest needs to be in root of source path, but the embedded version needs to be updated | ||||||
| # cp-459155 is 'CN=Microsoft Windows Store Publisher (Store EKU), O=Microsoft Corporation, L=Redmond, S=Washington, C=US' | ||||||
| # authenticodeFormer is 'CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US' | ||||||
| $releasePublisher = 'CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US' | ||||||
| # Retrieve manifest and set version correctly | ||||||
| $appxManifest = Get-Content "$PSScriptRoot\packaging\msix\AppxManifest.xml" -Raw | ||||||
| $appxManifest = $appxManifest.Replace('$VERSION$', $ProductVersion).Replace('$ARCH$', $Arch).Replace('$PRODUCTNAME$', $productName).Replace('$DISPLAYNAME$', $displayName).Replace('$PUBLISHER$', $releasePublisher) | ||||||
| if ($Release) { | ||||||
| # CP-459155 is 'CN=Microsoft Windows Store Publisher (Store EKU), O=Microsoft Corporation, L=Redmond, S=Washington, C=US' | ||||||
| # authenticodeFormer is 'CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US' | ||||||
| $publisher = 'CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US' | ||||||
| } else { | ||||||
| # 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' | ||||||
| } | ||||||
| $appxManifest = $appxManifest.Replace('$VERSION$', $ProductVersion).Replace('$ARCH$', $Arch).Replace('$PRODUCTNAME$', $productName).Replace('$DISPLAYNAME$', $displayName).Replace('$PUBLISHER$', $publisher) | ||||||
| # Remove the output directory if it already exists, then recreate it. | ||||||
| $msixTarget = $artifactDirectory.MsixTarget | ||||||
| if (Test-Path $msixTarget) { | ||||||
|
|
@@ -1970,7 +1976,12 @@ function Build-DscMsixPackage { | |||||
| if ($LASTEXITCODE -ne 0) { | ||||||
| throw "Failed to create msix package" | ||||||
| } | ||||||
| Write-Host -ForegroundColor Green "`nMSIX package is created at $packageName" | ||||||
|
|
||||||
| 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" | ||||||
|
||||||
| 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`"" |
Oops, something went wrong.
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.
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.
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).