PDA

View Full Version : Delay Installer until unstall finishes?


phungus420
22nd April 2009, 01:21
I have my script set up pretty good, but one minor problem still remains. If there is a previous version, the automatic uninstaller trips fine, but the user can simply skip the uninstaller, install, then uninstall after the fact, which of course leads to the program simply being uninstalled. It's minor, I just note this and say to hold off and let the uninstaller finish and then install, but I'd rather have it automatically wait. Is there anyway to do this?

This is the current relevant script code:
Function .onInit

ReadRegStr $R0 HKLM \
"Software\Microsoft\Windows\CurrentVersion\Uninstall\${MOD_LOC}" \
"UninstallString"
StrCmp $R0 "" done

MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION \
"${NAME} is already installed. $\n$\nDo you wish to uninstall?" \
IDOK uninst
Abort

;Run the uninstaller
uninst:
ClearErrors
Exec $INSTDIR\Mods\${MOD_LOC}\Uninstall.exe

done:

FunctionEnd

;--------------------------------
;Interface Settings

!define MUI_ABORTWARNING
!define MUI_UNABORTWARNING
!define MUI_FINISHPAGE_NOAUTOCLOSE
!define MUI_UNFINISHPAGE_NOAUTOCLOSE
!define MUI_HEADERIMAGE

ShowInstDetails show
ShowUninstDetails show

;--------------------------------
;Pages

Edit: I found this but I don't understand it clearly. My knowledge of code is all self taught, so I am not very proficient here:

http://forums.winamp.com/showthread.php?s=&threadid=302664&highlight=Uninstaller

kichik
10th May 2009, 13:43
Don't give the user the option to skip the uninstaller by running it silently. Simply pass it /S on the command line.