summaryrefslogtreecommitdiff
path: root/tools/build_scripts/z2_PackPluginUpdater.bat
blob: 56ac7e7f8223a4f17109ea8b5864e160fb760b29 (plain)
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
title MirandaNG packer
rem Packing compiled MirandaNG
rem use with param 32 or 64
rem set target platform %tp% from first parameter
set tp=%1
set dp=%2
if "%tp%"=="" (echo "please specify target platform 32 or 64!"&&pause&&goto :EOF)

set comp=%3
if "%comp%"=="" (echo "please specify target compiler folder!" && pause && goto :EOF)

call a_SetVar%tp%.bat

if exist %Arch% rd /Q /S "%Arch%" >nul

rem making temp dirs
mkdir %Arch%

if not exist "%comp%\Release%tp%" goto EOF

:FILECHECK
pushd "%comp%\Release%tp%"
if exist %Errors% del /F /Q %Errors%
if exist %NoErrors% del /F /Q %NoErrors%
for /f %%a in (..\..\%comp%\z2_PackPluginUpdater_x%tp%.txt) do (if not exist %%a echo %%a >> %Errors%)

:COMPRESS
REM Core
%ZipIt% "%Arch%\miranda%tp%.zip" "Miranda%tp%.exe" -i@..\..\z2_PackPluginUpdater.txt
REM end Core

REM Langpacks
for /f %%a in ('dir Languages\lang*.txt /B /L') do (%ZipIt% "%Arch%\Languages\%%~na.zip" "Languages\%%~nXa")
REM end Langpacks

REM Protocols
REM for /f %%a in ('dir Protocols\*.dll /B /L') do (%ZipIt% "%Arch%\Plugins\%%~na.zip" "Plugins\%%~nXa")
REM end Protocols

REM Plugins
for /f %%a in ('dir plugins\*.dll /B /L') do (
	rem check for special plugins and pack additional files first.
	if /I "%%a"=="Actman.dll" (%ZipIt% "%Arch%\Plugins\%%~na.zip" "Plugins\services.ini")
	if /I "%%a"=="BASS_interface.dll" (%ZipIt% "%Arch%\Plugins\%%~na.zip" "Plugins\BASS\*.dll")
	if /I "%%a"=="Boltun.dll" (%ZipIt% "%Arch%\Plugins\%%~na.zip" "Plugins\boltun.mindw")
	if /I "%%a"=="ClientChangeNotify.dll" (%ZipIt% "%Arch%\Plugins\%%~na.zip" "Libs\Pcre16.mir")
	if /I "%%a"=="Clist_modern.dll" (%ZipIt% "%Arch%\Plugins\%%~na.zip" "Plugins\AVS.dll" "Icons\Toolbar_icons.dll")
	if /I "%%a"=="CmdLine.dll" (%ZipIt% "%Arch%\Plugins\%%~na.zip" "MimCmd.exe")
	if /I "%%a"=="CurrencyRates.dll" (%ZipIt% "%Arch%\Plugins\%%~na.zip" "Icons\Proto_CurrencyRates.dll" "Plugins\CurrencyRates\*.xml" "Plugins\CurrencyRates\CurrencyRatesChart.exe")
	if /I "%%a"=="Dbx_mdbx.dll" (%ZipIt% "%Arch%\Plugins\%%~na.zip" "mdbx_dump.exe" "mdbx_load.exe")
	if /I "%%a"=="Dbx_sqlite.dll"  (%ZipIt% "%Arch%\Plugins\%%~na.zip" "Libs\sqlite3.mir")
	if /I "%%a"=="Discord.dll" (%ZipIt% "%Arch%\Plugins\%%~na.zip" "Icons\Proto_Discord.dll")
	if /I "%%a"=="Dummy.dll" (%ZipIt% "%Arch%\Plugins\%%~na.zip" "Icons\Proto_Dummy.dll")
	if /I "%%a"=="Facebook.dll" (%ZipIt% "%Arch%\Plugins\%%~na.zip" "Icons\Proto_Facebook.dll")
	if /I "%%a"=="FavContacts.dll" (%ZipIt% "%Arch%\Plugins\%%~na.zip" "Gadgets\favcontacts.gadget")
	if /I "%%a"=="Fingerprint.dll" (%ZipIt% "%Arch%\Plugins\%%~na.zip" "Icons\Fp_icons.dll")
	if /I "%%a"=="FTPFile.dll" (%ZipIt% "%Arch%\Plugins\%%~na.zip" "Libs\libcurl.mir" "Libs\libssh2.mir")
	if /I "%%a"=="GG.dll" (%ZipIt% "%Arch%\Plugins\%%~na.zip" "Icons\Proto_GG.dll")
	if /I "%%a"=="HistoryPP.dll" (%ZipIt% "%Arch%\Plugins\%%~na.zip" "Icons\HistoryPP_icons.dll")
	if /I "%%a"=="ICQ.dll" (%ZipIt% "%Arch%\Plugins\%%~na.zip" "Icons\Proto_ICQ.dll" "Icons\Proto_MRA.dll")
	if /I "%%a"=="Import.dll" (%ZipIt% "%Arch%\Plugins\%%~na.zip" "Libs\sqlite3.mir")
	if /I "%%a"=="IRC.dll" (%ZipIt% "%Arch%\Plugins\%%~na.zip" "Icons\Proto_IRC.dll")
	if /I "%%a"=="Jabber.dll" (%ZipIt% "%Arch%\Plugins\%%~na.zip" "Icons\Proto_Jabber.dll" "Icons\xStatus_Jabber.dll" "Libs\libsignal.mir")
	if /I "%%a"=="Listeningto.dll" (%ZipIt% "%Arch%\Plugins\%%~na.zip" "Plugins\Listeningto\*.dll")
	if /I "%%a"=="MinecraftDynmap.dll" (%ZipIt% "%Arch%\Plugins\%%~na.zip" "Icons\Proto_MinecraftDynmap.dll")
	if /I "%%a"=="MirLua.dll" (%ZipIt% "%Arch%\Plugins\%%~na.zip" "Scripts\*.dll" "Libs\lua*.dll")
	if /I "%%a"=="mRadio.dll" (%ZipIt% "%Arch%\Plugins\%%~na.zip" "Icons\Proto_mRadio.dll" "Plugins\BASS\*.dll")
	if /I "%%a"=="MSN.dll" (%ZipIt% "%Arch%\Plugins\%%~na.zip" "Icons\Proto_MSN.dll")
	if /I "%%a"=="NewsAggregator.dll" (%ZipIt% "%Arch%\Plugins\%%~na.zip" "Icons\Proto_NewsAggregator.dll")
	if /I "%%a"=="NotifyAnything.dll" (%ZipIt% "%Arch%\Plugins\%%~na.zip" "SendLog*.exe")
	if /I "%%a"=="Nudge.dll" (%ZipIt% "%Arch%\Plugins\%%~na.zip" "Sounds\nudge.wav")
	if /I "%%a"=="Omegle.dll" (%ZipIt% "%Arch%\Plugins\%%~na.zip" "Icons\Proto_Omegle.dll")
	if /I "%%a"=="PluginUpdater.dll" (%ZipIt% "%Arch%\Plugins\%%~na.zip" "pu_stub.exe")
	if /I "%%a"=="RemovePersonalSettings.dll" (%ZipIt% "%Arch%\Plugins\%%~na.zip" "RemovePersonalSettings.ini")
	if /I "%%a"=="Sametime.dll" (%ZipIt% "%Arch%\Plugins\%%~na.zip" "Icons\Proto_Sametime.dll")
	if /I "%%a"=="SecureIM.dll" (%ZipIt% "%Arch%\Plugins\%%~na.zip" "Plugins\CryptoPP.dll" "Icons\SecureIM_icons.dll")
	if /I "%%a"=="SkypeWeb.dll" (%ZipIt% "%Arch%\Plugins\%%~na.zip" "Icons\Proto_Skype.dll")
	if /I "%%a"=="SmileyAdd.dll" (%ZipIt% "%Arch%\Plugins\%%~na.zip" "Libs\Pcre16.mir")
	if /I "%%a"=="Spamotron.dll" (%ZipIt% "%Arch%\Plugins\%%~na.zip" "Libs\Pcre16.mir" "Libs\sqlite3.mir")
	if /I "%%a"=="SpellChecker.dll" (%ZipIt% "%Arch%\Plugins\%%~na.zip" "Icons\Flags_icons.dll" "Libs\hunspell.mir")
	if /I "%%a"=="Steam.dll" (%ZipIt% "%Arch%\Plugins\%%~na.zip" "Icons\Proto_Steam.dll")
	if /I "%%a"=="TabSRMM.dll" (%ZipIt% "%Arch%\Plugins\%%~na.zip" "Icons\TabSRMM_icons.dll")
	if /I "%%a"=="Tox.dll" (%ZipIt% "%Arch%\Plugins\%%~na.zip" "Icons\Proto_Tox.dll" "Libs\libtox.mir" "Libs\libsodium.mir" "Libs\pthreads.mir")
	if /I "%%a"=="Twitter.dll" (%ZipIt% "%Arch%\Plugins\%%~na.zip" "Icons\Proto_Twitter.dll")
	if /I "%%a"=="UInfoEx.dll" (%ZipIt% "%Arch%\Plugins\%%~na.zip" "Icons\UInfoEx_icons.dll")
	if /I "%%a"=="Variables.dll" (%ZipIt% "%Arch%\Plugins\%%~na.zip" "Libs\Pcre16.mir")
	if /I "%%a"=="VKontakte.dll" (%ZipIt% "%Arch%\Plugins\%%~na.zip" "Icons\Proto_VKontakte.dll")
	if /I "%%a"=="Watrack.dll" (%ZipIt% "%Arch%\Plugins\%%~na.zip" "Icons\Watrack_buttons.dll" "Icons\Watrack_icons.dll" "Plugins\player.ini")
	if /I "%%a"=="Weather.dll" (%ZipIt% "%Arch%\Plugins\%%~na.zip" "Icons\Proto_Weather.dll" "Plugins\Weather\*.ini")
	if /I "%%a"=="YAMN.dll" (%ZipIt% "%Arch%\Plugins\%%~na.zip" "Icons\Proto_YAMN.dll")
	rem now adding plugin itself into archive
	%ZipIt% "%Arch%\Plugins\%%~na.zip" %%a
)
REM end Plugins

REM Icons
for /f %%a in ('dir .\Icons\*.dll /B /L') do (%ZipIt% "%Arch%\Icons\%%~na.zip" "-ir-!Icons\%%~nXa")
REM end Icons

REM CRC32
copy /y /v hashes.txt %Arch%\hash.txt
pushd %Arch%

if /i '%dp%' == 'DEV_N_STABLE' (
  echo ;DoNotSwitchToStable > hashes.txt
) else if /i '%dp%' == 'DEV_ONLY' (
  echo DoNotSwitchToStable > hashes.txt
) else (
  echo ;StableAllowed > hashes.txt
)

for /f "tokens=1,2 delims= " %%i in (hash.txt) do call :WriteLine %%i %%j
%ZipIt% "hashes.zip" hashes.txt
del /f /q hash*.txt
popd
REM end CRC32

if not exist %Errors% echo "No errors!" >> %NoErrors%

cd ..

:EOF
popd
goto :eof
:: END OF WORK

:WriteLine
for /F "tokens=1,2 delims=:" %%i in ('%SourceDir%\tools\crc32.exe %~dpn1.zip') do echo %1 %2 %%j >> hashes.txt
goto :eof