@@ -30,6 +30,7 @@ Enum AssetType {
3030 Unknown
3131 ApplicationBundle
3232 PreinstallKit
33+ GroupPolicy
3334 Zip
3435}
3536
@@ -83,14 +84,17 @@ Class Asset {
8384 $local :bundlePath = Join-Path $local :directory $local :bundleName
8485 $this.Type = [AssetType ]::PreinstallKit
8586 $this.Architecture = " all"
87+ } ElseIf (" .zip" -eq $local :ext -and $local :filename -like ' GroupPolicy*' ) {
88+ $this.Type = [AssetType ]::GroupPolicy
89+ $this.Architecture = " all"
8690 } ElseIf (" .zip" -eq $local :ext ) {
8791 $this.Type = [AssetType ]::Zip
8892 } ElseIf (" .msixbundle" -eq $local :ext ) {
8993 $this.Type = [AssetType ]::ApplicationBundle
9094 $this.Architecture = " all"
9195 }
9296
93- If ($this.Type -Ne [AssetType ]::Zip ) {
97+ If ($this.Type -In ( [AssetType ]::ApplicationBundle , [ AssetType ]::PreinstallKit) ) {
9498 Write-Verbose " Cracking bundle $ ( $local :bundlePath ) "
9599 $local :firstMsixName = & $script :tar - t -f $local :bundlePath |
96100 Select-String ' Cascadia.*\.msix' |
@@ -105,8 +109,10 @@ Class Asset {
105109 $local :Manifest = [xml ](Get-Content (Join-Path $local :directory AppxManifest.xml))
106110 $this.ParseManifest ($local :Manifest )
107111 } Else {
108- & $script :tar - x -f $this.Path - C $local :directory -- strip- components= 1 ' */wt.exe'
109- $this.ExpandedVersion = (Get-Item (Join-Path $local :directory wt.exe )).VersionInfo.ProductVersion
112+ If ($this.Type -Ne [AssetType ]::GroupPolicy) {
113+ & $script :tar - x -f $this.Path - C $local :directory -- strip- components= 1 ' */wt.exe'
114+ $this.ExpandedVersion = (Get-Item (Join-Path $local :directory wt.exe )).VersionInfo.ProductVersion
115+ }
110116
111117 # Zip files just encode everything in their filename. Not great, but workable.
112118 $this.ParseFilename ($local :filename )
@@ -133,7 +139,9 @@ Class Asset {
133139 $parts = [IO.Path ]::GetFileNameWithoutExtension($filename ).Split(" _" )
134140 $this.Name = $parts [0 ]
135141 $this.Version = $parts [1 ]
136- $this.Architecture = $parts [2 ]
142+ If ($parts.Length -Ge 3 ) {
143+ $this.Architecture = $parts [2 ]
144+ }
137145 }
138146
139147 [string ]IdealFilename() {
@@ -149,6 +157,9 @@ Class Asset {
149157 Zip {
150158 " {0}_{1}_{2}.zip" -f ($this.Name , $this.Version , $this.Architecture )
151159 }
160+ GroupPolicy {
161+ " {0}_{1}.zip" -f ($this.Name , $this.Version )
162+ }
152163 Default {
153164 Throw " Unknown type $ ( $_.Type ) "
154165 }
@@ -174,7 +185,7 @@ class Release {
174185
175186 Release([Asset []]$a ) {
176187 $this.Assets = $a
177- $this.Branding = $a [ 0 ]. Branding
188+ $this.Branding = $a | Where-Object Branding -Ne ([ Branding ]::Unknown) | Select - Unique - First 1 - Expand Branding
178189 $this.Name = Switch ($this.Branding ) {
179190 Release { " Windows Terminal" }
180191 Preview { " Windows Terminal Preview" }
0 commit comments