PDA

View Full Version : How to stop uninstall selected settings?



pakigem
10-23-2003, 07:34 AM
Hi all,

I want to stop some settings from deinstallation.

Brief description is as below:

Installation requires to update the environment variable PATH with embeded new value. I am using following steps for this after destinition dialog and before setup status dialog.
###
szKey = "SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment";
RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
if(StrLength(szDir) = 3) then
svLibPath = svPDFPath ^ "Plug_ins\\Ascertia\\libs";
else
if (StrRemoveLastSlash(szDir) < 0) then
svLibPath = svPDFPath ^ "Plug_ins\\Ascertia\\libs";
else
svLibPath = svPDFPath ^ "Plug_ins\\Ascertia\\libs";
endif;
endif;
nResult = RegDBGetKeyValueEx(szKey, "PATH", nType, svPATH, nSize);
svPATH = svLibPath + ";" + svPATH;
nResult = RegDBSetKeyValueEx(szKey, "PATH", REGDB_STRING, svPATH, -1);
if (nResult < 0) then
MessageBox("Failed to Set Environment Variable", WARNING);
else
// Flush the NT registry to all applications.
szEnv = "Environment";
pEnv = &szEnv;
SendMessage (HWND_BROADCAST, WM_WININICHANGE, 0, pEnv );
endif;
###


What is Problem?

when setup deinstall the components, environment variable PATH is deleted from the list, and I want that it should not be deleted.


CAN ANY ONE PROVIDE THE SOLUTION?

I will appretiate on you positive responses/tries.

Kind Regards,
pakigem.

dhesog
10-23-2003, 10:45 AM
I would suggest you to use Disable(LOGGING) before setting the PATH variable. By doing this the registry entry you are creating will not be logged for uninstallation.

After setting this variable, enable the logging again using Enable(LOGGING).

Hope this helps!