Before proceeding with installation I would like to give the user the option of uninstalling the app, if it has previously been installed. Here is my attempt below:
Function .onInit
; $R0 contains the path to the uninstaller
IfFileExists $R0 +1 NoPriorInstall
MessageBox MB_YESNO "Existing App installation found. Installation cannot proceed unless App is uninstalled.$r$nUninstall App?" IDYES UninstallApp
Abort
UninstallApp:
ExecWait $R0
NoPriorInstall:
FunctionEnd
It works however the non-modal “Permanently remove App” YESNO dialog pops up at the same time as the non-modal “App Setup” wizard so that its possible to install the app before uninstalling it or the other way round.
I’d like to either have:
- the “Permanently remove App” YESNO dialog pop up before the “App Setup” wizard (I was hoping
ExecWait
would pause the installer but it doesn’t), or - the “Permanently remove App” YESNO dialog be modal and thus demand attention before over the “App Setup” wizard.
I hoped running the uninstaller R0
I would like to run the app uninstaller if one exists, i.e. if the app is already before