Archive: Deleting a previously installed version of my software?


Deleting a previously installed version of my software?
My install script currently writes a value to the registry which points the uninstall.exe file that get created during the install process. The line looks like this:


WriteRegStr ${UNINSTALL_ROOT_KEY} "${UNINSTALL_KEY}" "UninstallString" "$INSTDIR\uninstall.exe"


I would like to add logic to the beginning of my script that would check for the existence of this registry value, and if it exists, remove the previous version of my software by calling that uninstall.exe file.

Does anyone currently do this? The pseudo-logic would look like this:

if (registry_key.exists)
{
Variable x = registry_value;
Execute(x);
}

I'm not exactly sure how to check for the existance of a specific registry key, and then get the value for that key. Also, I then need execute the .exe file that is pointed to by that value.


Thank You,

Kennedy


ReadRegStr (returns "" and sets the error flag if not found)
also remember to use the _? trick if you need the uninstaller to wait (ExecWait '"$INSTDIR\uninstall.exe" _?=$INSTDIR')


Anders,

That is very helpful. ReadRegStr is just what I needed.

Thanks.