Skip to content

Commit 02f6688

Browse files
More friendly batch files & error handling
1 parent 9407085 commit 02f6688

File tree

2 files changed

+46
-16
lines changed

2 files changed

+46
-16
lines changed

SandboxiePlus/install_jom.cmd

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,25 @@
1+
@echo off
2+
3+
::Check that needed programs exist in path
4+
where /q curl
5+
if %ERRORLEVEL% == 1 (
6+
echo curl.exe not found in path!
7+
exit /b 1
8+
)
9+
10+
where /q 7z
11+
if %ERRORLEVEL% == 1 (
12+
echo 7z.exe not found in path!
13+
exit /b 2
14+
)
15+
116
curl -LsSO --output-dir %~dp0..\..\ https://download.qt.io/official_releases/jom/jom.zip
2-
"C:\Program Files\7-Zip\7z.exe" x -aoa -o%~dp0..\..\Qt\Tools\QtCreator\bin\ %~dp0..\..\jom.zip
17+
7z x -aoa -o%~dp0..\..\Qt\Tools\QtCreator\bin\ %~dp0..\..\jom.zip
318

419
REM dir %~dp0..\..\
520
REM dir %~dp0..\..\Qt
621
REM dir %~dp0..\..\Qt\Tools
22+
23+
echo Success!
24+
::/b terminates the script without closing the CMD
25+
exit /b 0

SandboxiePlus/qmake_plus.cmd

Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1-
REM @echo off
1+
@echo off
22
REM echo Current dir: %cd%
33
REM echo folder: %~dp0
44
REM echo arch: %1
55

66

7+
IF "%1" == "" (
8+
call :print_usage
9+
exit /b 2
10+
)
711
IF %1 == Win32 (
812
set qt_path=%~dp0..\..\Qt\5.15.2\msvc2019
913

@@ -13,31 +17,29 @@ IF %1 == Win32 (
1317
set build_arch=Win32
1418
set qt_params=
1519
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars32.bat"
16-
)
17-
IF %1 == x64 (
20+
) ELSE IF %1 == x64 (
1821
set qt_path=%~dp0..\..\Qt\5.15.2\msvc2019_64
19-
REM set qt_path=%~dp0..\..\Qt\6.3.1\msvc2019_64
22+
REM set qt_path=%~dp0..\..\Qt\6.3.1\msvc2019_64
2023

2124
REM get private headers for QtCore
2225
Xcopy /E /I /Y /Q %~dp0..\..\Qt\5.15.2\msvc2019_64\include\QtCore\5.15.2\QtCore %~dp0..\..\Qt\5.15.2\msvc2019_64\include\QtCore
23-
REM Xcopy /E /I /Y /Q %~dp0..\..\Qt\6.3.1\msvc2019_64\include\QtCore\6.3.1\QtCore %~dp0..\..\Qt\6.3.1\msvc2019_64\include\QtCore
26+
REM Xcopy /E /I /Y /Q %~dp0..\..\Qt\6.3.1\msvc2019_64\include\QtCore\6.3.1\QtCore %~dp0..\..\Qt\6.3.1\msvc2019_64\include\QtCore
2427

2528
set build_arch=x64
2629
set qt_params=
2730
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
28-
)
29-
IF %1 == ARM64 (
31+
) ELSE IF %1 == ARM64 (
3032
set qt_path=%~dp0..\..\Qt\6.3.1\msvc2019_64
3133

3234
REM get private headers for QtCore
3335
Xcopy /E /I /Y /Q %~dp0..\..\Qt\6.3.1\msvc2019_arm64\include\QtCore\6.3.1\QtCore %~dp0..\..\Qt\6.3.1\msvc2019_arm64\include\QtCore
3436

3537
set build_arch=ARM64
3638

37-
REM set qt_params=-qtconf "%~dp0..\..\Qt\6.3.1\msvc2019_arm64\bin\target_qt.conf"
38-
39-
REM type %~dp0..\..\Qt\6.3.1\msvc2019_arm64\bin\target_qt.conf
40-
39+
REM set qt_params=-qtconf "%~dp0..\..\Qt\6.3.1\msvc2019_arm64\bin\target_qt.conf"
40+
41+
REM type %~dp0..\..\Qt\6.3.1\msvc2019_arm64\bin\target_qt.conf
42+
4143
REM
4244
REM The target_qt.conf as provided by the windows-2019 github action runner
4345
REM is non functional, hence we create our own working edition here.
@@ -58,8 +60,12 @@ REM type %~dp0..\..\Qt\6.3.1\msvc2019_arm64\bin\target_qt.conf
5860

5961
set qt_params=-qtconf "%~dp0..\..\Qt\6.3.1\msvc2019_arm64\bin\my_target_qt.conf"
6062

61-
REM set VSCMD_DEBUG=3
62-
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsamd64_arm64.bat"
63+
REM set VSCMD_DEBUG=3
64+
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsamd64_arm64.bat"
65+
) ELSE (
66+
echo Unknown architecture!
67+
call :print_usage
68+
exit /b 2
6369
)
6470
@echo on
6571

@@ -121,8 +127,13 @@ rem dir .\bin
121127
rem dir .\bin\%build_arch%
122128
rem dir .\bin\%build_arch%\Release
123129

124-
goto :eof
130+
exit /b 0
131+
132+
:print_usage
133+
echo Usage: qmake_plus.cmd ^<architecture^>
134+
echo Architecture can be Win32 / x64 / ARM64
125135

126136
:error
127137
echo Build failed
128-
exit 1
138+
exit /b 1
139+

0 commit comments

Comments
 (0)