NSIS or Me?
One of us is not getting it and I think it's me...
basically I have a simple function to check if the program being installed has been uninstalled from the same machine. On uninstall, a key is left behind that the installer will check for every time it runs.
The function works correctly for the first install. I get the messagebox that has a blank value for $R0 when it reaches "done:" which it should since nothing has been uninstalled as of yet.
The problem is that it also continues to work after the program has been uninstalled. When I install again, it skips the "$R0 inside" messagebox and shows the string value of "un" ( which is correct ) for "$R0" in the messagebox after "done:".
I'm thinking that if the installer can see the key and copy the value, there shouldn't be an error and the program should abort.
The registry key is definitely in place after the uninstall.
Function checkForUninstall
ReadRegStr $R0 HKLM "SOFTWARE\legacy" "name"
IfErrors done
MessageBox MB_OK|MB_ICONINFORMATION "$R0 inside"
Abort
done:
MessageBox MB_OK|MB_ICONINFORMATION "$R0 pass"
FunctionEnd
I also tried it this way with a similar outcome:
Function checkForUninstall
ReadRegStr $R0 HKLM "SOFTWARE\legacy" "name"
IfErrors done bad
bad:
MessageBox MB_OK|MB_ICONINFORMATION "$R0 inside"
Abort
done:
MessageBox MB_OK|MB_ICONINFORMATION "$R0 pass"
FunctionEnd
Usually this means I'm missing something so simple that it will be painfully obvious to a second set of more savvy NSIS eyes, many thanks for any help
jonny