Statistics
| Revision:

root / tmp / org.txm.rcp.feature / win / TXM.bat @ 1179

History | View | Annotate | Download (2.9 kB)

1 753 sjacqu01
set installdir=%~dp0
2 753 sjacqu01
set DEBUG=0
3 753 sjacqu01
set VERSION=0.8.0
4 753 sjacqu01
set USERHOME=%USERPROFILE%\
5 753 sjacqu01
6 753 sjacqu01
IF NOT EXIST ROAMINGINSTALL GOTO ROAMINGINSTALLDONE
7 753 sjacqu01
echo "The 'roaming' install option is set."
8 753 sjacqu01
set USERHOME=%HOMEDRIVE%%HOMEPATH%\
9 753 sjacqu01
echo "USERHOME set to %USERHOME%"
10 753 sjacqu01
11 753 sjacqu01
:ROAMINGINSTALLDONE
12 753 sjacqu01
13 753 sjacqu01
IF NOT EXIST ASKUSERDIRECTORY GOTO ASKUSERDIRECTORYDONE
14 753 sjacqu01
echo "The 'ask user directory' install option is set."
15 753 sjacqu01
for /f "tokens=*" %%a in ('jre\bin\java -jar StartDialog.jar') do set USERHOME=%%a\
16 753 sjacqu01
echo "USERHOME set to %USERHOME%"
17 753 sjacqu01
18 753 sjacqu01
:ASKUSERDIRECTORYDONE
19 753 sjacqu01
20 753 sjacqu01
IF EXIST "%USERHOME%" GOTO USERHOMEOK
21 753 sjacqu01
echo "%USERHOME% does not exist. Aborting"
22 753 sjacqu01
msg * "TXM could not start using the USERHOME='%USERHOME%' directory."
23 753 sjacqu01
GOTO:EOF
24 753 sjacqu01
25 753 sjacqu01
:USERHOMEOK
26 753 sjacqu01
27 947 mdecorde
set TXMHOME=%USERHOME%TXM-%VERSION%\
28 1179 sjacqu01
set DOTTXM=%TXMHOME%.txm\
29 753 sjacqu01
30 753 sjacqu01
mkdir "%TXMHOME%"
31 753 sjacqu01
32 753 sjacqu01
mkdir "%DOTTXM%"
33 753 sjacqu01
34 753 sjacqu01
(
35 753 sjacqu01
echo "TXM: getting install date from %installdir%STAMP and %DOTTXM%STAMP files"
36 753 sjacqu01
Fc "%installdir%STAMP" "%DOTTXM%STAMP"
37 753 sjacqu01
) >"%TXMHOME%TXMOutputLogs.txt" 2>"%TXMHOME%TXMErrorLogs.txt"
38 753 sjacqu01
39 753 sjacqu01
IF errorlevel 1 (goto :install) else (goto :run)
40 753 sjacqu01
41 753 sjacqu01
:install
42 753 sjacqu01
43 753 sjacqu01
(
44 753 sjacqu01
echo "New TXM install: it's the first launch after the installation."
45 753 sjacqu01
del "%temp%\org.txm.rcpapplication.prefs"
46 753 sjacqu01
copy "%DOTTXM%configuration\.settings\org.txm.rcpapplication.prefs" "%temp%\org.txm.rcpapplication.prefs"
47 753 sjacqu01
copy "%DOTTXM%.metadata\.plugins\org.eclipse.core.runtime\.settings\org.txm.rcpapplication.prefs" "%temp%\org.txm.rcpapplication.prefs"
48 753 sjacqu01
copy "%DOTTXM%data\.metadata\.plugins\org.eclipse.core.runtime\.settings\org.txm.rcpapplication.prefs" "%temp%\org.txm.rcpapplication.prefs"
49 753 sjacqu01
50 753 sjacqu01
rmdir "%DOTTXM%" /s /q
51 753 sjacqu01
IF errorlevel 1 (echo "TXM: failed to delete %DOTTXM% directory.")
52 753 sjacqu01
53 753 sjacqu01
mkdir "%DOTTXM%"
54 753 sjacqu01
IF errorlevel 1 (echo "TXM: failed to create %DOTTXM% directory.")
55 753 sjacqu01
56 753 sjacqu01
copy "%installdir%TXM.ini" "%DOTTXM%TXM.ini"
57 753 sjacqu01
IF errorlevel 1 (echo "TXM: failed to copy %DOTTXM%TXM.ini file")
58 753 sjacqu01
59 753 sjacqu01
copy "%temp%\org.txm.rcpapplication.prefs" "%DOTTXM%org.txm.rcpapplication.prefs"
60 753 sjacqu01
61 753 sjacqu01
mkdir "%DOTTXM%user"
62 753 sjacqu01
IF errorlevel 1 (echo "TXM: failed to create %DOTTXM%user directory.")
63 753 sjacqu01
64 753 sjacqu01
mkdir "%DOTTXM%data"
65 753 sjacqu01
IF errorlevel 1 (echo "TXM: failed to create %DOTTXM%data directory.")
66 753 sjacqu01
67 753 sjacqu01
copy "%installdir%STAMP" "%DOTTXM%STAMP"
68 753 sjacqu01
IF errorlevel 1 (echo "TXM: failed to copy %DOTTXM%STAMP file")
69 753 sjacqu01
70 753 sjacqu01
) >"%TXMHOME%TXMOutputLogs.txt" 2>"%TXMHOME%TXMErrorLogs.txt"
71 753 sjacqu01
72 753 sjacqu01
:run
73 753 sjacqu01
74 753 sjacqu01
(
75 753 sjacqu01
set _JAVA_OPTIONS=-Duser.home="%USERHOME%"
76 819 sjacqu01
echo running "%installdir%TXM.exe" -run --launcher.ini "%DOTTXM%TXM.ini" -data "%DOTTXM%data" -user "%DOTTXM%user" -install "%installdir%"
77 1179 sjacqu01
REM "%installdir%TXM.exe" -run --launcher.ini "%DOTTXM%TXM.ini" -data "%DOTTXM%corpora" -user "%DOTTXM%user" -install "%installdir%"
78 1179 sjacqu01
"%installdir%TXM.exe" -log -run --launcher.ini "%DOTTXM%TXM.ini" -consolelog -clean -debug -console -noexit -data "%TXMHOME%corpora" -user "%DOTTXM%user" -install "%installdir%\"
79 753 sjacqu01
) >"%TXMHOME%TXMOutputLogs.txt" 2>"%TXMHOME%TXMErrorLogs.txt"