2026-07-13 03:23:39 -04:00 | | | @echo off
|
| | | REM Builds WarriorDML.dll with MSVC. Run this from a plain cmd/PowerShell
|
| | | REM window - it locates and loads the VS build environment itself, no
|
| | | REM need to open a "Developer Command Prompt" first.
|
| | | setlocal
|
| | |
|
| | | set VSWHERE="%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe"
|
| | | if not exist %VSWHERE% (
|
| | | echo Could not find vswhere.exe - is Visual Studio / Build Tools installed?
|
| | | exit /b 1
|
| | | )
|
| | |
|
| | | for /f "usebackq tokens=*" %%i in (`%VSWHERE% -latest -products * -property installationPath`) do (
|
| | | set VSINSTALL=%%i
|
| | | )
|
| | | if not defined VSINSTALL (
|
| | | echo Could not find any Visual Studio / Build Tools installation.
|
| | | exit /b 1
|
| | | )
|
| | | if not exist "%VSINSTALL%\VC\Auxiliary\Build\vcvars64.bat" (
|
| | | echo Found a VS install at "%VSINSTALL%" but it has no C++ toolset ^(vcvars64.bat missing^).
|
| | | echo Install the "Desktop development with C++" workload ^(or the smaller
|
| | | echo "Build Tools for Visual Studio"^) and re-run this script.
|
| | | exit /b 1
|
| | | )
|
| | |
|
| | | call "%VSINSTALL%\VC\Auxiliary\Build\vcvars64.bat"
|
| | | if errorlevel 1 exit /b 1
|
| | |
|
| | | cd /d "%~dp0"
|
| | | cl.exe /nologo /LD /EHsc /O2 /std:c++17 ^
|
| | | WarriorDML.cpp ^
|
| | | /Fe:WarriorDML.dll ^
|
| | | d3d12.lib dxgi.lib d3dcompiler.lib
|
| | |
|
| | | if errorlevel 1 (
|
| | | echo Build failed.
|
| | | exit /b 1
|
| | | )
|
| | |
|
2026-07-28 20:46:27 -04:00 | | | set "TARGET_ROOT=%APPDATA%\MetaQuotes"
|
| | | if exist "%TARGET_ROOT%\Terminal" (
|
| | | for /d %%D in ("%TARGET_ROOT%\Terminal\*") do (
|
| | | if exist "%%~fD\MQL5\Libraries" (
|
| | | copy /Y "%~dp0WarriorCPU.dll" "%%~fD\MQL5\Libraries\WarriorCPU.dll" >nul 2>&1
|
| | | copy /Y "%~dp0WarriorDML.dll" "%%~fD\MQL5\Libraries\WarriorDML.dll" >nul 2>&1
|
| | | )
|
| | | )
|
| | | )
|
| | | if exist "%TARGET_ROOT%\Tester" (
|
| | | for /d %%D in ("%TARGET_ROOT%\Tester\*") do (
|
| | | if exist "%%~fD\MQL5\Libraries" (
|
| | | copy /Y "%~dp0WarriorCPU.dll" "%%~fD\MQL5\Libraries\WarriorCPU.dll" >nul 2>&1
|
| | | copy /Y "%~dp0WarriorDML.dll" "%%~fD\MQL5\Libraries\WarriorDML.dll" >nul 2>&1
|
| | | )
|
| | | )
|
| | | )
|
| | |
|
2026-07-13 03:23:39 -04:00 | | | echo.
|
| | | echo Built DirectML\WarriorDML.dll
|
2026-07-28 20:46:27 -04:00 | | | echo Deployed to any discovered MetaTrader MQL5\Libraries folders.
|
2026-07-13 03:23:39 -04:00 | | | endlocal
|