Adding support for flat bundles. There are two ways a flat bundle can be unpacked:
1. Payload packages are in the same directory as the flat bundle.
1. Payload packages are in a different directory as the flat bundle.
For case 1, we create the stream of the package given the path of the bundle plus the information on the bundle manifest. A flat bundle and payload packages for testing can be found under test/appx/flat.
For case 2, two new public interfaces are defined: IMsixFactoryOverrides and IMsixStreamFactory. IMsixFactoryOverrides is implemented by the AppxFactory. The user can QI for this interface and specify an override via SpecifyExtension and the extension it wants to override defined in the MSIX_FACTORY_EXTENSION enum before creating the bundle/package reader. For now, we only have MSIX_FACTORY_EXTENSION_STREAM_FACTORY but it is design to be extended if we need to (eg. override applicability logic)
For MSIX_FACTORY_EXTENSION_STREAM_FACTORY, the user needs to set an object that implements IMsixStreamFactory. When the bundle being unpacked is a flat bundle, we get the override via GetCurrentSpecifiedExtension and QI for IMsixStreamFactory. IMsixStreamFactory has only one method, CreateStreamOnRelativePath that takes a path of the package and returns an IStream for that package. We then validate this stream as normal.
sample/OverrideStreamSample contains a sample implementation of IMsixStreamFactory and IStream. An easy way to play with the sample is to copy FlatBundleWithAsset.appxbundle in a different folder and try to unpack it.
Extras: refactor to improve readability of the code.
Related work items: #18607747, #18607753
In this change:
- Implementations of several public interfaces to expand the SDK
- IAppxManifestReader
- IAppxManifestReader2
- IAppxManifestReader3
- IAppxManifestPackageId
- IAppxManifestProperties
- IAppxManifestTargetDeviceFamiliesEnumerator
- IAppxManifestTargetDeviceFamily
- IAppxManifestResourcesEnumerator
- IAppxManifestApplicationsEnumerator
- IAppxManifestApplication
- IAppxManifestQualifiedResourcesEnumerator
- IAppxManifestQualifiedResource
- IAppxBundleManifestReader
- IAppxBundleManifestPackageInfoEnumerator
- IAppxBundleManifestPackageInfo
- New option for makemsix unbundle -d <directory> -p <package> [-sl] [-sp]
- New entrypoints UnpackBundle and UnpackBundleFromStream
- Parse attributes from AppxManifest.xml
- EnumeratorCom class specialized for enumerators interfaces.
- ChainInterfaces struct for ComClass (eg. IAppxManifestReader3->IAppxManifestReader2->IAppxManifestReader)
- Fix QI'ing for IUnknown and other bugs.
- ApiTest to validate the correctness of the implementation
- New bundle sample to show information about packages in a bundle (doesn't extract)
Related work items: #15765569
This change contains the renaming from xPlatAppx to MSIX Packaging SDK
Binaries
- xPlatAppx.dll -> msix.dll
- MakexPlatAppx.exe -> makemsix.exe
Export rename
- UnpackAppx ->UnpackPackage
Related work items: #15704951