We have a UWP app in the Windows Store. From this app we would like to launch various apps on the same system. For this process we need to do 2 things.
- Check if the app exists on the system
- If yes, launch it. If no, give feedback
We tried a couple of things but i'm searching for the best way to do this. We would like to launch both other UWP apps and Standalone apps.
I tried messing with the Unity PlayerPrefs, but that acts weird. It works if I make a custom PlayerPref and check if it exists from within 1 app, but as soon as I make a playerpref in the UWP and check for it in the Standalone I get nothing. And vice versa ofcourse. (Yes I know UWP saves its playerprefs somewhere else)
What would be the best general solution to this? Continue messing around with Playerprefs and search for different paths depending on the app we want to open?(Standalone, UWP) or some other way?
EDIT: What I have so far:
if (Input.GetKeyDown(KeyCode.Backspace))
{
PlayerPrefs.SetString("42069" , "testing_this");
PlayerPrefs.Save();
Debug.Log("Wrote key 42069 to registry with: -value testing_this-");
}
if (Input.GetKeyDown(KeyCode.Space))
{
if (PlayerPrefs.HasKey("42069"))
{
Debug.Log("I found the key 42069 in my registry");
cube.SetActive(true);
}
else
{
Debug.Log("I cant find key 42069 in my registry");
}
}
if (Input.GetKeyDown(KeyCode.S))
{
const string registry_key = @"SOFTWARE\DefaultCompany";
using(RegistryKey key = Registry.CurrentUser.OpenSubKey(registry_key))
{
if (key != null)
foreach (string subKeyName in key.GetSubKeyNames())
{
if (subKeyName == "RegistryTesting")
{
Debug.Log("I found the key on path: " + registry_key);
}
}
}
}
EDIT: No one? I know there is a way. All I need to do is check whether a standalone app exists from a UWP app. But I do not have acces to the register in a UWP app. I know there are some ways with bridges etc, but I have no clue how and where to start.