Forum Discussion
Add Environment Variable to MSIX package using PSF Fixups in Packaging Tool - what am I missing?
Hi everyone,
I am currently testing packaging apps into the MSIX format and have been successful for any simple installers.
Now that I am trying to package more advanced installers I have to utilize PSF Fixups, in which I have issues with the Environment Fixup.
Even though I have read up on previous discussions regarding this, I simply cannot get this fixup to be successfully added and recognized within the MSIX App.
I am judging this based on that the same app will tell in its own app options whether the environment variable is available or not.
Some key info (Tried attaching several screenshots, but it wilI not let me. Hopefully the necessary information comes across):
- Using MSIX Packaging Tool version 1.2024.405.0
- Using the included PSF Fixup for Environment Variables within MSIX Packaging Tool.
- All PSF Fixup files are included in the MSIX Package.
- In the manifest file the executable "PsfLauncher64.exe" is pointed at.
- Basically, the config.json is formatted in the following way if I were to change out anything referring to the actual app name.
What am I possibly missing out on or have misunderstood here? Any help in leading me into the right direction is very much appreciated, thanks!
5 Replies
- If you are adding the PSF using the MMPT, that version of the PSF does not support the EnvVar Fixup.
- If you added the PSF using PsfTooling (or TMEditX or any of the other third party tool that pulls from the TimMangan fork of the PSF), then the EnvVarFixup is available. However, note that the environment variable will only available to the running applications inside the container - you will not see the variable on the end-user system by looking at environment variables from outside the container.
- Bogdan MitracheIron Contributor
Hi Hanessa,
Is this a public application that we can test? Advanced Installer has built-in support for handling environment variables in MSIX packages, and I am curious to see if there is anything particular with this app or not.Disclaimer: I work on the team building Advanced Installer.
Your syntax looks OK to me.
I will mention that you will not see the environment variable by using any tools running outside of the container. Also, with userregistry = false you would also not see it in a process run inside the container if that process was not launched by PsfLauncher, which would be any process other than randomapp.
- HanessaCopper Contributor
Hi Timothy, appreciate to see you reach out!
I got sidetracked with packaging other apps, but have returned to investigate this particular app requiring environment variables. Something very strange is occuring here.
In short, I manually modified the config.json file (biggest change being process match PSFLauncher) and changed out every PSF-file to their Debug-counterparts as retrieved from https://github.com/TimMangan/MSIX-PackageSupportFramework/blob/develop/ZipRelease.zip-v2025-8-2.zip. Therefore enabling me to use DebugView and follow what's going on "under the hood".
If the output is to be trusted, it seems that the EnvVarFixup .dlls aren't found as expected.
Both variants of the EnvVarFixup .dll's are of course in the root of the package.
Do you have any ideas on how to progress here?Ahah! As the dll is present in the root, this procmon error usually indicates missing dependencies of the PSF component. MfrFixup, RegLegFixup, and EnvVarFixup all have documented dependencies.
If you are manually adding PSF dlls, most likely you are missing the dependent VC Runtimes. Tooling generally adds these to the VFS\SystemX86 and VFS\SystemX64 folders, so I can't see if they are present.
Alternatively, and this is usually preferred, the VC Runtimes are supplied to the end-systems externally - meaning the latest Microsoft VC Runtimes 2015-2022 redistributables Latest supported Visual C++ Redistributable downloads | Microsoft Learn. In that case install both the 32 and 64 bit versions on end-user systems.