Skip to content
⌘ NSIS Forum Archive

Environment Variable used by nsExec:ExecToLog

2 posts

wongbego#

Environment Variable used by nsExec:ExecToLog

Hi,

I have a problem, which is caused by calling an external program using nsExec:ExecToLog.
I managed to gain some infos that the environment variable (in this case the %PATH%) used by the nsExec:ExecToLog is not correct.

I found that there is registry entries for the env. var.
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\"
During in the installation process, which update the env variable, the values in the registry and the values displayed by calling
ReadEnvStr $0 PATH
are different.

I've checked by displaying the values in the registry on the log and they are different. My external program update the %PATH% env variable in the registry and also displayed correctly.

My question:
1. Which env. variable %PATH% is used by nsExec:ExecToLog?
2. Is there any other windows registry values, which are relevant to this env. var. settings??

Thank you very very much for the help.
kichik#
The installer, and therefore nsExec as well, uses the environment of its parent process. If that's Explorer, it's the most up-to-date value. If not, it depends on what happened first, the lunch of the parent application or the value change.

HKCU\Environment holds the user's environment and also affects it.