From 3e7205cb52704d7899c6d2498ef60b44b26a552c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=28x*ln=287=29=29=E2=81=BB=C2=B9?= <100133857+DerivativeOfLog7@users.noreply.github.com> Date: Tue, 11 Jul 2023 15:31:16 +0200 Subject: [PATCH 1/9] Trying to get ARM64 compilation to work --- Sandboxie/ReadMe.md | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Sandboxie/ReadMe.md b/Sandboxie/ReadMe.md index 3cd106f63d..7bcb8c8a29 100644 --- a/Sandboxie/ReadMe.md +++ b/Sandboxie/ReadMe.md @@ -1,11 +1,17 @@ ## Sandboxie Build Instructions Please note: there is another [ReadMe.md](./install/ReadMe.md) file in the [\install](./install/) folder that explains how to create the Sandboxie installers. - -1) Sandboxie builds under MS Visual Studio 2019. -2) Install the Windows Driver Kit (WDK) for Windows 10, version 2004: +Sandboxie builds under MS Visual Studio 2019. +1) Acquire [Visual Studio 2019](https://visualstudio.microsoft.com/vs/older-downloads/#visual-studio-2019-and-other-products) +2) In the Visual Studio Installer, under the Workloads tab, tick "Desktop development with C++" + - This will also install the Windows 10 SDK (10.0.19041) and MFC for latest v142 by default +3) If you need to compile for other platforms, make sure to check the corresponding items in the side panel + - MSVC v142 - VS 2019 C++ {architecture} build tools (Latest) + - MFC for latest v142 build tools {architecture} +4) Install the Windows Driver Kit (WDK) for Windows 10, version 2004 (10.0.19041): https://go.microsoft.com/fwlink/?linkid=2128854 -3) The VS Solution File, Sandbox.sln, is in the source code root. Open this SLN in Visual Studio. +5) The VS Solution File, Sandbox.sln, is in the source code root. Open this SLN in Visual Studio. +6) Note that to compile for x64 it's necessary to first compile ´Solution/core/LowLevel ### Source Projects (in alphabetical order) From 007ff07e014f6e3e6958fbf68e6d13e7cdbc279b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=28x*ln=287=29=29=E2=81=BB=C2=B9?= <100133857+DerivativeOfLog7@users.noreply.github.com> Date: Tue, 11 Jul 2023 15:35:40 +0200 Subject: [PATCH 2/9] Add more build instructions --- Sandboxie/ReadMe.md | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/Sandboxie/ReadMe.md b/Sandboxie/ReadMe.md index 7bcb8c8a29..238ff6ae30 100644 --- a/Sandboxie/ReadMe.md +++ b/Sandboxie/ReadMe.md @@ -1,17 +1,21 @@ ## Sandboxie Build Instructions -Please note: there is another [ReadMe.md](./install/ReadMe.md) file in the [\install](./install/) folder that explains how to create the Sandboxie installers. -Sandboxie builds under MS Visual Studio 2019. +Please note: there is another [ReadMe.md](./install/ReadMe.md) file in the [\install](./install/) folder that explains how to create the Sandboxie installers. + +Sandboxie builds under MS Visual Studio 2019. 1) Acquire [Visual Studio 2019](https://visualstudio.microsoft.com/vs/older-downloads/#visual-studio-2019-and-other-products) -2) In the Visual Studio Installer, under the Workloads tab, tick "Desktop development with C++" - - This will also install the Windows 10 SDK (10.0.19041) and MFC for latest v142 by default -3) If you need to compile for other platforms, make sure to check the corresponding items in the side panel +2) In the Visual Studio Installer, tick "Desktop development with C++" + - This will install all needed components to build, including the Windows 10 SDK 10.0.19041 +3) If you need to build for other platforms, install the corresponding components - MSVC v142 - VS 2019 C++ {architecture} build tools (Latest) - MFC for latest v142 build tools {architecture} 4) Install the Windows Driver Kit (WDK) for Windows 10, version 2004 (10.0.19041): https://go.microsoft.com/fwlink/?linkid=2128854 5) The VS Solution File, Sandbox.sln, is in the source code root. Open this SLN in Visual Studio. -6) Note that to compile for x64 it's necessary to first compile ´Solution/core/LowLevel +6) If the WDK Extension doesn't install automatically, install it (can be found in \10\Vsix\VS2019) +7) If you have a more recent Windows SDK version installed, retarget the solution to 10.0.19041 + - This is for example necessary if VS2022 is also installed with the default desktop C++ components +8) To compile for x64, it's necessary to first compile `Solution/core/LowLevel` for Win32 ### Source Projects (in alphabetical order) From ec595c4f62e94e02b225006b1cef1845993c7310 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=28x*ln=287=29=29=E2=81=BB=C2=B9?= <100133857+DerivativeOfLog7@users.noreply.github.com> Date: Tue, 11 Jul 2023 23:13:33 +0200 Subject: [PATCH 3/9] More friendly batch files & error handling --- SandboxiePlus/install_jom.cmd | 21 +++++++++++++++++- SandboxiePlus/qmake_plus.cmd | 41 ++++++++++++++++++++++------------- 2 files changed, 46 insertions(+), 16 deletions(-) diff --git a/SandboxiePlus/install_jom.cmd b/SandboxiePlus/install_jom.cmd index 449f116af5..4507d5236b 100644 --- a/SandboxiePlus/install_jom.cmd +++ b/SandboxiePlus/install_jom.cmd @@ -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 \ No newline at end of file diff --git a/SandboxiePlus/qmake_plus.cmd b/SandboxiePlus/qmake_plus.cmd index a0f8e4bcce..e226030b91 100644 --- a/SandboxiePlus/qmake_plus.cmd +++ b/SandboxiePlus/qmake_plus.cmd @@ -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 @@ -13,20 +17,18 @@ 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 @@ -34,10 +36,10 @@ IF %1 == ARM64 ( 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. @@ -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 @@ -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 ^ +echo Architecture can be Win32 / x64 / ARM64 :error echo Build failed -exit 1 +exit /b 1 + From 251d7cc0fd8aad62a0c81d24ae6521b1c83ec8ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=28x*ln=287=29=29=E2=81=BB=C2=B9?= <100133857+DerivativeOfLog7@users.noreply.github.com> Date: Tue, 11 Jul 2023 23:30:07 +0200 Subject: [PATCH 4/9] Fix building Release x64 on VS --- SandboxiePlus/SandMan/SandMan.vcxproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SandboxiePlus/SandMan/SandMan.vcxproj b/SandboxiePlus/SandMan/SandMan.vcxproj index ef0ff22ac5..d9d90fa2c6 100644 --- a/SandboxiePlus/SandMan/SandMan.vcxproj +++ b/SandboxiePlus/SandMan/SandMan.vcxproj @@ -127,7 +127,7 @@ msvc2019_64 - core;gui;network;qml;widgets;concurrent;widgets-private;qml-private + core;network;gui;widgets;qml;winextras;concurrent;widgets-private;qml-private msvc2019_64 From ffa5b20f7f43bd5e84de323b183ca44110252a47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=28x*ln=287=29=29=E2=81=BB=C2=B9?= <100133857+DerivativeOfLog7@users.noreply.github.com> Date: Thu, 13 Jul 2023 16:13:39 +0200 Subject: [PATCH 5/9] move check at the beginningD --- SandboxiePlus/install_jom.cmd | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/SandboxiePlus/install_jom.cmd b/SandboxiePlus/install_jom.cmd index 7832d8cc7e..d634eec3a4 100644 --- a/SandboxiePlus/install_jom.cmd +++ b/SandboxiePlus/install_jom.cmd @@ -1,5 +1,10 @@ @echo off +if exist %~dp0..\..\Qt\Tools\QtCreator\bin\jom.exe ( + echo jom already installed, nothing to do + goto done +) + ::Check that needed programs exist in path where /q curl if %ERRORLEVEL% == 1 ( @@ -13,8 +18,6 @@ if %ERRORLEVEL% == 1 ( exit /b 2 ) -if exist %~dp0..\..\Qt\Tools\QtCreator\bin\jom.exe goto done - curl -LsSO --output-dir %~dp0..\..\ https://download.qt.io/official_releases/jom/jom.zip 7z x -aoa -o%~dp0..\..\Qt\Tools\QtCreator\bin\ %~dp0..\..\jom.zip @@ -26,4 +29,4 @@ REM dir %~dp0..\..\Qt\Tools echo Success! ::/b terminates the script without closing the CMD -exit /b 0 \ No newline at end of file +exit /b 0 From 772951eabc8eb0f8568e091af55abab6a36eed04 Mon Sep 17 00:00:00 2001 From: DerivativeOfLog7 <100133857+DerivativeOfLog7@users.noreply.github.com> Date: Thu, 3 Aug 2023 13:58:15 +0200 Subject: [PATCH 6/9] Add MFC requirement --- Sandboxie/ReadMe.md | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/Sandboxie/ReadMe.md b/Sandboxie/ReadMe.md index 238ff6ae30..cf9aa3fcc6 100644 --- a/Sandboxie/ReadMe.md +++ b/Sandboxie/ReadMe.md @@ -4,18 +4,19 @@ Please note: there is another [ReadMe.md](./install/ReadMe.md) file in the [\ins Sandboxie builds under MS Visual Studio 2019. 1) Acquire [Visual Studio 2019](https://visualstudio.microsoft.com/vs/older-downloads/#visual-studio-2019-and-other-products) -2) In the Visual Studio Installer, tick "Desktop development with C++" - - This will install all needed components to build, including the Windows 10 SDK 10.0.19041 -3) If you need to build for other platforms, install the corresponding components - - MSVC v142 - VS 2019 C++ {architecture} build tools (Latest) - - MFC for latest v142 build tools {architecture} -4) Install the Windows Driver Kit (WDK) for Windows 10, version 2004 (10.0.19041): +2) In the Visual Studio Installer, tick _Desktop development with C++_ + - This includes the Windows 10 SDK 10.0.19041 +3) The _MFC for latest v142 build tools {architecture}_ is also needed. Select it from the side panel or from the individual components tab +4) If you need to build for other platforms, install the corresponding components + - _MSVC v142 - VS 2019 C++ {architecture} build tools (Latest)_ + - _MFC for latest v142 build tools {architecture}_ +5) Install the Windows Driver Kit (WDK) for Windows 10, version 2004 (10.0.19041): https://go.microsoft.com/fwlink/?linkid=2128854 -5) The VS Solution File, Sandbox.sln, is in the source code root. Open this SLN in Visual Studio. -6) If the WDK Extension doesn't install automatically, install it (can be found in \10\Vsix\VS2019) -7) If you have a more recent Windows SDK version installed, retarget the solution to 10.0.19041 +6) The VS Solution File, Sandbox.sln, is in the source code root. Open this SLN in Visual Studio. +7) If the WDK Extension doesn't install automatically, install it (can be found in \10\Vsix\VS2019) +8) If you have a more recent Windows SDK version installed, retarget the solution to 10.0.19041 - This is for example necessary if VS2022 is also installed with the default desktop C++ components -8) To compile for x64, it's necessary to first compile `Solution/core/LowLevel` for Win32 +9) To compile for x64, it's necessary to first compile `Solution/core/LowLevel` for Win32 (x86) ### Source Projects (in alphabetical order) From 9ac86027701bbb3f868f6a8b90097c761a631c76 Mon Sep 17 00:00:00 2001 From: DerivativeOfLog7 <100133857+DerivativeOfLog7@users.noreply.github.com> Date: Thu, 3 Aug 2023 13:58:33 +0200 Subject: [PATCH 7/9] Rework scripts to be more flexible (WIP) --- SandboxiePlus/install_jom.cmd | 12 +++-- SandboxiePlus/qmake_plus.cmd | 84 ++++++++++++++++++++--------------- 2 files changed, 57 insertions(+), 39 deletions(-) diff --git a/SandboxiePlus/install_jom.cmd b/SandboxiePlus/install_jom.cmd index d634eec3a4..a7db257035 100644 --- a/SandboxiePlus/install_jom.cmd +++ b/SandboxiePlus/install_jom.cmd @@ -1,6 +1,12 @@ @echo off -if exist %~dp0..\..\Qt\Tools\QtCreator\bin\jom.exe ( +IF "%1" == "" ( + set qt_root_dir=%~dp0..\..\Qt +) ELSE ( + set qt_root_dir=%1 +) + +if exist %qt_root_dir%\Tools\QtCreator\bin\jom.exe ( echo jom already installed, nothing to do goto done ) @@ -18,8 +24,8 @@ if %ERRORLEVEL% == 1 ( exit /b 2 ) -curl -LsSO --output-dir %~dp0..\..\ https://download.qt.io/official_releases/jom/jom.zip -7z x -aoa -o%~dp0..\..\Qt\Tools\QtCreator\bin\ %~dp0..\..\jom.zip +curl -LsSO --output-dir %qt_root_dir%\ https://download.qt.io/official_releases/jom/jom.zip +7z x -aoa -o%qt_root_dir%\Tools\QtCreator\bin\ %qt_root_dir%\jom.zip :done diff --git a/SandboxiePlus/qmake_plus.cmd b/SandboxiePlus/qmake_plus.cmd index e226030b91..8509a8b5df 100644 --- a/SandboxiePlus/qmake_plus.cmd +++ b/SandboxiePlus/qmake_plus.cmd @@ -1,38 +1,48 @@ @echo off -REM echo Current dir: %cd% +REM echo Current dir: %cd /d% REM echo folder: %~dp0 REM echo arch: %1 +set ORIGINAL_FOLDER=%cd% +set WIN32_QT_VER=5.15.2 +set x64_QT_VER=5.15.2 +set ARM64_QT_VER=6.3.2 +IF "%2" == "" ( + set qt_root_dir=%~dp0..\..\Qt +) ELSE ( + set qt_root_dir=%2 +) + +REM Print usage if no architecture is specified IF "%1" == "" ( call :print_usage exit /b 2 ) -IF %1 == Win32 ( - set qt_path=%~dp0..\..\Qt\5.15.2\msvc2019 +IF %1 == Win32 ( + set qt_path=%qt_root_dir%\%WIN32_QT_VER%\msvc2019 + REM get private headers for QtCore - Xcopy /E /I /Y /Q %~dp0..\..\Qt\5.15.2\msvc2019\include\QtCore\5.15.2\QtCore %~dp0..\..\Qt\5.15.2\msvc2019\include\QtCore + Xcopy /E /I /Y /Q %qt_root_dir%\%WIN32_QT_VER%\msvc2019\include\QtCore\%WIN32_QT_VER%\QtCore %qt_root_dir%\%WIN32_QT_VER%\msvc2019\include\QtCore set build_arch=Win32 set qt_params= -call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars32.bat" + call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars32.bat" ) 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 + set qt_path=%qt_root_dir%\%x64_QT_VER%\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 + Xcopy /E /I /Y /Q %qt_root_dir%\%x64_QT_VER%\msvc2019_64\include\QtCore\%x64_QT_VER%\QtCore %qt_root_dir%\%x64_QT_VER%\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" ) ELSE IF %1 == ARM64 ( - set qt_path=%~dp0..\..\Qt\6.3.1\msvc2019_64 + set qt_path=%qt_root_dir%\%ARM64_QT_VER%\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 + Xcopy /E /I /Y /Q %qt_root_dir%\%ARM64_QT_VER%\msvc2019_arm64\include\QtCore\%ARM64_QT_VER%\QtCore %qt_root_dir%\%ARM64_QT_VER%\msvc2019_arm64\include\QtCore set build_arch=ARM64 @@ -45,20 +55,20 @@ call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliar REM is non functional, hence we create our own working edition here. REM - echo [DevicePaths] > %~dp0..\..\Qt\6.3.1\msvc2019_arm64\bin\my_target_qt.conf - echo Prefix=C:/Qt/Qt-6.3.1 >> %~dp0..\..\Qt\6.3.1\msvc2019_arm64\bin\my_target_qt.conf - echo [Paths] >> %~dp0..\..\Qt\6.3.1\msvc2019_arm64\bin\my_target_qt.conf - echo Prefix=../ >> %~dp0..\..\Qt\6.3.1\msvc2019_arm64\bin\my_target_qt.conf - echo HostPrefix=../../msvc2019_64 >> %~dp0..\..\Qt\6.3.1\msvc2019_arm64\bin\my_target_qt.conf - echo HostData=../msvc2019_arm64 >> %~dp0..\..\Qt\6.3.1\msvc2019_arm64\bin\my_target_qt.conf - echo Sysroot= >> %~dp0..\..\Qt\6.3.1\msvc2019_arm64\bin\my_target_qt.conf - echo SysrootifyPrefix=false >> %~dp0..\..\Qt\6.3.1\msvc2019_arm64\bin\my_target_qt.conf - echo TargetSpec=win32-arm64-msvc >> %~dp0..\..\Qt\6.3.1\msvc2019_arm64\bin\my_target_qt.conf - echo HostSpec=win32-msvc >> %~dp0..\..\Qt\6.3.1\msvc2019_arm64\bin\my_target_qt.conf - echo Documentation=../../Docs/Qt-6.3.1 >> %~dp0..\..\Qt\6.3.1\msvc2019_arm64\bin\my_target_qt.conf - echo Examples=../../Examples/Qt-6.3.1 >> %~dp0..\..\Qt\6.3.1\msvc2019_arm64\bin\my_target_qt.conf + echo [DevicePaths] > %qt_root_dir%\%ARM64_QT_VER%\msvc2019_arm64\bin\my_target_qt.conf + echo Prefix=%qt_root_dir% >> %qt_root_dir%\%ARM64_QT_VER%\msvc2019_arm64\bin\my_target_qt.conf + echo [Paths] >> %qt_root_dir%\%ARM64_QT_VER%\msvc2019_arm64\bin\my_target_qt.conf + echo Prefix=../ >> %qt_root_dir%\%ARM64_QT_VER%\msvc2019_arm64\bin\my_target_qt.conf + echo HostPrefix=../../msvc2019_64 >> %qt_root_dir%\%ARM64_QT_VER%\msvc2019_arm64\bin\my_target_qt.conf + echo HostData=../msvc2019_arm64 >> %qt_root_dir%\%ARM64_QT_VER%\msvc2019_arm64\bin\my_target_qt.conf + echo Sysroot= >> %qt_root_dir%\%ARM64_QT_VER%\msvc2019_arm64\bin\my_target_qt.conf + echo SysrootifyPrefix=false >> %qt_root_dir%\%ARM64_QT_VER%\msvc2019_arm64\bin\my_target_qt.conf + echo TargetSpec=win32-arm64-msvc >> %qt_root_dir%\%ARM64_QT_VER%\msvc2019_arm64\bin\my_target_qt.conf + echo HostSpec=win32-msvc >> %qt_root_dir%\%ARM64_QT_VER%\msvc2019_arm64\bin\my_target_qt.conf + echo Documentation=../../Docs/Qt-%ARM64_QT_VER% >> %qt_root_dir%\%ARM64_QT_VER%\msvc2019_arm64\bin\my_target_qt.conf + echo Examples=../../Examples/Qt-%ARM64_QT_VER% >> %qt_root_dir%\%ARM64_QT_VER%\msvc2019_arm64\bin\my_target_qt.conf - set qt_params=-qtconf "%~dp0..\..\Qt\6.3.1\msvc2019_arm64\bin\my_target_qt.conf" + set qt_params=-qtconf "%qt_root_dir%\%ARM64_QT_VER%\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" @@ -72,56 +82,56 @@ call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliar mkdir %~dp0\Build_UGlobalHotkey_%build_arch% -cd %~dp0\Build_UGlobalHotkey_%build_arch% +cd /d %~dp0\Build_UGlobalHotkey_%build_arch% %qt_path%\bin\qmake.exe %~dp0\UGlobalHotkey\uglobalhotkey.qc.pro %qt_params% -%~dp0..\..\Qt\Tools\QtCreator\bin\jom.exe -f Makefile.Release -j 8 +%qt_root_dir%\Tools\QtCreator\bin\jom.exe -f Makefile.Release -j 8 IF %ERRORLEVEL% NEQ 0 goto :error if NOT EXIST %~dp0\bin\%build_arch%\Release\UGlobalHotkey.dll goto :error mkdir %~dp0\Build_qtsingleapp_%build_arch% -cd %~dp0\Build_qtsingleapp_%build_arch% +cd /d %~dp0\Build_qtsingleapp_%build_arch% %qt_path%\bin\qmake.exe %~dp0\QtSingleApp\qtsingleapp\qtsingleapp\qtsingleapp.qc.pro %qt_params% -%~dp0..\..\Qt\Tools\QtCreator\bin\jom.exe -f Makefile.Release -j 8 +%qt_root_dir%\Tools\QtCreator\bin\jom.exe -f Makefile.Release -j 8 IF %ERRORLEVEL% NEQ 0 goto :error if NOT EXIST %~dp0\bin\%build_arch%\Release\qtsingleapp.dll goto :error mkdir %~dp0\Build_MiscHelpers_%build_arch% -cd %~dp0\Build_MiscHelpers_%build_arch% +cd /d %~dp0\Build_MiscHelpers_%build_arch% %qt_path%\bin\qmake.exe %~dp0\MiscHelpers\MiscHelpers.qc.pro %qt_params% -%~dp0..\..\Qt\Tools\QtCreator\bin\jom.exe -f Makefile.Release -j 8 +%qt_root_dir%\Tools\QtCreator\bin\jom.exe -f Makefile.Release -j 8 IF %ERRORLEVEL% NEQ 0 goto :error if NOT EXIST %~dp0\bin\%build_arch%\Release\MiscHelpers.dll goto :error mkdir %~dp0\Build_QSbieAPI_%build_arch% -cd %~dp0\Build_QSbieAPI_%build_arch% +cd /d %~dp0\Build_QSbieAPI_%build_arch% %qt_path%\bin\qmake.exe %~dp0\QSbieAPI\QSbieAPI.qc.pro %qt_params% -%~dp0..\..\Qt\Tools\QtCreator\bin\jom.exe -f Makefile.Release -j 8 +%qt_root_dir%\Tools\QtCreator\bin\jom.exe -f Makefile.Release -j 8 IF %ERRORLEVEL% NEQ 0 goto :error if NOT EXIST %~dp0\bin\%build_arch%\Release\QSbieAPI.dll goto :error mkdir %~dp0\Build_SandMan_%build_arch% -cd %~dp0\Build_SandMan_%build_arch% +cd /d %~dp0\Build_SandMan_%build_arch% %qt_path%\bin\qmake.exe %~dp0\SandMan\SandMan.qc.pro %qt_params% -%~dp0..\..\Qt\Tools\QtCreator\bin\jom.exe -f Makefile.Release -j 8 +%qt_root_dir%\Tools\QtCreator\bin\jom.exe -f Makefile.Release -j 8 IF %ERRORLEVEL% NEQ 0 goto :error if NOT EXIST %~dp0\bin\%build_arch%\Release\SandMan.exe goto :error -cd %~dp0 +cd /d %~dp0 rem dir .\bin rem dir .\bin\%build_arch% @@ -132,8 +142,10 @@ exit /b 0 :print_usage echo Usage: qmake_plus.cmd ^ echo Architecture can be Win32 / x64 / ARM64 +exit /b 0 :error -echo Build failed +echo Build failed! Make sure you installed the correct Qt version and components +cd /d %ORIGINAL_FOLDER% exit /b 1 From abebb51a369bb66cce9f1f05a74228b4cdd5c922 Mon Sep 17 00:00:00 2001 From: DerivativeOfLog7 <100133857+DerivativeOfLog7@users.noreply.github.com> Date: Thu, 3 Aug 2023 14:06:49 +0200 Subject: [PATCH 8/9] Add option to change the -j value --- SandboxiePlus/qmake_plus.cmd | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/SandboxiePlus/qmake_plus.cmd b/SandboxiePlus/qmake_plus.cmd index 8509a8b5df..c81166fb4b 100644 --- a/SandboxiePlus/qmake_plus.cmd +++ b/SandboxiePlus/qmake_plus.cmd @@ -1,4 +1,4 @@ -@echo off +REM @echo off REM echo Current dir: %cd /d% REM echo folder: %~dp0 REM echo arch: %1 @@ -8,6 +8,14 @@ set WIN32_QT_VER=5.15.2 set x64_QT_VER=5.15.2 set ARM64_QT_VER=6.3.2 +IF "%3" == "" ( + set parallelism=8 +) ELSE ( + set parallelism=%3 +) +set parallelism=-j %parallelism% + + IF "%2" == "" ( set qt_root_dir=%~dp0..\..\Qt ) ELSE ( @@ -85,7 +93,7 @@ mkdir %~dp0\Build_UGlobalHotkey_%build_arch% cd /d %~dp0\Build_UGlobalHotkey_%build_arch% %qt_path%\bin\qmake.exe %~dp0\UGlobalHotkey\uglobalhotkey.qc.pro %qt_params% -%qt_root_dir%\Tools\QtCreator\bin\jom.exe -f Makefile.Release -j 8 +%qt_root_dir%\Tools\QtCreator\bin\jom.exe -f Makefile.Release %parallelism% IF %ERRORLEVEL% NEQ 0 goto :error if NOT EXIST %~dp0\bin\%build_arch%\Release\UGlobalHotkey.dll goto :error @@ -95,7 +103,7 @@ mkdir %~dp0\Build_qtsingleapp_%build_arch% cd /d %~dp0\Build_qtsingleapp_%build_arch% %qt_path%\bin\qmake.exe %~dp0\QtSingleApp\qtsingleapp\qtsingleapp\qtsingleapp.qc.pro %qt_params% -%qt_root_dir%\Tools\QtCreator\bin\jom.exe -f Makefile.Release -j 8 +%qt_root_dir%\Tools\QtCreator\bin\jom.exe -f Makefile.Release %parallelism% IF %ERRORLEVEL% NEQ 0 goto :error if NOT EXIST %~dp0\bin\%build_arch%\Release\qtsingleapp.dll goto :error @@ -105,7 +113,7 @@ mkdir %~dp0\Build_MiscHelpers_%build_arch% cd /d %~dp0\Build_MiscHelpers_%build_arch% %qt_path%\bin\qmake.exe %~dp0\MiscHelpers\MiscHelpers.qc.pro %qt_params% -%qt_root_dir%\Tools\QtCreator\bin\jom.exe -f Makefile.Release -j 8 +%qt_root_dir%\Tools\QtCreator\bin\jom.exe -f Makefile.Release %parallelism% IF %ERRORLEVEL% NEQ 0 goto :error if NOT EXIST %~dp0\bin\%build_arch%\Release\MiscHelpers.dll goto :error @@ -115,7 +123,7 @@ mkdir %~dp0\Build_QSbieAPI_%build_arch% cd /d %~dp0\Build_QSbieAPI_%build_arch% %qt_path%\bin\qmake.exe %~dp0\QSbieAPI\QSbieAPI.qc.pro %qt_params% -%qt_root_dir%\Tools\QtCreator\bin\jom.exe -f Makefile.Release -j 8 +%qt_root_dir%\Tools\QtCreator\bin\jom.exe -f Makefile.Release %parallelism% IF %ERRORLEVEL% NEQ 0 goto :error if NOT EXIST %~dp0\bin\%build_arch%\Release\QSbieAPI.dll goto :error @@ -125,7 +133,7 @@ mkdir %~dp0\Build_SandMan_%build_arch% cd /d %~dp0\Build_SandMan_%build_arch% %qt_path%\bin\qmake.exe %~dp0\SandMan\SandMan.qc.pro %qt_params% -%qt_root_dir%\Tools\QtCreator\bin\jom.exe -f Makefile.Release -j 8 +%qt_root_dir%\Tools\QtCreator\bin\jom.exe -f Makefile.Release %parallelism% IF %ERRORLEVEL% NEQ 0 goto :error if NOT EXIST %~dp0\bin\%build_arch%\Release\SandMan.exe goto :error @@ -140,8 +148,11 @@ rem dir .\bin\%build_arch%\Release exit /b 0 :print_usage -echo Usage: qmake_plus.cmd ^ +echo Usage: qmake_plus.cmd ^ ^[Qt root directory^] ^[Threads to use (jom -j value)^] echo Architecture can be Win32 / x64 / ARM64 +echo Qt root directory defaults to ..\..\Qt +echo Threads to use defaults to 8 +echo Example: qmake_plus.cmd x64 D:\Qt 12 exit /b 0 :error From 2a1726ad8fc2b711f8a31091216befd1ce998217 Mon Sep 17 00:00:00 2001 From: isaak654 Date: Mon, 1 Apr 2024 16:44:40 +0200 Subject: [PATCH 9/9] Update install_qt.cmd --- SandboxiePlus/install_qt.cmd | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/SandboxiePlus/install_qt.cmd b/SandboxiePlus/install_qt.cmd index 0461c75227..d7e55bc5bf 100644 --- a/SandboxiePlus/install_qt.cmd +++ b/SandboxiePlus/install_qt.cmd @@ -1,16 +1,19 @@ +set WIN32_QT_VER=5.15.13 +set x64_QT_VER=5.15.13 + if %1 == Win32 ( - if exist %~dp0..\..\Qt\5.15.13\msvc2019\bin\qmake.exe goto done + if exist %~dp0..\..\Qt\%WIN32_QT_VER%\msvc2019\bin\qmake.exe goto done - curl -LsSO --output-dir %~dp0..\..\ https://github.com/xanasoft/qt-builds/releases/download/v5.15.13-lgpl/qt-everywhere-5.15.13-Windows_10-MSVC2019-x86.7z - "C:\Program Files\7-Zip\7z.exe" x -aoa -o%~dp0..\..\Qt\ %~dp0..\..\qt-everywhere-5.15.13-Windows_10-MSVC2019-x86.7z - certutil -hashfile %~dp0..\..\qt-everywhere-5.15.13-Windows_10-MSVC2019-x86.7z SHA256 | find /i "59ff4d30a756680f359cc937c78f878c3063510669fea306d48f4f745df952f6" + curl -LsSO --output-dir %~dp0..\..\ https://github.com/xanasoft/qt-builds/releases/download/v%WIN32_QT_VER%-lgpl/qt-everywhere-%WIN32_QT_VER%-Windows_10-MSVC2019-x86.7z + "C:\Program Files\7-Zip\7z.exe" x -aoa -o%~dp0..\..\Qt\ %~dp0..\..\qt-everywhere-%WIN32_QT_VER%-Windows_10-MSVC2019-x86.7z + certutil -hashfile %~dp0..\..\qt-everywhere-%WIN32_QT_VER%-Windows_10-MSVC2019-x86.7z SHA256 | find /i "59ff4d30a756680f359cc937c78f878c3063510669fea306d48f4f745df952f6" ) if %1 == x64 ( - if exist %~dp0..\..\Qt\5.15.13\msvc2019_64\bin\qmake.exe goto done + if exist %~dp0..\..\Qt\%x64_QT_VER%\msvc2019_64\bin\qmake.exe goto done - curl -LsSO --output-dir %~dp0..\..\ https://github.com/xanasoft/qt-builds/releases/download/v5.15.13-lgpl/qt-everywhere-5.15.13-Windows_10-MSVC2019-x86_64.7z - "C:\Program Files\7-Zip\7z.exe" x -aoa -o%~dp0..\..\Qt\ %~dp0..\..\qt-everywhere-5.15.13-Windows_10-MSVC2019-x86_64.7z - certutil -hashfile %~dp0..\..\qt-everywhere-5.15.13-Windows_10-MSVC2019-x86_64.7z SHA256 | find /i "3d7d7ac9d985c1cec1923fbe4feca630bcf5cc974f28e833d9c191e50906af2c" + curl -LsSO --output-dir %~dp0..\..\ https://github.com/xanasoft/qt-builds/releases/download/v%x64_QT_VER%-lgpl/qt-everywhere-%x64_QT_VER%-Windows_10-MSVC2019-x86_64.7z + "C:\Program Files\7-Zip\7z.exe" x -aoa -o%~dp0..\..\Qt\ %~dp0..\..\qt-everywhere-%x64_QT_VER%-Windows_10-MSVC2019-x86_64.7z + certutil -hashfile %~dp0..\..\qt-everywhere-%x64_QT_VER%-Windows_10-MSVC2019-x86_64.7z SHA256 | find /i "3d7d7ac9d985c1cec1923fbe4feca630bcf5cc974f28e833d9c191e50906af2c" ) if %ERRORLEVEL% == 1 exit /b 1 @@ -19,4 +22,4 @@ if %ERRORLEVEL% == 1 exit /b 1 REM dir %~dp0..\..\ REM dir %~dp0..\..\Qt -REM dir %~dp0..\..\Qt\5.15.13 +REM dir %~dp0..\..\Qt\%x64_QT_VER%