Statistics
| Revision:

root / tmp / trunk / org.txm.setups / shared / win / TXM.bat @ 741

History | View | Annotate | Download (2.6 kB)

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

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

    
11
:ROAMINGINSTALLDONE
12

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

    
18
:ASKUSERDIRECTORYDONE
19

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

    
25
:USERHOMEOK
26

    
27
set TXMHOME=%USERHOME%TXM_%VERSION%\
28
set DOTTXM=%TXMHOME%.txm\
29

    
30
mkdir "%TXMHOME%" 
31

    
32
mkdir "%DOTTXM%" 
33

    
34
(
35
echo "TXM: getting install date from %installdir%STAMP and %DOTTXM%STAMP files" 
36
Fc "%installdir%STAMP" "%DOTTXM%STAMP" 
37
) >"%TXMHOME%TXMOutputLogs.txt" 2>"%TXMHOME%TXMErrorLogs.txt" 
38

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

    
41
:install
42

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

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

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

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

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

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

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

    
67
copy "%installdir%STAMP" "%DOTTXM%STAMP" 
68
IF errorlevel 1 (echo "TXM: failed to copy %DOTTXM%STAMP file")
69

    
70
) >"%TXMHOME%TXMOutputLogs.txt" 2>"%TXMHOME%TXMErrorLogs.txt" 
71

    
72
:run
73

    
74
(
75

    
76
set _JAVA_OPTIONS=-Duser.home="%USERHOME%"
77

    
78
echo running "%installdir%TXM.exe" -run --launcher.ini "%DOTTXM%TXM.ini" -data "%DOTTXM%data" -user "%DOTTXM%user" -install "%installdir%" 
79

    
80
"%installdir%\TXM.exe" -run --launcher.ini "%DOTTXM%TXM.ini" -data "%DOTTXM%data" -user "%DOTTXM%user" -install "%installdir%" 
81

    
82
) >"%TXMHOME%TXMOutputLogs.txt" 2>"%TXMHOME%TXMErrorLogs.txt"