So it would appear that this would be a simple solution, but as I can not find any documentation on how to do exactly this it's effectively the same as brute-force guessing a password.
Environment
- Unity Versions: 2019.3.1, 2019.3.4(current)
- Platform: Universal Windows Platform
- MRTK: 2.2, 2.3(current)
- HoloLens 2 OS: Windows Holographic Operating System
What I Am Trying To Accomplish
- I push a button and the file browser/explorer appears inside my Unity scene
The Problem
- I can not launch the file browser/explorer in HoloLens 2.
Background/Context
With MRTK 2/HoloLens 2 you are able to launch external apps without exiting the Unity application. Something that HoloLens 1 could not do. Microsoft provides proof of this in their Unity examples package: Assets/MixedRealityToolkit.Examples/Demos/HandTracking/Scenes/HandInteraction.Examples.unity
once you have loaded the .Foundation and .Examples external packages into your Unity project.
In the provided scene, out of all the presented object there are two buttons off to the right side that when pressed will launch the Edge Browser or the OS's settings application. This is accomplished with a launch URI attached script that runs .OpenURL
on a string provided by the user via the GameObject's inspector.
And the code snippet (provided by Microsoft in MRTK2) that runs the user-inputted string:
public void Launch(string uri){
...
Application.OpenURL(uri);
...
}
What I Have Tried So Far
Due to how similar Windows 10 on the Desktop and Windows Holographic Operating System is, when these buttons are pressed while Unity is in Play Mode, the buttons fully function, launching the computer's default browser, and the settings application for Windows 10.
Under this assumption I looked up how to open the file browser/explorer and am able to successfully launch it with the string explorer
in the textbox, but only on the Windows 10 desktop. It does not work when running on HoloLens 2. Unsurprisingly, there are differences between Windows 10 and Windows Holographic Operating System, so testing this is slightly tedious as I need to build every time I need to test. So far the strings that I have tested are:
explorer
explorer.exe
ms-explorer
ms-browser
ms-storage
ms-storage.storagefile:// (and without the ://)
https://C:\
And so on....
Thinking that Application.OpenURL
might not be the only/best route I have also tried a different script:
public void Opener(){
System.Diagnostics.Process.Start("explorer.exe");
}
But once again, this approach works perfectly on Windows 10 Desktop, but not in HoloLens 2. I could keep on going with more examples and explanations but I'm already concerned I'll have to redefine this post as a Wikipedia article with the length it's already gotten to.
And that's about it. I'm stumped as to where to go from here. So while I continue to randomly shotgun into the Googleverse and see what half related snippets I can find to test and prove that they work on the Desktop and not HoloLens 2, thoughts/suggestions? I do not believe this is a complicated problem/solution. But it is a very specific one that, again as far as I can tell, has zero documentation on due to how new and scarce HoloLens 2 still is.
(Also I can't create a new tag for HoloLens 2, not good enough of a person. So for now I have to use the regular hololens tag)