Opening other application from script on HL2

Hello guys, I’m working on a pretty simple app for Hololens 2 in which use button prompt to open 2 applications.
One is an appxbundle I have in my StreamingAssets folder, and the other one is Dynamics365Guides which is already installed on the device.
So far I tried to launch the appxbundle file with the Application.OpenURL method and the Windows.System.Launcher.LaunchUriAsync method, none of which are successful.
And I did not even try to open the Dynamics365Guides since I don’t know how to get the path to installed apps.

So if anyone can shed some light on this suject I would be very grateful :slight_smile:

In case anyone ever faces the sam problem, here is the working solution Microsoft support gave me.
Apps are sandboxed on Hololens, so opening anything outside what’s contained in the package is not possible (so opening an app with its .exe URL is not an option).
UWP apps (which is the target platform for HL apps) can register an URI handler which allows them to be launched by passing said URI to the system.
On principle every Microsoft app should already have this handler (you can get it by watching which protocol are registered when the app opens), and for your own app you have to add the URI scheme to the package manifest, and add a tiny bit of code to handle this special startup.

Opening an app this way is done throught LaunchUriAsync, but it has to be called on the Windows UI thread, so the full method to launch the app is as follows :

#if !UNITY_EDITOR
string uriToLaunch = @"ms-guides://"; //Dynamics365guides URI
System.Uri uri = new System.Uri(uriToLaunch);
await Windows.ApplicationModel.Core.CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, async () =>
{
    await Windows.System.Launcher.LaunchUriAsync(uri);
});
#endif
2 Likes

Thank you!!!

@Arkonis_Khobalt
I am trying to use Dynamic 365 remote assist app to share my mixed reality app (built in Unity) to users on Microsoft teams. My app is using Vuforia for image target detection. Problem is, both remote assist and my app requires the camera at the same time. Seems like, while my camera is “On” on remote assist app, my image target is not getting detected. Hence, the app is not useful anymore.
Any help would be highly appreciated!
Thanks!

Hi @komalsharma21294
I’m encountering the same problem. Could you share how you successfully addressed it?

Thanks!