LaunchUriAsync returns TRUE but does not open app store

Roland Plüss 1 Reputation point
2022-02-02T18:36:19.753+00:00

I'm creating a small launcher which runs an application protocol I've defined using a file. For this I'm using the following code (WinRT, C++):

Windows::System::LauncherOptions options;
    options.PreferredApplicationPackageFamilyName(packageFamilyName);
    options.PreferredApplicationDisplayName(packageDisplayName);
    options.DesiredRemainingView(ViewSizePreference::UseNone);
    options.TreatAsUntrusted(false);

    std::wstring uriString{L"delauncher:run?file="};
    uriString += pathLaunchFile;

    Uri uri{uriString};

    if(Windows::System::Launcher::LaunchUriAsync(uri, options).get()){

    }else{
        throw std::runtime_error("Failed launching file");
    }

I've tested two situations: 1) required package is installed and 2) required package is not installed.

In case 1) the application is started as it should so all is fine.

In case 2) the application is not started (correct) and TRUE is returned (also correct) but the user is not redirected to the app store to obtain the required package. According to MSDN this should be the case though:

LauncherOptions.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.

What am I overlooking here?

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
37,794 questions
{count} votes