1

I always get the list of the system variable (of the machine) back although the EnvironmentVariableTarget is set to user. Here my Code:

string pathVariable = "Path";    
string pathVariableUser = Environment.GetEnvironmentVariable(pathVariable, EnvironmentVariableTarget.User);

I like to change the system variable with WIX toolset with an installer. If I run this code in as "normal" command line app, I have no problems and I get the correct value.

Do you know what the problem is?

Antonio
  • 23
  • 5
  • Is this a deferred CA? Do you have a per-machine or a per-user install? – Klaus Gütter Sep 03 '20 at 12:41
  • Avoid custom action for this, [**see this answer**](https://stackoverflow.com/a/57580977/129130). Always try to avoid custom actions, [details here](https://stackoverflow.com/questions/46179778/why-is-it-a-good-idea-to-limit-the-use-of-custom-actions-in-my-wix-msi-setups/46179779#46179779). – Stein Åsmul Sep 03 '20 at 15:09
  • I have one per machine installation. – Antonio Sep 04 '20 at 07:12

0 Answers0