-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathsetupenv.bat
115 lines (94 loc) · 3.15 KB
/
setupenv.bat
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
REM
REM Copyright 2010 Jeremy Schneider
REM
REM This file is part of RAC-ATTACK.
REM
REM RAC-ATTACK is free software: you can redistribute it and/or modify
REM it under the terms of the GNU General Public License as published by
REM the Free Software Foundation, either version 3 of the License, or
REM (at your option) any later version.
REM
REM RAC-ATTACK is distributed in the hope that it will be useful,
REM but WITHOUT ANY WARRANTY; without even the implied warranty of
REM MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
REM GNU General Public License for more details.
REM
REM You should have received a copy of the GNU General Public License
REM along with RAC-ATTACK. If not, see <http://www.gnu.org/licenses/>.
REM
REM
set PROMPTENV=YES
set SOURCEDRIVE=H:
set DESTDRIVE=G:
set DESTDIR=RAC11g
set DESTDRIVESHARED=C:
set DESTDIRSHARED=RAC11g-shared
set DESTDIRISO=RAC11g-iso
set MEMSIZE=900
set MYUSER=%USERNAME%
set MYPASS=%YOUR_WINDOWS_PASSWORD%
set VMWAREDIR="C:\Program Files\VMware\VMware Server"
if exist "C:\Program Files (x86)\VMware\VMware Server\vmrun.exe" set VMWAREDIR="C:\Program Files (x86)\VMware\VMware Server"
REM ===============================================================
REM Begin prompting section
if /i %PROMPTENV% neq YES goto endprompt
cd|sed "s/\\.*//;s/^/set SOURCEDRIVE=/" >%TEMP%\DetectVars.bat
call %TEMP%\DetectVars.bat
if "%SOURCEDIR%"=="RAC-DEMO-INPLACE" set DESTDRIVE=%SOURCEDRIVE%
echo s/DEFAULT-SOURCEDRIVE/%SOURCEDRIVE%/ >%TEMP%\UserIn.sed
echo s/DEFAULT-DESTDRIVESHARED/%DESTDRIVESHARED%/ >>%TEMP%\UserIn.sed
echo s/DEFAULT-DESTDRIVE/%DESTDRIVE%/ >>%TEMP%\UserIn.sed
echo s/DEFAULT-VMWAREDIR/%VMWAREDIR%/ >>%TEMP%\UserIn.sed
echo s/DEFAULT-MYUSER/%MYUSER%/ >>%TEMP%\UserIn.sed
echo s/DEFAULT-MYPASS/%MYPASS%/ >>%TEMP%\UserIn.sed
echo s/DEFAULT-SOURCEDIR/%SOURCEDIR%/ >>%TEMP%\UserIn.sed
echo s/DEFAULT-MEMSIZE/%MEMSIZE%/ >>%TEMP%\UserIn.sed
sed "s/\\/\\\\/g" %TEMP%\UserIn.sed >%TEMP%\UserIn2.sed
sed -f %TEMP%\UserIn2.sed input.hta >%TEMP%\UserIn.hta
start /w %TEMP%\UserIn.hta
if not exist %TEMP%\UserIn.bat (
echo ERROR: user canceled input dialog!
pause
del %TEMP%\DetectVars.bat
del %TEMP%\UserIn.sed
del %TEMP%\UserIn2.sed
del %TEMP%\UserIn.hta
exit 1
)
call %TEMP%\UserIn.bat
del %TEMP%\DetectVars.bat
del %TEMP%\UserIn.sed
del %TEMP%\UserIn2.sed
del %TEMP%\UserIn.hta
del %TEMP%\UserIn.bat
@echo off
echo.
echo SOURCEDRIVE=%SOURCEDRIVE%
echo DESTDRIVE=%DESTDRIVE%
echo DESTDRIVESHARED=%DESTDRIVESHARED%
echo VMWAREDIR=%VMWAREDIR%
echo MYUSER=%MYUSER%
echo MYPASS=%MYPASS%
echo.
@echo on
:endprompt
REM ===============================================================
REM Vars that are dependant on other vars
set VMRUNBIN="%VMWAREDIR:"=%\vmrun.exe"
set LZOPBIN=%SOURCEDRIVE%\lzop.exe
set MD5BIN=%SOURCEDRIVE%\md5sum
set SEDBIN=%SOURCEDRIVE%\sed
set DESTDRIVEISO=%DESTDRIVESHARED%
if "%SOURCEDIR%"=="RAC-DEMO-INPLACE" (
set DESTDRIVEISO=%SOURCEDRIVE%
)
if not exist %LZOPBIN% (
echo ERROR: bad source drive!
pause
exit 1
)
if not exist %VMRUNBIN% (
echo ERROR: bad VMware installation directory!
pause
exit 1
)