Forum Discussion
Environment variables in MSIX package wont be used by AVD session host
As I mentioned in my previous comment, we had created a test application. The config file was in the format:
{
"applications":
[
{
"id": "ENVVARIABLETEST",
"executable": "VFS/EnvVariableTest.exe"
}
],
"processes":
[
{
"executable": "PsfLauncher.*"
},
{
"executable": ".*",
"fixups":
[
{
"dll": "EnvVarFixup.dll",
"config":
{
"envVars":
[
{
"name": "Test1",
"value": "Value1",
"useregistry": "false"
},
{
"name": "Test2",
"value": "Value2",
"useregistry": "false"
},
{
"name": "Test3",
"value": "Value3",
"useregistry": "false"
}
]
}
}
]
}
]
}
Would you expect to see the Environment Variable listed in the Environment tab for the virtual process in Process Explorer?
- Aniket_BanerjeeMay 03, 2023Former Employee
Hi SajidRavat,
This is a solution suggested by TIMOTHY_MANGAN on a similar issue from another post:
There are two requirements to see the virtualized environment variables:
- The process enumerating or querying the variable must be running inside the container.
- The process enumerating or querying the variable must use a standard api to perform the action. I believe that Process Explorer uses underdocumented interfaces to read kernel memory (the Process block) directly, which does not know about the virtualized variables.
To determine if the process is in the container you can use an elevated Process Explorer (either inside or outside of the container) and look at the Jobs tab. Alternatively, you can add the "Package Name" and/or "JobID" column in Task Manager.
To see what the app sees, you can create a shortcut to a cmd in the package (to run inside the container), or alternatively you can use the powershell "invoke-CommandInDesktopPackage". In both cases, you use period asterisk method in the json.
You can try this approach to track the environment variables for your scenario.