File: install_smplayer2.cmd

package info (click to toggle)
smplayer 25.6.0%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 37,376 kB
  • sloc: cpp: 52,858; ansic: 16,655; makefile: 247; sh: 123; xml: 67
file content (213 lines) | stat: -rw-r--r-- 6,435 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
@echo off

for /f %%d in ('wmic os get localdatetime ^|findstr /b [0-9]') do @set datetime=%%d

REM Read from generated file during compile if exist
REM Relative paths are relative to install_smplayer

if exist win32inst_vars.cmd (

  call win32inst_vars.cmd

  set MPLAYER_DIR=mplayer
  set MPV_DIR=mpv

) else (

  echo This batch file can help you to create a directory with all required files
  echo Just change the variables at the beginning
  echo.
  echo Warning: it will only work with sources from the SVN and the command svn has to be in the path
  echo.

  set /P QT_VER="Qt Version (Default: 5.6.0): "
  if "%QT_VER%"=="" set QT_VER=5.6.0

  set SMPLAYER_DIR=svn\smplayer
  REM set SMTUBE_DIR=svn\smtube
  set SMPLAYER_THEMES_DIR=svn\smplayer-themes
  set SMPLAYER_SKINS_DIR=svn\smplayer-skins
  set MPLAYER_DIR=mplayer
  set MPV_DIR=mpv
  set QT_DIR=C:\Qt\%QT_VER%
  set MINGW_DIR=C:\Qt\%QT_VER%\Tools\mingw492_32
  set X86_64=
  set BUILD_PREFIX=..
  set DEBUG=

)

if [%X86_64%]==[yes] (
  set BASE_BUILD_DIR=smplayer-build64
  set OUTPUT_DIR=%BUILD_PREFIX%\smplayer-build64
  set OPENSSL_DIR=openssl64
) else (
  set BASE_BUILD_DIR=smplayer-build
  set OUTPUT_DIR=%BUILD_PREFIX%\smplayer-build
  set OPENSSL_DIR=openssl
)

if exist "%OUTPUT_DIR%" (
  ren "%OUTPUT_DIR%" "%BASE_BUILD_DIR%.%datetime%"
)

if [%DEBUG%]==[yes] (
  set QT_DEBUG_DLL_SUFFIX=d
  set QT_BUILD_DIR=debug
) else (
  set QT_DEBUG_DLL_SUFFIX=
  set QT_BUILD_DIR=release
)

:begin
echo.
echo --      SMPlayer, QT libs      --
echo.

mkdir %OUTPUT_DIR%
copy "%SMPLAYER_DIR%\src\%QT_BUILD_DIR%\smplayer.exe" "%OUTPUT_DIR%"
copy "%SMPLAYER_DIR%\dxlist\release\dxlist.exe" "%OUTPUT_DIR%"
copy "%SMPLAYER_DIR%\webserver\simple_web_server.exe" "%OUTPUT_DIR%"
copy "%SMPLAYER_DIR%\zlib\zlib1.dll" "%OUTPUT_DIR%"
copy "%SMPLAYER_DIR%\*.txt" "%OUTPUT_DIR%"
REM copy "%SMPLAYER_DIR%\setup\sample.avi" "%OUTPUT_DIR%"

REM Core files
if %QT_VER% lss 5.0.0 (

  copy "%QT_DIR%\bin\QtCore%QT_DEBUG_DLL_SUFFIX%4.dll" "%OUTPUT_DIR%"
  copy "%QT_DIR%\bin\QtDBus%QT_DEBUG_DLL_SUFFIX%4.dll" "%OUTPUT_DIR%"
  copy "%QT_DIR%\bin\QtGui%QT_DEBUG_DLL_SUFFIX%4.dll" "%OUTPUT_DIR%"
  copy "%QT_DIR%\bin\QtNetwork%QT_DEBUG_DLL_SUFFIX%4.dll" "%OUTPUT_DIR%"
  copy "%QT_DIR%\bin\QtXml%QT_DEBUG_DLL_SUFFIX%4.dll" "%OUTPUT_DIR%"
  copy "%QT_DIR%\bin\QtScript%QT_DEBUG_DLL_SUFFIX%4.dll" "%OUTPUT_DIR%"

) else if %QT_VER% geq 5.0.0 (

  REM copy "%QT_DIR%\bin\icudt*.dll" "%OUTPUT_DIR%"
  REM copy "%QT_DIR%\bin\icuin*.dll" "%OUTPUT_DIR%"
  REM copy "%QT_DIR%\bin\icuuc*.dll" "%OUTPUT_DIR%"
  copy "%QT_DIR%\bin\Qt5Core%QT_DEBUG_DLL_SUFFIX%.dll" "%OUTPUT_DIR%"
  REM copy "%QT_DIR%\bin\Qt5DBus%QT_DEBUG_DLL_SUFFIX%.dll" "%OUTPUT_DIR%"
  copy "%QT_DIR%\bin\Qt5Gui%QT_DEBUG_DLL_SUFFIX%.dll" "%OUTPUT_DIR%"
  copy "%QT_DIR%\bin\Qt5Network%QT_DEBUG_DLL_SUFFIX%.dll" "%OUTPUT_DIR%"
  copy "%QT_DIR%\bin\Qt5Widgets%QT_DEBUG_DLL_SUFFIX%.dll" "%OUTPUT_DIR%"
  copy "%QT_DIR%\bin\Qt5Xml%QT_DEBUG_DLL_SUFFIX%.dll" "%OUTPUT_DIR%"
  copy "%QT_DIR%\bin\Qt5Script%QT_DEBUG_DLL_SUFFIX%.dll" "%OUTPUT_DIR%"

)

REM Qt Plugins
mkdir "%OUTPUT_DIR%\imageformats"
if %QT_VER% lss 5.0.0 (

  copy "%QT_DIR%\plugins\imageformats\qjpeg%QT_DEBUG_DLL_SUFFIX%4.dll" "%OUTPUT_DIR%\imageformats\"

) else if %QT_VER% geq 5.0.0 (

  mkdir "%OUTPUT_DIR%\platforms"
  copy "%QT_DIR%\plugins\imageformats\qjpeg%QT_DEBUG_DLL_SUFFIX%.dll" "%OUTPUT_DIR%\imageformats\"
  copy "%QT_DIR%\plugins\platforms\qwindows%QT_DEBUG_DLL_SUFFIX%.dll" "%OUTPUT_DIR%\platforms\"

)

REM Toolchain specific files
copy "%QT_DIR%\bin\mingwm10.dll" "%OUTPUT_DIR%"
copy "%QT_DIR%\bin\libgcc_s_*.dll" "%OUTPUT_DIR%"
copy "%QT_DIR%\bin\libstdc++-6.dll" "%OUTPUT_DIR%"
copy "%QT_DIR%\bin\libwinpthread-1.dll" "%OUTPUT_DIR%"

REM OpenSSL
copy "%OPENSSL_DIR%\*.dll" "%OUTPUT_DIR%"

if not exist "%QT_DIR%\bin\libeay32.dll" goto skip_toolchain_ssl
if not exist "%QT_DIR%\bin\ssleay32.dll" goto skip_toolchain_ssl
copy /y "%QT_DIR%\bin\libeay32.dll" "%OUTPUT_DIR%"
copy /y "%QT_DIR%\bin\ssleay32.dll" "%OUTPUT_DIR%"

:skip_toolchain_ssl

REM echo.
REM echo --           Fonts             --
REM echo.
REM mkdir "%OUTPUT_DIR%\open-fonts"
REM copy "open-fonts\*.*" "%OUTPUT_DIR%\open-fonts\"

echo.
echo --        Translations         --
echo.
mkdir "%OUTPUT_DIR%\translations"
copy "%SMPLAYER_DIR%\src\translations\*.qm" "%OUTPUT_DIR%\translations"

echo.
echo --       Qt Translations       --
echo.
copy "%QT_DIR%\translations\qt_*.qm" %OUTPUT_DIR%\translations
copy "%QT_DIR%\translations\qtbase*.qm" %OUTPUT_DIR%\translations
copy "%SMPLAYER_DIR%\qt-translations\qt_*.qm" "%OUTPUT_DIR%\translations"
del "%OUTPUT_DIR%\translations\qt_help_*.qm"

echo.
echo --         Shortcuts           --
echo.
mkdir "%OUTPUT_DIR%\shortcuts"
copy "%SMPLAYER_DIR%\src\shortcuts\*.keys" "%OUTPUT_DIR%\shortcuts"

echo.
echo --        Documentation        --
echo.
svn export --force "%SMPLAYER_DIR%\docs" "%OUTPUT_DIR%\docs"

echo.
echo --         Icon Themes         --
echo.
for /f "tokens=*" %%a in ('dir /ad /b ^"%SMPLAYER_THEMES_DIR%\themes^"') do (
xcopy "%SMPLAYER_THEMES_DIR%\themes\%%a\*.rcc" "%OUTPUT_DIR%\themes\%%a\"
xcopy "%SMPLAYER_THEMES_DIR%\themes\%%a\*.qss" "%OUTPUT_DIR%\themes\%%a\"
xcopy "%SMPLAYER_THEMES_DIR%\themes\%%a\README.txt" "%OUTPUT_DIR%\themes\%%a\"
)

echo.
echo --            Skins            --
echo.
for /f "tokens=*" %%b in ('dir /ad /b ^"%SMPLAYER_SKINS_DIR%\themes^"') do (
xcopy "%SMPLAYER_SKINS_DIR%\themes\%%b\*.rcc" "%OUTPUT_DIR%\themes\%%b\"
xcopy "%SMPLAYER_SKINS_DIR%\themes\%%b\main.css" "%OUTPUT_DIR%\themes\%%b\"
)

echo.
echo --           MPlayer           --
echo.
for /f %%i in ("%MPLAYER_DIR%") do set MPLAYER_DIR=%%~fi
mklink /D "%OUTPUT_DIR%\mplayer" "%MPLAYER_DIR%"
if not errorlevel 0 (
  xcopy "%MPLAYER_DIR%" "%OUTPUT_DIR%\mplayer\" /E
)

echo.
echo --           MPV           --
echo.
for /f %%i in ("%MPV_DIR%") do set MPV_DIR=%%~fi
mklink /D "%OUTPUT_DIR%\mpv" "%MPV_DIR%"
if not errorlevel 0 (
  xcopy "%MPV_DIR%" "%OUTPUT_DIR%\mpv\" /E
)

echo.

:end

set SMPLAYER_DIR=
set SMTUBE_DIR=
set SMPLAYER_THEMES_DIR=
set SMPLAYER_SKINS_DIR=
set MPLAYER_DIR=
set MPV_DIR=
set QT_DIR=
set QT_VER=
set MINGW_DIR=
set X86_64=
set BUILD_PREFIX=

set QT_DEBUG_DLL_SUFFIX=
set QT_BUILD_DIR=