[ekiga] [windows] Use nsis' version compare function



commit 8eeb9a632678eabd91797e0c14c196e64bf6217f
Author: Eugen Dedu <Eugen Dedu pu-pm univ-fcomte fr>
Date:   Thu May 6 07:23:12 2010 +0200

    [windows] Use nsis' version compare function

 win32/nsisinstaller/ekiga.nsi |   82 +----------------------------------------
 1 files changed, 2 insertions(+), 80 deletions(-)
---
diff --git a/win32/nsisinstaller/ekiga.nsi b/win32/nsisinstaller/ekiga.nsi
index 8e7d4d5..dfb14df 100644
--- a/win32/nsisinstaller/ekiga.nsi
+++ b/win32/nsisinstaller/ekiga.nsi
@@ -43,6 +43,7 @@ OutFile "${TARGET_DIR}/ekiga-setup-${EKIGA_VERSION}-nogtk.exe"
 !include "Sections.nsh"
 !include "FileFunc.nsh"
 !include "Library.nsh"
+!include "WordFunc.nsh"
 !include "${NSISSYSTEMDIR}/System.nsh"
 
 !insertmacro GetParameters
@@ -122,15 +123,6 @@ OutFile "${TARGET_DIR}/ekiga-setup-${EKIGA_VERSION}-nogtk.exe"
 !insertmacro EKIGA_MACRO_INCLUDE_LANGFILE "ROMANIAN"	"${INSTALLER_DIR}/language_files/romanian.nsh"
 !insertmacro EKIGA_MACRO_INCLUDE_LANGFILE "ENGLISH"		"${INSTALLER_DIR}/language_files/english.nsh"
 
-!macro VersionCheckV5 Ver1 Ver2 OutVar
-Push "${Ver1}"
-Push "${Ver2}"
-Call VersionCheckV5
-Pop "${OutVar}"
-!macroend
-
-!define VersionCheckV5 "!insertmacro VersionCheckV5"
-
 ; ===========================
 ; Sections
 Section -SecUninstallOldEkiga
@@ -720,7 +712,7 @@ Function DoWeNeedGtk
 
   have_gtk:
     ; GTK+ is already installed.. check version.
-    ${VersionCheckV5} ${GTK_VERSION} $0 "$2"
+    ${VersionCompare} ${GTK_VERSION} $0 "$2"
     IntCmp $2 1  bad_version good_version good_version
 
   bad_version:
@@ -840,76 +832,6 @@ Function preWelcomePage
 FunctionEnd
 !endif
 
-
-; VersionCheckV5
-;Source: http://nsis.sourceforge.net/VersionCheckNew:_Compare_version_numbers
-Function VersionCheckV5
-Exch $R0 ; second version number
-Exch
-Exch $R1 ; first version number
-Push $R2
-Push $R3
-Push $R4
-Push $R5 ; second version part
-Push $R6 ; first version part
-
-StrCpy $R1 $R1.
-StrCpy $R0 $R0.
-
-Next: StrCmp $R0$R1 "" 0 +3
-StrCpy $R0 0
-Goto Done
-
-StrCmp $R0 "" 0 +2
-StrCpy $R0 0.
-StrCmp $R1 "" 0 +2
-StrCpy $R1 0.
-
-StrCpy $R2 0
-IntOp $R2 $R2 + 1
-StrCpy $R4 $R1 1 $R2
-StrCmp $R4 . 0 -2
-StrCpy $R6 $R1 $R2
-IntOp $R2 $R2 + 1
-StrCpy $R1 $R1 "" $R2
-
-StrCpy $R2 0
-IntOp $R2 $R2 + 1
-StrCpy $R4 $R0 1 $R2
-StrCmp $R4 . 0 -2
-StrCpy $R5 $R0 $R2
-IntOp $R2 $R2 + 1
-StrCpy $R0 $R0 "" $R2
-
-IntCmp $R5 0 Compare
-IntCmp $R6 0 Compare
-
-StrCpy $R3 0
-StrCpy $R4 $R6 1 $R3
-IntOp $R3 $R3 + 1
-StrCmp $R4 0 -2
-
-StrCpy $R2 0
-StrCpy $R4 $R5 1 $R2
-IntOp $R2 $R2 + 1
-StrCmp $R4 0 -2
-
-IntCmp $R3 $R2 0 +2 +4
-Compare: IntCmp 1$R5 1$R6 Next 0 +3
-
-StrCpy $R0 1
-Goto Done
-StrCpy $R0 2
-
-Done:
-Pop $R6
-Pop $R5
-Pop $R4
-Pop $R3
-Pop $R2
-Pop $R1
-Exch $R0 ; output
-FunctionEnd
 ;--------------------------------
 ;Descriptions
 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]