Ignore:
Timestamp:
May 27, 2013, 3:28:05 PM (12 years ago)
Author:
Silvan Scherrer
Message:

SMPlayer: update trunk to 0.8.5

Location:
smplayer/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • smplayer/trunk

  • smplayer/trunk/setup/smplayer.nsi

    r139 r142  
    4343  !define SMPLAYER_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\SMPlayer"
    4444
    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"
    5646
    5747;--------------------------------
     
    110100  Var Reinstall_UninstallButton
    111101  Var Reinstall_UninstallButton_State
     102  Var Restore_Codecs
    112103  Var SMPlayer_Path
    113104  Var SMPlayer_UnStrPath
     
    233224  !insertmacro MUI_LANGUAGE "Slovenian"
    234225  !insertmacro MUI_LANGUAGE "Spanish"
     226  !insertmacro MUI_LANGUAGE "Thai"
    235227  !insertmacro MUI_LANGUAGE "TradChinese"
    236228
     
    260252  !insertmacro LANGFILE_INCLUDE "translations\slovenian.nsh"
    261253  !insertmacro LANGFILE_INCLUDE "translations\spanish.nsh"
     254  !insertmacro LANGFILE_INCLUDE "translations\thai.nsh"
    262255  !insertmacro LANGFILE_INCLUDE "translations\tradchinese.nsh"
    263256
     
    271264  !insertmacro MUI_RESERVEFILE_LANGDLL
    272265  ReserveFile "${NSISDIR}\Plugins\UserInfo.dll"
    273   ReserveFile "FindProcDLL.dll"
    274266
    275267;--------------------------------
     
    288280      Quit
    289281    ${ElseIf} $Reinstall_OverwriteButton_State == 1
     282
     283      Call Backup_Codecs
     284
    290285      ${If} "$INSTDIR" == "$SMPlayer_Path"
    291286        ExecWait '"$SMPlayer_UnStrPath" /S /R _?=$SMPlayer_Path'
     
    293288        ExecWait '"$SMPlayer_UnStrPath" /S /R'
    294289      ${EndIf}
     290
     291      Sleep 2500
     292
    295293    ${EndIf}
    296294
     
    363361
    364362    SetOutPath "$INSTDIR\mplayer"
    365     File /r "${SMPLAYER_BUILD_DIR}\mplayer\*.*"
     363    File /r /x mencoder.exe "${SMPLAYER_BUILD_DIR}\mplayer\*.*"
    366364
    367365    WriteRegDWORD HKLM "${SMPLAYER_REG_KEY}" Installed_MPlayer 0x1
     
    371369  Section /o $(Section_MPlayerCodecs) SecCodecs
    372370
    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
    386380    ${EndIf}
    387381
    388     retry_codecs:
     382    retry_codecs_dl:
    389383
    390384    DetailPrint $(Codecs_DL_Msg)
     385!ifndef USE_NSISDL
    391386    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" /END
     387    "http://www.mplayerhq.hu/MPlayer/releases/codecs/${CODEC_VERSION}.zip" \
     388    "$PLUGINSDIR\${CODEC_VERSION}.zip" /END
    394389    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:
    396403
    397404    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"'
    399406
    400407    CreateDirectory "$INSTDIR\mplayer\codecs"
    401     CopyFiles /SILENT "$PLUGINSDIR\$Codec_Version\*" "$INSTDIR\mplayer\codecs"
     408    CopyFiles /SILENT "$PLUGINSDIR\${CODEC_VERSION}\*" "$INSTDIR\mplayer\codecs"
    402409
    403410    check_codecs:
    404411
    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
    411413        WriteRegDWORD HKLM "${SMPLAYER_REG_KEY}" Installed_Codecs 0x1
    412414        Goto done
    413415      codecsInstFailed:
    414         MessageBox MB_RETRYCANCEL|MB_ICONEXCLAMATION $(Codecs_DL_Retry) /SD IDCANCEL IDRETRY retry_codecs
    415416        DetailPrint $(Codecs_Inst_Failed)
    416417        WriteRegDWORD HKLM "${SMPLAYER_REG_KEY}" Installed_Codecs 0x0
     
    498499!macro MacroAllExtensions _action
    499500  !insertmacro ${_action} ".3gp"
     501  !insertmacro ${_action} ".aac"
    500502  !insertmacro ${_action} ".ac3"
    501503  !insertmacro ${_action} ".ape"
    502504  !insertmacro ${_action} ".asf"
    503505  !insertmacro ${_action} ".avi"
     506  !insertmacro ${_action} ".bik"
    504507  !insertmacro ${_action} ".bin"
    505508  !insertmacro ${_action} ".dat"
    506509  !insertmacro ${_action} ".divx"
     510  !insertmacro ${_action} ".dts"
    507511  !insertmacro ${_action} ".dv"
    508512  !insertmacro ${_action} ".dvr-ms"
     
    515519  !insertmacro ${_action} ".m2t"
    516520  !insertmacro ${_action} ".m2ts"
     521  !insertmacro ${_action} ".mts"
    517522  !insertmacro ${_action} ".m2v"
    518523  !insertmacro ${_action} ".m3u"
     
    541546  !insertmacro ${_action} ".rm"
    542547  !insertmacro ${_action} ".rmvb"
     548  !insertmacro ${_action} ".smk"
    543549  !insertmacro ${_action} ".swf"
    544550  !insertmacro ${_action} ".thd"
     
    591597  Delete "$INSTDIR\zlib1.dll"
    592598  Delete "$INSTDIR\Qt*.dll"
     599  Delete "$INSTDIR\sample.avi"
    593600  Delete "$INSTDIR\smplayer.exe"
    594601  Delete "$INSTDIR\smtube.exe"
     
    613620;Shared functions
    614621
     622!ifdef USE_RUNCHECK
    615623!macro RunCheckMacro UN
    616624Function ${UN}RunCheck
    617625
    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:
    623632
    624633FunctionEnd
     
    626635!insertmacro RunCheckMacro ""
    627636!insertmacro RunCheckMacro "un."
     637!endif
    628638
    629639;--------------------------------
     
    632642Function .onInit
    633643
     644/*
    634645  ${Unless} ${AtLeastWinXP}
    635646    MessageBox MB_YESNO|MB_ICONSTOP $(OS_Not_Supported) /SD IDNO IDYES installonoldwindows
     
    637648  installonoldwindows:
    638649  ${EndIf}
     650*/
    639651
    640652!ifdef WIN64
     
    675687    Abort
    676688
     689!ifdef USE_RUNCHECK
    677690  ;Check if SMPlayer is running
    678691  ;Allow skipping check using /NORUNCHECK
     
    681694  IfErrors 0 +2
    682695    Call RunCheck
     696!endif
    683697
    684698  ;Check for admin on < Vista
     
    705719  ${MementoSectionSave}
    706720
     721  ExecShell "open" "http://smplayer.sourceforge.net/thank-you.php?version=${SMPLAYER_VERSION}"
     722
    707723FunctionEnd
    708724
     
    717733  Delete "$INSTDIR\${SMPLAYER_UNINST_EXE}"
    718734  RMDir "$INSTDIR"
     735
     736FunctionEnd
     737
     738Function 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}"
    719746
    720747FunctionEnd
     
    747774FunctionEnd
    748775
    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:
     776Function 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
    759790
    760791FunctionEnd
     
    9691000  ${EndIf}
    9701001
     1002!ifdef USE_RUNCHECK
    9711003  ;Check if SMPlayer is running
    9721004  ;Allow skipping check using /NORUNCHECK
     
    9751007  IfErrors 0 +2
    9761008    Call un.RunCheck
     1009!endif
    9771010
    9781011  ;Gets start menu folder name
Note: See TracChangeset for help on using the changeset viewer.