Search code examples
windowsuwpuwp-xamllauncher

Is there any better way to Launch UWP apps from Console application


I tried to launch the UWP application from c# console application. It tried with below code which uses APPID

Process.Start(@"C:\Program Files (x86)\Windows Kits\10\App Certification Kit\microsoft.windows.softwarelogo.appxlauncher.exe", "1a75- 6f75 - 5ed3 - 8944 - 6b7df2bee095");

Is there any better way to launch UWP application programatically.


Solution

  • To launch any UWP app on the system you can use the following API:
    AppListEntry.LaunchAsync Method

    To get the AppListEntry for the desired application, use the PackageManager APIs: PackageManager.FindPackageForUser(String, String) Method
    Package.GetAppListEntriesAsync Method

    Alternatively, you can use the following Win32 API insteadp of the AppListEntry API:
    IApplicationActivationManager::ActivateApplication method