27 lines
827 B
Batchfile
27 lines
827 B
Batchfile
|
|
@echo off
|
||
|
|
rem Build keygen.exe (Win32 GUI) with MSVC cl.exe.
|
||
|
|
rem Edit VS_VCVARS below if your Visual Studio lives elsewhere.
|
||
|
|
setlocal
|
||
|
|
|
||
|
|
set VS_VCVARS=C:\Program Files (x86)\Microsoft Visual Studio\18\BuildTools\VC\Auxiliary\Build\vcvars64.bat
|
||
|
|
if not exist "%VS_VCVARS%" set VS_VCVARS=C:\Program Files\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvars64.bat
|
||
|
|
if not exist "%VS_VCVARS%" (
|
||
|
|
echo [error] vcvars64.bat not found. Edit VS_VCVARS in this script.
|
||
|
|
exit /b 1
|
||
|
|
)
|
||
|
|
|
||
|
|
call "%VS_VCVARS%" >nul
|
||
|
|
cd /d "%~dp0"
|
||
|
|
|
||
|
|
rem /utf-8: source (and the Chinese UI strings) are UTF-8.
|
||
|
|
cl /nologo /O2 /EHsc /utf-8 /DUNICODE /D_UNICODE keygen.cpp /link /SUBSYSTEM:WINDOWS comctl32.lib /OUT:keygen.exe
|
||
|
|
if errorlevel 1 (
|
||
|
|
echo Build failed.
|
||
|
|
exit /b 1
|
||
|
|
)
|
||
|
|
|
||
|
|
del /q keygen.obj >nul 2>nul
|
||
|
|
echo.
|
||
|
|
echo Build OK: %~dp0keygen.exe
|
||
|
|
endlocal
|