Statistics
| Revision:

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

History | View | Annotate | Download (2.9 kB)

1
set installdir=%~dp0
2
set ARGS=%*
3
set DEBUG=0
4
set VERSION=0.8.0
5
set USERHOME=%USERPROFILE%\
6

    
7
IF NOT EXIST ROAMINGINSTALL GOTO ROAMINGINSTALLDONE
8
echo "The 'roaming' install option is set."
9
set USERHOME=%HOMEDRIVE%%HOMEPATH%\
10
echo "USERHOME set to %USERHOME%"
11

    
12
:ROAMINGINSTALLDONE
13

    
14
IF NOT EXIST ASKUSERDIRECTORY GOTO ASKUSERDIRECTORYDONE
15
echo "The 'ask user directory' install option is set."
16
for /f "tokens=*" %%a in ('jre\bin\java -jar StartDialog.jar') do set USERHOME=%%a\
17
echo "USERHOME set to %USERHOME%"
18

    
19
:ASKUSERDIRECTORYDONE
20

    
21
IF EXIST "%USERHOME%" GOTO USERHOMEOK
22
echo "%USERHOME% does not exist. Aborting"
23
msg * "TXM could not start using the USERHOME='%USERHOME%' directory."
24
GOTO:EOF
25

    
26
:USERHOMEOK
27

    
28
set TXMHOME="%USERHOME%TXM-%VERSION%\"
29
set DOTTXM="%USERHOME%.TXM-%VERSION%\"
30

    
31
mkdir "%TXMHOME%" 
32

    
33
mkdir "%DOTTXM%" 
34
attrib +h "%DOTTXM%" /s /d
35

    
36
echo "TXM: getting install date from %installdir%STAMP and %DOTTXM%STAMP files" 
37
Fc "%installdir%STAMP" "%DOTTXM%STAMP" 
38

    
39
IF errorlevel 1 (goto :install) else (goto :run)
40

    
41
:install
42

    
43
echo "New TXM install: it's the first launch after the installation." 
44
del "%temp%\org.txm.rcpapplication.prefs" 
45
copy "%DOTTXM%configuration\.settings\org.txm.rcpapplication.prefs" "%temp%\org.txm.rcpapplication.prefs" 
46
copy "%DOTTXM%.metadata\.plugins\org.eclipse.core.runtime\.settings\org.txm.rcpapplication.prefs" "%temp%\org.txm.rcpapplication.prefs" 
47
copy "%DOTTXM%data\.metadata\.plugins\org.eclipse.core.runtime\.settings\org.txm.rcpapplication.prefs" "%temp%\org.txm.rcpapplication.prefs" 
48

    
49
rmdir /s /q "%DOTTXM%"
50
IF errorlevel 1 (echo "TXM: failed to delete the %DOTTXM% directory.")
51

    
52
mkdir "%DOTTXM%" 
53
IF errorlevel 1 (echo "TXM: failed to create %DOTTXM% directory.")
54

    
55
copy "%installdir%TXM.ini" "%DOTTXM%TXM.ini" 
56
IF errorlevel 1 (echo "TXM: failed to copy %DOTTXM%TXM.ini file")
57

    
58
copy "%temp%\org.txm.rcpapplication.prefs" "%DOTTXM%org.txm.rcpapplication.prefs" 
59

    
60
mkdir "%DOTTXM%user" 
61
IF errorlevel 1 (echo "TXM: failed to create %DOTTXM%user directory.")
62

    
63
mkdir "%DOTTXM%configuration" 
64
IF errorlevel 1 (echo "TXM: failed to create %DOTTXM%user directory.")
65

    
66
mkdir "%DOTTXM%data" 
67
IF errorlevel 1 (echo "TXM: failed to create %DOTTXM%data directory.")
68

    
69
rmdir /s /q "%TXMHOME%\.metadata"
70
IF errorlevel 1 (echo "TXM: failed to delete the %TXMHOME%corpora\.metadata directory.")
71

    
72
copy "%installdir%STAMP" "%DOTTXM%STAMP" 
73
IF errorlevel 1 (echo "TXM: failed to copy %DOTTXM%STAMP file")
74

    
75
:run
76

    
77
set _JAVA_OPTIONS=-Duser.home="%USERHOME%"
78
echo running "%installdir%TXM.exe" -run --launcher.ini "%DOTTXM%TXM.ini" %ARGS% -data "%DOTTXM%data" -user "%DOTTXM%user" -install "%installdir%"
79
REM "%installdir%TXM.exe" -run --launcher.ini "%DOTTXM%TXM.ini" %ARGS% -user "%DOTTXM%user" -install "%installdir%"
80
"%installdir%TXM.exe" -run --launcher.ini "%DOTTXM%TXM.ini" %ARGS% -configuration "%DOTTXM%configuration" -user "%DOTTXM%user" -install "%installdir%\"