Changeset 179 for smplayer/vendor/current/setup/smplayer.nsi
- Timestamp:
- Aug 31, 2016, 5:19:25 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
smplayer/vendor/current/setup/smplayer.nsi
r175 r179 1 ;Installer script for win32/win64 SMPlayer1 ;Installer script for win32/win64 SMPlayer 2 2 ;Written by redxii (redxii@users.sourceforge.net) 3 ;Tested/Developed with Unicode NSIS 2.46.5 3 ;Tested/Developed with Unicode NSIS 2.46.5/3.0rc1 4 4 5 5 !ifndef VER_MAJOR | VER_MINOR | VER_BUILD 6 6 !error "Version information not defined (or incomplete). You must define: VER_MAJOR, VER_MINOR, VER_BUILD." 7 !endif 8 9 ;Use this to make 3.0+ mandatory 10 ;!if 0x2999999 >= "${NSIS_PACKEDVERSION}" 11 ;!error "NSIS 3.0 or higher required" 12 ;!endif 13 14 !if ${NSIS_PACKEDVERSION} > 0x2999999 15 Unicode true 7 16 !endif 8 17 … … 43 52 !define SMPLAYER_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\SMPlayer" 44 53 54 ; Not the same as Qt, check file properties of the webkit dll if unsure 55 !ifndef QT_WEBKIT_VERSION 56 !define QT_WEBKIT_VERSION "5.6.1.0" 57 !endif 58 59 !define STATUS_DLL_NOT_FOUND "-1073741515" 60 45 61 ;-------------------------------- 46 62 ;General … … 50 66 BrandingText "SMPlayer for Windows v${SMPLAYER_VERSION}" 51 67 !ifdef WIN64 52 !ifdef QT553 OutFile "output\Qt5\smplayer-${SMPLAYER_VERSION}-x64-qt5.exe"54 !else55 68 OutFile "output\smplayer-${SMPLAYER_VERSION}-x64.exe" 56 !endif57 69 !else 58 !ifdef QT559 OutFile "output\Qt5\smplayer-${SMPLAYER_VERSION}-win32-qt5.exe"60 !else61 70 OutFile "output\smplayer-${SMPLAYER_VERSION}-win32.exe" 62 !endif63 71 !endif 64 72 … … 116 124 Var SMPlayer_UnStrPath 117 125 Var SMPlayer_StartMenuFolder 126 127 Var Qt_Core_Source_Version 128 Var Qt_Core_Installed_Version 129 Var Qt_WebKit_Installed_Version 130 131 Var YTDL_Exit_Code 118 132 119 133 ;-------------------------------- … … 305 319 306 320 !insertmacro MUI_RESERVEFILE_LANGDLL 307 ReserveFile "${NSISDIR}\Plugins\UserInfo.dll" 321 !if ! ${NSIS_PACKEDVERSION} > 0x2999999 322 ReserveFile /nonfatal "${NSISDIR}\Plugins\UserInfo.dll" 323 !else 324 ReserveFile /nonfatal "${NSISDIR}\Plugins\x86-unicode\UserInfo.dll" 325 !endif 308 326 309 327 ;-------------------------------- … … 350 368 ;Qt imageformats 351 369 SetOutPath "$INSTDIR\imageformats" 352 File / r "${SMPLAYER_BUILD_DIR}\imageformats\*.*"370 File /nonfatal /r "${SMPLAYER_BUILD_DIR}\imageformats\*.*" 353 371 354 372 ;Open fonts … … 357 375 358 376 ;Qt platforms (Qt 5+) 359 !ifdef QT5360 377 SetOutPath "$INSTDIR\platforms" 361 File /r "${SMPLAYER_BUILD_DIR}\platforms\*.*" 362 !endif 378 File /nonfatal /r "${SMPLAYER_BUILD_DIR}\platforms\*.*" 363 379 364 380 ;SMPlayer key shortcuts … … 427 443 CopyFiles /SILENT "$PLUGINSDIR\youtube-dl.exe" "$INSTDIR\mpv" 428 444 429 DetailPrint $(YTDL_Update_Check)445 ;DetailPrint $(YTDL_Update_Check) 430 446 NsExec::ExecToLog '"$INSTDIR\mpv\youtube-dl.exe" -U' 431 447 432 Goto skip_ytdl448 Goto check_ytdl 433 449 434 450 YTDL: 435 NSISdl::download /TIMEOUT=30000 \ 436 "http://yt-dl.org/latest/youtube-dl.exe" \ 437 "$INSTDIR\mpv\youtube-dl.exe" /END 451 INetC::get /CONNECTTIMEOUT 30000 /POPUP "" "http://yt-dl.org/latest/youtube-dl.exe" "$INSTDIR\mpv\youtube-dl.exe" /END 438 452 Pop $R0 439 StrCmp $R0 " success" +3 0453 StrCmp $R0 "OK" +3 0 440 454 DetailPrint $(YTDL_DL_Failed) 441 MessageBox MB_RETRYCANCEL|MB_ICONEXCLAMATION $(YTDL_DL_Retry) /SD IDCANCEL IDRETRY YTDL 455 MessageBox MB_RETRYCANCEL|MB_ICONEXCLAMATION $(YTDL_DL_Retry) /SD IDCANCEL IDRETRY YTDL IDCANCEL skip_ytdl 456 457 check_ytdl: 458 NsExec::Exec '"$INSTDIR\mpv\youtube-dl.exe" --version' 459 Pop $YTDL_Exit_Code 460 461 ${If} $YTDL_Exit_Code != "0" 462 DetailPrint $(YTDL_Error_Msg1) 463 ${If} $YTDL_Exit_Code == "${STATUS_DLL_NOT_FOUND}" 464 DetailPrint $(YTDL_Error_Msg2) 465 ${EndIf} 466 467 Sleep 5000 468 ${EndIf} 442 469 443 470 skip_ytdl: … … 474 501 CopyFiles /SILENT "$PLUGINSDIR\smtubebak\docs\smtube\*" "$INSTDIR\docs\smtube" 475 502 CopyFiles /SILENT "$PLUGINSDIR\smtubebak\translations\*" "$INSTDIR\translations" 476 !ifdef QT5 503 CopyFiles /SILENT "$PLUGINSDIR\smtubebak\icuin*.dll" "$INSTDIR" 504 CopyFiles /SILENT "$PLUGINSDIR\smtubebak\icuuc*.dll" "$INSTDIR" 505 CopyFiles /SILENT "$PLUGINSDIR\smtubebak\icudt*.dll" "$INSTDIR" 477 506 CopyFiles /SILENT "$PLUGINSDIR\smtubebak\Qt5WebKit.dll" "$INSTDIR" 478 507 CopyFiles /SILENT "$PLUGINSDIR\smtubebak\Qt5Sql.dll" "$INSTDIR" … … 487 516 CopyFiles /SILENT "$PLUGINSDIR\smtubebak\Qt5PrintSupport.dll" "$INSTDIR" 488 517 CopyFiles /SILENT "$PLUGINSDIR\smtubebak\Qt5MultimediaWidgets.dll" "$INSTDIR" 489 !else490 CopyFiles /SILENT "$PLUGINSDIR\smtubebak\QtWebKit4.dll" "$INSTDIR"491 !endif492 518 ${EndIf} 493 519 … … 554 580 Sleep 2500 555 581 556 ;SetAutoClose false 582 !ifdef VER_REVISION 583 SetAutoClose false 584 !endif 557 585 558 586 SectionEnd … … 692 720 Delete "$INSTDIR\smtube.exe" 693 721 Delete "$INSTDIR\dxlist.exe" 694 Delete "$INSTDIR\icudt 5*.dll"695 Delete "$INSTDIR\icuin 5*.dll"696 Delete "$INSTDIR\icuuc 5*.dll"722 Delete "$INSTDIR\icudt*.dll" 723 Delete "$INSTDIR\icuin*.dll" 724 Delete "$INSTDIR\icuuc*.dll" 697 725 Delete "$INSTDIR\libgcc_s_*.dll" 698 726 Delete "$INSTDIR\libstdc++-6.dll" … … 747 775 !ifdef WIN64 748 776 ${Unless} ${AtLeastWinVista} 777 MessageBox MB_YESNO|MB_ICONSTOP $(OS_Not_Supported_VistaRequired) /SD IDNO IDYES installonoldwindows 749 778 !else 750 779 ${Unless} ${AtLeastWinXP} 751 !endif752 780 MessageBox MB_YESNO|MB_ICONSTOP $(OS_Not_Supported) /SD IDNO IDYES installonoldwindows 781 !endif 753 782 Abort 754 783 installonoldwindows: … … 867 896 StrCpy $Reinstall_OverwriteButton_State 1 868 897 ${EndIf} 898 899 Call RetrieveQtVersions 869 900 ${EndIf} 870 901 … … 923 954 924 955 IfFileExists "$SMPlayer_Path\smtube.exe" 0 NoBackup 925 !ifdef QT5 926 IfFileExists "$SMPlayer_Path\Qt5WebKit.dll" 0 NoBackup 927 !else 928 IfFileExists "$SMPlayer_Path\QtWebKit4.dll" 0 NoBackup 929 !endif 930 DetailPrint $(Info_SMTube_Backup) 931 CreateDirectory "$PLUGINSDIR\smtubebak\translations" 932 CreateDirectory "$PLUGINSDIR\smtubebak\docs\smtube" 933 CopyFiles /SILENT "$SMPlayer_Path\smtube.exe" "$PLUGINSDIR\smtubebak" 934 CopyFiles /SILENT "$SMPlayer_Path\docs\smtube\*" "$PLUGINSDIR\smtubebak\docs\smtube" 935 CopyFiles /SILENT "$SMPlayer_Path\translations\smtube*.qm" "$PLUGINSDIR\smtubebak\translations" 936 !ifdef QT5 937 CopyFiles /SILENT "$SMPlayer_Path\Qt5WebKit.dll" "$PLUGINSDIR\smtubebak" 938 CopyFiles /SILENT "$SMPlayer_Path\Qt5Sql.dll" "$PLUGINSDIR\smtubebak" 939 CopyFiles /SILENT "$SMPlayer_Path\Qt5Qml.dll" "$PLUGINSDIR\smtubebak" 940 CopyFiles /SILENT "$SMPlayer_Path\Qt5Quick.dll" "$PLUGINSDIR\smtubebak" 941 CopyFiles /SILENT "$SMPlayer_Path\Qt5Positioning.dll" "$PLUGINSDIR\smtubebak" 942 CopyFiles /SILENT "$SMPlayer_Path\Qt5Multimedia.dll" "$PLUGINSDIR\smtubebak" 943 CopyFiles /SILENT "$SMPlayer_Path\Qt5Sensors.dll" "$PLUGINSDIR\smtubebak" 944 CopyFiles /SILENT "$SMPlayer_Path\Qt5WebChannel.dll" "$PLUGINSDIR\smtubebak" 945 CopyFiles /SILENT "$SMPlayer_Path\Qt5WebKitWidgets.dll" "$PLUGINSDIR\smtubebak" 946 CopyFiles /SILENT "$SMPlayer_Path\Qt5OpenGL.dll" "$PLUGINSDIR\smtubebak" 947 CopyFiles /SILENT "$SMPlayer_Path\Qt5PrintSupport.dll" "$PLUGINSDIR\smtubebak" 948 CopyFiles /SILENT "$SMPlayer_Path\Qt5MultimediaWidgets.dll" "$PLUGINSDIR\smtubebak" 949 !else 950 CopyFiles /SILENT "$SMPlayer_Path\QtWebKit4.dll" "$PLUGINSDIR\smtubebak" 951 !endif 952 956 StrCmp "${QT_WEBKIT_VERSION}" "$Qt_WebKit_Installed_Version" 0 QtVerMismatch 957 DetailPrint $(Info_SMTube_Backup) 958 CreateDirectory "$PLUGINSDIR\smtubebak\translations" 959 CreateDirectory "$PLUGINSDIR\smtubebak\docs\smtube" 960 CopyFiles /SILENT "$SMPlayer_Path\smtube.exe" "$PLUGINSDIR\smtubebak" 961 CopyFiles /SILENT "$SMPlayer_Path\docs\smtube\*" "$PLUGINSDIR\smtubebak\docs\smtube" 962 CopyFiles /SILENT "$SMPlayer_Path\translations\smtube*.qm" "$PLUGINSDIR\smtubebak\translations" 963 CopyFiles /SILENT "$SMPlayer_Path\icuin*.dll" "$PLUGINSDIR\smtubebak" 964 CopyFiles /SILENT "$SMPlayer_Path\icuuc*.dll" "$PLUGINSDIR\smtubebak" 965 CopyFiles /SILENT "$SMPlayer_Path\icudt*.dll" "$PLUGINSDIR\smtubebak" 966 CopyFiles /SILENT "$SMPlayer_Path\Qt5WebKit.dll" "$PLUGINSDIR\smtubebak" 967 CopyFiles /SILENT "$SMPlayer_Path\Qt5Sql.dll" "$PLUGINSDIR\smtubebak" 968 CopyFiles /SILENT "$SMPlayer_Path\Qt5Qml.dll" "$PLUGINSDIR\smtubebak" 969 CopyFiles /SILENT "$SMPlayer_Path\Qt5Quick.dll" "$PLUGINSDIR\smtubebak" 970 CopyFiles /SILENT "$SMPlayer_Path\Qt5Positioning.dll" "$PLUGINSDIR\smtubebak" 971 CopyFiles /SILENT "$SMPlayer_Path\Qt5Multimedia.dll" "$PLUGINSDIR\smtubebak" 972 CopyFiles /SILENT "$SMPlayer_Path\Qt5Sensors.dll" "$PLUGINSDIR\smtubebak" 973 CopyFiles /SILENT "$SMPlayer_Path\Qt5WebChannel.dll" "$PLUGINSDIR\smtubebak" 974 CopyFiles /SILENT "$SMPlayer_Path\Qt5WebKitWidgets.dll" "$PLUGINSDIR\smtubebak" 975 CopyFiles /SILENT "$SMPlayer_Path\Qt5OpenGL.dll" "$PLUGINSDIR\smtubebak" 976 CopyFiles /SILENT "$SMPlayer_Path\Qt5PrintSupport.dll" "$PLUGINSDIR\smtubebak" 977 CopyFiles /SILENT "$SMPlayer_Path\Qt5MultimediaWidgets.dll" "$PLUGINSDIR\smtubebak" 953 978 StrCpy $Restore_SMTube 1 954 979 Return 980 QtVerMismatch: 981 DetailPrint $(SMTube_Incompatible_Msg1) 982 DetailPrint $(SMTube_Incompatible_Msg2) 983 Sleep 5000 955 984 NoBackup: 956 985 StrCpy $Restore_SMTube 0 … … 1112 1141 FunctionEnd 1113 1142 1143 Function RetrieveQtVersions 1144 1145 ; Get version of Qt5Core.dll from the build sources (smplayer-build/smplayer-build64) 1146 ClearErrors 1147 GetDLLVersionLocal ${SMPLAYER_BUILD_DIR}\Qt5Core.dll $R0 $R1 1148 IntOp $R2 $R0 / 0x00010000 1149 IntOp $R3 $R0 & 0x0000FFFF 1150 IntOp $R4 $R1 / 0x00010000 1151 IntOp $R5 $R1 & 0x0000FFFF 1152 StrCpy $Qt_Core_Source_Version "$R2.$R3.$R4.$R5" 1153 ;MessageBox MB_OK "Qt Core source version: $Qt_Core_Source_Version" 1154 1155 ; Get version of Qt Core.dll that is already installed 1156 ClearErrors 1157 GetDLLVersion "$INSTDIR\Qt5Core.dll" $R0 $R1 1158 IfErrors 0 +2 1159 GetDLLVersion "$INSTDIR\QtCore4.dll" $R0 $R1 1160 1161 IntOp $R2 $R0 / 0x00010000 1162 IntOp $R3 $R0 & 0x0000FFFF 1163 IntOp $R4 $R1 / 0x00010000 1164 IntOp $R5 $R1 & 0x0000FFFF 1165 StrCpy $Qt_Core_Installed_Version "$R2.$R3.$R4.$R5" 1166 ;MessageBox MB_OK "Qt Core installed version: $Qt_Core_Installed_Version" 1167 1168 ; Get version of Qt WebKit.dll that is already installed 1169 ClearErrors 1170 GetDLLVersion "$INSTDIR\Qt5WebKit.dll" $R0 $R1 1171 IfErrors 0 +2 1172 GetDLLVersion "$INSTDIR\QtWebKit4.dll" $R0 $R1 1173 1174 IntOp $R2 $R0 / 0x00010000 1175 IntOp $R3 $R0 & 0x0000FFFF 1176 IntOp $R4 $R1 / 0x00010000 1177 IntOp $R5 $R1 & 0x0000FFFF 1178 StrCpy $Qt_WebKit_Installed_Version "$R2.$R3.$R4.$R5" 1179 ;MessageBox MB_OK "Qt WebKit installed version: $Qt_WebKit_Installed_Version" 1180 1181 FunctionEnd 1182 1114 1183 Function RegisterDefaultPrograms 1115 1184
Note:
See TracChangeset
for help on using the changeset viewer.