My installer detects if it was run as root/admin or normal user and then sets <addEnvironmentVariable> and <addEnvironmentVariable> to update the <scope> to system or user variables. On MS Windows, the installed updates registry values as I would expect, in the HKEY_CURRENT_USER\Environment\ for users and HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment\ for system updates.

On Linux, updates to <scope> with either system and user values change the $HOME/.bashrc and $HOME/.profile files. In effect, does this mean there is no difference between <scope> system/user values on Linux? To make a difference, would it be better to update the respective /etc/bash.bashrc and /etc/profile files when <scope> is system?

asked 05 Jul '12, 00:23

tahoar's gravatar image

accept rate: 42%

This is something we have been looking for, too. I noticed that the answer was given almost two years ago, is there any chance that this change will be implemented in the near future?

(12 Mar '14, 04:24) ahov

Sorry. I, too, forgot about this. We redesigned our app so we don't need to modify the environment path at all.

(25 May '16, 13:23) tahoar

I have added your suggestion of modifying environment variables for Unix systems using /etc. If implemented, it would require additional option as changing it using <scope> option might break existing installers that set it to system and would not work properly if it is set system-wide.

However, investigating and planning this feature may take some time to investigate as the files where this should be put may be different for various shells and/or distributions that would have to be supported.

Also, I apologize for the late response. Due to an issue with notification system, we have missed this question.


answered 23 Jul '12, 08:22

wojciechka's gravatar image

wojciechka ♦♦
accept rate: 26%

Is there any update to this? I'm struggling to get the environment variables setup correctly for our installer.

(01 Oct '14, 13:45) seanraby

Is there any updates on this? The correct way is to put the environment variables the way that tahoar suggest atleast if they are system wide. Maybe it should be two valid options for this. addEnvironmentVariable and maybe an addSystemEnvironmentVariable or something like that?


answered 24 May '16, 07:43

andny's gravatar image

accept rate: 0%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: 05 Jul '12, 00:23

Seen: 2,258 times

Last updated: 25 May '16, 13:23