Add apps to your Factory OS image
The Windows System Kit includes scripts to help make adding Universal Windows Apps to your Factory OS images easier. These scripts automatically create or update a Feature Manifest file based on the apps that you add to a workspace.
To add apps to an image that's already running, see Connect using Device Portal.
Prerequisites
- A WSK workspace
- One or more properly packaged Universal Windows Apps
Gather your apps
Gather all your .msix, .msixbundles, .appx, and .appxbundle files, including all dependency and license files, for all architectures that your app supports (x64, x86, and arm) on your technician PC.
Save the apps to the default Apps folder in your workspace, for example:
C:\Workspace\Apps\
. If your apps are each in their own folders, It's OK to use subfolders. The scripts can find your apps.It's also OK to have multiple apps that include the same dependency file. The dependency file will only be added once to the final image.
Our sample uses the Calculator app which is bundled along the WSK as a Microsoft-provided Universal Windows Platform (UWP) app. You can use the apps from UWP app samples, or replace it with your own apps.
Add apps to the AppFM included in your workspace
Your workspace includes an empty App FM that's already included in your OEMInput.xml file. To add apps to an image, use the scripts in the WSK to add apps to the App FM. If don't want to use this FM and want to learn how to create a new app FM and include it in an OEMInput.xml file, see Create a new App FM.
Add apps to your workspace's App FM:
Start the Windows System Kit Build Environment as an administrator (example, from the mounted WSK ISO, right-click
E:\SetImagGenEnv.cmd
and click Run as administrator.)From the Windows System Kit build environment, navigate to your workspace folder:
cd c:\Workspace
Set your workspace root variable to point to Update the WSKWorkspaceRoot environment variable to point to your workspace.
C:\Workspace\SetWSKWorkspaceRoot.cmd
Add the apps in your workspace to to the included App FM: Use the scripts in the WSK to update your App FM so it includes the apps in your workspace.
Run the
UpdateWSKAppsFM
script to add all of the apps in your workspace apps folder (%WSKWorkspaceRoot%\Apps
) to theOEMAppsFM.xml
. All apps listed in this FM will be included in your image.UpdateWSKAppsFM
If you don't specify any options, the script will update the
%WSKWorkspaceRoot%\FMFiles\OEMAppsFM.xml
file to include all the apps in the workspace's Apps folder. For script options, see UpdateWSKAppsFM Syntax below.By default, the apps are included in all image designs, but you can add app identifiers and mark apps as optional if you're creating multiple image designs using a centralized set of collateral.
When you add, remove, or update your apps, re-run
UpdateWSKAppsFM
to add changes into your feature manifest. It's OK if you've made other edits to your feature manifest, for example, setting an app as optional. The script won't affect those changes.
Create a new App FM
You can use the scripts in the Windows System Kit to create a new App FM:
From the Windows System Kit environment:
Place the apps you want to include in a folder.
Run the
CreateWSKAppsFM
script to include all of the apps in your app folder. Specify the name of the new AppFM, and your apps folder:CreateWSKAppsFM -fmfile %WSKWorkspaceRoot%\FMFiles\NewOEMAppsFM.xml -AppsFolder C:\NewApps
For script options, see CreateWSKAppsFM Syntax below.
This script creates a new feature manifest file, for example,
%WSKWorkspaceRoot%\FMFiles\NewOEMAppsFM.xml
that contains the location of each of the apps.By default, the apps are included in all image designs, but you can add app identifiers and mark apps as optional if you're creating multiple image designs using a centralized set of collateral.
Add the new App FM to your OEMInput.xml file by adding it as an
<AdditionalFM>
:<AdditionalFM>%WSKWorkspaceRoot%\FMFiles\NewOEMAppsFM.xml</AdditionalFM>
If you add, remove, or update your apps, run
UpdateWSKAppsFM
to add the apps into your feature manifest. It's OK if you've made other edits to your feature manifest, for example, setting an app as optional. The script won't affect those changes:UpdateWSKAppsFM -fmfile %WSKWorkspaceRoot%\FMFiles\NewOEMAppsFM.xml -AppsFolder C:\NewApps
App FM scripts syntax
CreateWSKAppsFM syntax
CreateWSKAppsFM {-FMFile: [path]} {-AppsFolder [Path]} {-IncludeWow}
Parameter | Description |
---|---|
-FMFile [Path] | Path to the FM file you wish to create. By default, updates %WSKWorkspaceRoot%\FMFiles\OEMAppsFM.xml . |
-AppsFolder [Path] | Path to the folder you wish to search for Apps in. By default, searches %WSKWorkspaceRoot%\Apps . |
-IncludeWow | Adds support for x86 on amd64 images, and support for arm on arm64 images. |
UpdateWSKAppsFM syntax
UpdateWSKAppsFM {-FMFile: [path]} {-AppsFolder [Path]} {-IncludeWow}
Parameter | Description |
---|---|
-FMFile [Path] | Path to the FM file you wish to update. By default, creates or replaces %WSKWorkspaceRoot%\FMFiles\OEMAppsFM.xml . |
-AppsFolder [Path] | Path to the folder you wish to search for Apps in. By default, searches %WSKWorkspaceRoot%\Apps . |
-IncludeWow | If set, it will add x86 to amd64, arm to arm64 images. |