Skip to content

Commit 9766818

Browse files
committed
Fix: BuildMsixBundle.ps1 now reads version from Package.appxmanifest instead of hardcoded 2.0.4.0
1 parent 0589f3b commit 9766818

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

BuildMsixBundle.ps1

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
Write-Host "Building MSIX Bundle for Microsoft Store submission..." -ForegroundColor Green
44
Write-Host "================================================" -ForegroundColor Green
55

6+
# Read version from Package.appxmanifest
7+
$manifestPath = "PingTool.WinUI3\Package.appxmanifest"
8+
[xml]$manifest = Get-Content $manifestPath
9+
$version = $manifest.Package.Identity.Version
10+
Write-Host "Detected version from manifest: $version" -ForegroundColor Cyan
11+
612
# Set the configuration
713
$Configuration = "Release"
814
$ProjectPath = "PingTool.WinUI3\PingTool.WinUI3.csproj"
@@ -83,13 +89,13 @@ if ($makeAppxPath -and (Test-Path $makeAppxPath)) {
8389
}
8490

8591
$bundleContent | Out-File -FilePath $bundleMapPath -Encoding UTF8
86-
87-
# Create the bundle
88-
$bundleName = "PingTool.WinUI3_2.0.4.0_x86_x64_ARM64.msixbundle"
92+
93+
# Create the bundle using version from manifest
94+
$bundleName = "PingTool.WinUI3_${version}_x86_x64_ARM64.msixbundle"
8995
$bundlePath = "$packageDir\$bundleName"
90-
91-
Write-Host "`nCreating bundle..." -ForegroundColor Cyan
92-
& $makeAppxPath bundle /f $bundleMapPath /p $bundlePath /bv 2.0.4.0 /o
96+
97+
Write-Host "`nCreating bundle with version $version..." -ForegroundColor Cyan
98+
& $makeAppxPath bundle /f $bundleMapPath /p $bundlePath /bv $version /o
9399

94100
if ($LASTEXITCODE -eq 0) {
95101
Write-Host "`n================================================" -ForegroundColor Green

0 commit comments

Comments
 (0)