comparison 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
comparison
equal deleted inserted replaced
10919:9695281b1aa1 10920:6a8440e9edba
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 intended for NSIS 2.0 (finale release). 4 ; NOTE: this .NSI script is intended for NSIS 2.0 (final release).
5 ; 5 ;
6 6
7 ;-------------------------------- 7 ;--------------------------------
8 ;Global Variables 8 ;Global Variables
9 Var name 9 Var name
50 !define HKLM_APP_PATHS_KEY "SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\gaim.exe" 50 !define HKLM_APP_PATHS_KEY "SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\gaim.exe"
51 !define GAIM_STARTUP_RUN_KEY "SOFTWARE\Microsoft\Windows\CurrentVersion\Run" 51 !define GAIM_STARTUP_RUN_KEY "SOFTWARE\Microsoft\Windows\CurrentVersion\Run"
52 !define GAIM_UNINST_EXE "gaim-uninst.exe" 52 !define GAIM_UNINST_EXE "gaim-uninst.exe"
53 !define GAIM_REG_LANG "Installer Language" 53 !define GAIM_REG_LANG "Installer Language"
54 54
55 !define GTK_VERSION "2.4.7" 55 !define GTK_VERSION "2.6.2"
56 !define GTK_REG_KEY "SOFTWARE\GTK\2.0" 56 !define GTK_REG_KEY "SOFTWARE\GTK\2.0"
57 !define PERL_REG_KEY "SOFTWARE\Perl" 57 !define PERL_REG_KEY "SOFTWARE\Perl"
58 !define PERL_DLL "perl58.dll" 58 !define PERL_DLL "perl58.dll"
59 !define GTK_DEFAULT_INSTALL_PATH "$PROGRAMFILES\Common Files\GTK\2.0" 59 !define GTK_DEFAULT_INSTALL_PATH "$PROGRAMFILES\Common Files\GTK\2.0"
60 !define GTK_RUNTIME_INSTALLER "..\gtk_installer\gtk-runtime*.exe" 60 !define GTK_RUNTIME_INSTALLER "..\gtk_installer\gtk-runtime*.exe"
443 ReadRegStr $R3 HKLM "${HKLM_APP_PATHS_KEY}" "Path" 443 ReadRegStr $R3 HKLM "${HKLM_APP_PATHS_KEY}" "Path"
444 WriteRegStr HKLM "${HKLM_APP_PATHS_KEY}" "Path" "$R3;$R2\bin" 444 WriteRegStr HKLM "${HKLM_APP_PATHS_KEY}" "Path" "$R3;$R2\bin"
445 445
446 perl_done: 446 perl_done:
447 447
448 CreateDirectory "$SMPROGRAMS\Gaim" 448 ; If this is under NT4, delete the SILC support stuff
449 CreateShortCut "$SMPROGRAMS\Gaim\Gaim.lnk" "$INSTDIR\gaim.exe" 449 ; there is a bug that will prevent any account from connecting
450 CreateShortCut "$DESKTOP\Gaim.lnk" "$INSTDIR\gaim.exe" 450 ; See https://lists.silcnet.org/pipermail/silc-devel/2005-January/001588.html
451 Call GetWindowsVersion
452 Pop $R2
453 StrCmp $R2 "NT 4.0" 0 nt4_done
454 Delete "$INSTDIR\plugins\libsilc.dll"
455 Delete "$INSTDIR\silcclient.dll"
456 Delete "$INSTDIR\silc.dll"
457
458 nt4_done:
459
451 SetOutPath "$INSTDIR" 460 SetOutPath "$INSTDIR"
452 461
453 ; If we don't have install rights.. we're done 462 ; If we don't have install rights.. we're done
454 StrCmp $R0 "NONE" done 463 StrCmp $R0 "NONE" done
455 CreateShortCut "$SMPROGRAMS\Gaim\Uninstall.lnk" "$INSTDIR\${GAIM_UNINST_EXE}"
456 SetOverwrite off 464 SetOverwrite off
457 465
458 ; Write out installer language 466 ; Write out installer language
459 WriteRegStr HKCU "${GAIM_REG_KEY}" "${GAIM_REG_LANG}" "$LANGUAGE" 467 WriteRegStr HKCU "${GAIM_REG_KEY}" "${GAIM_REG_LANG}" "$LANGUAGE"
460 468
469 StrCmp $STARTUP_RUN_KEY "HKLM" +1 +2 477 StrCmp $STARTUP_RUN_KEY "HKLM" +1 +2
470 WriteRegStr HKLM "${GAIM_STARTUP_RUN_KEY}" "Gaim" "$INSTDIR\gaim.exe" 478 WriteRegStr HKLM "${GAIM_STARTUP_RUN_KEY}" "Gaim" "$INSTDIR\gaim.exe"
471 479
472 done: 480 done:
473 SectionEnd ; end of default Gaim section 481 SectionEnd ; end of default Gaim section
482
483 ;--------------------------------
484 ;Shortcuts
485
486 SubSection /e $(GAIM_SHORTCUTS_SECTION_TITLE) SecShortcuts
487 Section /o $(GAIM_DESKTOP_SHORTCUT_SECTION_TITLE) SecDesktopShortcut
488 SetOverwrite on
489 CreateShortCut "$DESKTOP\Gaim.lnk" "$INSTDIR\gaim.exe"
490 SetOverwrite off
491 SectionEnd
492 Section $(GAIM_STARTMENU_SHORTCUT_SECTION_TITLE) SecStartMenuShortcut
493 SetOverwrite on
494 CreateDirectory "$SMPROGRAMS\Gaim"
495 CreateShortCut "$SMPROGRAMS\Gaim\Gaim.lnk" "$INSTDIR\gaim.exe"
496 SetOverwrite off
497 SectionEnd
498 SubSectionEnd
474 499
475 ;-------------------------------- 500 ;--------------------------------
476 ;GTK+ Themes 501 ;GTK+ Themes
477 502
478 SubSection /e $(GTK_THEMES_SECTION_TITLE) SecGtkThemes 503 SubSection /e $(GTK_THEMES_SECTION_TITLE) SecGtkThemes
584 Delete "$INSTDIR\plugins\libnapster.dll" 609 Delete "$INSTDIR\plugins\libnapster.dll"
585 Delete "$INSTDIR\plugins\libnovell.dll" 610 Delete "$INSTDIR\plugins\libnovell.dll"
586 Delete "$INSTDIR\plugins\liboscar.dll" 611 Delete "$INSTDIR\plugins\liboscar.dll"
587 Delete "$INSTDIR\plugins\libtoc.dll" 612 Delete "$INSTDIR\plugins\libtoc.dll"
588 Delete "$INSTDIR\plugins\libyahoo.dll" 613 Delete "$INSTDIR\plugins\libyahoo.dll"
614 Delete "$INSTDIR\plugins\libsilc.dll"
589 Delete "$INSTDIR\plugins\perl.dll" 615 Delete "$INSTDIR\plugins\perl.dll"
590 Delete "$INSTDIR\plugins\relnot.dll" 616 Delete "$INSTDIR\plugins\relnot.dll"
591 Delete "$INSTDIR\plugins\spellchk.dll" 617 Delete "$INSTDIR\plugins\spellchk.dll"
592 Delete "$INSTDIR\plugins\ssl-nss.dll" 618 Delete "$INSTDIR\plugins\ssl-nss.dll"
593 Delete "$INSTDIR\plugins\ssl.dll" 619 Delete "$INSTDIR\plugins\ssl.dll"
612 Delete "$INSTDIR\nspr4.dll" 638 Delete "$INSTDIR\nspr4.dll"
613 Delete "$INSTDIR\nss3.dll" 639 Delete "$INSTDIR\nss3.dll"
614 Delete "$INSTDIR\nssckbi.dll" 640 Delete "$INSTDIR\nssckbi.dll"
615 Delete "$INSTDIR\plc4.dll" 641 Delete "$INSTDIR\plc4.dll"
616 Delete "$INSTDIR\plds4.dll" 642 Delete "$INSTDIR\plds4.dll"
643 Delete "$INSTDIR\silc.dll"
644 Delete "$INSTDIR\silcclient.dll"
617 Delete "$INSTDIR\softokn3.dll" 645 Delete "$INSTDIR\softokn3.dll"
618 Delete "$INSTDIR\ssl3.dll" 646 Delete "$INSTDIR\ssl3.dll"
619 Delete "$INSTDIR\${GAIM_UNINST_EXE}" 647 Delete "$INSTDIR\${GAIM_UNINST_EXE}"
620 !ifdef DEBUG 648 !ifdef DEBUG
621 Delete "$INSTDIR\exchndl.dll" 649 Delete "$INSTDIR\exchndl.dll"
653 !ifdef WITH_GTK 681 !ifdef WITH_GTK
654 !insertmacro MUI_DESCRIPTION_TEXT ${SecGtk} \ 682 !insertmacro MUI_DESCRIPTION_TEXT ${SecGtk} \
655 $(GTK_SECTION_DESCRIPTION) 683 $(GTK_SECTION_DESCRIPTION)
656 !endif 684 !endif
657 !insertmacro MUI_DESCRIPTION_TEXT ${SecGtkThemes} \ 685 !insertmacro MUI_DESCRIPTION_TEXT ${SecGtkThemes} \
658 $(GTK_THEMES_SECTION_DESCRIPTION) 686 $(GTK_THEMES_SECTION_DESCRIPTION)
659 !insertmacro MUI_DESCRIPTION_TEXT ${SecGtkNone} \ 687 !insertmacro MUI_DESCRIPTION_TEXT ${SecGtkNone} \
660 $(GTK_NO_THEME_DESC) 688 $(GTK_NO_THEME_DESC)
661 !insertmacro MUI_DESCRIPTION_TEXT ${SecGtkWimp} \ 689 !insertmacro MUI_DESCRIPTION_TEXT ${SecGtkWimp} \
662 $(GTK_WIMP_THEME_DESC) 690 $(GTK_WIMP_THEME_DESC)
663 !insertmacro MUI_DESCRIPTION_TEXT ${SecGtkBluecurve} \ 691 !insertmacro MUI_DESCRIPTION_TEXT ${SecGtkBluecurve} \
664 $(GTK_BLUECURVE_THEME_DESC) 692 $(GTK_BLUECURVE_THEME_DESC)
665 !insertmacro MUI_DESCRIPTION_TEXT ${SecGtkLighthouseblue} \ 693 !insertmacro MUI_DESCRIPTION_TEXT ${SecGtkLighthouseblue} \
666 $(GTK_LIGHTHOUSEBLUE_THEME_DESC) 694 $(GTK_LIGHTHOUSEBLUE_THEME_DESC)
695
696
697 !insertmacro MUI_DESCRIPTION_TEXT ${SecShortcuts} \
698 $(GAIM_SHORTCUTS_SECTION_DESCRIPTION)
699 !insertmacro MUI_DESCRIPTION_TEXT ${SecDesktopShortcut} \
700 $(GAIM_DESKTOP_SHORTCUT_DESC)
701 !insertmacro MUI_DESCRIPTION_TEXT ${SecStartMenuShortcut} \
702 $(GAIM_STARTMENU_SHORTCUT_DESC)
667 !insertmacro MUI_FUNCTION_DESCRIPTION_END 703 !insertmacro MUI_FUNCTION_DESCRIPTION_END
668 704
669 ;-------------------------------- 705 ;--------------------------------
670 ;Functions 706 ;Functions
671 707
1246 Pop $R1 1282 Pop $R1
1247 Exch $R0 1283 Exch $R0
1248 1284
1249 FunctionEnd 1285 FunctionEnd
1250 1286
1251 ; StrStr 1287 ; StrStr
1252 ; input, top of stack = string to search for 1288 ; input, top of stack = string to search for
1253 ; top of stack-1 = string to search in 1289 ; top of stack-1 = string to search in
1254 ; output, top of stack (replaces with the portion of the string remaining) 1290 ; output, top of stack (replaces with the portion of the string remaining)
1255 ; modifies no other variables. 1291 ; modifies no other variables.
1256 ; 1292 ;
1259 ; Push "ass" 1295 ; Push "ass"
1260 ; Call StrStr 1296 ; Call StrStr
1261 ; Pop $R0 1297 ; Pop $R0
1262 ; ($R0 at this point is "ass string") 1298 ; ($R0 at this point is "ass string")
1263 1299
1264 Function StrStr 1300 Function StrStr
1265 Exch $R1 ; st=haystack,old$R1, $R1=needle 1301 Exch $R1 ; st=haystack,old$R1, $R1=needle
1266 Exch ; st=old$R1,haystack 1302 Exch ; st=old$R1,haystack
1267 Exch $R2 ; st=old$R1,old$R2, $R2=haystack 1303 Exch $R2 ; st=old$R1,old$R2, $R2=haystack
1268 Push $R3 1304 Push $R3
1269 Push $R4 1305 Push $R4
1270 Push $R5 1306 Push $R5
1279 StrCpy $R5 $R2 $R3 $R4 1315 StrCpy $R5 $R2 $R3 $R4
1280 StrCmp $R5 $R1 done 1316 StrCmp $R5 $R1 done
1281 StrCmp $R5 "" done 1317 StrCmp $R5 "" done
1282 IntOp $R4 $R4 + 1 1318 IntOp $R4 $R4 + 1
1283 Goto loop 1319 Goto loop
1284 done: 1320 done:
1285 StrCpy $R1 $R2 "" $R4 1321 StrCpy $R1 $R2 "" $R4
1286 Pop $R5 1322 Pop $R5
1287 Pop $R4 1323 Pop $R4
1288 Pop $R3 1324 Pop $R3
1289 Pop $R2 1325 Pop $R2
1290 Exch $R1 1326 Exch $R1
1291 FunctionEnd 1327 FunctionEnd
1292 1328
1293 ; 1329 ;
1294 ; Parse the Command line 1330 ; Parse the Command line
1295 ; 1331 ;
1296 ; Unattended install command line parameters 1332 ; Unattended install command line parameters
1303 Push $R0 1339 Push $R0
1304 Push "L=" 1340 Push "L="
1305 Call StrStr 1341 Call StrStr
1306 Pop $R1 1342 Pop $R1
1307 StrCmp $R1 "" next 1343 StrCmp $R1 "" next
1308 StrCpy $R1 $R1 4 2 ; Strip first 2 chars of string 1344 StrCpy $R1 $R1 4 2 ; Strip first 2 chars of string
1309 StrCpy $LANGUAGE $R1 1345 StrCpy $LANGUAGE $R1
1310 IntOp $LANG_IS_SET 0 + 1 1346 IntOp $LANG_IS_SET 0 + 1
1311 next: 1347 next:
1312 FunctionEnd 1348 FunctionEnd
1313 1349
1350 ; GetWindowsVersion
1351 ;
1352 ; Based on Yazno's function, http://yazno.tripod.com/powerpimpit/
1353 ; Updated by Joost Verburg
1354 ;
1355 ; Returns on top of stack
1356 ;
1357 ; Windows Version (95, 98, ME, NT x.x, 2000, XP, 2003)
1358 ; or
1359 ; '' (Unknown Windows Version)
1360 ;
1361 ; Usage:
1362 ; Call GetWindowsVersion
1363 ; Pop $R0
1364 ;
1365 ; at this point $R0 is "NT 4.0" or whatnot
1366 Function GetWindowsVersion
1367
1368 Push $R0
1369 Push $R1
1370
1371 ReadRegStr $R0 HKLM \
1372 "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
1373
1374 IfErrors 0 lbl_winnt
1375
1376 ; we are not NT
1377 ReadRegStr $R0 HKLM \
1378 "SOFTWARE\Microsoft\Windows\CurrentVersion" VersionNumber
1379
1380 StrCpy $R1 $R0 1
1381 StrCmp $R1 '4' 0 lbl_error
1382
1383 StrCpy $R1 $R0 3
1384
1385 StrCmp $R1 '4.0' lbl_win32_95
1386 StrCmp $R1 '4.9' lbl_win32_ME lbl_win32_98
1387
1388 lbl_win32_95:
1389 StrCpy $R0 '95'
1390 Goto lbl_done
1391
1392 lbl_win32_98:
1393 StrCpy $R0 '98'
1394 Goto lbl_done
1395
1396 lbl_win32_ME:
1397 StrCpy $R0 'ME'
1398 Goto lbl_done
1399
1400 lbl_winnt:
1401 StrCpy $R1 $R0 1
1402
1403 StrCmp $R1 '3' lbl_winnt_x
1404 StrCmp $R1 '4' lbl_winnt_x
1405
1406 StrCpy $R1 $R0 3
1407
1408 StrCmp $R1 '5.0' lbl_winnt_2000
1409 StrCmp $R1 '5.1' lbl_winnt_XP
1410 StrCmp $R1 '5.2' lbl_winnt_2003 lbl_error
1411
1412 lbl_winnt_x:
1413 StrCpy $R0 "NT $R0" 6
1414 Goto lbl_done
1415
1416 lbl_winnt_2000:
1417 Strcpy $R0 '2000'
1418 Goto lbl_done
1419
1420 lbl_winnt_XP:
1421 Strcpy $R0 'XP'
1422 Goto lbl_done
1423
1424 lbl_winnt_2003:
1425 Strcpy $R0 '2003'
1426 Goto lbl_done
1427
1428 lbl_error:
1429 Strcpy $R0 ''
1430 lbl_done:
1431
1432 Pop $R1
1433 Exch $R0
1434 FunctionEnd
1435