@echo off echo "Parameter 1:hg | lsc| hw | zj | cts" echo "Parameter 2:x86 | x64 " echo "Parameter 3:0x100 | 0x... " echo "Parameter 4:0 | 1 , is 1 var++ ,is 0 var unchanged " echo "Parameter 5:onlytwain | all ,is onlytwain build twain ,is all ,build scanner.dll sane.dll and twain..." set OEM=%1 set CPU=%2 set PID=%3 set NOV=%4 set ISTWAIN=%5 set COMPILE_RANGE="none" set NOT_INCREASE_VER="" rem ----------------------------------------------------------------------------------------------------------------------------------- if "%OEM%" equ "hg" goto oem if "%OEM%" equ "hw" goto oem if "%OEM%" equ "lsc" goto oem if "%OEM%" equ "zj" goto oem if "%OEM%" equ "cts" goto oem echo "Parameter 1:oem is fail" exit 1 :oem echo %OEM% rem ----------------------------------------------------------------------------------------------------------------------------------- if "%CPU%" equ "x64" goto sys if "%CPU%" equ "x86" goto sys echo "Parameter 2:sys is fail" exit 1 :sys echo %CPU% rem ----------------------------------------------------------------------------------------------------------------------------------- if "%PID:~0,2%" equ "0x" goto pid echo "Parameter 3:pid is fail" exit 1 :pid echo %PID% rem ----------------------------------------------------------------------------------------------------------------------------------- if "%NOV%" equ "0" ( set NOT_INCREASE_VER="-nov" goto nov ) if "%NOV%" equ "1" goto nov echo "Parameter 4:ver is 0 or 1" exit 1 :nov echo var:%NOV% NOT_INCREASE_VER:%NOT_INCREASE_VER% rem ----------------------------------------------------------------------------------------------------------------------------------- if "%ISTWAIN%" equ "onlytwain" ( set COMPILE_RANGE="-only-twain" goto istwain ) if "%ISTWAIN%" equ "all" goto istwain echo "Parameter 5:istwain is onlytwain or all" exit 1 :istwain echo istwain:"%ISTWAIN%" COMPILE_RANGE:%COMPILE_RANGE% rem ----------------------------------------------------------------------------------------------------------------------------------- echo oem=%OEM% echo cpu=%CPU% echo pid=%PID% if "%COMPILE_RANGE%"=="none" ( set dev="" for /f "tokens=1,2,* " %%i in ('reg QUERY "HKEY_CLASSES_ROOT\CLSID\{2E1517DA-87BF-4443-984A-D2BF18F5A908}\LocalServer32" /ve') do set dev=%%k echo dev=%dev% if "%dev%"=="" ( echo "Can not find Visual-Studio installing path" goto end ) call %dev%\..\..\..\vc\auxiliary\build\vcvars32.bat ) "%~dp0\sln\release\hgsetver.exe" "%~dp0\..\sdk\include\huagao\brand.h" -oem %OEM% -cpu %CPU% -pid %PID% %COMPILE_RANGE% %NOT_INCREASE_VER% if %COMPILE_RANGE%=="none" ( MSBuild.exe "%~dp0\lang\lang.vcxproj" /p:Configuration=Release /p:Platform=%CPU% MSBuild.exe "%~dp0\device\scanner.vcxproj" /p:Configuration=Release /p:Platform=%CPU% MSBuild.exe "%~dp0\sane\sane.vcxproj" /p:Configuration=Release /p:Platform=%CPU% ) MSBuild.exe "%~dp0\twain\twain.vcxproj" /p:Configuration=Release /p:Platform=%CPU% :end