comparison gaim-installer.nsi @ 4897:65a0a360e8c4

[gaim-migrate @ 5229] GTK+ runtime dlls no longer installed by Gaim installer committer: Tailor Script <tailor@pidgin.im>
author Herman Bloggs <hermanator12002@yahoo.com>
date Thu, 27 Mar 2003 18:32:22 +0000
parents cb0681cfb9f2
children d8c8f8993b53
comparison
equal deleted inserted replaced
4896:3c649fe22e2c 4897:65a0a360e8c4
1 ; Installer script for win32 Gaim 1 ; Installer script for win32 Gaim
2 ; Herman Bloggs <hermanator12002@yahoo.com> 2 ; Herman Bloggs <hermanator12002@yahoo.com>
3 3
4 ; NOTE: this .NSI script is designed for NSIS v2.0b0+ 4 ; NOTE: this .NSI script is designed for NSIS v2.0b3+
5 5
6 Name "Gaim ${GAIM_VERSION} (Win32)" 6 !define MUI_PRODUCT "Gaim" ;Define your own software name here
7 OutFile "gaim-${GAIM_VERSION}.exe" 7 !define MUI_VERSION ${GAIM_VERSION} ;Define your own software version here
8 Icon .\pixmaps\gaim-install.ico
9 UninstallIcon .\pixmaps\gaim-install.ico
10 8
11 ; Some default compiler settings (uncomment and change at will): 9 !include "MUI.nsh"
12 ; SetCompress auto ; (can be off or force)
13 ; SetDatablockOptimize on ; (can be off)
14 ; CRCCheck on ; (can be off)
15 ; AutoCloseWindow false ; (can be true for the window go away automatically at end)
16 ; ShowInstDetails hide ; (can be show to have them shown, or nevershow to disable)
17 ; SetDateSave off ; (can be on to have files restored to their orginal date)
18 10
19 InstallDir "$PROGRAMFILES\Gaim" 11 ;--------------------------------
20 InstallDirRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Gaim" "" 12 ;Configuration
21 DirShow show ; (make this hide to not let the user change it) 13
22 DirText "Select the directory to install Gaim in:" 14 ;General
15 OutFile "gaim-${GAIM_VERSION}.exe"
16
17 ;Folder selection page
18 InstallDir "$PROGRAMFILES\Gaim"
19
20 ;Remember install folder
21 InstallDirRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Gaim" ""
22
23 !define MUI_ICON .\pixmaps\gaim-install.ico
24 !define MUI_UNICON .\pixmaps\gaim-install.ico
25
26
27 ;--------------------------------
28 ;Modern UI Configuration
29
30 !define MUI_WELCOMEPAGE
31 !define MUI_LICENSEPAGE
32 !define MUI_DIRECTORYPAGE
33 !define MUI_FINISHPAGE
34
35 !define MUI_ABORTWARNING
36
37 !define MUI_UNINSTALLER
38 !define MUI_UNCONFIRMPAGE
39
40 ;--------------------------------
41 ;Languages
42
43 !insertmacro MUI_LANGUAGE "English"
44
45 ;--------------------------------
46 ;Data
47
48 LicenseData "./COPYING"
49
50 ;--------------------------------
51 ;Installer Sections
23 52
24 Section "" ; (default section) 53 Section "" ; (default section)
25 ; Check if previous intallation exists 54 ; Check if previous intallation exists
26 ReadRegStr $R0 HKEY_LOCAL_MACHINE "SOFTWARE\gaim" "" 55 ReadRegStr $R0 HKEY_LOCAL_MACHINE "SOFTWARE\gaim" ""
27 StrCmp $R0 "" cont_install 56 StrCmp $R0 "" cont_install
57 ; Previous version found
28 ReadRegStr $R1 HKEY_LOCAL_MACHINE "SOFTWARE\gaim" "Version" 58 ReadRegStr $R1 HKEY_LOCAL_MACHINE "SOFTWARE\gaim" "Version"
29 StrCmp $R1 "" no_version 59 ; Version key started with 0.60a3. Prior versions can't be
30 ; Gaim found, so exit Intallation 60 ; automaticlly uninstalled.
31 MessageBox MB_OK "Gaim (v$R1) already exists on this machine. Uninstall first then try again." IDOK 61 StrCmp $R1 "" uninstall_first_no_ver
62 ; Version found - Read in uninstall string.
63 ReadRegStr $R2 HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Gaim" "UninstallString"
64 StrCmp $R2 "" uninstall_first_no_ver
65 ; Have uninstall string.. go ahead and uninstall.
66 ExecWait '$R2 /S _?=$R0'
67 IfErrors "" cont_install
68 ; Errors occured
69 MessageBox MB_OK "Errors encountered while trying to uninstall previous version of Gaim, continuing installation.." IDOK
70 Goto cont_install
71
72 uninstall_first_no_ver:
73 MessageBox MB_OK "Gaim already exists on this machine. Uninstall first then try again." IDOK
74 Quit
75
76 cont_install:
77 ; Check to see if GTK+ Runtime is installed.
78 ReadRegStr $R0 HKEY_LOCAL_MACHINE "SOFTWARE\GTK\2.0" "Version"
79 StrCmp $R0 "" no_gtk have_gtk
80 no_gtk:
81 ; Instruct user to install GTK+ runtime first.
82 MessageBox MB_OK "Could not find GTK+ runtime environment. Visit http://www.dropline.net/gtk/ to download and install GTK+ v2.2.1" IDOK
83 Quit
84 have_gtk:
85 ; Check GTK+ version
86 StrLen $R3 $R0 ; Expecting 5 char length version string
87 IntCmp $R3 5 check_version bad_version check_version ; if greater or equal to 5... good
88 check_version:
89 StrCpy $R4 $R0 1 ;Major
90 StrCpy $R1 $R0 1 2 ;Minor
91 StrCpy $R2 $R0 1 4 ;Micro
92 IntCmp $R4 2 to_minor bad_version
93 to_minor:
94 IntCmp $R1 2 to_micro bad_version
95 to_micro: ; If greator or equal to one.. good
96 IntCmp $R2 1 good_version bad_version good_version
97 bad_version:
98 MessageBox MB_OK "Found GTK+ verison $R0. Make sure that you have version 2.2.1 or higher installed, before installing Gaim." IDOK
32 Quit 99 Quit
33 no_version: 100
34 MessageBox MB_OK "Gaim already exists on this machine. Uninstall first then try again." IDOK 101 ; Continue
35 Quit 102 good_version:
36 cont_install:
37 SetOutPath "$INSTDIR" 103 SetOutPath "$INSTDIR"
38 ; Gaim files 104 ; Gaim files
39 File /r .\win32-install-dir\*.* 105 File /r .\win32-install-dir\*.*
40 106
41 ; Gaim Registry Settings 107 ; Gaim Registry Settings
42 WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Gaim" "" "$INSTDIR" 108 WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Gaim" "" "$INSTDIR"
43 WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Gaim" "Version" "${GAIM_VERSION}" 109 WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Gaim" "Version" "${GAIM_VERSION}"
44 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Gaim" "DisplayName" "Gaim (remove only)" 110 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Gaim" "DisplayName" "Gaim (remove only)"
45 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Gaim" "UninstallString" '"$INSTDIR\gaim-uninst.exe"' 111 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Gaim" "UninstallString" '"$INSTDIR\gaim-uninst.exe"'
112 ; Set App path to include GTK+ lib dir
113 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\App Paths\gaim.exe" "" "$INSTDIR\gaim.exe"
114 ; Concat GTK+ path and lib dir
115 ReadRegStr $R5 HKEY_LOCAL_MACHINE "SOFTWARE\GTK\2.0" "Path"
116 StrCpy $R5 "$R5\lib"
117 WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\App Paths\gaim.exe" "Path" $R5
46 118
47 ; Set Start Menu icons 119 ; Set Start Menu icons
48 SetShellVarContext "all" 120 SetShellVarContext "all"
49 SetOutPath "$SMPROGRAMS\Gaim" 121 CreateDirectory "$SMPROGRAMS\Gaim"
50 CreateShortCut "$SMPROGRAMS\Gaim\Gaim.lnk" \ 122 CreateShortCut "$SMPROGRAMS\Gaim\Gaim.lnk" \
51 "$INSTDIR\gaim.exe" 123 "$INSTDIR\gaim.exe"
52 CreateShortCut "$SMPROGRAMS\Gaim\Unistall.lnk" \ 124 CreateShortCut "$SMPROGRAMS\Gaim\Unistall.lnk" \
53 "$INSTDIR\gaim-uninst.exe" 125 "$INSTDIR\gaim-uninst.exe"
54 ; Set Desktop icon 126 ; Set Desktop icon
57 129
58 ; write out uninstaller 130 ; write out uninstaller
59 WriteUninstaller "$INSTDIR\gaim-uninst.exe" 131 WriteUninstaller "$INSTDIR\gaim-uninst.exe"
60 SectionEnd ; end of default section 132 SectionEnd ; end of default section
61 133
62 ; begin uninstall settings/section 134 ;--------------------------------
63 UninstallText "This will uninstall Gaim from your system" 135 ;Uninstaller Section
64 136
65 Section Uninstall 137 Section Uninstall
66 ; Delete Gaim Dir 138 ; Delete Gaim Dir
67 RMDir /r "$INSTDIR" 139 RMDir /r "$INSTDIR"
68 140
72 Delete "$DESKTOP\Gaim.lnk" 144 Delete "$DESKTOP\Gaim.lnk"
73 145
74 ; Delete Gaim Registry Settings 146 ; Delete Gaim Registry Settings
75 DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Gaim" 147 DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Gaim"
76 DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Gaim" 148 DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Gaim"
149 DeleteRegKey HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\App Paths\gaim.exe"
150
151 ;Display the Finish header
152 !insertmacro MUI_UNFINISHHEADER
77 153
78 SectionEnd ; end of uninstall section 154 SectionEnd ; end of uninstall section
79
80 ; eof
81