Changeset 124 for smplayer/trunk/setup/smplayer.win32.nsi
- Timestamp:
- Mar 16, 2012, 4:02:47 PM (13 years ago)
- Location:
- smplayer/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
smplayer/trunk
- Property svn:mergeinfo changed
/smplayer/vendor/current merged: 121-122
- Property svn:mergeinfo changed
-
smplayer/trunk/setup/smplayer.win32.nsi
r119 r124 208 208 !insertmacro MUI_LANGUAGE "Basque" 209 209 !insertmacro MUI_LANGUAGE "Catalan" 210 !insertmacro MUI_LANGUAGE "Croatian" 210 211 !insertmacro MUI_LANGUAGE "Czech" 211 212 !insertmacro MUI_LANGUAGE "Danish" … … 234 235 !insertmacro LANGFILE_INCLUDE "translations\basque.nsh" 235 236 !insertmacro LANGFILE_INCLUDE "translations\catalan.nsh" 237 !insertmacro LANGFILE_INCLUDE "translations\croatian.nsh" 236 238 !insertmacro LANGFILE_INCLUDE "translations\czech.nsh" 237 239 !insertmacro LANGFILE_INCLUDE "translations\danish.nsh" … … 264 266 !insertmacro MUI_RESERVEFILE_LANGDLL 265 267 ReserveFile "${NSISDIR}\Plugins\UserInfo.dll" 268 ReserveFile "FindProcDLL.dll" 266 269 267 270 ;-------------------------------- … … 276 279 ${If} $Reinstall_Uninstall == 1 277 280 278 ReadRegStr $R0 HKLM ${SMPLAYER_REG_KEY} "Path"279 280 281 ${If} $Reinstall_UninstallButton_State == 1 281 Exec '"$ R0\uninst.exe" /X'282 Exec '"$SMPlayer_Path\uninst.exe" /X' 282 283 Quit 283 284 ${ElseIf} $Reinstall_OverwriteButton_State == 1 284 ${If} "$INSTDIR" == "$ R0"285 ExecWait '"$ R0\uninst.exe" /S /R _?=$R0'285 ${If} "$INSTDIR" == "$SMPlayer_Path" 286 ExecWait '"$SMPlayer_Path\uninst.exe" /S /R _?=$SMPlayer_Path' 286 287 ${Else} 287 ExecWait '"$ R0\uninst.exe" /S /R'288 ExecWait '"$SMPlayer_Path\uninst.exe" /S /R' 288 289 ${EndIf} 289 290 ${EndIf} … … 339 340 CreateDirectory "$SMPROGRAMS\$SMPlayer_StartMenuFolder" 340 341 CreateShortCut "$SMPROGRAMS\$SMPlayer_StartMenuFolder\SMPlayer.lnk" "$INSTDIR\smplayer.exe" 342 CreateShortCut "$SMPROGRAMS\$SMPlayer_StartMenuFolder\SMTube.lnk" "$INSTDIR\smtube.exe" 341 343 WriteINIStr "$SMPROGRAMS\$SMPlayer_StartMenuFolder\SMPlayer on the Web.url" "InternetShortcut" "URL" "http://smplayer.sf.net" 342 344 CreateShortCut "$SMPROGRAMS\$SMPlayer_StartMenuFolder\Uninstall SMPlayer.lnk" "$INSTDIR\${SMPLAYER_UNINST_EXE}" … … 377 379 378 380 DetailPrint $(MPlayer_DL_Msg) 379 inetc::get / timeout 30000 /resume "" /silent"http://downloads.sourceforge.net/smplayer/$MPlayer_Version.7z?big_mirror=0" \380 "$PLUGINSDIR\$MPlayer_Version.7z" / end381 inetc::get /CONNECTTIMEOUT 15000 /RESUME "" /BANNER $(MPlayer_DL_Msg) /CAPTION $(MPlayer_DL_Msg) \"http://downloads.sourceforge.net/smplayer/$MPlayer_Version.7z?big_mirror=0" \ 382 "$PLUGINSDIR\$MPlayer_Version.7z" /END 381 383 Pop $R0 382 384 StrCmp $R0 OK 0 check_mplayer … … 424 426 425 427 DetailPrint $(Codecs_DL_Msg) 426 inetc::get /timeout 30000 /resume "" /silent "http://www.mplayerhq.hu/MPlayer/releases/codecs/$Codec_Version.zip" \ 427 "$PLUGINSDIR\$Codec_Version.zip" /end 428 inetc::get /CONNECTTIMEOUT 15000 /RESUME "" /BANNER $(Codecs_DL_Msg) /CAPTION $(Codecs_DL_Msg) \ 429 "http://www.mplayerhq.hu/MPlayer/releases/codecs/$Codec_Version.zip" \ 430 "$PLUGINSDIR\$Codec_Version.zip" /END 428 431 Pop $R0 429 432 StrCmp $R0 OK 0 check_codecs … … 468 471 ;-------------------------------- 469 472 ;Translations 470 SectionGroup $(Section_Translations) SecTranslations 471 472 Section "English" SecLang_ENUS 473 SectionIn RO 474 475 SetOutPath "$INSTDIR\translations" 476 File /r "smplayer-build\translations\smplayer_en_US.qm" 477 SectionEnd 478 479 ${MementoSection} "العربية" SecLang_ARSY 480 SetOutPath "$INSTDIR\translations" 481 File /r "smplayer-build\translations\smplayer_ar_SY.qm" 482 ${MementoSectionEnd} 483 484 ${MementoSection} "български" SecLang_BG 485 SetOutPath "$INSTDIR\translations" 486 File /r "smplayer-build\translations\smplayer_bg.qm" 487 ${MementoSectionEnd} 488 489 ${MementoSection} "Català" SecLang_CA 490 SetOutPath "$INSTDIR\translations" 491 File /r "smplayer-build\translations\smplayer_ca.qm" 492 ${MementoSectionEnd} 493 494 ${MementoSection} "Čeština" SecLang_CS 495 SetOutPath "$INSTDIR\translations" 496 File /r "smplayer-build\translations\smplayer_cs.qm" 497 ${MementoSectionEnd} 498 499 ${MementoSection} "Dansk" SecLang_DA 500 SetOutPath "$INSTDIR\translations" 501 File /r "smplayer-build\translations\smplayer_da.qm" 502 ${MementoSectionEnd} 503 504 ${MementoSection} "Deutsch" SecLang_DE 505 SetOutPath "$INSTDIR\translations" 506 File /r "smplayer-build\translations\smplayer_de.qm" 507 ${MementoSectionEnd} 508 509 ${MementoSection} "Ελληνικά" SecLang_ELGR 510 SetOutPath "$INSTDIR\translations" 511 File /r "smplayer-build\translations\smplayer_el_GR.qm" 512 ${MementoSectionEnd} 513 514 ${MementoSection} "Español" SecLang_ES 515 SetOutPath "$INSTDIR\translations" 516 File /r "smplayer-build\translations\smplayer_es.qm" 517 ${MementoSectionEnd} 518 519 ${MementoSection} "Eesti Keel" SecLang_ET 520 SetOutPath "$INSTDIR\translations" 521 File /r "smplayer-build\translations\smplayer_et.qm" 522 ${MementoSectionEnd} 523 524 ${MementoSection} "Euskara" SecLang_EU 525 SetOutPath "$INSTDIR\translations" 526 File /r "smplayer-build\translations\smplayer_eu.qm" 527 ${MementoSectionEnd} 528 529 ${MementoSection} "Suomi" SecLang_FI 530 SetOutPath "$INSTDIR\translations" 531 File /r "smplayer-build\translations\smplayer_fi.qm" 532 ${MementoSectionEnd} 533 534 ${MementoSection} "Français" SecLang_FR 535 SetOutPath "$INSTDIR\translations" 536 File /r "smplayer-build\translations\smplayer_fr.qm" 537 ${MementoSectionEnd} 538 539 ${MementoSection} "Galego" SecLang_GL 540 SetOutPath "$INSTDIR\translations" 541 File /r "smplayer-build\translations\smplayer_gl.qm" 542 ${MementoSectionEnd} 543 544 ${MementoSection} "Magyar" SecLang_HU 545 SetOutPath "$INSTDIR\translations" 546 File /r "smplayer-build\translations\smplayer_hu.qm" 547 ${MementoSectionEnd} 548 549 ${MementoSection} "Italiano" SecLang_IT 550 SetOutPath "$INSTDIR\translations" 551 File /r "smplayer-build\translations\smplayer_it.qm" 552 ${MementoSectionEnd} 553 554 ${MementoSection} "日本語" SecLang_JA 555 SetOutPath "$INSTDIR\translations" 556 File /r "smplayer-build\translations\smplayer_ja.qm" 557 ${MementoSectionEnd} 558 559 ${MementoSection} "ქართული" SecLang_KA 560 SetOutPath "$INSTDIR\translations" 561 File /r "smplayer-build\translations\smplayer_ka.qm" 562 ${MementoSectionEnd} 563 564 ${MementoSection} "한국어" SecLang_KO 565 SetOutPath "$INSTDIR\translations" 566 File /r "smplayer-build\translations\smplayer_ko.qm" 567 ${MementoSectionEnd} 568 569 ${MementoSection} "كوردی" SecLang_KU 570 SetOutPath "$INSTDIR\translations" 571 File /r "smplayer-build\translations\smplayer_ku.qm" 572 ${MementoSectionEnd} 573 574 ${MementoSection} "Lietuvių" SecLang_LT 575 SetOutPath "$INSTDIR\translations" 576 File /r "smplayer-build\translations\smplayer_lt.qm" 577 ${MementoSectionEnd} 578 579 ${MementoSection} "Mакедонски" SecLang_MK 580 SetOutPath "$INSTDIR\translations" 581 File /r "smplayer-build\translations\smplayer_mk.qm" 582 ${MementoSectionEnd} 583 584 ${MementoSection} "Nederlands" SecLang_NL 585 SetOutPath "$INSTDIR\translations" 586 File /r "smplayer-build\translations\smplayer_nl.qm" 587 ${MementoSectionEnd} 588 589 ${MementoSection} "Polski" SecLang_PL 590 SetOutPath "$INSTDIR\translations" 591 File /r "smplayer-build\translations\smplayer_pl.qm" 592 ${MementoSectionEnd} 593 594 ${MementoSection} "Português" SecLang_PT 595 SetOutPath "$INSTDIR\translations" 596 File /r "smplayer-build\translations\smplayer_pt.qm" 597 ${MementoSectionEnd} 598 599 ${MementoSection} "Português (Brasil)" SecLang_PTBR 600 SetOutPath "$INSTDIR\translations" 601 File /r "smplayer-build\translations\smplayer_pt_BR.qm" 602 ${MementoSectionEnd} 603 604 ${MementoSection} "Română" SecLang_roRO 605 SetOutPath "$INSTDIR\translations" 606 File /r "smplayer-build\translations\smplayer_ro_RO.qm" 607 ${MementoSectionEnd} 608 609 ${MementoSection} "Pусский" SecLang_ruRU 610 SetOutPath "$INSTDIR\translations" 611 File /r "smplayer-build\translations\smplayer_ru_RU.qm" 612 ${MementoSectionEnd} 613 614 ${MementoSection} "Slovenčina" SecLang_SK 615 SetOutPath "$INSTDIR\translations" 616 File /r "smplayer-build\translations\smplayer_sk.qm" 617 ${MementoSectionEnd} 618 619 ${MementoSection} "Slovenščina" SecLang_SLSI 620 SetOutPath "$INSTDIR\translations" 621 File /r "smplayer-build\translations\smplayer_sl_SI.qm" 622 ${MementoSectionEnd} 623 624 ${MementoSection} "Cрпски" SecLang_SR 625 SetOutPath "$INSTDIR\translations" 626 File /r "smplayer-build\translations\smplayer_sr.qm" 627 ${MementoSectionEnd} 628 629 ${MementoSection} "Svenska" SecLang_SV 630 SetOutPath "$INSTDIR\translations" 631 File /r "smplayer-build\translations\smplayer_sv.qm" 632 ${MementoSectionEnd} 633 634 ${MementoSection} "Türkçe" SecLang_TR 635 SetOutPath "$INSTDIR\translations" 636 File /r "smplayer-build\translations\smplayer_tr.qm" 637 ${MementoSectionEnd} 638 639 ${MementoSection} "Yкраїнська" SecLang_UKUA 640 SetOutPath "$INSTDIR\translations" 641 File /r "smplayer-build\translations\smplayer_uk_UA.qm" 642 ${MementoSectionEnd} 643 644 ${MementoSection} "Tiếng Việt" SecLang_VIVN 645 SetOutPath "$INSTDIR\translations" 646 File /r "smplayer-build\translations\smplayer_vi_VN.qm" 647 ${MementoSectionEnd} 648 649 ${MementoSection} "简化字" SecLang_ZHCN 650 SetOutPath "$INSTDIR\translations" 651 File /r "smplayer-build\translations\smplayer_zh_CN.qm" 652 ${MementoSectionEnd} 653 654 ${MementoSection} "漢語(繁體)" SecLang_ZHTW 655 SetOutPath "$INSTDIR\translations" 656 File /r "smplayer-build\translations\smplayer_zh_TW.qm" 657 ${MementoSectionEnd} 658 659 SectionGroupEnd 473 ${MementoSection} $(Section_Translations) SecTranslations 474 475 SetOutPath "$INSTDIR\translations" 476 File /r "smplayer-build\translations\*.*" 477 478 ${MementoSectionEnd} 660 479 661 480 ;-------------------------------- … … 776 595 Delete "$DESKTOP\SMPlayer.lnk" 777 596 Delete "$SMPROGRAMS\$SMPlayer_StartMenuFolder\SMPlayer.lnk" 597 Delete "$SMPROGRAMS\$SMPlayer_StartMenuFolder\SMTube.lnk" 778 598 Delete "$SMPROGRAMS\$SMPlayer_StartMenuFolder\SMPlayer on the Web.url" 779 599 Delete "$SMPROGRAMS\$SMPlayer_StartMenuFolder\Uninstall SMPlayer.lnk" … … 795 615 Delete "$INSTDIR\libgcc_s_dw2-1.dll" 796 616 Delete "$INSTDIR\mingwm10.dll" 617 Delete "$INSTDIR\zlib1.dll" 797 618 Delete "$INSTDIR\Q*.dll" 798 619 Delete "$INSTDIR\smplayer.exe" 620 Delete "$INSTDIR\smtube.exe" 799 621 Delete "$INSTDIR\dxlist.exe" 800 622 … … 814 636 815 637 ;-------------------------------- 816 ;Installer functions 817 818 Function .onInit 819 820 !ifdef PRE_RELEASE 821 MessageBox MB_OK|MB_ICONINFORMATION "This is a pre-release version of SMPlayer. Please report all issues." 822 !endif 823 824 ;Check if setup is already running 825 System::Call 'kernel32::CreateMutexW(i 0, i 0, t "SMPlayerSetup") i .r1 ?e' 826 Pop $R0 827 828 StrCmp $R0 0 +3 829 MessageBox MB_OK|MB_ICONEXCLAMATION $(Installer_Is_Running) 830 Abort 831 832 ;Check for admin on older OSes 833 Call CheckUserRights 834 835 ${If} $Is_Admin == 0 836 MessageBox MB_OK|MB_ICONSTOP $(Installer_No_Admin) 837 Abort 838 ${EndIf} 839 840 Call LoadPreviousSettings 841 842 ;Setup language selection 843 !insertmacro MUI_LANGDLL_DISPLAY 844 845 Call CheckPreviousVersion 846 847 SetShellVarContext all 848 849 FunctionEnd 850 851 Function .onInstSuccess 852 853 ${MementoSectionSave} 854 855 FunctionEnd 856 857 Function .onInstFailed 858 859 SetDetailsPrint textonly 860 DetailPrint "Rolling back changes..." 861 SetDetailsPrint listonly 862 863 !insertmacro MacroRemoveSMPlayer 864 865 Delete "$INSTDIR\${SMPLAYER_UNINST_EXE}" 866 RMDir "$INSTDIR" 867 868 FunctionEnd 869 870 Function CheckPreviousVersion 871 872 ReadRegStr $Previous_Version HKLM "${SMPLAYER_REG_KEY}" "Version" 873 ReadRegStr $SMPlayer_Path HKLM "${SMPLAYER_REG_KEY}" "Path" 874 875 /* $Previous_Version_State Assignments: 876 $Previous_Version_State=0 This installer is the same version as the installed copy 877 $Previous_Version_State=1 A newer version than this installer is already installed 878 $Previous_Version_State=2 An older version than this installer is already installed */ 879 ${VersionCompare} $Previous_Version ${SMPLAYER_VERSION} $Previous_Version_State 880 881 ${If} $Previous_Version_State == 0 882 StrCpy $Inst_Type $(Type_Reinstall) 883 ${ElseIf} $Previous_Version_State == 1 884 StrCpy $Inst_Type $(Type_Downgrade) 885 ${ElseIf} $Previous_Version_State == 2 886 StrCpy $Inst_Type $(Type_Upgrade) 887 ${EndIf} 888 889 FunctionEnd 890 891 Function CheckUserRights 638 ;Shared functions 639 640 !macro CheckUserRightsMacro UN 641 Function ${UN}CheckUserRights 892 642 893 643 ClearErrors … … 912 662 913 663 FunctionEnd 664 !macroend 665 !insertmacro CheckUserRightsMacro "" 666 !insertmacro CheckUserRightsMacro "un." 667 668 !macro RunCheckMacro UN 669 Function ${UN}RunCheck 670 671 retry_runcheck: 672 FindProcDLL::FindProc "smplayer.exe" 673 IntCmp $R0 1 0 +3 674 MessageBox MB_RETRYCANCEL|MB_ICONEXCLAMATION $(SMPlayer_Is_Running) /SD IDCANCEL IDRETRY retry_runcheck 675 Abort 676 677 FunctionEnd 678 !macroend 679 !insertmacro RunCheckMacro "" 680 !insertmacro RunCheckMacro "un." 681 682 ;-------------------------------- 683 ;Installer functions 684 685 Function .onInit 686 687 !ifdef PRE_RELEASE 688 MessageBox MB_OK|MB_ICONINFORMATION "This is a pre-release version of SMPlayer. Please report all issues." 689 !endif 690 691 ;Check if setup is already running 692 System::Call 'kernel32::CreateMutexW(i 0, i 0, t "SMPlayerSetup") i .r1 ?e' 693 Pop $R0 694 695 StrCmp $R0 0 +3 696 MessageBox MB_OK|MB_ICONEXCLAMATION $(Installer_Is_Running) 697 Abort 698 699 ;Check if SMPlayer is running 700 Call RunCheck 701 702 ;Check for admin on older OSes 703 Call CheckUserRights 704 705 ${If} $Is_Admin == 0 706 MessageBox MB_OK|MB_ICONSTOP $(Installer_No_Admin) 707 Abort 708 ${EndIf} 709 710 Call LoadPreviousSettings 711 712 ;Setup language selection 713 !insertmacro MUI_LANGDLL_DISPLAY 714 715 Call CheckPreviousVersion 716 717 SetShellVarContext all 718 719 FunctionEnd 720 721 Function .onInstSuccess 722 723 ${MementoSectionSave} 724 725 FunctionEnd 726 727 Function .onInstFailed 728 729 SetDetailsPrint textonly 730 DetailPrint $(Info_RollBack) 731 SetDetailsPrint listonly 732 733 !insertmacro MacroRemoveSMPlayer 734 735 Delete "$INSTDIR\${SMPLAYER_UNINST_EXE}" 736 RMDir "$INSTDIR" 737 738 FunctionEnd 739 740 Function CheckPreviousVersion 741 742 ClearErrors 743 ReadRegStr $Previous_Version HKLM "${SMPLAYER_REG_KEY}" "Version" 744 ReadRegStr $SMPlayer_Path HKLM "${SMPLAYER_REG_KEY}" "Path" 745 746 ${IfNot} ${Errors} 747 StrCpy $Reinstall_Uninstall 1 748 ${EndIf} 749 750 /* $Previous_Version_State Assignments: 751 $Previous_Version_State=0 This installer is the same version as the installed copy 752 $Previous_Version_State=1 A newer version than this installer is already installed 753 $Previous_Version_State=2 An older version than this installer is already installed */ 754 ${VersionCompare} $Previous_Version ${SMPLAYER_VERSION} $Previous_Version_State 755 756 ${If} $Previous_Version_State == 0 757 StrCpy $Inst_Type $(Type_Reinstall) 758 ${ElseIf} $Previous_Version_State == 1 759 StrCpy $Inst_Type $(Type_Downgrade) 760 ${ElseIf} $Previous_Version_State == 2 761 StrCpy $Inst_Type $(Type_Upgrade) 762 ${EndIf} 763 764 FunctionEnd 914 765 915 766 Function GetVerInfo … … 917 768 IfFileExists "$PLUGINSDIR\version-info" end_dl_ver_info 0 918 769 DetailPrint $(VerInfo_DL_Msg) 919 inetc::get / timeout 30000 /resume "" /silent ${VERSION_FILE_URL} "$PLUGINSDIR\version-info" /end770 inetc::get /CONNECTTIMEOUT 15000 /SILENT ${VERSION_FILE_URL} "$PLUGINSDIR\version-info" /END 920 771 Pop $R0 921 772 StrCmp $R0 OK +2 … … 943 794 Function PageReinstall 944 795 945 ${If} $Previous_Version == "" 946 ${OrIf} $SMPlayer_Path == "" 796 ${If} $Reinstall_Uninstall != 1 947 797 Abort 948 798 ${EndIf} … … 985 835 986 836 Call PageReinstallUpdate 987 988 StrCpy $Reinstall_Uninstall 1989 837 990 838 nsDialogs::Show … … 1128 976 ${EndIf} 1129 977 978 ;Check if SMPlayer is running 979 Call un.RunCheck 980 1130 981 ;Gets start menu folder name 1131 982 !insertmacro MUI_STARTMENU_GETFOLDER "SMP_SMenu" $SMPlayer_StartMenuFolder … … 1133 984 ;Get the stored language preference 1134 985 !insertmacro MUI_UNGETLANGUAGE 1135 1136 FunctionEnd1137 1138 Function un.CheckUserRights1139 1140 ClearErrors1141 UserInfo::GetName1142 ${If} ${Errors}1143 StrCpy $Is_Admin 11144 Return1145 ${EndIf}1146 1147 Pop $UserName1148 UserInfo::GetAccountType1149 Pop $R01150 ${Switch} $R01151 ${Case} "Admin"1152 ${Case} "Power"1153 StrCpy $Is_Admin 11154 ${Break}1155 ${Default}1156 StrCpy $Is_Admin 01157 ${Break}1158 ${EndSwitch}1159 986 1160 987 FunctionEnd
Note:
See TracChangeset
for help on using the changeset viewer.