SOLVED

Launching Apps with Parameters

MVP

In the recent Ignite video from @John Vintzel , he mentioned that launching apps with parameters is supported on OS2004.  I believe I heard that this may be done in the manifest, and that you'll have to set the minimum supported to OS2004 to get the functionality.

 

So what is the syntax to do this in the manifest?  I haven't seen any changes supporting it in the schemas.

6 Replies

<Application> and <Extension> support the uap10:Parameters=... optional parameter to pass manifested parameters to the launched process.

You can specify certain dynamic runtime values e.g.

<Application...uap10:Parameters="$(package.effectiveLocation)\bar.dat")

will launch the application with the parameter per GetPackagePathByFulName2(...PackagePathType_Effective...) + "\bar.dat"

As I read the documentation, this seems to only apply to uap10 hosted apps and not an app in general. Is the documentation (or my interpretation) incorrect?

What I am looking for is the ability to have a standard win32 based exe expose a start menu entry that uses command line arguments without the need of the PSF.
best response confirmed by TIMOTHY MANGAN (MVP)
Solution
>As I read the documentation, this seems to only apply to uap10 hosted apps

Nope. <Application> and <Extension> attributes are 'activation info' -- Executable, EntryPoint, TrustLevel, RuntimeBehavior, Parameters, etc. That tells Windows "here's how to create a process for this activatable extension point". Parameters aren't just for host runtime.

>standard win32 based exe expose a start menu entry that uses command line arguments without the need of the PSF.

Can you elaborate?

What do you expect happen when the start menu entry is selected? A process is created with the exe? Does the process have package identity? Application identity? Is this exe referenced by an <Application> in appxmanfiest.xml? Is this just a random exe in an MSIX package not referenced by anything in appxmanifest.xml?

The exe is a normal packaged Win32 Application listed with identity and EntryPoint="Windows.FullTrustApplication". As long as a uap10 application extension under it with uap10:Extension with Category = "windows.hostRuntime" will extended the full trust app, then we are good (although perhaps the uap10:Extension documentation could be improved as that is not an obvious conclusion to make when reading, such as an example of this use case).

 

Thanks!

Thank you for the feedback @TimothyMangan. I will be sure to update the documentation on the MSIX Docs.

I would like to confirm that as you have marked Howard's response as the best response you got an answer to your question?
Yes, that was me.
1 best response

Accepted Solutions
best response confirmed by TIMOTHY MANGAN (MVP)
Solution
>As I read the documentation, this seems to only apply to uap10 hosted apps

Nope. <Application> and <Extension> attributes are 'activation info' -- Executable, EntryPoint, TrustLevel, RuntimeBehavior, Parameters, etc. That tells Windows "here's how to create a process for this activatable extension point". Parameters aren't just for host runtime.

>standard win32 based exe expose a start menu entry that uses command line arguments without the need of the PSF.

Can you elaborate?

What do you expect happen when the start menu entry is selected? A process is created with the exe? Does the process have package identity? Application identity? Is this exe referenced by an <Application> in appxmanfiest.xml? Is this just a random exe in an MSIX package not referenced by anything in appxmanifest.xml?

View solution in original post