summaryrefslogtreecommitdiff
path: root/tools/lpgen/installer.bat
blob: cfabe071cbeab5428704bcffd7737d14a3fb393f (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
@echo off
cls

echo ========================
echo    Langpack installer
echo      Author: Robyer
echo ========================
echo.

set err=0
if "%~1" == "" (
	echo ERROR: You must specify language parameter!
	set err=1
)

if "%~2" == "" (
	echo ERROR: You must specify Miranda path!
	set err=1
)

if not "%~3" == "" (
	echo ERROR: You must specify 1 or 2 parameters only.
	echo NOTE: If you have path with spaces inside, suround it with "".
	set err=1
)

if "%err%"=="1" (
	goto usage
)

set "language=%~1"
set "mirandaPath=%~2"

if not exist "..\..\langpacks\%language%" (
	echo ERROR: This language doesn't exists!
	goto exit
)

if not exist "%mirandaPath%\mimcmd.exe" (
	echo ERROR: mimcmd.exe wasn't found in your Miranda path. Make sure you have installed Command line plugin.
	goto exit
)

if not exist "..\..\langpacks\%language%\Langpack_%language%.txt" (
	echo ERROR: Langpack_%language%.txt in your langpack folder wasn't found. Make sure you have freshly refreshed langpack using Refresher.bat script
	goto exit
)

echo Installing langpack...

copy "..\..\langpacks\%language%\Langpack_%language%.txt" "%mirandaPath%\Langpack_%language%.txt"
cd "%mirandaPath%"
mimcmd.exe callservice LangPack/Reload 0 0

echo Installation successful.
exit /b

:usage
echo.
echo ========================
echo Usage: installer.bat language "Miranda folder path"
echo Note:  for proper installation make sure you have enabled Command line plugin
echo.
echo Example: installer.bat czech "C:\Program files\Miranda NG"
echo.
echo If you want own script in langpack dir, look at "langpacks\czech\refresh.bat"
echo ========================
echo.

:exit
pause
exit /b