Forum Discussion
Environment Variable Fixup Proposal
Darren_Hoehna I am unaware of any support for environment variables in MSIX. (See post from 2 years ago https://techcommunity.microsoft.com/t5/msix-deployment/no-support-for-virtualized-environment-variables/m-p/228140)
Certainly, even today if I capture an installer that sets either user or system environment variables with the MSIX Packaging Tool, the packaged app doesn't see them.
If there is a Manifest setting needed and the packaging tool just doesn't use it (sort of like Fonts...), please let me know.
I was mistaken. I thought MSIX had something to read and write environment variables. I was wrong.
Before you get too far with your prototype I was wondering if, instead of specifying what Registry keys the user needs to put in the config, why not redirect all registry reads and writes? That way the user can use this fixup in a plug-and-play style?
Cheers,
Darren.
- Aug 22, 2020
Darren_Hoehna I'm unfamiliar with the "plug-and-play" scenario, so I'm not sure what you mean. Perhaps you can clarify?
However, I'll explain what I have so far. For a developer building a package, they don't need the registry and can specify the variables using the fixup with definitions in the Json. The registry option might be useful for developers if they want the app to be able to modify the value at runtime.
The registry aspect is primarily intended as an option for repackaged apps that captured an installed environment variable, using the registry based data. This option is preferred, because while the Json file is immutable, if we pull from the registry the app at runtime may update the setting, allowing for normal MSIX redirection to save off the registry changes (at least for User based environment variables stored under HKCU).