I'm fuzzy on how to actually invoke the system.dll plug-in to set an environment variable. The following archive link shows two ways to accomplish this and I'm attempting to use the first approach described ... but it isn't working for me:
Here is TestSetEnv.nsi, which I would think would cause the environment variable "DID_IT_WORK" to "YES"
When I try something very similar, nothing seems to happen. Is there something else I need to do in my script to let the system.dll plug-in be used?
Name "TestSetEnv"
OutFile "TestSetEnv_setup.exe"
InstallDir $PROGRAMFILES\TestSetEnv
InstallDirRegKey HKLM SOFTWARE\TestSetEnv "Install_Dir"
Section "TestSetEnv (req with s/w)"
SectionIn RO
SetOutPath $INSTDIR
StrCpy $R0 "YES"
system::Call 'Kernel32::SetEnvironmentVariableA(t, t) i("DID_IT_WORK", $R0).r0'
SectionEnd
How do I have the environment variable DID_IT_WORK be created with the value "YES"?
I looked at the top of the compiler output, and system::call was shown.
</alert>