We recently made a major version change to our software package, however we will still be offering the legacy version with the new version.
That being said, normally when the installer loads up, it looks if the previous version is installed and it uninstalls it.
Since the product name changed, the checker will now obviously only check if the new version is old, not both since it uses the $PRODUCT_NAME variable in the uninstall check function.
Would I need to simply add two functions or is there a way to check both variables at once?
code:
ReadRegStr $R0 HKLM \
"Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" \
"UninstallString"
StrCmp $R0 "" blah
; this perhaps should be handled better. maybe if they hit cancel the installer quits.
MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION \
"${PRODUCT_NAME} is already installed. $\n$\nClick `OK` to remove the \
previous version or `Cancel` to cancel this upgrade." \
IDOK uninst
Abort
;Run the uninstaller
uninst:
ClearErrors
ExecWait '$R0 _?=$INSTDIR' ;Do not copy the uninstaller to a temp file
IfErrors no_remove_uninstaller
no_remove_uninstaller:
blah:
FunctionEnd