changeset 14985:6bdcfafc2259

[gaim-migrate @ 17764] Don't install incompatible GTK+ versions on Win95/98/ME. Alert the user about the incompatibility and abort installation if a good version of GTK+ isn't already installed. Also don't allow a theme selection because it wont work with our GTK+ 2.6.10 runtime. committer: Tailor Script <tailor@pidgin.im>
author Daniel Atallah <daniel.atallah@gmail.com>
date Fri, 17 Nov 2006 03:26:19 +0000
parents fb98e9c45607
children 167421cfe7d7
files gaim-installer.nsi gtk/win32/nsis/langmacros.nsh gtk/win32/nsis/translations/english.nsh
diffstat 3 files changed, 53 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/gaim-installer.nsi	Fri Nov 17 02:15:28 2006 +0000
+++ b/gaim-installer.nsi	Fri Nov 17 03:26:19 2006 +0000
@@ -120,9 +120,7 @@
 ;--------------------------------
 ;Pages
 
-!ifndef WITH_GTK
   !define MUI_PAGE_CUSTOMFUNCTION_PRE		preWelcomePage
-!endif
   !insertmacro MUI_PAGE_WELCOME
   !insertmacro MUI_PAGE_LICENSE			"./COPYING"
   !insertmacro MUI_PAGE_COMPONENTS
@@ -831,7 +829,9 @@
   StrCmp $2 "HKLM" 0 user_theme
 
   ; Global Theme
+  ClearErrors
   ReadRegStr $2 HKLM ${GTK_REG_KEY} "Path"
+  IfErrors user_theme
   StrCpy $3 "$2\etc\gtk-2.0\gtkrc"
   Goto update_theme
   user_theme:
@@ -1227,24 +1227,56 @@
 
 ; Page enter and exit functions..
 
+Function preWelcomePage
+  Push R0
+
 !ifndef WITH_GTK
-Function preWelcomePage
   ; If this installer dosn't have GTK, check whether we need it.
   ; We do this here an not in .onInit because language change in
   ; .onInit doesn't take effect until it is finished.
-    Push $R0
+  Call DoWeNeedGtk
+  Pop $R0
+  Pop $GTK_FOLDER
+
+  IntCmp $R0 1 done done
+  MessageBox MB_OK $(GTK_INSTALLER_NEEDED) /SD IDOK
+  Quit
+
+  done:
+
+!else
+  Push R1
+
+  ; If on Win95/98/ME warn them that the GTK+ version wont work
+  Call GetWindowsVersion
+  Pop $R1
+  StrCmp $R1 "95" win_ver_bad
+  StrCmp $R1 "98" win_ver_bad
+  StrCmp $R1 "ME" win_ver_bad
+  Goto done
+
+  win_ver_bad:
+    !insertmacro UnselectSection ${SecGtk}
+    !insertmacro SetSectionFlag ${SecGtkNone} ${SF_RO}
+    !insertmacro UnselectSection ${SecGtkNone}
+    !insertmacro SetSectionFlag ${SecGtkWimp} ${SF_RO}
+    !insertmacro UnselectSection ${SecGtkWimp}
+    !insertmacro SetSectionFlag ${SecGtkBluecurve} ${SF_RO}
+    !insertmacro UnselectSection ${SecGtkBluecurve}
+    !insertmacro SetSectionFlag ${SecGtkLighthouseblue} ${SF_RO}
+    !insertmacro UnselectSection ${SecGtkLighthouseblue}
+    MessageBox MB_OK $(GTK_WINDOWS_INCOMPATIBLE) /SD IDOK
     Call DoWeNeedGtk
     Pop $R0
-    Pop $GTK_FOLDER
-
-    IntCmp $R0 1 have_gtk have_gtk
+    Pop $R1
+    IntCmp $R0 1 done done ; Upgrade isn't optional - abort if we don't have a suitable version
+    Quit
 
-      MessageBox MB_OK $(GTK_INSTALLER_NEEDED) /SD IDOK
-      Quit
-    have_gtk:
-    Pop $R0
+  done:
+  Pop $R1
+!endif
+  Pop $R0
 FunctionEnd
-!endif
 
 !ifdef WITH_GTK
 Function preGtkDirPage
@@ -1307,7 +1339,7 @@
 ;
 ; Returns on top of stack
 ;
-; Windows Version (95, 98, ME, NT x.x, 2000, XP, 2003)
+; Windows Version (95, 98, ME, NT x.x, 2000, XP, 2003, Vista)
 ; or
 ; '' (Unknown Windows Version)
 ;
@@ -1361,7 +1393,8 @@
 
     StrCmp $R1 '5.0' lbl_winnt_2000
     StrCmp $R1 '5.1' lbl_winnt_XP
-    StrCmp $R1 '5.2' lbl_winnt_2003 lbl_error
+    StrCmp $R1 '5.2' lbl_winnt_2003
+    StrCmp $R1 '6.0' lbl_winnt_vista lbl_error
 
   lbl_winnt_x:
     StrCpy $R0 "NT $R0" 6
@@ -1379,6 +1412,10 @@
     Strcpy $R0 '2003'
   Goto lbl_done
 
+  lbl_winnt_vista:
+    Strcpy $R0 'Vista'
+  Goto lbl_done
+
   lbl_error:
     Strcpy $R0 ''
   lbl_done:
--- a/gtk/win32/nsis/langmacros.nsh	Fri Nov 17 02:15:28 2006 +0000
+++ b/gtk/win32/nsis/langmacros.nsh	Fri Nov 17 03:26:19 2006 +0000
@@ -61,6 +61,7 @@
 
   ; GTK+ Directory Page
   !insertmacro GAIM_MACRO_LANGSTRING_INSERT GTK_UPGRADE_PROMPT			${CUR_LANG}
+  !insertmacro GAIM_MACRO_LANGSTRING_INSERT GTK_WINDOWS_INCOMPATIBLE		${CUR_LANG}
 
   ; Installer Finish Page
   !insertmacro GAIM_MACRO_LANGSTRING_INSERT GAIM_FINISH_VISIT_WEB_SITE		${CUR_LANG}
--- a/gtk/win32/nsis/translations/english.nsh	Fri Nov 17 02:15:28 2006 +0000
+++ b/gtk/win32/nsis/translations/english.nsh	Fri Nov 17 03:26:19 2006 +0000
@@ -44,6 +44,7 @@
 
 ; GTK+ Directory Page
 !insertmacro GAIM_MACRO_DEFAULT_STRING GTK_UPGRADE_PROMPT			"An old version of the GTK+ runtime was found. Do you wish to upgrade?$\rNote: Gaim may not work unless you do."
+!insertmacro GAIM_MACRO_DEFAULT_STRING GTK_WINDOWS_INCOMPATIBLE			"Windows 95/98/Me are incompatible with GTK+ 2.8.0 or newer.  GTK+ ${GTK_INSTALL_VERSION} will not be installed.$\rIf you don't have GTK+ ${GTK_MIN_VERSION} or newer already installed, installation will now abort."
 
 ; Installer Finish Page
 !insertmacro GAIM_MACRO_DEFAULT_STRING GAIM_FINISH_VISIT_WEB_SITE		"Visit the Windows Gaim Web Page"