Skip to content

Commit fdc4ce0

Browse files
committed
Update Create-MsixBundle.ps1
1 parent 8304374 commit fdc4ce0

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

.github/scripts/Create-MsixBundle.ps1

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,14 @@ if ($msixFiles.Count -eq 0) {
5555
Write-Host "Found $($msixFiles.Count) .msix package(s):"
5656
$msixFiles | ForEach-Object { Write-Host " $_" }
5757

58+
if ($Version -eq "" -and $PackageManifestPath -ne "" -and (Test-Path $PackageManifestPath)) {
59+
[xml]$versionManifest = Get-Content $PackageManifestPath
60+
$Version = $versionManifest.Package.Identity.Version
61+
Write-Host "Version from manifest: $Version"
62+
}
5863
if ($Version -eq "") {
5964
$Version = $msixFiles[0].BaseName -replace '^[^_]+_([^_]+)_.*$','$1'
60-
Write-Host "Detected version: $Version"
65+
Write-Host "Detected version from filename: $Version"
6166
}
6267

6368
$platformList = $msixFiles | ForEach-Object { $_.BaseName -replace '.*_(\w+)$','$1' } | Sort-Object -Descending
@@ -74,7 +79,7 @@ $bundlePath = Join-Path $AppxPackageDir "$BundleName.msixbundle"
7479
if (Test-Path $bundlePath) { Remove-Item $bundlePath -Force }
7580

7681
Write-Host "Creating msixbundle at: $bundlePath"
77-
& $makeAppx.FullName bundle /d $mappingDir /p $bundlePath /o
82+
& $makeAppx.FullName bundle /d $mappingDir /p $bundlePath /bv $Version /o
7883
if ($LASTEXITCODE -ne 0) {
7984
Write-Error "MakeAppx bundle creation failed with exit code $LASTEXITCODE"
8085
exit 1

0 commit comments

Comments
 (0)