From e56984085d87a35f8d59c524143e2b433a0419af Mon Sep 17 00:00:00 2001 From: aerkefiende Date: Sun, 6 Nov 2011 20:33:34 +0000 Subject: [PATCH] Installation routine checks now if there exists a previous installation and asks whether it should uninstall it or not. git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6693 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/vcpp/buildEnv/ac.nsi | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/source/vcpp/buildEnv/ac.nsi b/source/vcpp/buildEnv/ac.nsi index 021677aa..df4842b4 100644 --- a/source/vcpp/buildEnv/ac.nsi +++ b/source/vcpp/buildEnv/ac.nsi @@ -358,6 +358,8 @@ FunctionEnd Function WelcomePage + Call CheckPrevInstallation + nsDialogs::Create /NOUNLOAD 1044 Pop $DIALOG @@ -468,7 +470,7 @@ Function InstallationTypePage Pop $R1 ; minor version StrCmp $R0 "6" 0 winvercheckdone ; vista - + ; suggest multiuser option on vista and later !insertmacro MUI_INSTALLOPTIONS_WRITE "InstallTypes.ini" "Field 2" "State" "1" !insertmacro MUI_INSTALLOPTIONS_WRITE "InstallTypes.ini" "Field 1" "State" "0" @@ -502,6 +504,18 @@ Function ConfigureWithoutAppdata FunctionEnd +Function CheckPrevInstallation + + ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${AC_SHORTNAME}" "UninstallString" + StrCmp $0 "" isnotinstalled isinstalled + isinstalled: + MessageBox MB_YESNO "A previous installation was detected. Would you like to uninstall before installation?" IDNO uninstallno + ExecWait "$0" + uninstallno: + isnotinstalled: + +FunctionEnd + ; Installer Sections Section "AssaultCube ${AC_FULLVERSION}" AC