From 5a3c7e038bb52035adcd54102c41d01a7ee90420 Mon Sep 17 00:00:00 2001 From: 0x5BFA <62196528+0x5bfa@users.noreply.github.com> Date: Thu, 4 Jul 2024 00:18:21 +0900 Subject: [PATCH] Update Configure-AppxManifest.ps1 --- scripts/Configure-AppxManifest.ps1 | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/scripts/Configure-AppxManifest.ps1 b/scripts/Configure-AppxManifest.ps1 index a98eb00adca6..7f7bf132b2b1 100644 --- a/scripts/Configure-AppxManifest.ps1 +++ b/scripts/Configure-AppxManifest.ps1 @@ -11,8 +11,8 @@ param( [string]$SecretGitHubOAuthClientId = "" ) -[xml]$xmlDoc = Get-Content "$PackageManifestPath" -$xmlDoc.Package.Identity.Publisher="$Publisher" +[xml]$xmlDoc = Get-Content $PackageManifestPath +$xmlDoc.Package.Identity.Publisher = $Publisher if ($Branch -eq "Preview") { @@ -20,10 +20,11 @@ if ($Branch -eq "Preview") $xmlDoc.Package.Identity.Name="FilesPreview" $xmlDoc.Package.Properties.DisplayName="Files - Preview" $xmlDoc.Package.Applications.Application.VisualElements.DisplayName="Files - Preview" + $xmlDoc.Save($PackageManifestPath) - Get-ChildItem "$WorkingDir\src" -Include *.csproj, *.appxmanifest, *.wapproj, *.xaml -recurse | ForEach -Process ` + Get-ChildItem $WorkingDir -Include *.csproj, *.appxmanifest, *.wapproj, *.xaml -recurse | ForEach-Object -Process ` { ` - (Get-Content $_ -Raw | ForEach -Process { $_ -replace "Assets\\AppTiles\\Dev", "Assets\AppTiles\Preview" }) | ` + (Get-Content $_ -Raw | ForEach-Object -Process { $_ -replace "Assets\\AppTiles\\Dev", "Assets\AppTiles\Preview" }) | ` Set-Content $_ -NoNewline ` } } @@ -33,10 +34,11 @@ elseif ($Branch -eq "Stable") $xmlDoc.Package.Identity.Name="Files" $xmlDoc.Package.Properties.DisplayName="Files" $xmlDoc.Package.Applications.Application.VisualElements.DisplayName="Files" + $xmlDoc.Save($PackageManifestPath) - Get-ChildItem "$WorkingDir\src" -Include *.csproj, *.appxmanifest, *.wapproj, *.xaml -recurse | ForEach -Process ` + Get-ChildItem $WorkingDir -Include *.csproj, *.appxmanifest, *.wapproj, *.xaml -recurse | ForEach-Object -Process ` { ` - (Get-Content $_ -Raw | ForEach -Process { $_ -replace "Assets\\AppTiles\\Dev", "Assets\AppTiles\Release" }) | ` + (Get-Content $_ -Raw | ForEach-Object -Process { $_ -replace "Assets\\AppTiles\\Dev", "Assets\AppTiles\Release" }) | ` Set-Content $_ -NoNewline ` } } @@ -53,29 +55,28 @@ elseif ($Branch -eq "Store") $nsmgr.AddNamespace("rescap", "http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities") $pm = $xmlDoc.SelectSingleNode("/pkg:Package/pkg:Capabilities/rescap:Capability[@Name='packageManagement']", $nsmgr) $xmlDoc.Package.Capabilities.RemoveChild($pm) + $xmlDoc.Save($PackageManifestPath) - Get-ChildItem "$WorkingDir\src" -Include *.csproj, *.appxmanifest, *.wapproj, *.xaml -recurse | ForEach -Process ` + Get-ChildItem $WorkingDir -Include *.csproj, *.appxmanifest, *.wapproj, *.xaml -recurse | ForEach-Object -Process ` { ` - (Get-Content $_ -Raw | ForEach -Process { $_ -replace "Assets\\AppTiles\\Dev", "Assets\AppTiles\Release" }) | ` + (Get-Content $_ -Raw | ForEach-Object -Process { $_ -replace "Assets\\AppTiles\\Dev", "Assets\AppTiles\Release" }) | ` Set-Content $_ -NoNewline ` } } -$xmlDoc.Save("$PackageManifestPath") - -Get-ChildItem "$WorkingDir\src" -Include *.cs -recurse | ForEach-Object -Process ` +Get-ChildItem $WorkingDir -Include *.cs -recurse | ForEach-Object -Process ` { ` (Get-Content $_ -Raw | ForEach-Object -Process { $_ -replace "bingmapskey.secret", "$SecretBingMapsKey" }) | ` Set-Content $_ -NoNewline ` } -Get-ChildItem "$WorkingDir\src" -Include *.cs -recurse | ForEach-Object -Process ` +Get-ChildItem $WorkingDir -Include *.cs -recurse | ForEach-Object -Process ` { (Get-Content $_ -Raw | ForEach-Object -Process { $_ -replace "sentry.secret", "$SecretSentry" }) | ` Set-Content $_ -NoNewline ` } -Get-ChildItem "$WorkingDir\src" -Include *.cs -recurse | ForEach-Object -Process ` +Get-ChildItem $WorkingDir -Include *.cs -recurse | ForEach-Object -Process ` { ` (Get-Content $_ -Raw | ForEach-Object -Process { $_ -replace "githubclientid.secret", "$SecretGitHubOAuthClientId" }) | ` Set-Content $_ -NoNewline `