From: Daniel A. <dat...@us...> - 2005-04-11 21:33:11
|
Update of /cvsroot/gaim-bnet/gaim-bnet In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10605 Modified Files: gaim-bnet-installer.nsi Log Message: Use the gaim-plugin.nsh functions for checking gaim version. Index: gaim-bnet-installer.nsi =================================================================== RCS file: /cvsroot/gaim-bnet/gaim-bnet/gaim-bnet-installer.nsi,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** gaim-bnet-installer.nsi 7 Feb 2005 15:50:26 -0000 1.1 --- gaim-bnet-installer.nsi 11 Apr 2005 21:32:55 -0000 1.2 *************** *** 29,32 **** --- 29,36 ---- !include "nsis\translations\english.nsh" + ;------------------------------- + ; Gaim Plugin installer helper stuff + !addincludedir "..\..\src\win32\nsis" + !include "gaim-plugin.nsh" ; Modern UI Configuration *************** *** 57,61 **** ; MUI Config ! !define MUI_CUSTOMFUNCTION_GUIINIT checkGaimVersion !define MUI_ABORTWARNING !define MUI_UNINSTALLER --- 61,65 ---- ; MUI Config ! !define MUI_CUSTOMFUNCTION_GUIINIT bnet_checkGaimVersion !define MUI_ABORTWARNING !define MUI_UNINSTALLER *************** *** 245,314 **** FunctionEnd ! Function checkGaimVersion Push $R0 - Push $R1 - Push $R2 ! ClearErrors ! ReadRegStr $R0 HKLM "SOFTWARE\gaim" "version" ! IfErrors readHKCUGaimVersion compareVersion ! ! readHKCUGaimVersion: ! ReadRegStr $R0 HKCU "SOFTWARE\gaim" "version" ! IfErrors noGaimInstallFound compareVersion ! noGaimInstallFound: MessageBox MB_OK|MB_ICONSTOP "$(NO_GAIM_VERSION)" Quit ! compareVersion: ! StrCmp $R0 ${GAIM_VERSION} GaimVersionOK ! ; Versions are in the form of X.Y.Z ! ; If X is different, then we shouldn't install ! Push $R0 ! Call GetMajorVersion ! IfErrors BadVersion ! Pop $R2 ! Push ${GAIM_VERSION} ! Call GetMajorVersion ! IfErrors noGaimInstallFound ! Pop $R1 ! ;Check that both version's X is the same ! IntCmp $R1 $R2 GaimVersionOK ! BadVersion: ! MessageBox MB_OK|MB_ICONSTOP "$(BAD_GAIM_VERSION_1) $R0 $(BAD_GAIM_VERSION_2)" ! Quit ! GaimVersionOK: ! Pop $R2 ! Pop $R1 Pop $R0 FunctionEnd - ; Extract the part of a string prior to "." (or the whole string if there is no ".") - ; If no "." was found, the ErrorFlag will be set - Function GetMajorVersion - ClearErrors - Pop $0 - StrCpy $1 "0" - - startGetMajorVersionLoop: - ;avoid an infinite loop, if we have gotten the whole initial string, exit the loop and set the error flag - StrCmp $2 $0 GetMajorVersionSetErrorFlag - IntOp $1 $1 + 1 - ;Append the next character in $0 to $2 - StrCpy $2 $0 $1 - ;store the next character in $3 - StrCpy $3 $0 1 $1 - ;if the next character is ".", $2 will contain the string prior to "." - StrCmp $3 "." endGetMajorVersion startGetMajorVersionLoop - - GetMajorVersionSetErrorFlag: - SetErrors - - endGetMajorVersion: - - Push $2 - FunctionEnd - Function CheckUserInstallRights ClearErrors --- 249,273 ---- FunctionEnd ! Function bnet_checkGaimVersion Push $R0 ! Push ${GAIM_VERSION} ! Call CheckGaimVersion ! Pop $R0 ! StrCmp $R0 ${GAIM_VERSION_OK} bnet_checkGaimVersion_OK ! StrCmp $R0 ${GAIM_VERSION_INCOMPATIBLE} +1 +6 ! Call GetGaimVersion ! IfErrors +3 ! Pop $R0 ! MessageBox MB_OK|MB_ICONSTOP "$(BAD_GAIM_VERSION_1) $R0 $(BAD_GAIM_VERSION_2)" ! goto +2 MessageBox MB_OK|MB_ICONSTOP "$(NO_GAIM_VERSION)" Quit ! bnet_checkGaimVersion_OK: Pop $R0 FunctionEnd Function CheckUserInstallRights ClearErrors |