@@ -11,7 +11,17 @@ param(
1111 [string ]$SecretGitHubOAuthClientId = " "
1212)
1313
14+ # Load Package.appxmanifest
1415[xml ]$xmlDoc = Get-Content $PackageManifestPath
16+
17+ # Add namespaces
18+ $nsmgr = New-Object System.Xml.XmlNamespaceManager($xmlDoc.NameTable )
19+ $nsmgr.AddNamespace (" pkg" , " http://schemas.microsoft.com/appx/manifest/foundation/windows10" )
20+ $nsmgr.AddNamespace (" rescap" , " http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities" )
21+ $nsmgr.AddNamespace (" uap" , " http://schemas.microsoft.com/appx/manifest/uap/windows10" )
22+ $nsmgr.AddNamespace (" uap5" , " http://schemas.microsoft.com/appx/manifest/uap/windows10/5" )
23+
24+ # Update the publisher
1525$xmlDoc.Package.Identity.Publisher = $Publisher
1626
1727if ($Branch -eq " Preview" )
@@ -21,13 +31,27 @@ if ($Branch -eq "Preview")
2131 $xmlDoc.Package.Properties.DisplayName = " Files - Preview"
2232 $xmlDoc.Package.Applications.Application.VisualElements.DisplayName = " Files - Preview"
2333 $xmlDoc.Package.Applications.Application.VisualElements.DefaultTile.ShortName = " Files - Preview"
34+
35+ # Update app protocol and execution alias
36+ $ap = $xmlDoc.SelectSingleNode (" /pkg:Package/pkg:Applications/pkg:Application/pkg:Extensions/uap:Extension[@Category='windows.protocol']" , $nsmgr )
37+ $ap.Attributes [" Name" ]= " files-pre" ;
38+ $aea = $xmlDoc.SelectSingleNode (" /pkg:Package/pkg:Applications/pkg:Application/pkg:Extensions/uap:Extension[@Category='windows.appExecutionAlias']/uap5:AppExecutionAlias" , $nsmgr )
39+ $aea.Attributes [" Alias" ]= " files-pre.exe" ;
40+
41+ # Save modified Package.appxmanifest
2442 $xmlDoc.Save ($PackageManifestPath )
2543
2644 Get-ChildItem $WorkingDir - Include * .csproj, * .appxmanifest, * .wapproj, * .xaml - recurse | ForEach-Object - Process `
2745 { `
2846 (Get-Content $_ - Raw | ForEach-Object - Process { $_ -replace " Assets\\AppTiles\\Dev" , " Assets\AppTiles\Preview" }) | `
2947 Set-Content $_ - NoNewline `
3048 }
49+
50+ Get-ChildItem $WorkingDir - Include * .cs, * .cpp - recurse | ForEach-Object - Process `
51+ { `
52+ (Get-Content $_ - Raw | ForEach-Object - Process { $_ -replace " files-dev" , " files-pre" }) | `
53+ Set-Content $_ - NoNewline `
54+ }
3155}
3256elseif ($Branch -eq " Stable" )
3357{
@@ -36,13 +60,27 @@ elseif ($Branch -eq "Stable")
3660 $xmlDoc.Package.Properties.DisplayName = " Files"
3761 $xmlDoc.Package.Applications.Application.VisualElements.DisplayName = " Files"
3862 $xmlDoc.Package.Applications.Application.VisualElements.DefaultTile.ShortName = " Files"
63+
64+ # Update app protocol and execution alias
65+ $ap = $xmlDoc.SelectSingleNode (" /pkg:Package/pkg:Applications/pkg:Application/pkg:Extensions/uap:Extension[@Category='windows.protocol']" , $nsmgr )
66+ $ap.Attributes [" Name" ]= " files" ;
67+ $aea = $xmlDoc.SelectSingleNode (" /pkg:Package/pkg:Applications/pkg:Application/pkg:Extensions/uap:Extension[@Category='windows.appExecutionAlias']/uap5:AppExecutionAlias" , $nsmgr )
68+ $aea.Attributes [" Alias" ]= " files.exe" ;
69+
70+ # Save modified Package.appxmanifest
3971 $xmlDoc.Save ($PackageManifestPath )
4072
4173 Get-ChildItem $WorkingDir - Include * .csproj, * .appxmanifest, * .wapproj, * .xaml - recurse | ForEach-Object - Process `
4274 { `
4375 (Get-Content $_ - Raw | ForEach-Object - Process { $_ -replace " Assets\\AppTiles\\Dev" , " Assets\AppTiles\Release" }) | `
4476 Set-Content $_ - NoNewline `
4577 }
78+
79+ Get-ChildItem $WorkingDir - Include * .cs, * .cpp - recurse | ForEach-Object - Process `
80+ { `
81+ (Get-Content $_ - Raw | ForEach-Object - Process { $_ -replace " files-dev" , " files" }) | `
82+ Set-Content $_ - NoNewline `
83+ }
4684}
4785elseif ($Branch -eq " Store" )
4886{
@@ -53,18 +91,29 @@ elseif ($Branch -eq "Store")
5391 $xmlDoc.Package.Applications.Application.VisualElements.DefaultTile.ShortName = " Files"
5492
5593 # Remove an capability that is used for the sideload
56- $nsmgr = New-Object System.Xml.XmlNamespaceManager($xmlDoc.NameTable )
57- $nsmgr.AddNamespace (" pkg" , " http://schemas.microsoft.com/appx/manifest/foundation/windows10" )
58- $nsmgr.AddNamespace (" rescap" , " http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities" )
5994 $pm = $xmlDoc.SelectSingleNode (" /pkg:Package/pkg:Capabilities/rescap:Capability[@Name='packageManagement']" , $nsmgr )
6095 $xmlDoc.Package.Capabilities.RemoveChild ($pm )
96+
97+ # Update app protocol and execution alias
98+ $ap = $xmlDoc.SelectSingleNode (" /pkg:Package/pkg:Applications/pkg:Application/pkg:Extensions/uap:Extension[@Category='windows.protocol']" , $nsmgr )
99+ $ap.Attributes [" Name" ]= " files" ;
100+ $aea = $xmlDoc.SelectSingleNode (" /pkg:Package/pkg:Applications/pkg:Application/pkg:Extensions/uap:Extension[@Category='windows.appExecutionAlias']/uap5:AppExecutionAlias" , $nsmgr )
101+ $aea.Attributes [" Alias" ]= " files.exe" ;
102+
103+ # Save modified Package.appxmanifest
61104 $xmlDoc.Save ($PackageManifestPath )
62105
63106 Get-ChildItem $WorkingDir - Include * .csproj, * .appxmanifest, * .wapproj, * .xaml - recurse | ForEach-Object - Process `
64107 { `
65108 (Get-Content $_ - Raw | ForEach-Object - Process { $_ -replace " Assets\\AppTiles\\Dev" , " Assets\AppTiles\Release" }) | `
66109 Set-Content $_ - NoNewline `
67110 }
111+
112+ Get-ChildItem $WorkingDir - Include * .cs, * .cpp - recurse | ForEach-Object - Process `
113+ { `
114+ (Get-Content $_ - Raw | ForEach-Object - Process { $_ -replace " files-dev" , " files" }) | `
115+ Set-Content $_ - NoNewline `
116+ }
68117}
69118
70119Get-ChildItem $WorkingDir - Include * .cs - recurse | ForEach-Object - Process `
0 commit comments