diff gaim-installer.nsi @ 10920:6a8440e9edba

[gaim-migrate @ 12686] Apparently automatically placing an icon on the Desktop, and putting a link to the uninstaller on the Start Menu goes against the MS Application guidelines. I suppose it makes sense, so why not give the user an option. Also some other changes that were made in oldstatus but not here. committer: Tailor Script <tailor@pidgin.im>
author Daniel Atallah <daniel.atallah@gmail.com>
date Sun, 15 May 2005 18:53:23 +0000
parents 364a2ef907ae
children af2a4d5b9afe
line wrap: on
line diff
--- a/gaim-installer.nsi	Sun May 15 18:16:20 2005 +0000
+++ b/gaim-installer.nsi	Sun May 15 18:53:23 2005 +0000
@@ -1,7 +1,7 @@
 ; Installer script for win32 Gaim
 ; Herman Bloggs <hermanator12002@yahoo.com>
 
-; NOTE: this .NSI script is intended for NSIS 2.0 (finale release).
+; NOTE: this .NSI script is intended for NSIS 2.0 (final release).
 ;
 
 ;--------------------------------
@@ -52,7 +52,7 @@
 !define GAIM_UNINST_EXE				"gaim-uninst.exe"
 !define GAIM_REG_LANG				"Installer Language"
 
-!define GTK_VERSION				"2.4.7"
+!define GTK_VERSION				"2.6.2"
 !define GTK_REG_KEY				"SOFTWARE\GTK\2.0"
 !define PERL_REG_KEY				"SOFTWARE\Perl"
 !define PERL_DLL				"perl58.dll"
@@ -445,14 +445,22 @@
 
     perl_done:
 
-    CreateDirectory "$SMPROGRAMS\Gaim"
-    CreateShortCut "$SMPROGRAMS\Gaim\Gaim.lnk" "$INSTDIR\gaim.exe"
-    CreateShortCut "$DESKTOP\Gaim.lnk" "$INSTDIR\gaim.exe"
+    ; If this is under NT4, delete the SILC support stuff
+    ; there is a bug that will prevent any account from connecting
+    ; See https://lists.silcnet.org/pipermail/silc-devel/2005-January/001588.html
+    Call GetWindowsVersion
+    Pop $R2
+    StrCmp $R2 "NT 4.0" 0 nt4_done
+    Delete "$INSTDIR\plugins\libsilc.dll"
+    Delete "$INSTDIR\silcclient.dll"
+    Delete "$INSTDIR\silc.dll"
+
+    nt4_done:
+
     SetOutPath "$INSTDIR"
 
     ; If we don't have install rights.. we're done
     StrCmp $R0 "NONE" done
-    CreateShortCut "$SMPROGRAMS\Gaim\Uninstall.lnk" "$INSTDIR\${GAIM_UNINST_EXE}"
     SetOverwrite off
 
     ; Write out installer language
@@ -473,6 +481,23 @@
 SectionEnd ; end of default Gaim section
 
 ;--------------------------------
+;Shortcuts
+
+SubSection /e $(GAIM_SHORTCUTS_SECTION_TITLE) SecShortcuts
+  Section /o $(GAIM_DESKTOP_SHORTCUT_SECTION_TITLE) SecDesktopShortcut
+    SetOverwrite on
+    CreateShortCut "$DESKTOP\Gaim.lnk" "$INSTDIR\gaim.exe"
+    SetOverwrite off
+  SectionEnd
+  Section $(GAIM_STARTMENU_SHORTCUT_SECTION_TITLE) SecStartMenuShortcut
+    SetOverwrite on
+    CreateDirectory "$SMPROGRAMS\Gaim"
+    CreateShortCut "$SMPROGRAMS\Gaim\Gaim.lnk" "$INSTDIR\gaim.exe"
+    SetOverwrite off
+  SectionEnd
+SubSectionEnd
+
+;--------------------------------
 ;GTK+ Themes
 
 SubSection /e $(GTK_THEMES_SECTION_TITLE) SecGtkThemes
@@ -586,6 +611,7 @@
     Delete "$INSTDIR\plugins\liboscar.dll"
     Delete "$INSTDIR\plugins\libtoc.dll"
     Delete "$INSTDIR\plugins\libyahoo.dll"
+    Delete "$INSTDIR\plugins\libsilc.dll"
     Delete "$INSTDIR\plugins\perl.dll"
     Delete "$INSTDIR\plugins\relnot.dll"
     Delete "$INSTDIR\plugins\spellchk.dll"
@@ -614,6 +640,8 @@
     Delete "$INSTDIR\nssckbi.dll"
     Delete "$INSTDIR\plc4.dll"
     Delete "$INSTDIR\plds4.dll"
+    Delete "$INSTDIR\silc.dll"
+    Delete "$INSTDIR\silcclient.dll"
     Delete "$INSTDIR\softokn3.dll"
     Delete "$INSTDIR\ssl3.dll"
     Delete "$INSTDIR\${GAIM_UNINST_EXE}"
@@ -655,7 +683,7 @@
 	$(GTK_SECTION_DESCRIPTION)
 !endif
   !insertmacro MUI_DESCRIPTION_TEXT ${SecGtkThemes} \
-	$(GTK_THEMES_SECTION_DESCRIPTION)
+        $(GTK_THEMES_SECTION_DESCRIPTION)
   !insertmacro MUI_DESCRIPTION_TEXT ${SecGtkNone} \
         $(GTK_NO_THEME_DESC)
   !insertmacro MUI_DESCRIPTION_TEXT ${SecGtkWimp} \
@@ -664,6 +692,14 @@
         $(GTK_BLUECURVE_THEME_DESC)
   !insertmacro MUI_DESCRIPTION_TEXT ${SecGtkLighthouseblue} \
         $(GTK_LIGHTHOUSEBLUE_THEME_DESC)
+
+
+  !insertmacro MUI_DESCRIPTION_TEXT ${SecShortcuts} \
+        $(GAIM_SHORTCUTS_SECTION_DESCRIPTION)
+  !insertmacro MUI_DESCRIPTION_TEXT ${SecDesktopShortcut} \
+        $(GAIM_DESKTOP_SHORTCUT_DESC)
+  !insertmacro MUI_DESCRIPTION_TEXT ${SecStartMenuShortcut} \
+        $(GAIM_STARTMENU_SHORTCUT_DESC)
 !insertmacro MUI_FUNCTION_DESCRIPTION_END
 
 ;--------------------------------
@@ -1248,7 +1284,7 @@
  
 FunctionEnd
 
-; StrStr
+ ; StrStr
  ; input, top of stack = string to search for
  ;        top of stack-1 = string to search in
  ; output, top of stack (replaces with the portion of the string remaining)
@@ -1261,8 +1297,8 @@
  ;   Pop $R0
  ;  ($R0 at this point is "ass string")
 
- Function StrStr
- Exch $R1 ; st=haystack,old$R1, $R1=needle
+Function StrStr
+   Exch $R1 ; st=haystack,old$R1, $R1=needle
    Exch    ; st=old$R1,haystack
    Exch $R2 ; st=old$R1,old$R2, $R2=haystack
    Push $R3
@@ -1281,14 +1317,14 @@
      StrCmp $R5 "" done
      IntOp $R4 $R4 + 1
      Goto loop
- done:
+   done:
    StrCpy $R1 $R2 "" $R4
    Pop $R5
    Pop $R4
    Pop $R3
    Pop $R2
    Exch $R1
- FunctionEnd
+FunctionEnd
 
 ;
 ; Parse the Command line
@@ -1305,9 +1341,95 @@
   Call StrStr
   Pop $R1
   StrCmp $R1 "" next
-    StrCpy $R1 $R1 4 2 ; Strip first 2 chars of string
-    StrCpy $LANGUAGE $R1
-    IntOp $LANG_IS_SET 0 + 1
+  StrCpy $R1 $R1 4 2 ; Strip first 2 chars of string
+  StrCpy $LANGUAGE $R1
+  IntOp $LANG_IS_SET 0 + 1
   next:
 FunctionEnd
 
+; GetWindowsVersion
+;
+; Based on Yazno's function, http://yazno.tripod.com/powerpimpit/
+; Updated by Joost Verburg
+;
+; Returns on top of stack
+;
+; Windows Version (95, 98, ME, NT x.x, 2000, XP, 2003)
+; or
+; '' (Unknown Windows Version)
+;
+; Usage:
+;   Call GetWindowsVersion
+;   Pop $R0
+;
+; at this point $R0 is "NT 4.0" or whatnot
+Function GetWindowsVersion
+
+  Push $R0
+  Push $R1
+
+  ReadRegStr $R0 HKLM \
+  "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
+
+  IfErrors 0 lbl_winnt
+
+  ; we are not NT
+  ReadRegStr $R0 HKLM \
+  "SOFTWARE\Microsoft\Windows\CurrentVersion" VersionNumber
+
+  StrCpy $R1 $R0 1
+  StrCmp $R1 '4' 0 lbl_error
+
+  StrCpy $R1 $R0 3
+
+  StrCmp $R1 '4.0' lbl_win32_95
+  StrCmp $R1 '4.9' lbl_win32_ME lbl_win32_98
+
+  lbl_win32_95:
+    StrCpy $R0 '95'
+  Goto lbl_done
+
+  lbl_win32_98:
+    StrCpy $R0 '98'
+  Goto lbl_done
+
+  lbl_win32_ME:
+    StrCpy $R0 'ME'
+  Goto lbl_done
+
+  lbl_winnt:
+    StrCpy $R1 $R0 1
+
+    StrCmp $R1 '3' lbl_winnt_x
+    StrCmp $R1 '4' lbl_winnt_x
+
+    StrCpy $R1 $R0 3
+
+    StrCmp $R1 '5.0' lbl_winnt_2000
+    StrCmp $R1 '5.1' lbl_winnt_XP
+    StrCmp $R1 '5.2' lbl_winnt_2003 lbl_error
+
+  lbl_winnt_x:
+    StrCpy $R0 "NT $R0" 6
+  Goto lbl_done
+
+  lbl_winnt_2000:
+    Strcpy $R0 '2000'
+  Goto lbl_done
+
+  lbl_winnt_XP:
+    Strcpy $R0 'XP'
+  Goto lbl_done
+
+  lbl_winnt_2003:
+    Strcpy $R0 '2003'
+  Goto lbl_done
+
+  lbl_error:
+    Strcpy $R0 ''
+  lbl_done:
+ 
+  Pop $R1
+  Exch $R0
+FunctionEnd
+