-
Notifications
You must be signed in to change notification settings - Fork 4
/
SetupCodeBlocks_AllInOne.bat
206 lines (153 loc) · 6.4 KB
/
SetupCodeBlocks_AllInOne.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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
@echo off
echo CB4LSD+ : CodeBlocks for Legacy Software Development (+ modern) installer bundle
echo This scripts automatically installs CodeBlocks IDE (https://www.codeblocks.org/) and various compilers
echo.
echo This package allows building software for Windows 3.11 (Win32s), ANSI Windows 9x,
echo Windows 9x with Unicode (MSLU/Unicows), modern 64-bit Windows, MS-DOS
echo.
echo This script will download and prepare for use following software:
echo Code::Blocks 64-bit IDE wxWidgets 2.8.12, wxWidgets 3.0.5, wxWidgets 3.2.1
echo Compilers: Borland BCC5.5 (free version), TDM-GCC 32bit, MinGW-W64, DJGPP, OpenWatcom
echo.
echo DOSBox-X will also be installed to allow executing and testing MS-DOS software.
echo Windows 3.11 and Windows 95 will also be installed and configured
echo to allow automatic execution IF YOU PROVIDE YOUR OWN installation files.
echo Only English Windows 95 OSR2 and English WfW 3.11 are supported now.
echo.
echo.
pause
SET ZPATH=%~dp0\installers\7-zip
if not exist "%ZPATH%\7zr.exe" (
mkdir .\installers\7-zip
echo Downloading 7-zip
powershell wget https://www.7-zip.org/a/7zr.exe -UseBasicParsing -OutFile "%~dp0\installers\7-zip\7zr.exe"
powershell wget https://www.7-zip.org/a/7z2201.exe -UseBasicParsing -OutFile "%~dp0\installers\7-zip\7z2201.exe"
"%~dp0\installers\7-zip\7zr.exe" x "%~dp0\installers\7-zip\7z2201.exe" -o"%~dp0\installers\7-zip"
)
if not exist "%ZPATH%\7z.exe" (
"%~dp0\installers\7-zip\7zr.exe" x "%~dp0\installers\7-zip\7z2201.exe" -o"%~dp0\installers\7-zip"
)
xcopy "%~dp0\installers\_install-*.bat" "%~dp0"
REM CODE::BLOCKS INSTALLATION
REM =========================
pushd "%~dp0"
if not exist "%~dp0\installers\CB_202*.<7z" (
mkdir installers
echo Downloading Code::Blocks 2022.06.19 Win 64-bit
powershell Invoke-WebRequest https://master.dl.sourceforge.net/project/codeblocks/Binaries/Nightlies/2022/CB_20220619_rev12839_win64.7z -UserAgent "Wget" -OutFile '%~dp0\installers\CB_20220619_rev12839_win64.7z'
echo Downloading prerequisites
powershell Invoke-WebRequest https://kumisystems.dl.sourceforge.net/project/codeblocks/Binaries/Nightlies/Prerequisites/wxmsw31u_gcc_cb_wx315_2D_gcc810-mingw64.7z -UserAgent "Wget" -OutFile '%~dp0\installers\wxmsw31u_gcc_cb_wx315_2D_gcc810-mingw64.7z'
powershell Invoke-WebRequest https://altushost-swe.dl.sourceforge.net/project/codeblocks/Binaries/Nightlies/Prerequisites/Mingw64dlls8.1.0.7z -UserAgent "Wget" -OutFile '%~dp0\installers\Mingw64dlls8.1.0.7z'
)
if not exist .\CodeBlocks\ (
echo.
echo Extracting Code::Blocks
REM powershell "Expand-Archive '%~dp0\installers\codeblocks-20.03-nosetup.zip' '%~dp0\CodeBlocks'"
"%ZPATH%\7z.exe" x "%~dp0\installers\CB_202*" -o"%~dp0\CodeBlocks"
"%ZPATH%\7z.exe" x "%~dp0\installers\wxmsw3*" -o"%~dp0\CodeBlocks"
"%ZPATH%\7z.exe" x "%~dp0\installers\mingw64dlls*" -o"%~dp0\CodeBlocks"
)
REM BCC5.5 INSTALLATION
call _install-bcc55.bat
REM TDM-GCC 4.7.1 32-bit installation
call _install-tdmgcc32.bat
REM MinGW-W64 8.1.0 64-bit installation
call _install-mingw64.bat
REM DJGPP INSTALLATION
call _install-djgpp.bat
REM OPENWATCOM INSTALLATION
call _install-openwatcom.bat
REM WXWIDGETS 2.8.12 BUILD
if not exist "%~dp0\installers\wxMSW-2.8.12_prebuild.7z" (
call _install-wxmsw28bcc.bat
call _install-wxmsw28tdm32.bat
)
if exist "%~dp0\installers\wxMSW-2.8.12_prebuild.7z" (
if not exist "%~dp0\CodeBlocks\wxMSW-2.8.12\lib\bcc_lib\wxmsw28.lib" (
echo Unpacking pre-built wxWidgets 2.8.12
"%ZPATH%\7z.exe" x "%~dp0\installers\wxMSW-2.8.12_prebuild.7z" -o"%~dp0\CodeBlocks"
)
)
REM ===============================
REM WXWIDGETS 3.0.5 TDM-GCC32 BUILD
if not exist "%~dp0\installers\wxWidgets-3.0.5_prebuild.7z" (
call _install-wxmsw305tdm32.bat
)
if exist "%~dp0\installers\wxWidgets-3.0.5_prebuild.7z" (
if not exist "%~dp0\CodeBlocks\wxWidgets-3.0.5\lib\gcc_lib\libwxmsw30u.a" (
echo Unpacking pre-built wxWidgets 3.0.5 for TDM-GCC 32bit
"%ZPATH%\7z.exe" x "%~dp0\installers\wxWidgets-3.0.5_prebuild.7z" -o"%~dp0\CodeBlocks"
)
)
REM ===============================
REM WXWIDGETS 3.2.1 MINGW-W64 BUILD
if not exist "%~dp0\installers\wxWidgets-3.2.1_mingw64-810_msw64_prebuild.7z" (
call _install-wxmsw321mingw64.bat
)
if exist "%~dp0\installers\wxWidgets-3.2.1_mingw64-810_msw64_prebuild.7z" (
if not exist "%~dp0\CodeBlocks\wxWidgets-3.2.1\lib\gcc_lib\libwxmsw32u.a" (
echo Unpacking pre-built wxWidgets 3.2.1 for MinGW-W64 8.1.0
"%ZPATH%\7z.exe" x "%~dp0\installers\wxWidgets-3.2.1_mingw64-810_msw64_prebuild.7z" -o"%~dp0\CodeBlocks"
)
)
REM ===============================
pushd "%~dp0"
echo Copying project templates
xcopy /E /Y ".\installers\wizard\*.*" "%~dp0\CodeBlocks\share\CodeBlocks\templates\wizard\*.*"
echo Copying DOSBOX
xcopy /E /Y ".\installers\dosbox\*.*" "%~dp0\CodeBlocks\dosbox\*.*"
echo Copying DOSBOX-X
xcopy /E /Y ".\installers\dosboxx\*.*" "%~dp0\CodeBlocks\dosboxx\*.*"
echo Copying DOSBOXW31
xcopy /E /Y ".\installers\dosboxw31\*.*" "%~dp0\CodeBlocks\dosboxw31\*.*"
echo Copying DOSBOXW95
xcopy /E /Y ".\installers\dosboxw95\*.*" "%~dp0\CodeBlocks\dosboxw95\*.*"
echo Copying utils
xcopy /E /Y ".\installers\utils\*.*" "%~dp0\CodeBlocks\utils\*.*"
echo.
echo Generating run script
echo @echo off > runCodeBlocks.bat
echo cd /D ""%%~dp0"" >> runCodeBlocks.bat
echo cd CodeBlocks >> runCodeBlocks.bat
echo cd BCC55 >> runCodeBlocks.bat
echo set PATH=%%PATH%%;%%CD%% >> runCodeBlocks.bat
echo cd.. >> runCodeBlocks.bat
echo cd CodeBlocks >> runCodeBlocks.bat
echo START """" ""CbLauncher.exe"" >> runCodeBlocks.bat
echo.
echo Copying default config file
mkdir "%~dp0\CodeBlocks\AppData\codeblocks\"
copy "%~dp0\installers\default.conf" "%~dp0\CodeBlocks\AppData\codeblocks\default.conf"
echo.
echo.
echo Updating config file with local paths
pushd "%~dp0"
cd CodeBlocks
cd watcom
set WATCOMPATH=%CD%
pushd "%~dp0"
cd CodeBlocks
cd AppData
cd codeblocks
powershell "((Get-Content -path default.conf -Raw) -replace '\$\(APP-PATH\)\\watcom','%WATCOMPATH%') | Set-Content -Path default.conf"
pushd "%~dp0"
echo.
echo Unpacking samples
"%ZPATH%\7z.exe" x "%~dp0\installers\Samples.zip" -o"%~dp0"
pushd "%~dp0"
del /Q _install-*.bat
echo.
echo Installing DOSBOX and DOSBOX-X w/ Win3.11, Win95
pushd "%~dp0\CodeBlocks\dosboxx"
call dosboxx_install.bat
pushd "%~dp0\CodeBlocks\dosboxw31"
call _WFW311AUTOINSTALLER_.bat
pushd "%~dp0\CodeBlocks\dosboxw95"
call SetupW95DosboxX.bat
pushd "%~dp0"
echo All done.
echo.
echo Run runCodeBlocks.bat file to start the IDE.
echo.
pause
ren SetupCodeBlocks_AllInOne.bat SetupCodeBlocks_AllInOne.bak