You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/PSADT/PSADT/AppManagement/ManifestInformation.cs
+137-2Lines changed: 137 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,10 @@
1
1
usingSystem;
2
+
usingSystem.IO;
3
+
usingSystem.IO.Compression;
4
+
usingSystem.Runtime.InteropServices;
5
+
usingPSADT.Interop;
2
6
usingWindows.Win32.Storage.Packaging.Appx;
7
+
usingWindows.Win32.System.Com;
3
8
4
9
namespacePSADT.AppManagement
5
10
{
@@ -8,12 +13,28 @@ namespace PSADT.AppManagement
8
13
/// </summary>
9
14
publicsealedrecordManifestInformation
10
15
{
16
+
/// <summary>
17
+
/// Retrieves the manifest information from the specified package file by determining the package type and reading the appropriate manifest file within the package archive.
18
+
/// </summary>
19
+
/// <param name="packageUri">The URI to the package file.</param>
20
+
/// <returns>The manifest information.</returns>
21
+
/// <exception cref="InvalidOperationException">Thrown if the package file is not a valid Appx/Msix package or bundle.</exception>
returnarchive.GetEntry("AppxMetadata/AppxBundleManifest.xml")is not null?PackageType.Bundle:archive.GetEntry("AppxManifest.xml")is not null?PackageType.Package
101
+
:thrownewInvalidOperationException("The specified package file is not a valid Appx/Msix package or bundle.");
102
+
}
103
+
104
+
/// <summary>
105
+
/// Reads the package information from the specified package file by opening it as an IStream and using the AppxFactory COM interfaces.
106
+
/// </summary>
107
+
/// <param name="packageUri">The URI to the package file.</param>
0 commit comments