This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Environment variable problem in install script project
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Jul 12, 2015
08:10 AM
Environment variable problem in install script project
Hi
I using the following code and It works fine for first time installation but when the user uninstall the product the PATH variable will damaged. can anyone give me an ide or tell me what I am doing wrong?
Many thanks...
I tried to move it to a feature installed event but then the PATH Environment Variable is deleted after uninstall
I using the following code and It works fine for first time installation but when the user uninstall the product the PATH variable will damaged. can anyone give me an ide or tell me what I am doing wrong?
function OnEnd()
#define WM_WININICHANGE 0x001A
#define HWND_BROADCAST 0xffff
NUMBER nResult, nvSize, nvType, nLocation ;
STRING szKey, szEnv, svPath, szFileFound, szStr;
WPOINTER pEnv;
begin
FileRegistration("ScanX.dll");
szEnv = "";
szKey = "SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment";
RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
RegDBGetKeyValueEx(szKey, "Path", nvType, szEnv, nvSize);
nLocation = StrFind ( szEnv , TARGETDIR );
if (nLocation < 0) then
szEnv = szEnv + ";" + TARGETDIR;
nResult = RegDBSetKeyValueEx(szKey, "Path", REGDB_STRING, szEnv, -1);
if (nResult < 0) then
//MessageBox("Failed to Set Environment Variable", WARNING);
else
//MessageBox("Successfully Set Environment Variable", INFORMATION);
// Flush the registry to all applications.
szStr = "Environment";
pEnv = &szStr;
SendMessage (HWND_BROADCAST, WM_WININICHANGE, 0, pEnv );
endif;
// RebootDialog("", "", SYS_BOOTMACHINE);
endif;
end;
Many thanks...
I tried to move it to a feature installed event but then the PATH Environment Variable is deleted after uninstall
(1) Reply
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Jul 27, 2015
05:13 AM
Entries written to Registry key is by default logged for uninstallation by InstallScript.
you may want to call Disable(LOGGING) just before the registry key write function and then enable the same.
you may want to call Disable(LOGGING) just before the registry key write function and then enable the same.