View Full Version : Problem with Environment Variable

08-24-2005, 05:00 AM
I have used environment variable functions from the following thread,


My problem is that, it sets environment varible, but it sets System environment varible, i want to set it in user environment variable.


08-24-2005, 04:32 PM
That looks likely to be controlled by the bAllUsers parameter. I would try setting that to false. If that fails, I would go edit the code to use whatever the proper location is for non-system environment variables. Presumably it is similar to that of system ones, but under HKEY_CURRENT_USER instead of HKEY_LOCAL_MACHINE.

08-25-2005, 06:02 AM
I have used both of the options, setting bAllUsers=FALSE and using the key HKEY_LOCAL_USER. but in both cases the it doesn't set any environment variable.
Please help me on this. I have to do it ASAP.

08-25-2005, 07:38 AM
I got the solution.
for user variables we have to set szKey= "Environment"

Now the problem is, On uninstall, the installer doesn't restore these varaibles. I have called ModEnvVarRestore() function in onUninstall Event. I think, i am using it on wrong place.