Forum Discussion

TaylorBrown's avatar
TaylorBrown
Brass Contributor
Dec 18, 2018

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>
  
How can I edit my MSIX package so that the start menu items launch with the appropriate command line arguments?
  • 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.

     

     

  • Support for shortcut parameters is not yet supported in 1809, it should be in an upcoming Insider preview.

     

    John.

    • TaylorBrown's avatar
      TaylorBrown
      Brass 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?

      • jvintzel's avatar
        jvintzel
        Icon for Microsoft rankMicrosoft

        You can add something to the ideas section of the community and we can update you on the progress.

         

        John.

    • BrettBurgeson's avatar
      BrettBurgeson
      Brass Contributor

      jvintzel

      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

Share

Resources