Skip to content

Commit 7489f96

Browse files
committed
Expand ManifestInformation class with the package type.
1 parent b05402b commit 7489f96

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

src/PSADT/PSADT/AppManagement/ManifestInformation.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ public sealed record ManifestInformation
1212
/// Initializes a new instance of the <see cref="ManifestInformation"/> record based on the provided <see cref="IAppxManifestPackageId"/>.
1313
/// </summary>
1414
/// <param name="packageId">The package ID from which to initialize the package information.</param>
15-
internal ManifestInformation(IAppxManifestPackageId packageId)
15+
/// <param name="packageType">The type of the package (single package or bundle).</param>
16+
internal ManifestInformation(IAppxManifestPackageId packageId, AppxPackageType packageType)
1617
{
1718
Name = packageId.GetName().ToString();
1819
Architecture = (Interop.APPX_PACKAGE_ARCHITECTURE)packageId.GetArchitecture();
@@ -22,6 +23,7 @@ internal ManifestInformation(IAppxManifestPackageId packageId)
2223
ResourceId = packageId.GetResourceId().ToString();
2324
PackageFullName = packageId.GetPackageFullName().ToString();
2425
PackageFamilyName = packageId.GetPackageFamilyName().ToString();
26+
PackageType = packageType;
2527
}
2628

2729
/// <summary>
@@ -58,5 +60,10 @@ internal ManifestInformation(IAppxManifestPackageId packageId)
5860
/// Gets the package family name.
5961
/// </summary>
6062
public string PackageFamilyName { get; }
63+
64+
/// <summary>
65+
/// Gets the type of the package (single package or bundle) based on the presence of specific manifest files within the package archive.
66+
/// </summary>
67+
public AppxPackageType PackageType { get; }
6168
}
6269
}

src/PSADT/PSADT/AppManagement/PackageManagement.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ private static ManifestInformation GetPackageManifestInformation(Uri packageUri)
6565
IAppxManifestPackageId packageId = manifestReader.GetPackageId();
6666
try
6767
{
68-
return new(packageId);
68+
return new(packageId, AppxPackageType.Package);
6969
}
7070
finally
7171
{
@@ -115,7 +115,7 @@ private static ManifestInformation GetBundleManifestInformation(Uri packageUri)
115115
IAppxManifestPackageId packageId = manifestReader.GetPackageId();
116116
try
117117
{
118-
return new(packageId);
118+
return new(packageId, AppxPackageType.Bundle);
119119
}
120120
finally
121121
{

0 commit comments

Comments
 (0)