Introduction
If you're a device maker with an associated Microsoft Store application (a Hardware Support App), the ideal experience is when the user connects you device to their PC for the first time, the corresponding driver package and Microsoft Store app are installed. To enable this, you'll need to associate the app with the driver package. There are additional steps needed if the app needs to communicate with the driver or RPC endpoint. This post will focus on the first scenario of device and Store app association.
INF File
Specifying App Dependency in Driver Package
In the Driver Package specify the INF AddSoftware
Directive.
AddSoftware=SoftwareName,[flags],software-install-section
- Set the
SoftwareType
entry to 2. - Provide the Package Family Name (PFN) of your Store App in the
SoftwareID
entry. This can be found the the Packaging tab of thepackaging.Appxmanifest
file in your Visual Studio project.
Specifying Driver Dependency in APPX Manifest
This step is necessary if you need to prevent the app from loading if the driver is not present or to constrain a driver version to a specific app version. The Store can maintain up to 32 versions of your HSA.
In the Appx Manifest specify uap5:DriverDependency
and one or more uap5:DriverConstraint
.
At least one DriverDependency criteria must be satisfied in order for the app to load.
In this first scenario we don't want the app to load unless the HMDDevice is installed or both the Test and Camera devices are installed and the HMDDevice is not installed.
Scenario | Drivers (no minVersion or minDate) | Driver Installed | Dependency Satisfied? | App Loads? |
---|---|---|---|---|
1 | Microsoft_Test | Yes | No - Group 1 | No - Group 1 and Group 2 fail |
1 | Microsoft_Camera | No | No - Group 1 | No - Group 1 and Group 2 fail |
1 | Contoso_HMDDevice | No | No - Group 2 | No - Group 1 and Group 2 fail |
2 | Microsoft_Test | Yes | Yes - Group 1 | Yes - Group 1 succeeds |
2 | Microsoft_Camera | Yes | Yes - Group 1 | Yes - Group 1 succeeds |
2 | Contoso_HMDDevice | No | No - Group 2 | Yes - Group 1 succeeds |
3 | Microsoft_Test | No | No - Group 1 | Yes - Group 2 succeeds |
3 | Microsoft_Camera | No | No - Group 1 | Yes - Group 2 succeeds |
3 | Contoso_HMDDevice | Yes | Yes - Group 2 | Yes - Group 2 succeeds |
In this this scenario we've added some date and version constraints - we can see how the version / date of the driver impacts the loading of the app.
Scenario | Drivers (with minVersion or minDate Constraints) | Driver Version Installed | Driver Date: Installed | minVersion in AppxManifest | minDate in AppxManifest | Dependency Satisfied? | App Loads? |
---|---|---|---|---|---|---|---|
1 | Microsoft_Test | 2.0.0.0 | na | 2.0.0.0 | na | Yes - Group 1 | Yes - Group 1 succeeds |
1 | Microsoft_Camera | 3.0.0.0 | na | 3.0.0.0 | na | Yes - Group 1 | Yes - Group 1 succeeds |
1 | Contoso_HMDDevice | na | 5/10/2017 | na | 5/10/2017 | Yes - Group 2 | Yes - Group 1 succeeds |
2 | Microsoft_Test | 1.0.0.0 | na | 2.0.0.0 | na | No - Group 1 | No - Group 1 and Group 2 fail |
2 | Microsoft_Camera | 2.0.0.0 | na | 3.0.0.0 | na | No - Group 1 | No - Group 1 and Group 2 fail |
2 | Contoso_HMDDevice | na | 4/4/2016 | na | 5/10/2017 | No- Group 2 | No - Group 1 and Group 2 fail |
More information here: Pairing a driver with a Universal Windows Platform (UWP) app - Windows drivers | Microsoft Docs