Skip to content

Commit 379e1c1

Browse files
committed
util update
1 parent 32195a8 commit 379e1c1

10 files changed

Lines changed: 484 additions & 23 deletions

File tree

src/WinGetUtilInterop.UnitTests/ManifestUnitTest/V1ManifestReadTest.cs

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ private enum TestManifestVersion
3838
V1_9_0,
3939
V1_10_0,
4040
V1_12_0,
41+
V1_28_0,
4142
}
4243

4344
/// <summary>
@@ -81,6 +82,11 @@ public void ReadV1ManifestsAndVerifyContents()
8182
Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "TestCollateral", ManifestStrings.V1_12_0ManifestMerged));
8283

8384
this.ValidateManifestFields(v1_12_0manifest, TestManifestVersion.V1_12_0);
85+
86+
Manifest v1_28_0manifest = Manifest.CreateManifestFromPath(
87+
Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "TestCollateral", ManifestStrings.V1_28_0ManifestMerged));
88+
89+
this.ValidateManifestFields(v1_28_0manifest, TestManifestVersion.V1_28_0);
8490
}
8591

8692
/// <summary>
@@ -500,6 +506,31 @@ private void ValidateManifestFields(Manifest manifest, TestManifestVersion manif
500506
Assert.Equal("https://www.microsoft.com/msixsdk/msixsdkx64.exe", installer4.Url);
501507
Assert.Equal("69D84CA8899800A5575CE31798293CD4FEBAB1D734A07C2E51E56A28E0DF8C82", installer4.Sha256);
502508
}
509+
510+
if (manifestVersion >= TestManifestVersion.V1_28_0)
511+
{
512+
// Root level DesiredStateConfiguration
513+
Assert.NotNull(manifest.DesiredStateConfiguration);
514+
Assert.Single(manifest.DesiredStateConfiguration.PowerShell);
515+
Assert.Equal("https://www.powershellgallery.com/api/v2", manifest.DesiredStateConfiguration.PowerShell[0].RepositoryUrl);
516+
Assert.Equal("DefaultTestModule", manifest.DesiredStateConfiguration.PowerShell[0].ModuleName);
517+
Assert.Single(manifest.DesiredStateConfiguration.PowerShell[0].Resources);
518+
Assert.Equal("DefaultTestResource", manifest.DesiredStateConfiguration.PowerShell[0].Resources[0].Name);
519+
Assert.NotNull(manifest.DesiredStateConfiguration.DSCv3);
520+
Assert.Single(manifest.DesiredStateConfiguration.DSCv3.Resources);
521+
Assert.Equal("DefaultPublisher.DefaultProduct/DefaultResource", manifest.DesiredStateConfiguration.DSCv3.Resources[0].Type);
522+
523+
// Installer level DesiredStateConfiguration
524+
Assert.NotNull(installer1.DesiredStateConfiguration);
525+
Assert.Single(installer1.DesiredStateConfiguration.PowerShell);
526+
Assert.Equal("https://www.powershellgallery.com/api/v2", installer1.DesiredStateConfiguration.PowerShell[0].RepositoryUrl);
527+
Assert.Equal("TestModule", installer1.DesiredStateConfiguration.PowerShell[0].ModuleName);
528+
Assert.Single(installer1.DesiredStateConfiguration.PowerShell[0].Resources);
529+
Assert.Equal("TestResource", installer1.DesiredStateConfiguration.PowerShell[0].Resources[0].Name);
530+
Assert.NotNull(installer1.DesiredStateConfiguration.DSCv3);
531+
Assert.Single(installer1.DesiredStateConfiguration.DSCv3.Resources);
532+
Assert.Equal("TestPublisher.TestProduct/TestResource", installer1.DesiredStateConfiguration.DSCv3.Resources[0].Type);
533+
}
503534
}
504535

505536
/// <summary>
@@ -542,6 +573,11 @@ internal class ManifestStrings
542573
/// Merged v1.12 manifest.
543574
/// </summary>
544575
public const string V1_12_0ManifestMerged = "V1_12ManifestMerged.yaml";
576+
577+
/// <summary>
578+
/// Merged v1.28 manifest.
579+
/// </summary>
580+
public const string V1_28_0ManifestMerged = "V1_28ManifestMerged.yaml";
545581
#pragma warning restore SA1310 // FieldNamesMustNotContainUnderscore
546582

547583
/// <summary>
Lines changed: 296 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,296 @@
1+
PackageIdentifier: microsoft.msixsdk
2+
PackageVersion: 1.7.32
3+
PackageLocale: en-US
4+
Publisher: Microsoft
5+
PublisherUrl: https://www.microsoft.com
6+
PublisherSupportUrl: https://www.microsoft.com/support
7+
PrivacyUrl: https://www.microsoft.com/privacy
8+
Author: Microsoft
9+
PackageName: MSIX SDK
10+
PackageUrl: https://www.microsoft.com/msixsdk/home
11+
License: MIT License
12+
LicenseUrl: https://www.microsoft.com/msixsdk/license
13+
Copyright: Copyright Microsoft Corporation
14+
CopyrightUrl: https://www.microsoft.com/msixsdk/copyright
15+
ShortDescription: This is MSIX SDK
16+
Description: The MSIX SDK project is an effort to enable developers
17+
Moniker: msixsdk
18+
Tags:
19+
- "appxsdk"
20+
- "msixsdk"
21+
ReleaseNotes: Default release notes
22+
ReleaseNotesUrl: https://DefaultReleaseNotes.net
23+
PurchaseUrl: https://DefaultPurchaseUrl.com
24+
InstallationNotes: Default installation notes
25+
Documentations:
26+
- DocumentLabel: Default document label
27+
DocumentUrl: https://DefaultDocumentUrl.com
28+
Icons:
29+
- IconUrl: https://testIcon
30+
IconFileType: ico
31+
IconResolution: custom
32+
IconTheme: default
33+
IconSha256: 69D84CA8899800A5575CE31798293CD4FEBAB1D734A07C2E51E56A28E0DF8123
34+
Agreements:
35+
- AgreementLabel: DefaultLabel
36+
Agreement: DefaultText
37+
AgreementUrl: https://DefaultAgreementUrl.net
38+
InstallerLocale: en-US
39+
Platform:
40+
- Windows.Desktop
41+
- Windows.Universal
42+
MinimumOSVersion: 10.0.0.0
43+
InstallerType: zip
44+
Scope: machine
45+
InstallModes:
46+
- interactive
47+
- silent
48+
- silentWithProgress
49+
InstallerSwitches:
50+
Custom: /custom
51+
SilentWithProgress: /silentwithprogress
52+
Silent: /silence
53+
Interactive: /interactive
54+
Log: /log=<LOGPATH>
55+
InstallLocation: /dir=<INSTALLPATH>
56+
Upgrade: /upgrade
57+
Repair: /repair
58+
InstallerSuccessCodes:
59+
- 1
60+
- 0x80070005
61+
UpgradeBehavior: uninstallPrevious
62+
Commands:
63+
- makemsix
64+
- makeappx
65+
Protocols:
66+
- protocol1
67+
- protocol2
68+
FileExtensions:
69+
- appx
70+
- msix
71+
- appxbundle
72+
- msixbundle
73+
Dependencies:
74+
WindowsFeatures:
75+
- IIS
76+
WindowsLibraries:
77+
- VC Runtime
78+
PackageDependencies:
79+
- PackageIdentifier: Microsoft.MsixSdkDep
80+
MinimumVersion: 1.0.0
81+
ExternalDependencies:
82+
- Outside dependencies
83+
Capabilities:
84+
- internetClient
85+
RestrictedCapabilities:
86+
- runFullTrust
87+
PackageFamilyName: Microsoft.DesktopAppInstaller_8wekyb3d8bbwe
88+
ProductCode: "{Foo}"
89+
ReleaseDate: 2021-01-01
90+
InstallerAbortsTerminal: true
91+
InstallLocationRequired: true
92+
RequireExplicitUpgrade: true
93+
DisplayInstallWarnings: true
94+
ElevationRequirement: elevatesSelf
95+
UnsupportedOSArchitectures:
96+
- arm
97+
AppsAndFeaturesEntries:
98+
- DisplayName: DisplayName
99+
DisplayVersion: DisplayVersion
100+
Publisher: Publisher
101+
ProductCode: ProductCode
102+
UpgradeCode: UpgradeCode
103+
InstallerType: exe
104+
Markets:
105+
AllowedMarkets:
106+
- US
107+
ExpectedReturnCodes:
108+
- InstallerReturnCode: 2
109+
ReturnResponse: contactSupport
110+
ReturnResponseUrl: https://defaultReturnResponseUrl.com
111+
- InstallerReturnCode: 3
112+
ReturnResponse: custom
113+
UnsupportedArguments:
114+
- log
115+
NestedInstallerType: msi
116+
NestedInstallerFiles:
117+
- RelativeFilePath: RelativeFilePath
118+
PortableCommandAlias: PortableCommandAlias
119+
InstallationMetadata:
120+
DefaultInstallLocation: "%ProgramFiles%\\TestApp"
121+
Files:
122+
- RelativeFilePath: "main.exe"
123+
FileSha256: 69D84CA8899800A5575CE31798293CD4FEBAB1D734A07C2E51E56A28E0DF8C82
124+
FileType: launch
125+
InvocationParameter: "/arg"
126+
DisplayName: "DisplayName"
127+
DownloadCommandProhibited: true
128+
ArchiveBinariesDependOnPath: true
129+
RepairBehavior: uninstaller
130+
Authentication:
131+
AuthenticationType: microsoftEntraId
132+
MicrosoftEntraIdAuthenticationInfo:
133+
Resource: DefaultResource
134+
Scope: DefaultScope
135+
DesiredStateConfiguration:
136+
PowerShell:
137+
- RepositoryUrl: https://www.powershellgallery.com/api/v2
138+
ModuleName: DefaultTestModule
139+
Resources:
140+
- Name: DefaultTestResource
141+
DSCv3:
142+
Resources:
143+
- Type: DefaultPublisher.DefaultProduct/DefaultResource
144+
Localization:
145+
- Agreements:
146+
- Agreement: Text
147+
AgreementLabel: Label
148+
AgreementUrl: https://AgreementUrl.net
149+
Author: Microsoft UK
150+
Copyright: Copyright Microsoft Corporation UK
151+
CopyrightUrl: https://www.microsoft.com/msixsdk/copyright/UK
152+
Description: The MSIX SDK project is an effort to enable developers UK
153+
License: MIT License UK
154+
LicenseUrl: https://www.microsoft.com/msixsdk/license/UK
155+
PackageLocale: en-GB
156+
PackageName: MSIX SDK UK
157+
PackageUrl: https://www.microsoft.com/msixsdk/home/UK
158+
PrivacyUrl: https://www.microsoft.com/privacy/UK
159+
Publisher: Microsoft UK
160+
PublisherSupportUrl: https://www.microsoft.com/support/UK
161+
PublisherUrl: https://www.microsoft.com/UK
162+
ReleaseNotes: Release notes
163+
ReleaseNotesUrl: https://ReleaseNotes.net
164+
ShortDescription: This is MSIX SDK UK
165+
Tags:
166+
- appxsdkUK
167+
- msixsdkUK
168+
PurchaseUrl: https://PurchaseUrl.com
169+
InstallationNotes: Installation notes
170+
Documentations:
171+
- DocumentLabel: Document label
172+
DocumentUrl: https://DocumentUrl.com
173+
Icons:
174+
- IconUrl: https://testIcon2
175+
IconFileType: png
176+
IconResolution: 32x32
177+
IconTheme: dark
178+
IconSha256: 69D84CA8899800A5575CE31798293CD4FEBAB1D734A07C2E51E56A28E0DF8321
179+
Installers:
180+
- Architecture: x86
181+
InstallerLocale: en-GB
182+
Platform:
183+
- Windows.Desktop
184+
MinimumOSVersion: 10.0.1.0
185+
InstallerType: msix
186+
InstallerUrl: https://www.microsoft.com/msixsdk/msixsdkx86.msix
187+
InstallerSha256: 69D84CA8899800A5575CE31798293CD4FEBAB1D734A07C2E51E56A28E0DF8C82
188+
SignatureSha256: 69D84CA8899800A5575CE31798293CD4FEBAB1D734A07C2E51E56A28E0DF8C82
189+
Scope: user
190+
InstallModes:
191+
- interactive
192+
InstallerSwitches:
193+
Custom: /c
194+
SilentWithProgress: /sp
195+
Silent: /s
196+
Interactive: /i
197+
Log: /l=<LOGPATH>
198+
InstallLocation: /d=<INSTALLPATH>
199+
Upgrade: /u
200+
Repair: /r
201+
UpgradeBehavior: install
202+
Commands:
203+
- makemsixPreview
204+
- makeappxPreview
205+
Protocols:
206+
- protocol1preview
207+
- protocol2preview
208+
FileExtensions:
209+
- appxbundle
210+
- msixbundle
211+
- appx
212+
- msix
213+
Dependencies:
214+
WindowsFeatures:
215+
- PreviewIIS
216+
WindowsLibraries:
217+
- Preview VC Runtime
218+
PackageDependencies:
219+
- PackageIdentifier: Microsoft.MsixSdkDepPreview
220+
MinimumVersion: 1.0.0
221+
ExternalDependencies:
222+
- Preview Outside dependencies
223+
PackageFamilyName: Microsoft.DesktopAppInstallerPreview_8wekyb3d8bbwe
224+
Capabilities:
225+
- internetClientPreview
226+
RestrictedCapabilities:
227+
- runFullTrustPreview
228+
ReleaseDate: 2021-02-02
229+
InstallerAbortsTerminal: false
230+
InstallLocationRequired: false
231+
NestedInstallerFiles:
232+
- RelativeFilePath: RelativeFilePath2
233+
PortableCommandAlias: PortableCommandAlias2
234+
RequireExplicitUpgrade: false
235+
DisplayInstallWarnings: true
236+
ElevationRequirement: elevationRequired
237+
NestedInstallerType: msi
238+
UnsupportedArguments:
239+
- location
240+
UnsupportedOSArchitectures:
241+
- arm64
242+
Markets:
243+
ExcludedMarkets:
244+
- "US"
245+
ExpectedReturnCodes:
246+
- InstallerReturnCode: 2
247+
ReturnResponse: contactSupport
248+
ReturnResponseUrl: https://returnResponseUrl.com
249+
DownloadCommandProhibited: true
250+
ArchiveBinariesDependOnPath: false
251+
RepairBehavior: modify
252+
InstallationMetadata:
253+
DefaultInstallLocation: "%ProgramFiles%\\TestApp"
254+
Files:
255+
- RelativeFilePath: "main2.exe"
256+
FileSha256: 79D84CA8899800A5575CE31798293CD4FEBAB1D734A07C2E51E56A28E0DF8C82
257+
FileType: launch2
258+
InvocationParameter: "/arg2"
259+
DisplayName: "DisplayName2"
260+
Authentication:
261+
AuthenticationType: microsoftEntraId
262+
MicrosoftEntraIdAuthenticationInfo:
263+
Resource: Resource
264+
Scope: Scope
265+
DesiredStateConfiguration:
266+
PowerShell:
267+
- RepositoryUrl: https://www.powershellgallery.com/api/v2
268+
ModuleName: TestModule
269+
Resources:
270+
- Name: TestResource
271+
DSCv3:
272+
Resources:
273+
- Type: TestPublisher.TestProduct/TestResource
274+
- Architecture: x64
275+
InstallerSha256: 69D84CA8899800A5575CE31798293CD4FEBAB1D734A07C2E51E56A28E0DF8C82
276+
InstallerUrl: https://www.microsoft.com/msixsdk/msixsdkx64.exe
277+
InstallerType: exe
278+
ProductCode: '{Bar}'
279+
MSStoreProductIdentifier: fakeIdentifier
280+
- Architecture: neutral
281+
InstallerType: zip
282+
InstallerUrl: https://www.microsoft.com/msixsdk/msixsdkx64.exe
283+
InstallerSha256: 69D84CA8899800A5575CE31798293CD4FEBAB1D734A07C2E51E56A28E0DF8C82
284+
NestedInstallerType: font
285+
NestedInstallerFiles:
286+
- RelativeFilePath: relativeFilePath1.otf
287+
- RelativeFilePath: relativeFilePath2.ttf
288+
- RelativeFilePath: relativeFilePath3.fnt
289+
- RelativeFilePath: relativeFilePath4.ttc
290+
- RelativeFilePath: relativeFilePath5.otc
291+
- Architecture: neutral
292+
InstallerType: font
293+
InstallerUrl: https://www.microsoft.com/msixsdk/msixsdkx64.exe
294+
InstallerSha256: 69D84CA8899800A5575CE31798293CD4FEBAB1D734A07C2E51E56A28E0DF8C82
295+
ManifestType: merged
296+
ManifestVersion: 1.28.0

src/WinGetUtilInterop.UnitTests/WinGetUtilInterop.UnitTests.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,9 @@
102102
<None Update="TestCollateral\V1_12ManifestMerged.yaml">
103103
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
104104
</None>
105+
<None Update="TestCollateral\V1_28ManifestMerged.yaml">
106+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
107+
</None>
105108
<None Update="xunit.runner.json">
106109
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
107110
</None>

0 commit comments

Comments
 (0)