changeset 14736:d1eb55b1b28d

[gaim-migrate @ 17492] Fix to work with GTK+ 2.10.6 installer. committer: Tailor Script <tailor@pidgin.im>
author Daniel Atallah <daniel.atallah@gmail.com>
date Tue, 17 Oct 2006 04:07:19 +0000
parents 52c90bdfd34c
children 87fe294744aa
files gaim-installer.nsi
diffstat 1 files changed, 31 insertions(+), 89 deletions(-) [+]
line wrap: on
line diff
--- a/gaim-installer.nsi	Tue Oct 17 03:23:08 2006 +0000
+++ b/gaim-installer.nsi	Tue Oct 17 04:07:19 2006 +0000
@@ -48,6 +48,10 @@
 !include "WordFunc.nsh"
 !insertmacro VersionCompare
 
+!include "TextFunc.nsh"
+!insertmacro ConfigRead
+!insertmacro ConfigWriteS
+
 ;--------------------------------
 ;Defines
 
@@ -60,15 +64,12 @@
 !define GAIM_STARTUP_RUN_KEY			"SOFTWARE\Microsoft\Windows\CurrentVersion\Run"
 !define GAIM_UNINST_EXE				"gaim-uninst.exe"
 
-!define GTK_VERSION				"2.6.10"
+!define GTK_VERSION				"2.10.6"
 !define GTK_REG_KEY				"SOFTWARE\GTK\2.0"
 !define PERL_REG_KEY				"SOFTWARE\Perl"
 !define PERL_DLL				"perl58.dll"
 !define GTK_DEFAULT_INSTALL_PATH		"$COMMONFILES\GTK\2.0"
 !define GTK_RUNTIME_INSTALLER			"..\gtk_installer\gtk-runtime*.exe"
-!define GTK_THEME_DIR				"..\gtk_installer\gtk_themes"
-!define GTK_DEFAULT_THEME_GTKRC_DIR		"share\themes\Default\gtk-2.0"
-!define GTK_DEFAULT_THEME_ENGINE_DIR		"lib\gtk-2.0\2.4.0\engines"
 
 !define ASPELL_REG_KEY				"SOFTWARE\Aspell"
 !define DOWNLOADER_URL				"http://gaim.sourceforge.net/win32/download_redir.php"
@@ -510,59 +511,23 @@
 
 SubSection /e $(GTK_THEMES_SECTION_TITLE) SecGtkThemes
   Section /o $(GTK_NOTHEME_SECTION_TITLE) SecGtkNone
-    Call CanWeInstallATheme
-    Pop $R0
-    StrCmp $R0 "" done
-    SetOverwrite on
-    Rename $R0\${GTK_DEFAULT_THEME_GTKRC_DIR}\gtkrc $R0\${GTK_DEFAULT_THEME_GTKRC_DIR}\gtkrc.old
-    CopyFiles $R0\${GTK_DEFAULT_THEME_GTKRC_DIR}\gtkrc.plain $R0\${GTK_DEFAULT_THEME_GTKRC_DIR}\gtkrc
-    SetOverwrite off
-    done:
+    Push "Raleigh"
+    Call WriteGtkThemeConfig
   SectionEnd
 
   Section $(GTK_WIMP_SECTION_TITLE) SecGtkWimp
-    Call CanWeInstallATheme
-    Pop $R0
-    StrCmp $R0 "" done
-    SetOverwrite on
-    Rename $R0\${GTK_DEFAULT_THEME_GTKRC_DIR}\gtkrc $R0\${GTK_DEFAULT_THEME_GTKRC_DIR}\gtkrc.old
-    SetOutPath $R0\${GTK_DEFAULT_THEME_ENGINE_DIR}
-    File ${GTK_THEME_DIR}\engines\libwimp.dll
-    SetOutPath $R0\${GTK_DEFAULT_THEME_GTKRC_DIR}
-    File ${GTK_THEME_DIR}\themes\gtkrc.gtkwimp
-    File /oname=gtkrc ${GTK_THEME_DIR}\themes\gtkrc.gtkwimp
-    SetOverwrite off
-    done:
+    Push "MS-Windows"
+    Call WriteGtkThemeConfig
   SectionEnd
 
   Section /o $(GTK_BLUECURVE_SECTION_TITLE) SecGtkBluecurve
-    Call CanWeInstallATheme
-    Pop $R0
-    StrCmp $R0 "" done
-    SetOverwrite on
-    Rename $R0\${GTK_DEFAULT_THEME_GTKRC_DIR}\gtkrc $R0\${GTK_DEFAULT_THEME_GTKRC_DIR}\gtkrc.old
-    SetOutPath $R0\${GTK_DEFAULT_THEME_ENGINE_DIR}
-    File ${GTK_THEME_DIR}\engines\libbluecurve.dll
-    SetOutPath $R0\${GTK_DEFAULT_THEME_GTKRC_DIR}
-    File ${GTK_THEME_DIR}\themes\gtkrc.bluecurve
-    File /oname=gtkrc ${GTK_THEME_DIR}\themes\gtkrc.bluecurve
-    SetOverwrite off
-    done:
+    Push "Bluecurve"
+    Call WriteGtkThemeConfig
   SectionEnd
 
   Section /o $(GTK_LIGHTHOUSEBLUE_SECTION_TITLE) SecGtkLighthouseblue
-    Call CanWeInstallATheme
-    Pop $R0
-    StrCmp $R0 "" done
-    SetOverwrite on
-    Rename $R0\${GTK_DEFAULT_THEME_GTKRC_DIR}\gtkrc $R0\${GTK_DEFAULT_THEME_GTKRC_DIR}\gtkrc.old
-    SetOutPath $R0\${GTK_DEFAULT_THEME_ENGINE_DIR}
-    File ${GTK_THEME_DIR}\engines\liblighthouseblue.dll
-    SetOutPath $R0\${GTK_DEFAULT_THEME_GTKRC_DIR}
-    File ${GTK_THEME_DIR}\themes\gtkrc.lighthouseblue
-    File /oname=gtkrc ${GTK_THEME_DIR}\themes\gtkrc.lighthouseblue
-    SetOverwrite off
-    done:
+    Push "Lighthouseblue"
+    Call WriteGtkThemeConfig
   SectionEnd
 SubSectionEnd
 
@@ -758,6 +723,7 @@
     !ifdef DEBUG
     Delete "$INSTDIR\exchndl.dll"
     !endif
+    Delete "$INSTDIR\install.log"
 
     ;Try to remove Gaim install dir .. if empty
     RMDir "$INSTDIR"
@@ -857,50 +823,26 @@
 ;--------------------------------
 ;Functions
 
-;
-; Usage:
-;
-; Call CanWeInstallATheme
-; Pop $R0
-;
-; Return:
-;   "" - If no
-;   "root path of GTK+ installation" - if yes
-;
-Function CanWeInstallATheme
-    Push $1
-    Push $0
+Function WriteGtkThemeConfig
+Exch $0
+Push $1
 
-    ; Set default.. no rights
-    StrCpy $1 ""
-
-    Call CheckUserInstallRights
-    Pop $0
+ClearErrors
+${ConfigRead} "$PROFILE\.gtkrc-2.0" "gtk-theme-name =" $1
+IfErrors new_file
+${ConfigWriteS} "$PROFILE\.gtkrc-2.0" "gtk-theme-name =" "$\"$0$\"" $1
+Goto done
 
-    ; If no rights check if gtk was installed to gaim dir..
-    StrCmp $0 "NONE" 0 themes_cont
-      StrCmp $GTK_FOLDER $INSTDIR 0 no_rights
-        StrCpy $1 $INSTDIR
-        Goto done
-    themes_cont:
-
-    StrCmp $0 "HKCU" hkcu hklm
+new_file:
+ClearErrors
+FileOpen $1 "$PROFILE\.gtkrc-2.0" w
+FileWrite $1 "gtk-theme-name = $\"$0$\""
+FileClose $1
+Goto done
 
-    hkcu:
-      ReadRegStr $1 HKCU ${GTK_REG_KEY} "Path"
-      StrCmp $1 "" no_rights done
-
-    hklm:
-      ReadRegStr $1 HKLM ${GTK_REG_KEY} "Path"
-      Goto done
-
-    no_rights:
-      MessageBox MB_OK $(GTK_NO_THEME_INSTALL_RIGHTS) /SD IDOK
-      StrCpy $1 ""
-
-    done:
-      Pop $0
-      Exch $1
+done:
+Pop $1
+Pop $0
 FunctionEnd
 
 !macro CheckUserInstallRightsMacro UN