comparison gaim-installer.nsi @ 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 8186cb621d2b
children 7ca4a6820154
comparison
equal deleted inserted replaced
14984:fb98e9c45607 14985:6bdcfafc2259
118 !define MUI_FINISHPAGE_LINK_LOCATION "http://gaim.sourceforge.net/win32" 118 !define MUI_FINISHPAGE_LINK_LOCATION "http://gaim.sourceforge.net/win32"
119 119
120 ;-------------------------------- 120 ;--------------------------------
121 ;Pages 121 ;Pages
122 122
123 !ifndef WITH_GTK
124 !define MUI_PAGE_CUSTOMFUNCTION_PRE preWelcomePage 123 !define MUI_PAGE_CUSTOMFUNCTION_PRE preWelcomePage
125 !endif
126 !insertmacro MUI_PAGE_WELCOME 124 !insertmacro MUI_PAGE_WELCOME
127 !insertmacro MUI_PAGE_LICENSE "./COPYING" 125 !insertmacro MUI_PAGE_LICENSE "./COPYING"
128 !insertmacro MUI_PAGE_COMPONENTS 126 !insertmacro MUI_PAGE_COMPONENTS
129 127
130 !ifdef WITH_GTK 128 !ifdef WITH_GTK
829 Call CheckUserInstallRights 827 Call CheckUserInstallRights
830 Pop $2 828 Pop $2
831 StrCmp $2 "HKLM" 0 user_theme 829 StrCmp $2 "HKLM" 0 user_theme
832 830
833 ; Global Theme 831 ; Global Theme
832 ClearErrors
834 ReadRegStr $2 HKLM ${GTK_REG_KEY} "Path" 833 ReadRegStr $2 HKLM ${GTK_REG_KEY} "Path"
834 IfErrors user_theme
835 StrCpy $3 "$2\etc\gtk-2.0\gtkrc" 835 StrCpy $3 "$2\etc\gtk-2.0\gtkrc"
836 Goto update_theme 836 Goto update_theme
837 user_theme: 837 user_theme:
838 StrCpy $3 "$PROFILE\.gtkrc-2.0" 838 StrCpy $3 "$PROFILE\.gtkrc-2.0"
839 839
1225 Pop $0 1225 Pop $0
1226 FunctionEnd 1226 FunctionEnd
1227 1227
1228 ; Page enter and exit functions.. 1228 ; Page enter and exit functions..
1229 1229
1230 Function preWelcomePage
1231 Push R0
1232
1230 !ifndef WITH_GTK 1233 !ifndef WITH_GTK
1231 Function preWelcomePage
1232 ; If this installer dosn't have GTK, check whether we need it. 1234 ; If this installer dosn't have GTK, check whether we need it.
1233 ; We do this here an not in .onInit because language change in 1235 ; We do this here an not in .onInit because language change in
1234 ; .onInit doesn't take effect until it is finished. 1236 ; .onInit doesn't take effect until it is finished.
1235 Push $R0 1237 Call DoWeNeedGtk
1238 Pop $R0
1239 Pop $GTK_FOLDER
1240
1241 IntCmp $R0 1 done done
1242 MessageBox MB_OK $(GTK_INSTALLER_NEEDED) /SD IDOK
1243 Quit
1244
1245 done:
1246
1247 !else
1248 Push R1
1249
1250 ; If on Win95/98/ME warn them that the GTK+ version wont work
1251 Call GetWindowsVersion
1252 Pop $R1
1253 StrCmp $R1 "95" win_ver_bad
1254 StrCmp $R1 "98" win_ver_bad
1255 StrCmp $R1 "ME" win_ver_bad
1256 Goto done
1257
1258 win_ver_bad:
1259 !insertmacro UnselectSection ${SecGtk}
1260 !insertmacro SetSectionFlag ${SecGtkNone} ${SF_RO}
1261 !insertmacro UnselectSection ${SecGtkNone}
1262 !insertmacro SetSectionFlag ${SecGtkWimp} ${SF_RO}
1263 !insertmacro UnselectSection ${SecGtkWimp}
1264 !insertmacro SetSectionFlag ${SecGtkBluecurve} ${SF_RO}
1265 !insertmacro UnselectSection ${SecGtkBluecurve}
1266 !insertmacro SetSectionFlag ${SecGtkLighthouseblue} ${SF_RO}
1267 !insertmacro UnselectSection ${SecGtkLighthouseblue}
1268 MessageBox MB_OK $(GTK_WINDOWS_INCOMPATIBLE) /SD IDOK
1236 Call DoWeNeedGtk 1269 Call DoWeNeedGtk
1237 Pop $R0 1270 Pop $R0
1238 Pop $GTK_FOLDER 1271 Pop $R1
1239 1272 IntCmp $R0 1 done done ; Upgrade isn't optional - abort if we don't have a suitable version
1240 IntCmp $R0 1 have_gtk have_gtk 1273 Quit
1241 1274
1242 MessageBox MB_OK $(GTK_INSTALLER_NEEDED) /SD IDOK 1275 done:
1243 Quit 1276 Pop $R1
1244 have_gtk: 1277 !endif
1245 Pop $R0 1278 Pop $R0
1246 FunctionEnd 1279 FunctionEnd
1247 !endif
1248 1280
1249 !ifdef WITH_GTK 1281 !ifdef WITH_GTK
1250 Function preGtkDirPage 1282 Function preGtkDirPage
1251 Push $R0 1283 Push $R0
1252 Push $R1 1284 Push $R1
1305 ; Based on Yazno's function, http://yazno.tripod.com/powerpimpit/ 1337 ; Based on Yazno's function, http://yazno.tripod.com/powerpimpit/
1306 ; Updated by Joost Verburg 1338 ; Updated by Joost Verburg
1307 ; 1339 ;
1308 ; Returns on top of stack 1340 ; Returns on top of stack
1309 ; 1341 ;
1310 ; Windows Version (95, 98, ME, NT x.x, 2000, XP, 2003) 1342 ; Windows Version (95, 98, ME, NT x.x, 2000, XP, 2003, Vista)
1311 ; or 1343 ; or
1312 ; '' (Unknown Windows Version) 1344 ; '' (Unknown Windows Version)
1313 ; 1345 ;
1314 ; Usage: 1346 ; Usage:
1315 ; Call GetWindowsVersion 1347 ; Call GetWindowsVersion
1359 1391
1360 StrCpy $R1 $R0 3 1392 StrCpy $R1 $R0 3
1361 1393
1362 StrCmp $R1 '5.0' lbl_winnt_2000 1394 StrCmp $R1 '5.0' lbl_winnt_2000
1363 StrCmp $R1 '5.1' lbl_winnt_XP 1395 StrCmp $R1 '5.1' lbl_winnt_XP
1364 StrCmp $R1 '5.2' lbl_winnt_2003 lbl_error 1396 StrCmp $R1 '5.2' lbl_winnt_2003
1397 StrCmp $R1 '6.0' lbl_winnt_vista lbl_error
1365 1398
1366 lbl_winnt_x: 1399 lbl_winnt_x:
1367 StrCpy $R0 "NT $R0" 6 1400 StrCpy $R0 "NT $R0" 6
1368 Goto lbl_done 1401 Goto lbl_done
1369 1402
1375 Strcpy $R0 'XP' 1408 Strcpy $R0 'XP'
1376 Goto lbl_done 1409 Goto lbl_done
1377 1410
1378 lbl_winnt_2003: 1411 lbl_winnt_2003:
1379 Strcpy $R0 '2003' 1412 Strcpy $R0 '2003'
1413 Goto lbl_done
1414
1415 lbl_winnt_vista:
1416 Strcpy $R0 'Vista'
1380 Goto lbl_done 1417 Goto lbl_done
1381 1418
1382 lbl_error: 1419 lbl_error:
1383 Strcpy $R0 '' 1420 Strcpy $R0 ''
1384 lbl_done: 1421 lbl_done: