diff options
Diffstat (limited to '')
-rw-r--r-- | Prebuild/runprebuild.bat | 127 |
1 files changed, 127 insertions, 0 deletions
diff --git a/Prebuild/runprebuild.bat b/Prebuild/runprebuild.bat new file mode 100644 index 0000000..5cdef31 --- /dev/null +++ b/Prebuild/runprebuild.bat | |||
@@ -0,0 +1,127 @@ | |||
1 | |||
2 | |||
3 | rem Prebuild.exe /target VS2010 | ||
4 | |||
5 | @ECHO OFF | ||
6 | |||
7 | echo ========================================== | ||
8 | echo ==== WhiteCore Prebuild Configuration ==== | ||
9 | echo ========================================== | ||
10 | echo. | ||
11 | echo If you wish to customize the configuration, re-run with the switch '-p' | ||
12 | echo e.g. runprebuild -p | ||
13 | echo. | ||
14 | |||
15 | rem ## Default "configuration" choice ((r)elease, (d)ebug) | ||
16 | set configuration=d | ||
17 | |||
18 | rem ## Default Visual Studio edition | ||
19 | set vstudio=2010 | ||
20 | |||
21 | rem ## Default Framework | ||
22 | set framework=4_0 | ||
23 | |||
24 | rem ## Default architecture (86 (for 32bit), 64) | ||
25 | :CheckArch | ||
26 | set bits=AnyCPU | ||
27 | rem if exist "%PROGRAMFILES(X86)%" (set bits=x64) | ||
28 | rem if %bits% == x64 ( | ||
29 | rem echo Found 64bit architecture | ||
30 | rem ) | ||
31 | rem if %bits% == x86 ( | ||
32 | rem echo Found 32 bit architecture | ||
33 | rem ) | ||
34 | |||
35 | rem ## Determine native framework | ||
36 | :CheckOS | ||
37 | set framework=4_5 | ||
38 | for /f "tokens=4-5 delims=. " %%i in ('ver') do set VERSION=%%i.%%j | ||
39 | if %version% == 10.0 ( | ||
40 | set framework=4_5 | ||
41 | echo Windows 10 | ||
42 | ) | ||
43 | if %version% == 6.3 ( | ||
44 | set framework=4_5 | ||
45 | echo Windows 8.1 or Server 2012 R2 | ||
46 | ) | ||
47 | if %version% == 6.2 ( | ||
48 | set framework=4_5 | ||
49 | echo Windows 8 or Server 2012 | ||
50 | ) | ||
51 | if %version% == 6.1 ( | ||
52 | set framework=4_0 | ||
53 | echo Windows 7 or Server 2008 R2 | ||
54 | ) | ||
55 | if %version% == 6.0 ( | ||
56 | set framework=3_5 | ||
57 | echo hmmm... Windows Vista or Server 2008 | ||
58 | ) | ||
59 | if %version% == 5.2 ( | ||
60 | set framework=3_5 | ||
61 | echo hmmm... Windows XP x64 or Server 2003 | ||
62 | ) | ||
63 | if %version% == 5.1 ( | ||
64 | set framework=3_5 | ||
65 | echo hmmm... Windows XP | ||
66 | ) | ||
67 | |||
68 | |||
69 | rem ## If not requested, skip the prompting | ||
70 | if "%1" =="" goto final | ||
71 | if %1 == -p goto prompt | ||
72 | if %1 == --prompt goto prompt | ||
73 | goto final | ||
74 | |||
75 | :prompt | ||
76 | echo I will now ask you four questions regarding your build. | ||
77 | echo However, if you wish to build for: | ||
78 | echo %bits% Architecture | ||
79 | echo .NET %framework% | ||
80 | echo Visual Studio %vstudio% | ||
81 | |||
82 | echo. | ||
83 | echo Simply tap [ENTER] three times. | ||
84 | echo. | ||
85 | echo Note that you can change these defaults by opening this | ||
86 | echo batch file in a text editor. | ||
87 | echo. | ||
88 | |||
89 | :bits | ||
90 | set /p bits="Choose your architecture (x86, x64, AnyCPU) [%bits%]: " | ||
91 | if %bits%==86 goto configuration | ||
92 | if %bits%==x86 goto configuration | ||
93 | if %bits%==64 goto configuration | ||
94 | if %bits%==x64 goto configuration | ||
95 | if %bits%==AnyCPU goto configuration | ||
96 | if %bits%==anycpu goto configuration | ||
97 | echo "%bits%" isn't a valid choice! | ||
98 | goto bits | ||
99 | |||
100 | :configuration | ||
101 | set /p configuration="Choose your configuration ((r)elease or (d)ebug)? [%configuration%]: " | ||
102 | if %configuration%==r goto framework | ||
103 | if %configuration%==d goto framework | ||
104 | if %configuration%==release goto framework | ||
105 | if %configuration%==debug goto framework | ||
106 | echo "%configuration%" isn't a valid choice! | ||
107 | goto configuration | ||
108 | |||
109 | :framework | ||
110 | set /p framework="Choose your .NET framework (4_0 or 4_5)? [%framework%]: " | ||
111 | if %framework%==4_0 goto final | ||
112 | if %framework%==4_5 goto final | ||
113 | echo "%framework%" isn't a valid choice! | ||
114 | goto framework | ||
115 | |||
116 | :final | ||
117 | echo. | ||
118 | echo Configuring for %bits% architecture using %framework% .NET framework | ||
119 | echo. | ||
120 | echo. | ||
121 | |||
122 | |||
123 | if %framework%==4_5 set %vstudio%=2012 | ||
124 | |||
125 | echo Calling Prebuild for target %vstudio% with framework %framework%... | ||
126 | Prebuild.exe /target vs%vstudio% /targetframework v%framework% /conditionals ISWIN;NET_%framework% | ||
127 | |||