App-V to MSIX conversion: Environment Variables

Written by Horatiu Vladasel · October 17th, 2023

In our previous article, we simplified the steps of App-V 5 to MSIX conversion using MSIX Packaging Tool and Advanced Installer. We went even further and saw How to Automate the App-V to MSIX conversion.

But, this conversion comes with a series of challenges, and Environment Variables is one of them.

In this article, we’ll help you convert your App-V 5 package that contains an Environment Variable into an MSIX package.

Let’s get to business.

The Environment Variable Challenge

For those of you familiar with App-V 5, you'd recognize how environment variables appear in the App-V 5 AppXManifest.xml. Here's a snapshot:

<!--      
      Environment Variables      
      -->
      <EnvironmentVariables Enabled="true">
        <Include>
          <Variable Name="MYAPP2" Value="[{ProgramFilesX64}]\MyApp" />
          <Variable Name="MYAPP1" Value="[{ProgramFilesX64}]\MyApp\MyApp.exe" />
        </Include>
      </EnvironmentVariables>

Let’s say you convert the App-V5 package to MSIX through the MSIX Packaging Tool.

But wait, all the environment variables are gone during the conversion process, which can lead to functionality issues for the application.

Don’t worry!

To fix this issue:

  • inject Package Support Framework into the converted MSIX Package;
  • and define the Environment Variables via the config.json file.

Or, you can define the Environment Variables via the AppXManifest.xml, but that’s applicable only for those Environment Variables targeting a File Path.

If you use MSIX Packaging Tool, that means extra effort compared to what I’m about to show you.

Yes, MSIX Packaging Tool means extra effort. That’s why you have Advanced Installer.

Advanced Installer

Advanced Installer comes with its own support for Environment Variables, it automatically takes care of environment variables in the background once you import the App-V 5 package.

If you browse to the “Environment Variables” page, you will see that all the Environment Variables are listed there.

Environment Variables page in Advanced Installer

And, if we install the converted MSIX, we will notice that the Environment Variables are accessible from within the application.

Environment Variables in MSIX package

Conclusion

Advanced Installer simplifies your transition by proficiently managing Environment Variables during the App-V 5 to MSIX conversion process, allowing for a more streamlined and effective workflow.

Make your App-V to MSIX conversions smoother and more efficient with Advanced Installer’s 30-day free trial.

Happy converting!

Written by
See author's page
Horatiu Vladasel

Horatiu is a Software Packager/Sequencer with over 10 years experience, who has worked as a Software Packager at IBM and is currently offering software packaging services to companies such as BT or Nationwide.

Comments: