App feature manifests

App feature manifests define the location of the apps you want to include in an image. Like other feature manifests, app feature manifests need to be included in the <AdditionalFMs> element in your image's OEMInput.xml file for the apps defined in the app fm to be included in an image.

For your first image, you can add all the apps in your workspace's apps folder at once to your image using CreateWSKAppsFM and UpdateWSKAppsFM.

Sample OEMAppsFM.xml manifest

<?xml version="1.0" encoding="utf-8"?>
<FeatureManifest 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
  xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
  xmlns="http://schemas.microsoft.com/embedded/2004/10/ImageUpdate" Revision="1" SchemaVersion="1.2">
  <AppX>
    <AppXPackages>
      <PackageFile Path="%WSKWorkspaceRoot%\Apps\Calculator" Name="Microsoft.WindowsCalculator_8wekyb3d8bbwe.appxbundle" LicenseFile="Microsoft.WindowsCalculator_8wekyb3d8bbwe.xml" ID="Microsoft.WindowsCalculator_8wekyb3d8bbwe" Optional="false" />
      <PackageFile Path="%WSKWorkspaceRoot%\Apps\Frameworks" CPUType="x86" Name="Microsoft.VCLibs.x86.14.00.appx" ID="Microsoft.VCLibs.140.00_8wekyb3d8bbwe" Optional="false" />
      <PackageFile Path="%WSKWorkspaceRoot%\Apps\Frameworks" CPUType="amd64" Name="Microsoft.VCLibs.x64.14.00.appx" ID="Microsoft.VCLibs.140.00_8wekyb3d8bbwe" Optional="false" />
      <PackageFile Path="%WSKWorkspaceRoot%\Apps\Frameworks" CPUType="arm" Name="Microsoft.VCLibs.arm.14.00.appx" ID="Microsoft.VCLibs.140.00_8wekyb3d8bbwe" Optional="false" />
      <PackageFile Path="%WSKWorkspaceRoot%\Apps\ContosoApp" Name="Contoso.Sampleapp_8wekyb3d8bbwe.appxbundle" LicenseFile="Contoso.Sampleapp_8wekyb3d8bbwe.xml" ID="Contoso.Sampleapp_8wekyb3d8bbwe" Optional="false" />
    </AppXPackages>
  </AppX>
</FeatureManifest>

Optional apps

The scripts in the Windows system kit configure every app in an app FM so they're included in an image. You can modify an app FM so that certain apps have to be specifically added to an OEMInput.xml to be included in an image.

Each app included in an app FM has an Optional attribute that controls whether the app will be included automatically in an image, or if the app needs to be manually included in an image by adding its ID to the OEMInput.xml.

If you're using a single collateral set for multiple images, marking apps as optional enables you to the apps to include in specific image configurations. An app FM in this scenario can include all the apps in your collateral set, while also specifying:

  • The base set of apps to be included in all images
  • A set of optional apps that you can manually add to specific OEMInput.xml files

Apps marked optional won't be included in any image unless you specifically include them in an image design. This allows you to reuse your app feature manifest for multiple images.

Work with optional apps

To specify an app as optional and add it manually to an image:

  1. Choose an app to mark as optional.

  2. In your app FM, change the app's Optional attribute to "true". This marks the app as optional and the app will no longer be included in all images.

    <PackageFile Path="%WSKWorkspaceRoot%\Apps\ContosoApp" Name="Contoso.Sampleapp_8wekyb3d8bbwe.appxbundle" LicenseFile="Contoso.Sampleapp_8wekyb3d8bbwe.xml" ID="Contoso.Sampleapp_8wekyb3d8bbwe" Optional="true" />
    
  3. Note the App ID, for example, ID="Contoso.Sampleapp_8wekyb3d8bbwe". Don't change this ID or the image will fail to build.

    If you acquired the app from the Microsoft Store, you can find the package family name in the app license. Open the license file using a text editor and use the value between the PFM tags.

  4. Add the optional app to an image by adding the ID as an <AppXID> value in your OEMInput.xml:

    <AppXOptionalPackages> 
      <AppXID>Contoso.Sampleapp_8wekyb3d8bbwe</AppXID>
    </AppXOptionalPackages> 
    

You can also specify an app as architecture-specific by adding CPUType="(arch)". When you build your image, files that don’t match the architecture type are excluded.

SetAppsRegion command-line syntax

SetAppsRegion -AppName <AppName> -Region <Region> [-OEMAppsFMPath <path>]
SetAppsRegion -AppName HelloWorld_1.0.0.0_x64.appx -Region en-us,de-de
Parameter Description
-AppName The filename name of the app. Use the Name attribute in the <PackageFile> element for the app.
-Region The region or regions where you want the app to be available. If specifying multiple regions, separate the regions with a ,: -Region en-us,de-de
-OEMAppsFMPath Path to the app FM. Default is %WSKWorkspaceRoot%\FMFiles\OEMAppsFM.xml

See also

Driver feature manifests