This is most likely an MSIX question and not an Advanced Installer question, but regardless I'd appreciate your help.
I have a c# app that needs to start a new process that runs a .bat file. This fails with the error
Code: Select all
Unable to start C:\Program Files\WindowsApps\App.E_1.0.0.67_x64__5c1j8dm4w74ew\utils\runtime_analyzer.bat. Exception received: System.ComponentModel.Win32Exception (1726): The remote procedure call failed.
at System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start()
at Worker.ExecuteAsync(CancellationToken stoppingToken)I opened PowerShell in that MSIX app using Hover (many thanks!) to see if I can run the batch file from there and saw that directly running the batch file works:
Code: Select all
PS C:\Program Files\WindowsApps\App.E_1.0.0.67_x64__5c1j8dm4w74ew> .\utils\runtime_analyzer.bat
[... does whatever it needs to do, but in this process]But indeed starting a new process doesn't:
Code: Select all
PS C:\Program Files\WindowsApps\App.E_1.0.0.67_x64__5c1j8dm4w74ew> Start-Process .\utils\runtime_analyzer.bat
Start-Process : This command cannot be run due to the error: The remote procedure call failed.
At line:1 char:1
+ Start-Process .\utils\runtime_analyzer.bat
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Start-Process], InvalidOperationException
+ FullyQualifiedErrorId : InvalidOperationException,Microsoft.PowerShell.Commands.StartProcessCommandNeedless to say, outside of MSIX context starting a new process does work.
Would appreciate any ideas on what am I doing wrong and how to start a new process from a batch file inside MSIX (Starting new exe processes is possible, from other tests done)
Many thanks!
Keren