Skip to content

Commit

Permalink
More friendly batch files & error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
derivativeoflog7 committed Jul 11, 2023
1 parent 007ff07 commit ec595c4
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 16 deletions.
21 changes: 20 additions & 1 deletion SandboxiePlus/install_jom.cmd
Original file line number Diff line number Diff line change
@@ -1,6 +1,25 @@
@echo off

::Check that needed programs exist in path
where /q curl
if %ERRORLEVEL% == 1 (
echo curl.exe not found in path!
exit /b 1
)

where /q 7z
if %ERRORLEVEL% == 1 (
echo 7z.exe not found in path!
exit /b 2
)

curl -LsSO --output-dir %~dp0..\..\ https://download.qt.io/official_releases/jom/jom.zip
"C:\Program Files\7-Zip\7z.exe" x -aoa -o%~dp0..\..\Qt\Tools\QtCreator\bin\ %~dp0..\..\jom.zip
7z x -aoa -o%~dp0..\..\Qt\Tools\QtCreator\bin\ %~dp0..\..\jom.zip

REM dir %~dp0..\..\
REM dir %~dp0..\..\Qt
REM dir %~dp0..\..\Qt\Tools

echo Success!
::/b terminates the script without closing the CMD
exit /b 0
41 changes: 26 additions & 15 deletions SandboxiePlus/qmake_plus.cmd
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
REM @echo off
@echo off
REM echo Current dir: %cd%
REM echo folder: %~dp0
REM echo arch: %1


IF "%1" == "" (
call :print_usage
exit /b 2
)
IF %1 == Win32 (
set qt_path=%~dp0..\..\Qt\5.15.2\msvc2019

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

REM get private headers for QtCore
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
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
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

set build_arch=x64
set qt_params=
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
)
IF %1 == ARM64 (
) ELSE IF %1 == ARM64 (
set qt_path=%~dp0..\..\Qt\6.3.1\msvc2019_64

REM get private headers for QtCore
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

set build_arch=ARM64

REM set qt_params=-qtconf "%~dp0..\..\Qt\6.3.1\msvc2019_arm64\bin\target_qt.conf"

REM type %~dp0..\..\Qt\6.3.1\msvc2019_arm64\bin\target_qt.conf

REM set qt_params=-qtconf "%~dp0..\..\Qt\6.3.1\msvc2019_arm64\bin\target_qt.conf"
REM type %~dp0..\..\Qt\6.3.1\msvc2019_arm64\bin\target_qt.conf
REM
REM The target_qt.conf as provided by the windows-2019 github action runner
REM is non functional, hence we create our own working edition here.
Expand All @@ -58,8 +60,12 @@ REM type %~dp0..\..\Qt\6.3.1\msvc2019_arm64\bin\target_qt.conf

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

REM set VSCMD_DEBUG=3
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsamd64_arm64.bat"
REM set VSCMD_DEBUG=3
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsamd64_arm64.bat"
) ELSE (
echo Unknown architecture!
call :print_usage
exit /b 2
)
@echo on

Expand Down Expand Up @@ -121,8 +127,13 @@ rem dir .\bin
rem dir .\bin\%build_arch%
rem dir .\bin\%build_arch%\Release

goto :eof
exit /b 0

:print_usage
echo Usage: qmake_plus.cmd ^<architecture^>
echo Architecture can be Win32 / x64 / ARM64

:error
echo Build failed
exit 1
exit /b 1

0 comments on commit ec595c4

Please sign in to comment.