Run External exe from UWP app, workaround sandboxed mode

倖福魔咒の 提交于 2019-12-11 10:57:59

问题


I have a program where i want to have the ability to launch a local application (for example Spotify) from my UWP App. I have searched the web for a solution as (Process.Start()) doesn't work. As i have understood the UWP applications is kind of sandboxed for saftey and stability reasons. But is there a (simpel) way to work around this.

I only want the ability to start and close a program inside my own frame/Window. No need to interact/send/recive data between my applications and the external program


回答1:


I have a program where i want to have the ability to launch a local application (for example Spotify) from my UWP App.

You can utilize Windows.System.ProcessLauncher API.

Here is a sample about how to launch an external process (exe) from a Universal Windows Platform (UWP) app you can reference.

Make sure add systemManagement capabiity.

For more information reference Process​Launcher.




回答2:


That is not possible with all apps. Some desktop apps handle protocol launches and that can be a way of launching another app. Spotify actually has a protocol registered so you could do this to launch it:

await Launcher.LaunchUriAsync(new Uri("spotify:"));


来源:https://stackoverflow.com/questions/44835014/run-external-exe-from-uwp-app-workaround-sandboxed-mode

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!