Forum Discussion
MSIX Command Line Argument
Hey guys,
I'm trying to convert an App-V package to an MSIX package. I've tried using the packager to make a new package from scratch, and I've tried converting the package.
Normally, my program's shortcut launches an executable with a command line argument. MSIX doesn't seem to support this in the manifest XML file, unlike App-V.
I've listed a comparison of both below.
App-V manifest item (has arguments, is working):
<appv:Extension Category="AppV.Shortcut">
<appv:Shortcut>
<appv:File>[{Programs}]\Microsoft Dynamics\GP 2015\GP.lnk</appv:File>
<appv:Target>[{ProgramFilesX86}]\Microsoft Dynamics\GP2015\Dynamics.exe</appv:Target>
<appv:Icon>[{ProgramFilesX86}]\Microsoft Dynamics\GP2015\Dynamics.exe.0.ico</appv:Icon>
<appv:Arguments>Dynamics.set</appv:Arguments>
<appv:WorkingDirectory>[{ProgramFilesX86}]\Microsoft Dynamics\GP2015\</appv:WorkingDirectory>
<appv:ShowCommand>1</appv:ShowCommand>
<appv:ApplicationId>[{ProgramFilesX86}]\Microsoft Dynamics\GP2015\Dynamics.exe</appv:ApplicationId>
</appv:Shortcut>
</appv:Extension>
MSIX manifest item (doesn't have arguments, isn't working):
<Application Id="DYNAMICS" Executable="VFS\ProgramFilesX86\Microsoft Dynamics\GP2015\Dynamics.exe" EntryPoint="Windows.FullTrustApplication">
<uap:VisualElements BackgroundColor="transparent" DisplayName="GP" Square150x150Logo="Assets\Square150x150Logo.png" Square44x44Logo="Assets\Square44x44Logo.png" Description="GP">
<uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png" Square310x310Logo="Assets\Square310x310Logo.png" Square71x71Logo="Assets\Square71x71Logo.png" />
</uap:VisualElements>
</Application>
- jvintzelMicrosoft
Support for shortcut parameters is not yet supported in 1809, it should be in an upcoming Insider preview.
John.
- BrettBurgesonBrass Contributor
Is there any update on allowing parameters to be specified to the MSIX package that get passed on to the installed application? My application needs environment specific data on the command line that can be different for each installation environment without creating a whole new package for each environment.
Thank you, Brett
- Bogdan MitracheSteel Contributor
Can you give us more details about the command line that you need to set? From what I see you said it depends on the target machine. Is it a file/folder path that can be different for each machine?
I am asking because in Advanced Installer we try to handle all these MSIX limitations with generic solutions that apply to multiple use cases. For example, now we are working on extending our private PSF fork to support expanding folder IDs or environment variables, like ProgramFilesFolder to "C:\Program Files". This path expansion can occur in a config file that gets installed or in a shortcut command line.
I am curious to better understand the specifics for your scenario.
Thanks,
Bogdan
- TaylorBrownBrass Contributor
Thanks for the update, John. Any idea when this will be supported? Is there a GitHub repo I can consult to open an issue?
- jvintzelMicrosoft
You can add something to the ideas section of the community and we can update you on the progress.
John.
- Bogdan MitracheSteel Contributor
Hi Taylor,
This is a well known limitation.
The solution is to have a stub/launcher used as entry point instead of your main app and that launcher can in the end launch your application with the desired command line parameters.
When MSIX was announced in March, Kevin Gallo introduced the free Express edition from Advanced Installer. This is a setup authoring tool that can convert old setups to MSIX, or import an existing MSIX package and package it, providing additional functionality, like a GUI based method for you to specify command line arguments and many others (Advanced Installer takes care of the details in the background, i.e. includes a launcher that saves your command line args and passes them to your main application).
So all you need to do is to import your current MSIX package into a new project in Advanced Installer, go to Application Details page and set your args in the "Arguments" field. Then build the MSIX package again.
Disclaimer: I work on the team building Advanced Installer.