'Run arbitrary executable from Delphi application in Microsoft Store
I'm trying to bring a Delphi/Win32 application to the Microsoft Store. In my application I have to download another app that needs to be executed. However, after installing this package (as MSIX) I get an ACCESS DENIED error on ShellExecute.
I found out that, in a UWP, it is (by default) not allowed to execute an arbitrary executable that is not included in your package. However, there is a workaround in C# using FullTrustProcessLauncher.LaunchFullTrustProcessForCurrentAppAsync. See UWP: how to start an exe file that is located in specific directory?
Are there ways to use FullTrustProcessLauncher.LaunchFullTrustProcessForCurrentAppAsync in Delphi? Or other ways to deploy my Win32 Delphi app through the appstore (I want to have the benefit of automatic updates)?
Solution 1:[1]
I'm trying to bring a Delphi/Win32 application to the Microsoft Store. In my application I have to download another app that needs to be executed
As the document said, you can't execute another app with UWP directly, the target app should be registered in the package manifest file and launched by LaunchFullTrustProcessForCurrentAppAsync method in UWP platform by default.
However, you have other way to execute download app that invoke Process.Start in desktop extension. you just need get the download app's path, then pass it to stat method.
Process.Start(Path.Combine(ApplicationData.Current.LocalFolder.Path, "CoreAppTest.exe"));
For more detail, you could research stefan's blog UWP with Desktop Extension – Part 2 launch remote app.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Nico Zhu - MSFT |
