Forum Discussion
Environment Variable in MSIX Using PSF
In your example the executable is not defined correctly and the slashes are not escaped in the variable value. Here is an example that should work, but remember to add EnvVarFixup64.dll as TIMOTHY_MANGAN mentioned, but keep the json the same - "dll": "EnvVarFixup.dll"
{
"applications": [
{
"id": "SevenZFM",
"executable": "VFS\\ProgramFilesX64\\7-Zip\\7zFM.exe",
"arguments": "",
"workingDirectory": ""
}
],
"processes": [
{
"executable": ".*",
"fixups": [
{
"dll": "EnvVarFixup.dll",
"config": {
"envVars": [
{
"name": "Z",
"useregistry": "false",
"value": "C:\\temp"
}
]
}
}
]
}
]
}
- Abhi211Jan 02, 2024Copper Contributor
Thank you for your response!
As you suggested I changed my config json accordingly, but I can't find the variable.
See the below json file.
- Edijs_Perkums_MasterPackagerJan 03, 2024Brass Contributor
Abhi211 How are you checking for the variable? You will not see it in process explorer or CMD. The only way I was able to actually verify that the fixup works was by writing my own C# console program that displays the value of the environment variable.
- Abhi211Jan 03, 2024Copper Contributor
I am using Invoke-CommandInDesktopPackage -PackageFamilyName "7Zip_8h66172c634n0" -command "cmd.exe" -AppId "SevenZFM" -PreventBreakaway to check the variable inside the bubble. Using the SET command in the cmd inside the bubble.
Will this not work?