Our users have the option of setting environment variable MYTHING as a system variable, user variable, or not at all (one typical example of this is the TEMP variable). To decide what to do, they need to know the values that are currently set.
In a custom dialog, I am able to print out the resolved value of MYTHING by using [%MYTHING] in the text field. I haven't found a way to reference the unresolved value, however.
I am able to get the user and machine values individually in powershell, sticking them in a variable as follows:
Code: Select all
$systhing = [Environment]::getEnvironmentVariable("MYTHING", "Machine")
$usrthing = [Environment]::getEnvironmentVariable("MYTHING", "User")
if ($systhing -eq "") {$somestring = "SYSTEM: Not set`n"} else {$somestring = "SYSTEM: " + $systhing + "`n"}
if ($usrthing -eq "") {$somestring += "USER: Not set"} else {$somestring += "USER: " + $usrthing}
Thanking you in advance!
FOLLOW US
Get the latest news in Application Packaging