2

What is the best working way to call a win32 executable from JavaScript UWP app (Windows Anniversary update)

I have tried to configure the win32 via an AppService:

<uap:Extension Category="windows.appService" StartPage="www\index.html">
    <uap:AppService Name="CommunicationService" />
</uap:Extension>

<desktop:Extension Category="windows.fullTrustProcess" Executable="mywin32app.exe" EntryPoint="Windows.FullTrustApplication" />

Now I can launch it with Windows.ApplicationModel.FullTrustProcessLauncher.launchFullTrustProcessForCurrentAppAsync() from JavaScript, but how do I launch It with parameters?

2
  • Did you every find a way to do this? I agree with you, the Parameter groups are useless as you cant pass runtime args Commented Oct 16, 2016 at 8:08
  • @mikeysee: no I try the appservice aproach right now Commented Oct 17, 2016 at 12:27

2 Answers 2

1

but how do I launch It with parameters

There is a with-parameter version of this method that you can use: FullTrustProcessLauncher.LaunchFullTrustProcessForCurrentAppAsync(String).

And declear the parameters in appxmanifest file:

<desktop:Extension Category="windows.fullTrustProcess" Executable="fulltrustprocess.exe"> 
      <desktop:FullTrustProcess> 
        <desktop:ParameterGroup GroupId="SyncGroup" Parameters="/Sync"/> 
        <desktop:ParameterGroup GroupId="OtherGroup" Parameters="/Other"/> 
      </desktop:FullTrustProcess> 
</desktop:Extension> 
Sign up to request clarification or add additional context in comments.

6 Comments

But it looks like the parameters could only be defined in the manifest, right? So how do I use dynamic parameters for the call?
Yes, the parameters could only be defined in the manifest and GroupId be passed as the argument to the method. I'm out of ideas of other options to pass the parameters.
Hm but this is useless. There should be a way do define the parameters during runtime.
You can define all parameters in appmanifest, and during runtime change the GroupId dynamically to decide which parameter to use.
Also you are welcomed to deliver Feature Request Feedback through Windows Feedback App to help us improve our work.
|
0

The provided mechanism for passing parameters doesn't seem to allow you to do them dynamically at the moment, which is not ideal. You can only pass through hard-coded parameters to your process. I suggest using an App Service extension in your UWP app to make data available to your full trust process. The process is documented here.

Do it this way:

Launch full trust process. Add a parameter to indicate that it is launched from UWP.

In your full trust process, check if the parameter was passed in, and call back to the UWP process' app service task to get the data you would otherwise pass in as a parameter.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.