MSIX application with required command line arguments - no stub

%3CLINGO-SUB%20id%3D%22lingo-sub-2775733%22%20slang%3D%22en-US%22%3EMSIX%20application%20with%20required%20command%20line%20arguments%20-%20no%20stub%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2775733%22%20slang%3D%22en-US%22%3E%3CP%3EJust%20thought%20I'd%20share%20a%20method%20for%20specifying%20command%20arguments%20to%20your%20applications%20when%20using%20the%20msix%20packaging%20tool.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ecreate%20package%20as%20per%20normal.%3C%2FP%3E%3CP%3Eopen%20up%20the%20package%20in%20the%20package%20editor%20after%3C%2FP%3E%3CP%3Eopen%20the%20%22Manifest%20File%22%3C%2FP%3E%3CP%3Efind%20the%20%3CAPPLICATION%3E%20xml%20tag%20that%20corresponds%20with%20the%20executable%20you%20need%20to%20add%20arguments.%3C%2FAPPLICATION%3E%3C%2FP%3E%3CP%3Ewithin%20the%20same%20%3CAPPLICATION%3E%20tag%20add%20in%20uap10%3AParameters%3D%22your%20parameters%22%3C%2FAPPLICATION%3E%3C%2FP%3E%3CP%3Eex.%3C%2FP%3E%3CP%3E%3CAPPLICATION%20id%3D%22%26quot%3Bmycoolapp%26quot%3B%22%20executable%3D%22%26quot%3BVFS%5CProgramFiles%5CMyCoolApp%5CApp.exe%26quot%3B%26lt%3BSTRONG%22%3E%20uap10%3AParameters%3D%22-nogui%22%20EntryPoint%3D%22Windows.FullTrustApplication%22%26gt%3B%3C%2FAPPLICATION%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ekeep%20in%20mind%20only%20the%20bold%20part%20is%20relevant%20to%20adding%20command%20parameters.%26nbsp%3B%20Also%20if%20you%20need%20quotes%20in%20your%20parameter%2C%20encase%20the%20whole%20thing%20with%20single%20quotes%20and%20it'll%20convert%20it%20for%20you%20to%20a%20friendly%20result%20ie%3A%20uap10%3AParameters%3D'%22coolbeans%22%20-stuff'%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAfter%20saving%2Fclosing%20it%20will%20validate%20your%20xml%20for%20you%20which%20is%20a%20nice%20bonus.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

Just thought I'd share a method for specifying command arguments to your applications when using the msix packaging tool.

 

create package as per normal.

open up the package in the package editor after

open the "Manifest File"

find the <application> xml tag that corresponds with the executable you need to add arguments.

within the same <application> tag add in uap10:Parameters="your parameters"

ex.

<Application id="mycoolapp" Executable="VFS\ProgramFiles\MyCoolApp\App.exe" uap10:Parameters="-nogui" EntryPoint="Windows.FullTrustApplication">

 

keep in mind only the bold part is relevant to adding command parameters.  Also if you need quotes in your parameter, encase the whole thing with single quotes and it'll convert it for you to a friendly result ie: uap10:Parameters='"coolbeans" -stuff'

 

After saving/closing it will validate your xml for you which is a nice bonus. 

 

0 Replies