Mercurial > pidgin.yaz
comparison pidgin/win32/nsis/pidgin-installer.nsi @ 17464:a3e68bb05594
Patch from Amir Szekely to make the installer start up faster and use NSIS' built-in Windows version checking. Fixes #1289 (Thanks, Amir)
author | Daniel Atallah <daniel.atallah@gmail.com> |
---|---|
date | Wed, 30 May 2007 03:17:56 +0000 |
parents | 6d940df6c095 |
children | 6731e5fe3673 |
comparison
equal
deleted
inserted
replaced
17463:93ecfed58d7d | 17464:a3e68bb05594 |
---|---|
1 ; Installer script for win32 Pidgin | 1 ; Installer script for win32 Pidgin |
2 ; Original Author: Herman Bloggs <hermanator12002@yahoo.com> | 2 ; Original Author: Herman Bloggs <hermanator12002@yahoo.com> |
3 ; Updated By: Daniel Atallah <daniel_atallah@yahoo.com> | 3 ; Updated By: Daniel Atallah <daniel_atallah@yahoo.com> |
4 | 4 |
5 ; NOTE: this .NSI script is intended for NSIS 2.08 | 5 ; NOTE: this .NSI script is intended for NSIS 2.27 |
6 ; | 6 ; |
7 | 7 |
8 ;-------------------------------- | 8 ;-------------------------------- |
9 ;Global Variables | 9 ;Global Variables |
10 Var name | 10 Var name |
36 | 36 |
37 ; $name and $INSTDIR are set in .onInit function.. | 37 ; $name and $INSTDIR are set in .onInit function.. |
38 | 38 |
39 !include "MUI.nsh" | 39 !include "MUI.nsh" |
40 !include "Sections.nsh" | 40 !include "Sections.nsh" |
41 !include "WinVer.nsh" | |
42 !include "LogicLib.nsh" | |
41 | 43 |
42 !include "FileFunc.nsh" | 44 !include "FileFunc.nsh" |
43 !insertmacro GetParameters | 45 !insertmacro GetParameters |
44 !insertmacro GetOptions | 46 !insertmacro GetOptions |
45 !insertmacro GetParent | 47 !insertmacro GetParent |
90 VIAddVersionKey "FileDescription" "Pidgin Installer (Debug Version)" | 92 VIAddVersionKey "FileDescription" "Pidgin Installer (Debug Version)" |
91 !else | 93 !else |
92 VIAddVersionKey "FileDescription" "Pidgin Installer (w/o GTK+ Installer)" | 94 VIAddVersionKey "FileDescription" "Pidgin Installer (w/o GTK+ Installer)" |
93 !endif | 95 !endif |
94 !endif | 96 !endif |
97 | |
98 ;-------------------------------- | |
99 ;Reserve files used in .onInit | |
100 ;for faster start-up | |
101 ReserveFile "${NSISDIR}\Plugins\System.dll" | |
102 !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS | |
103 !insertmacro MUI_RESERVEFILE_LANGDLL | |
95 | 104 |
96 ;-------------------------------- | 105 ;-------------------------------- |
97 ;Modern UI Configuration | 106 ;Modern UI Configuration |
98 | 107 |
99 !define MUI_ICON ".\pixmaps\pidgin-install.ico" | 108 !define MUI_ICON ".\pixmaps\pidgin-install.ico" |
479 perl_done: | 488 perl_done: |
480 | 489 |
481 ; If this is under NT4, delete the SILC support stuff | 490 ; If this is under NT4, delete the SILC support stuff |
482 ; there is a bug that will prevent any account from connecting | 491 ; there is a bug that will prevent any account from connecting |
483 ; See https://lists.silcnet.org/pipermail/silc-devel/2005-January/001588.html | 492 ; See https://lists.silcnet.org/pipermail/silc-devel/2005-January/001588.html |
484 Call GetWindowsVersion | 493 ${If} ${IsNT} |
485 Pop $R2 | 494 ${AndIf} ${IsWinNT4} |
486 StrCmp $R2 "NT 4.0" +1 +4 | 495 Delete "$INSTDIR\plugins\libsilc.dll" |
487 Delete "$INSTDIR\plugins\libsilc.dll" | 496 Delete "$INSTDIR\silcclient.dll" |
488 Delete "$INSTDIR\silcclient.dll" | 497 Delete "$INSTDIR\silc.dll" |
489 Delete "$INSTDIR\silc.dll" | 498 ${EndIf} |
490 | 499 |
491 SetOutPath "$INSTDIR" | 500 SetOutPath "$INSTDIR" |
492 | 501 |
493 ; If we don't have install rights we're done | 502 ; If we don't have install rights we're done |
494 StrCmp $R0 "NONE" done | 503 StrCmp $R0 "NONE" done |
1308 IntCmp $R0 1 gtk_not_mandatory gtk_not_mandatory | 1317 IntCmp $R0 1 gtk_not_mandatory gtk_not_mandatory |
1309 !insertmacro SetSectionFlag ${SecGtk} ${SF_RO} | 1318 !insertmacro SetSectionFlag ${SecGtk} ${SF_RO} |
1310 gtk_not_mandatory: | 1319 gtk_not_mandatory: |
1311 | 1320 |
1312 ; If on Win95/98/ME warn them that the GTK+ version wont work | 1321 ; If on Win95/98/ME warn them that the GTK+ version wont work |
1313 Call GetWindowsVersion | 1322 ${Unless} ${IsNT} |
1314 Pop $R1 | |
1315 StrCmp $R1 "95" win_ver_bad | |
1316 StrCmp $R1 "98" win_ver_bad | |
1317 StrCmp $R1 "ME" win_ver_bad | |
1318 Goto done | |
1319 | |
1320 win_ver_bad: | |
1321 !insertmacro UnselectSection ${SecGtk} | 1323 !insertmacro UnselectSection ${SecGtk} |
1322 !insertmacro SetSectionFlag ${SecGtk} ${SF_RO} | 1324 !insertmacro SetSectionFlag ${SecGtk} ${SF_RO} |
1323 MessageBox MB_OK $(GTK_WINDOWS_INCOMPATIBLE) /SD IDOK | 1325 MessageBox MB_OK $(GTK_WINDOWS_INCOMPATIBLE) /SD IDOK |
1324 IntCmp $R0 1 done done ; Upgrade isn't optional - abort if we don't have a suitable version | 1326 IntCmp $R0 1 done done ; Upgrade isn't optional - abort if we don't have a suitable version |
1325 Quit | 1327 Quit |
1328 ${EndIf} | |
1326 | 1329 |
1327 done: | 1330 done: |
1328 Pop $R2 | 1331 Pop $R2 |
1329 Pop $R1 | 1332 Pop $R1 |
1330 !endif | 1333 !endif |
1383 done: | 1386 done: |
1384 Pop $R0 | 1387 Pop $R0 |
1385 FunctionEnd | 1388 FunctionEnd |
1386 !endif | 1389 !endif |
1387 | 1390 |
1388 ; GetWindowsVersion | |
1389 ; | |
1390 ; Based on Yazno's function, http://yazno.tripod.com/powerpimpit/ | |
1391 ; Updated by Joost Verburg | |
1392 ; | |
1393 ; Returns on top of stack | |
1394 ; | |
1395 ; Windows Version (95, 98, ME, NT x.x, 2000, XP, 2003, Vista) | |
1396 ; or | |
1397 ; '' (Unknown Windows Version) | |
1398 ; | |
1399 ; Usage: | |
1400 ; Call GetWindowsVersion | |
1401 ; Pop $R0 | |
1402 ; | |
1403 ; at this point $R0 is "NT 4.0" or whatnot | |
1404 Function GetWindowsVersion | |
1405 | |
1406 Push $R0 | |
1407 Push $R1 | |
1408 | |
1409 ClearErrors | |
1410 ReadRegStr $R0 HKLM \ | |
1411 "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion | |
1412 | |
1413 IfErrors 0 lbl_winnt | |
1414 | |
1415 ; we are not NT | |
1416 ReadRegStr $R0 HKLM \ | |
1417 "SOFTWARE\Microsoft\Windows\CurrentVersion" VersionNumber | |
1418 | |
1419 StrCpy $R1 $R0 1 | |
1420 StrCmp $R1 '4' 0 lbl_error | |
1421 | |
1422 StrCpy $R1 $R0 3 | |
1423 | |
1424 StrCmp $R1 '4.0' lbl_win32_95 | |
1425 StrCmp $R1 '4.9' lbl_win32_ME lbl_win32_98 | |
1426 | |
1427 lbl_win32_95: | |
1428 StrCpy $R0 '95' | |
1429 Goto lbl_done | |
1430 | |
1431 lbl_win32_98: | |
1432 StrCpy $R0 '98' | |
1433 Goto lbl_done | |
1434 | |
1435 lbl_win32_ME: | |
1436 StrCpy $R0 'ME' | |
1437 Goto lbl_done | |
1438 | |
1439 lbl_winnt: | |
1440 StrCpy $R1 $R0 1 | |
1441 | |
1442 StrCmp $R1 '3' lbl_winnt_x | |
1443 StrCmp $R1 '4' lbl_winnt_x | |
1444 | |
1445 StrCpy $R1 $R0 3 | |
1446 | |
1447 StrCmp $R1 '5.0' lbl_winnt_2000 | |
1448 StrCmp $R1 '5.1' lbl_winnt_XP | |
1449 StrCmp $R1 '5.2' lbl_winnt_2003 | |
1450 StrCmp $R1 '6.0' lbl_winnt_vista lbl_error | |
1451 | |
1452 lbl_winnt_x: | |
1453 StrCpy $R0 "NT $R0" 6 | |
1454 Goto lbl_done | |
1455 | |
1456 lbl_winnt_2000: | |
1457 Strcpy $R0 '2000' | |
1458 Goto lbl_done | |
1459 | |
1460 lbl_winnt_XP: | |
1461 Strcpy $R0 'XP' | |
1462 Goto lbl_done | |
1463 | |
1464 lbl_winnt_2003: | |
1465 Strcpy $R0 '2003' | |
1466 Goto lbl_done | |
1467 | |
1468 lbl_winnt_vista: | |
1469 Strcpy $R0 'Vista' | |
1470 Goto lbl_done | |
1471 | |
1472 lbl_error: | |
1473 Strcpy $R0 '' | |
1474 lbl_done: | |
1475 | |
1476 Pop $R1 | |
1477 Exch $R0 | |
1478 FunctionEnd | |
1479 | |
1480 ; SpellChecker Related Functions | 1391 ; SpellChecker Related Functions |
1481 ;------------------------------- | 1392 ;------------------------------- |
1482 | 1393 |
1483 ; Convert the a Section index to the language code | 1394 ; Convert the a Section index to the language code |
1484 ; Push the section index onto the stack and pop off the language code after the call | 1395 ; Push the section index onto the stack and pop off the language code after the call |