2026-03-11 23:11:44 -05:00
|
|
|
@echo off
|
2026-03-12 00:40:08 -05:00
|
|
|
setlocal EnableDelayedExpansion
|
2026-03-12 00:53:18 -05:00
|
|
|
REM Build HVNCInjection DLL for Windows x64 using MSBuild (vcxproj).
|
|
|
|
|
REM Run from VS Developer Command Prompt, or let the script detect VS.
|
2026-03-11 23:11:44 -05:00
|
|
|
|
|
|
|
|
set ROOT=%~dp0
|
2026-03-12 00:53:18 -05:00
|
|
|
set PROJ=%ROOT%HVNCInjection\HVNCInjection.vcxproj
|
2026-03-11 23:11:44 -05:00
|
|
|
set OUT_DIR=%ROOT%Overlord-Server\dist-clients
|
2026-03-17 23:21:26 -05:00
|
|
|
set CONFIG=Release
|
2026-03-12 00:53:18 -05:00
|
|
|
set PLATFORM=x64
|
2026-03-11 23:11:44 -05:00
|
|
|
|
2026-03-12 00:53:18 -05:00
|
|
|
REM Locate MSBuild via vswhere if not already on PATH
|
|
|
|
|
where msbuild.exe >nul 2>&1
|
2026-03-11 23:11:44 -05:00
|
|
|
if %ERRORLEVEL% neq 0 (
|
2026-03-12 00:53:18 -05:00
|
|
|
echo msbuild.exe not found, searching for Visual Studio ...
|
2026-03-11 23:11:44 -05:00
|
|
|
set "FOUND_VS="
|
2026-03-12 00:53:18 -05:00
|
|
|
for /f "usebackq tokens=*" %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -latest -products * -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe 2^>nul`) do (
|
|
|
|
|
set "MSBUILD_PATH=%%i"
|
2026-03-11 23:11:44 -05:00
|
|
|
set "FOUND_VS=1"
|
|
|
|
|
)
|
|
|
|
|
if not defined FOUND_VS (
|
2026-03-12 00:53:18 -05:00
|
|
|
echo ERROR: Visual Studio with MSBuild not found.
|
2026-03-11 23:11:44 -05:00
|
|
|
exit /b 1
|
|
|
|
|
)
|
2026-03-12 00:53:18 -05:00
|
|
|
echo Found MSBuild at: !MSBUILD_PATH!
|
2026-03-11 23:11:44 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
if not exist "%OUT_DIR%" mkdir "%OUT_DIR%"
|
|
|
|
|
|
2026-03-12 00:53:18 -05:00
|
|
|
echo Building HVNCInjection.vcxproj [%CONFIG%^|%PLATFORM%] ...
|
|
|
|
|
if defined MSBUILD_PATH (
|
|
|
|
|
"!MSBUILD_PATH!" "%PROJ%" /p:Configuration=%CONFIG% /p:Platform=%PLATFORM% /p:OutDir="%OUT_DIR%\\" /m /nologo /v:minimal
|
|
|
|
|
) else (
|
|
|
|
|
msbuild.exe "%PROJ%" /p:Configuration=%CONFIG% /p:Platform=%PLATFORM% /p:OutDir="%OUT_DIR%\\" /m /nologo /v:minimal
|
|
|
|
|
)
|
2026-03-11 23:11:44 -05:00
|
|
|
if %ERRORLEVEL% neq 0 goto :error
|
|
|
|
|
|
2026-03-12 00:53:18 -05:00
|
|
|
if not exist "%OUT_DIR%\HVNCInjection.x64.dll" (
|
|
|
|
|
echo ERROR: DLL not found in output directory.
|
|
|
|
|
goto :error
|
|
|
|
|
)
|
2026-03-11 23:11:44 -05:00
|
|
|
|
|
|
|
|
echo.
|
|
|
|
|
echo Built: %OUT_DIR%\HVNCInjection.x64.dll
|
|
|
|
|
dir "%OUT_DIR%\HVNCInjection.x64.dll"
|
|
|
|
|
|
|
|
|
|
echo Done.
|
|
|
|
|
exit /b 0
|
|
|
|
|
|
|
|
|
|
:error
|
|
|
|
|
echo.
|
|
|
|
|
echo BUILD FAILED
|
|
|
|
|
exit /b 1
|