Changeset 142 for smplayer/trunk/setup/smplayer.nsi
- Timestamp:
- May 27, 2013, 3:28:05 PM (12 years ago)
- Location:
- smplayer/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
smplayer/trunk
- Property svn:mergeinfo changed
/smplayer/vendor/current merged: 140
- Property svn:mergeinfo changed
-
smplayer/trunk/setup/smplayer.nsi
r139 r142 43 43 !define SMPLAYER_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\SMPlayer" 44 44 45 ;Fallback versions 46 ;These can be changed in the compiler, otherwise 47 ;if not defined the values shown here will be used. 48 !ifndef DEFAULT_CODECS_VERSION 49 !define DEFAULT_CODECS_VERSION "windows-essential-20071007" 50 !endif 51 52 ;Version control 53 !ifndef VERSION_FILE_URL 54 !define VERSION_FILE_URL "http://smplayer.sourceforge.net/mplayer-version-info" 55 !endif 45 !define CODEC_VERSION "windows-essential-20071007" 56 46 57 47 ;-------------------------------- … … 110 100 Var Reinstall_UninstallButton 111 101 Var Reinstall_UninstallButton_State 102 Var Restore_Codecs 112 103 Var SMPlayer_Path 113 104 Var SMPlayer_UnStrPath … … 233 224 !insertmacro MUI_LANGUAGE "Slovenian" 234 225 !insertmacro MUI_LANGUAGE "Spanish" 226 !insertmacro MUI_LANGUAGE "Thai" 235 227 !insertmacro MUI_LANGUAGE "TradChinese" 236 228 … … 260 252 !insertmacro LANGFILE_INCLUDE "translations\slovenian.nsh" 261 253 !insertmacro LANGFILE_INCLUDE "translations\spanish.nsh" 254 !insertmacro LANGFILE_INCLUDE "translations\thai.nsh" 262 255 !insertmacro LANGFILE_INCLUDE "translations\tradchinese.nsh" 263 256 … … 271 264 !insertmacro MUI_RESERVEFILE_LANGDLL 272 265 ReserveFile "${NSISDIR}\Plugins\UserInfo.dll" 273 ReserveFile "FindProcDLL.dll"274 266 275 267 ;-------------------------------- … … 288 280 Quit 289 281 ${ElseIf} $Reinstall_OverwriteButton_State == 1 282 283 Call Backup_Codecs 284 290 285 ${If} "$INSTDIR" == "$SMPlayer_Path" 291 286 ExecWait '"$SMPlayer_UnStrPath" /S /R _?=$SMPlayer_Path' … … 293 288 ExecWait '"$SMPlayer_UnStrPath" /S /R' 294 289 ${EndIf} 290 291 Sleep 2500 292 295 293 ${EndIf} 296 294 … … 363 361 364 362 SetOutPath "$INSTDIR\mplayer" 365 File /r "${SMPLAYER_BUILD_DIR}\mplayer\*.*"363 File /r /x mencoder.exe "${SMPLAYER_BUILD_DIR}\mplayer\*.*" 366 364 367 365 WriteRegDWORD HKLM "${SMPLAYER_REG_KEY}" Installed_MPlayer 0x1 … … 371 369 Section /o $(Section_MPlayerCodecs) SecCodecs 372 370 373 AddSize 22300 374 375 Var /GLOBAL Codec_Version 376 377 Call GetVerInfo 378 379 /* Read from version-info 380 If it was unable to download, set version to that defined in the 381 beginning of the script. */ 382 ${If} ${FileExists} "$PLUGINSDIR\version-info" 383 ReadINIStr $Codec_Version "$PLUGINSDIR\version-info" smplayer mplayercodecs 384 ${Else} 385 StrCpy $Codec_Version ${DEFAULT_CODECS_VERSION} 371 AddSize 22931 372 373 ${If} $Restore_Codecs == 1 374 DetailPrint $(Info_Codecs_Restore) 375 CopyFiles /SILENT "$PLUGINSDIR\codecbak\*" "$INSTDIR\mplayer\codecs" 376 Goto check_codecs 377 ${ElseIf} ${FileExists} "$EXEDIR\${CODEC_VERSION}.zip" 378 CopyFiles /SILENT "$EXEDIR\${CODEC_VERSION}.zip" "$PLUGINSDIR" 379 Goto extract_codecs 386 380 ${EndIf} 387 381 388 retry_codecs :382 retry_codecs_dl: 389 383 390 384 DetailPrint $(Codecs_DL_Msg) 385 !ifndef USE_NSISDL 391 386 inetc::get /CONNECTTIMEOUT 15000 /RESUME "" /BANNER $(Codecs_DL_Msg) /CAPTION $(Codecs_DL_Msg) \ 392 "http://www.mplayerhq.hu/MPlayer/releases/codecs/$ Codec_Version.zip" \393 "$PLUGINSDIR\$ Codec_Version.zip" /END387 "http://www.mplayerhq.hu/MPlayer/releases/codecs/${CODEC_VERSION}.zip" \ 388 "$PLUGINSDIR\${CODEC_VERSION}.zip" /END 394 389 Pop $R0 395 StrCmp $R0 OK 0 check_codecs 390 StrCmp $R0 OK +4 0 391 !else 392 NSISdl::download /TIMEOUT=15000 \ 393 "http://www.mplayerhq.hu/MPlayer/releases/codecs/${CODEC_VERSION}.zip" \ 394 "$PLUGINSDIR\${CODEC_VERSION}.zip" /END 395 Pop $R0 396 StrCmp $R0 "success" +4 0 397 !endif 398 DetailPrint $(Codecs_DL_Failed) 399 MessageBox MB_RETRYCANCEL|MB_ICONEXCLAMATION $(Codecs_DL_Retry) /SD IDCANCEL IDRETRY retry_codecs_dl 400 Goto check_codecs 401 402 extract_codecs: 396 403 397 404 DetailPrint $(Info_Files_Extract) 398 nsExec::Exec '"$PLUGINSDIR\7za.exe" x "$PLUGINSDIR\$ Codec_Version.zip" -y -o"$PLUGINSDIR"'405 nsExec::Exec '"$PLUGINSDIR\7za.exe" x "$PLUGINSDIR\${CODEC_VERSION}.zip" -y -o"$PLUGINSDIR"' 399 406 400 407 CreateDirectory "$INSTDIR\mplayer\codecs" 401 CopyFiles /SILENT "$PLUGINSDIR\$ Codec_Version\*" "$INSTDIR\mplayer\codecs"408 CopyFiles /SILENT "$PLUGINSDIR\${CODEC_VERSION}\*" "$INSTDIR\mplayer\codecs" 402 409 403 410 check_codecs: 404 411 405 ${If} $R0 != "OK" 406 DetailPrint $(Codecs_DL_Failed) 407 ${EndIf} 408 409 IfFileExists "$INSTDIR\mplayer\codecs\*.dll" codecsInstSuccess codecsInstFailed 410 codecsInstSuccess: 412 IfFileExists "$INSTDIR\mplayer\codecs\*.dll" 0 codecsInstFailed 411 413 WriteRegDWORD HKLM "${SMPLAYER_REG_KEY}" Installed_Codecs 0x1 412 414 Goto done 413 415 codecsInstFailed: 414 MessageBox MB_RETRYCANCEL|MB_ICONEXCLAMATION $(Codecs_DL_Retry) /SD IDCANCEL IDRETRY retry_codecs415 416 DetailPrint $(Codecs_Inst_Failed) 416 417 WriteRegDWORD HKLM "${SMPLAYER_REG_KEY}" Installed_Codecs 0x0 … … 498 499 !macro MacroAllExtensions _action 499 500 !insertmacro ${_action} ".3gp" 501 !insertmacro ${_action} ".aac" 500 502 !insertmacro ${_action} ".ac3" 501 503 !insertmacro ${_action} ".ape" 502 504 !insertmacro ${_action} ".asf" 503 505 !insertmacro ${_action} ".avi" 506 !insertmacro ${_action} ".bik" 504 507 !insertmacro ${_action} ".bin" 505 508 !insertmacro ${_action} ".dat" 506 509 !insertmacro ${_action} ".divx" 510 !insertmacro ${_action} ".dts" 507 511 !insertmacro ${_action} ".dv" 508 512 !insertmacro ${_action} ".dvr-ms" … … 515 519 !insertmacro ${_action} ".m2t" 516 520 !insertmacro ${_action} ".m2ts" 521 !insertmacro ${_action} ".mts" 517 522 !insertmacro ${_action} ".m2v" 518 523 !insertmacro ${_action} ".m3u" … … 541 546 !insertmacro ${_action} ".rm" 542 547 !insertmacro ${_action} ".rmvb" 548 !insertmacro ${_action} ".smk" 543 549 !insertmacro ${_action} ".swf" 544 550 !insertmacro ${_action} ".thd" … … 591 597 Delete "$INSTDIR\zlib1.dll" 592 598 Delete "$INSTDIR\Qt*.dll" 599 Delete "$INSTDIR\sample.avi" 593 600 Delete "$INSTDIR\smplayer.exe" 594 601 Delete "$INSTDIR\smtube.exe" … … 613 620 ;Shared functions 614 621 622 !ifdef USE_RUNCHECK 615 623 !macro RunCheckMacro UN 616 624 Function ${UN}RunCheck 617 625 618 retry_runcheck: 619 FindProcDLL::FindProc "smplayer.exe" 620 IntCmp $R0 1 0 +3 621 MessageBox MB_RETRYCANCEL|MB_ICONEXCLAMATION $(SMPlayer_Is_Running) /SD IDCANCEL IDRETRY retry_runcheck 622 Abort 626 retry_runcheck: 627 FindWindow $0 "QWidget" "SMPlayer" 628 StrCmp $0 0 notRunning 629 MessageBox MB_RETRYCANCEL|MB_ICONEXCLAMATION $(SMPlayer_Is_Running) /SD IDCANCEL IDRETRY retry_runcheck 630 Abort 631 notrunning: 623 632 624 633 FunctionEnd … … 626 635 !insertmacro RunCheckMacro "" 627 636 !insertmacro RunCheckMacro "un." 637 !endif 628 638 629 639 ;-------------------------------- … … 632 642 Function .onInit 633 643 644 /* 634 645 ${Unless} ${AtLeastWinXP} 635 646 MessageBox MB_YESNO|MB_ICONSTOP $(OS_Not_Supported) /SD IDNO IDYES installonoldwindows … … 637 648 installonoldwindows: 638 649 ${EndIf} 650 */ 639 651 640 652 !ifdef WIN64 … … 675 687 Abort 676 688 689 !ifdef USE_RUNCHECK 677 690 ;Check if SMPlayer is running 678 691 ;Allow skipping check using /NORUNCHECK … … 681 694 IfErrors 0 +2 682 695 Call RunCheck 696 !endif 683 697 684 698 ;Check for admin on < Vista … … 705 719 ${MementoSectionSave} 706 720 721 ExecShell "open" "http://smplayer.sourceforge.net/thank-you.php?version=${SMPLAYER_VERSION}" 722 707 723 FunctionEnd 708 724 … … 717 733 Delete "$INSTDIR\${SMPLAYER_UNINST_EXE}" 718 734 RMDir "$INSTDIR" 735 736 FunctionEnd 737 738 Function un.onUninstSuccess 739 740 ;Don't launch uninstall page if reinstalling 741 ${un.GetParameters} $R0 742 ${un.GetOptionsS} $R0 "/R" $R1 743 744 IfErrors 0 +2 745 ExecShell "open" "http://smplayer.sourceforge.net/uninstall.php?version=${SMPLAYER_VERSION}" 719 746 720 747 FunctionEnd … … 747 774 FunctionEnd 748 775 749 Function GetVerInfo 750 751 IfFileExists "$PLUGINSDIR\version-info" end_dl_ver_info 0 752 DetailPrint $(VerInfo_DL_Msg) 753 inetc::get /CONNECTTIMEOUT 15000 /SILENT ${VERSION_FILE_URL} "$PLUGINSDIR\version-info" /END 754 Pop $R0 755 StrCmp $R0 OK +2 756 DetailPrint $(VerInfo_DL_Failed) 757 758 end_dl_ver_info: 776 Function Backup_Codecs 777 778 ${IfNot} ${SectionIsSelected} ${SecCodecs} 779 Return 780 ${EndIf} 781 782 IfFileExists "$SMPlayer_Path\mplayer\codecs\*.dll" 0 NoBackup 783 DetailPrint $(Info_Codecs_Backup) 784 CreateDirectory "$PLUGINSDIR\codecbak" 785 CopyFiles /SILENT "$SMPlayer_Path\mplayer\codecs\*" "$PLUGINSDIR\codecbak" 786 StrCpy $Restore_Codecs 1 787 Return 788 NoBackup: 789 StrCpy $Restore_Codecs 0 759 790 760 791 FunctionEnd … … 969 1000 ${EndIf} 970 1001 1002 !ifdef USE_RUNCHECK 971 1003 ;Check if SMPlayer is running 972 1004 ;Allow skipping check using /NORUNCHECK … … 975 1007 IfErrors 0 +2 976 1008 Call un.RunCheck 1009 !endif 977 1010 978 1011 ;Gets start menu folder name
Note:
See TracChangeset
for help on using the changeset viewer.