Add UTF8 variant to public APIs that use LPWSTR or LPCWSTR.
New Interfaces:
• IAppxBlockMapFileUtf8
• IAppxBlockMapReaderUtf8
• IAppxBundleManifestPackageInfoUtf8
• IAppxBundleReaderUtf8
• IAppxFactoryUtf8
• IAppxFileUtf8
• IAppxManifestApplicationUtf8
• IAppxManifestPackageDependencyUtf8
• IAppxManifestPackageIdUtf8
• IAppxManifestPropertiesUtf8
• IAppxManifestQualifiedResourceUtf8
• IAppxManifestResourcesEnumeratorUtf8
• IAppxManifestTargetDeviceFamilyUtf8
• IAppxPackageReaderUtf8
This change also fixes a bug were all non-AppPackaging public interfaces (eg. IMsixElement) had their IID_I* set to 0 for Windows only. GUID definition is now defined on AppxPackaging.hpp removing the need of AppPackaging_i.cpp
Re-wrote the entire API tests to not hardcode one package and one bundle and make them compatible with AOSP and iOS.
There are 5 main tests with subtests.
- TestPackage
-Package.PayloadFiles
-Package.PayloadFile
-Package.PayloadFile.DontExists
-Package.FootprintFile
- TestPackageManifest
-Package.Manifest.Stream
-Package.Manifest.Applications
-Package.Manifest.Properties
-Package.Manifest.Dependencies
-Package.Manifest.Capabilities
-Package.Manifest.Resources
-Package.Manifest.Tdf
-Package.Manifest.MsixDocument
-Package.Manifest.PackageId
- TestPackageBlockMap
-Package.BlockMap.Stream
-Package.BlockMap.ValidateFiles
- TestBundle
-Bundle.FootprintFile
-Bundle.PayloadPackages
- TestBundleManifest
-Bundle.Manifest.Stream
-Bundle.Manifest.PackageId
-Bundle.Manifest.PackageInfo
apitest.exe supports getting input from the command windows or taking a file with all the input. See test/api/input/apitest_test_1.cmakein for an example input file. This file is used in all automated tests. NOTE: don't use this file directly, use <bin folder>/test/api/input/apitest_test_1.txt
It is expected that the person who does the test knows what the input should be (eg. There is not: "Enter the package: " text output)
apitest.exe also supports redirecting the output to a file. That option is used for the AOSP and iOS BVTs.
Bugs found and fixed:
1. IAppxFile::GetName for CodeIntengrity footprint file returned AppxMetadata/CodeIntegrity.cat instead of AppxMetadata\CodeIntegrity.cat
1. IMsixElement::GetElements returned an empty IMsixElementEnumerator for AOSP.
1. S_OK and S_FALSE was taken as an int instead of signed long
This needs to be available on GitHub next week Monday 9/24 so that Andrew Clinick can point to it and say "look here we've made this open sourced".
Code was largely lifted from the MSIX.Win7 intern project with minor modifications
Enable the user to disable bundle support for the SDK by specifying -DSKIP_BUNDLES=on on CMake. If the user tries to unpack a bundle or create a bundle factory they will get 0x80070032 (E_NOTSUPPORTED). The binary size decreases ~60k.
Win x64
- bundle: 464 k
- no bundle: 413 k
Win x86
- bundle: 330 k
- no bundle: 293 k
Linux
- bundle: 5,424 k
- no bundle: 5,330 k
AOSP arm
- bundle: 4,381 k
- no bundle: 4,313 k
AOSP arm v7a
- bundle: 4,288 k
- no bundle: 4,220 k
MacOS
- bundle: 4,487 k
- no bundle: 4,413 k
iOS arm64
- bundle: 4,516 k
- no bundle: 4,458 k
Related work items: #18753331
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
In the extract sample, for non-Win platforms, a file in a subdirectory will be saved as `Assets\contrast-black\SplashScreen.scale-100_contrast-black.png` instead of creating the proper directories
Related work items: #15487436
Fix saving the files using the percentage encoding name that OPC uses. We now save files as the name defined in the AppxBlockMap.xml file.
Unpacking test\appx\BlockMap\HelloWorld.appx used to produce a file with name Shortcut%20File\HelloWorld.appxref-ms and now is Shortcut File\HelloWorld.appxref-ms
Unpacking test\appx\HelloWorld.appx used to produce a files with name icon-32%255B2%255D.png and icon-32%25255B2%25255D.png and now is icon-32%5B2%5D.png and icon-32%255B2%255D.png respectively.
Related work items: #14874780