LauncherOptions.PreferredApplicationPackageFamilyName | preferredApplicationPackageFamilyName property

Gets or sets a value that represents the package family name of the app in the Store that the user should install if no app exists to handle the file type or URI.


var preferredApplicationPackageFamilyName = launcherOptions.preferredApplicationPackageFamilyName;
launcherOptions.preferredApplicationPackageFamilyName = preferredApplicationPackageFamilyName;

Property value

Type: String [JavaScript] | System.String [.NET] | Platform::String [C++]

The package family name of the app.


In some cases the user may not have an app installed to handle the file that you are launching. By default, Windows will handle these cases by providing the user with a link to search for an appropriate app on the store. Use LauncherOptions.PreferredApplicationDisplayName in conjunction with LauncherOptions.preferredApplicationPackageFamilyName to provide the user with an app in the Windows Store that they can acquire to handle the file. The display name that you use should correspond to the display name of the app in the Windows Store.

You must set both of these preferred application properties to recommend an app. Setting one without the other will result in a failure.

Note  You cannot set the preferred application properties and the fallback URI at the same time, since only one fallback may be used. The Launcher API will fail if both fallbacks are set.


Call the Launcher.LaunchFileAsync(IStorageFile, LauncherOptions) | launchFileAsync(IStorageFile, LauncherOptions) method with preferredApplicationDisplayName set to the display name of an app in the Windows Store and the preferredApplicationPackageFamilyName set to the package family name of an app in the Windows Store.

// Path to the file in the app package to launch
var imageFile = "images\\test.png";

// Get the image file from the package's image directory
  function (file) {
    // Set the recommended app
    var options = new Windows.System.LauncherOptions();
    options.preferredApplicationPackageFamilyName = “Contoso.FileApp_8wknc82po1e”;
    options.preferredApplicationDisplayName = “Contoso File App”;

    // Launch the retrieved file pass in the recommended app 
    // in case the user has no apps installed to handle the file
    Windows.System.Launcher.launchFileAsync(file, options).then(
      function (success) {
        if (success) {
            // File launched
        } else {
            // File launch failed

Requirements (device family)

Device family


API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0


Windows::System [C++]



Requirements (operating system)

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps]


Windows::System [C++]



See also

Association launching sample
How to launch the default app for a file (JavaScript)
How to launch the default app for a file (C#/VB/C++)
How to launch the default app for a URI (JavaScript)
How to launch the default app for a URI (C#/VB/C++)
Guidelines and checklist for file types and URIs
Launcher.LaunchFileAsync(IStorageFile, LauncherOptions)
Launcher.LaunchUriAsync(Uri, LauncherOptions)



© 2015 Microsoft