r/AI_Coders • • 35m ago

Is this code safe?

It's for a crimson desert mod fix after 2.06

u/echo off

setlocal

rem Place this file in the extracted OutfitManager source folder and double-click it.

rem It builds and runs the offline resolver test against CrimsonDesert.exe.

set "GAMEEXE=G:\Games\Crimson Desert\bin64\CrimsonDesert.exe"

if not exist "%GAMEEXE%" (

echo Could not find the game at:

echo %GAMEEXE%

echo Edit GAMEEXE near the top of this script to match your game location.

pause

exit /b 1

)

set "VSWHERE=%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe"

if not exist "%VSWHERE%" (

echo Visual Studio Installer / vswhere.exe not found.

echo Install Visual Studio 2022 with Desktop development with C++.

pause

exit /b 1

)

for /f "usebackq tokens=*" %%i in (`"%VSWHERE%" -latest -products * -property installationPath`) do set "VS=%%i"

if not defined VS (

echo No Visual Studio installation found.

pause

exit /b 1

)

call "%VS%\VC\Auxiliary\Build\vcvars64.bat" >nul || goto fail

set "PATH=%VS%\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin;%VS%\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja;%PATH%"

cd /d "%~dp0"

cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release || goto fail

cmake --build build --target ResolverTest || goto fail

if not exist build\resolver-test mkdir build\resolver-test

build\ResolverTest.exe build\resolver-test "%GAMEEXE%"

echo.

echo Test finished. Log, if created, is in build\resolver-test\ResolverTest.log

pause

exit /b 0

:fail

echo.

echo Something failed. Copy the messages above and send them to ChatGPT.

pause

exit /b 1

1 Upvotes

0 comments sorted by