@@ -30,6 +30,7 @@ Enum AssetType {
30
30
Unknown
31
31
ApplicationBundle
32
32
PreinstallKit
33
+ GroupPolicy
33
34
Zip
34
35
}
35
36
@@ -83,14 +84,17 @@ Class Asset {
83
84
$local :bundlePath = Join-Path $local :directory $local :bundleName
84
85
$this.Type = [AssetType ]::PreinstallKit
85
86
$this.Architecture = " all"
87
+ } ElseIf (" .zip" -eq $local :ext -and $local :filename -like ' GroupPolicy*' ) {
88
+ $this.Type = [AssetType ]::GroupPolicy
89
+ $this.Architecture = " all"
86
90
} ElseIf (" .zip" -eq $local :ext ) {
87
91
$this.Type = [AssetType ]::Zip
88
92
} ElseIf (" .msixbundle" -eq $local :ext ) {
89
93
$this.Type = [AssetType ]::ApplicationBundle
90
94
$this.Architecture = " all"
91
95
}
92
96
93
- If ($this.Type -Ne [AssetType ]::Zip ) {
97
+ If ($this.Type -In ( [AssetType ]::ApplicationBundle , [ AssetType ]::PreinstallKit) ) {
94
98
Write-Verbose " Cracking bundle $ ( $local :bundlePath ) "
95
99
$local :firstMsixName = & $script :tar - t -f $local :bundlePath |
96
100
Select-String ' Cascadia.*\.msix' |
@@ -105,8 +109,10 @@ Class Asset {
105
109
$local :Manifest = [xml ](Get-Content (Join-Path $local :directory AppxManifest.xml))
106
110
$this.ParseManifest ($local :Manifest )
107
111
} 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
+ }
110
116
111
117
# Zip files just encode everything in their filename. Not great, but workable.
112
118
$this.ParseFilename ($local :filename )
@@ -133,7 +139,9 @@ Class Asset {
133
139
$parts = [IO.Path ]::GetFileNameWithoutExtension($filename ).Split(" _" )
134
140
$this.Name = $parts [0 ]
135
141
$this.Version = $parts [1 ]
136
- $this.Architecture = $parts [2 ]
142
+ If ($parts.Length -Ge 3 ) {
143
+ $this.Architecture = $parts [2 ]
144
+ }
137
145
}
138
146
139
147
[string ]IdealFilename() {
@@ -149,6 +157,9 @@ Class Asset {
149
157
Zip {
150
158
" {0}_{1}_{2}.zip" -f ($this.Name , $this.Version , $this.Architecture )
151
159
}
160
+ GroupPolicy {
161
+ " {0}_{1}.zip" -f ($this.Name , $this.Version )
162
+ }
152
163
Default {
153
164
Throw " Unknown type $ ( $_.Type ) "
154
165
}
@@ -174,7 +185,7 @@ class Release {
174
185
175
186
Release([Asset []]$a ) {
176
187
$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
178
189
$this.Name = Switch ($this.Branding ) {
179
190
Release { " Windows Terminal" }
180
191
Preview { " Windows Terminal Preview" }
0 commit comments