2023-01-30 08:36:07 +00:00
|
|
|
@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
|
2022-08-04 06:28:25 +00:00
|
|
|
set COMPILE_RANGE="none"
|
2022-07-27 09:05:46 +00:00
|
|
|
set NOT_INCREASE_VER=""
|
2022-07-06 10:09:13 +00:00
|
|
|
|
2023-01-30 08:36:07 +00:00
|
|
|
rem -----------------------------------------------------------------------------------------------------------------------------------
|
2022-07-06 10:09:13 +00:00
|
|
|
|
2023-01-30 08:36:07 +00:00
|
|
|
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 -----------------------------------------------------------------------------------------------------------------------------------
|
2022-07-06 10:09:13 +00:00
|
|
|
|
2023-01-30 08:36:07 +00:00
|
|
|
if "%CPU%" equ "x64" goto sys
|
|
|
|
if "%CPU%" equ "x86" goto sys
|
|
|
|
echo "Parameter 2:sys is fail"
|
|
|
|
exit 1
|
|
|
|
:sys
|
|
|
|
echo %CPU%
|
|
|
|
rem -----------------------------------------------------------------------------------------------------------------------------------
|
2022-07-06 10:09:13 +00:00
|
|
|
|
2023-01-30 08:36:07 +00:00
|
|
|
if "%PID:~0,2%" equ "0x" goto pid
|
|
|
|
echo "Parameter 3:pid is fail"
|
|
|
|
exit 1
|
|
|
|
:pid
|
|
|
|
echo %PID%
|
|
|
|
rem -----------------------------------------------------------------------------------------------------------------------------------
|
2022-07-27 09:05:46 +00:00
|
|
|
|
2023-01-30 08:36:07 +00:00
|
|
|
if "%NOV%" equ "0" (
|
|
|
|
set NOT_INCREASE_VER="-nov"
|
|
|
|
goto nov
|
2022-07-11 02:59:36 +00:00
|
|
|
)
|
2023-01-30 08:36:07 +00:00
|
|
|
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
|
2022-07-11 02:59:36 +00:00
|
|
|
)
|
2023-01-30 08:36:07 +00:00
|
|
|
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 -----------------------------------------------------------------------------------------------------------------------------------
|
2022-07-11 02:59:36 +00:00
|
|
|
|
2022-07-06 10:09:13 +00:00
|
|
|
echo oem=%OEM%
|
|
|
|
echo cpu=%CPU%
|
|
|
|
echo pid=%PID%
|
2022-07-27 09:05:46 +00:00
|
|
|
|
2022-08-05 09:34:18 +00:00
|
|
|
if "%COMPILE_RANGE%"=="none" (
|
2023-01-30 08:36:07 +00:00
|
|
|
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%
|
2022-07-27 09:05:46 +00:00
|
|
|
|
2023-01-30 08:36:07 +00:00
|
|
|
if "%dev%"=="" (
|
|
|
|
echo "Can not find Visual-Studio installing path"
|
|
|
|
goto end
|
|
|
|
)
|
|
|
|
call %dev%\..\..\..\vc\auxiliary\build\vcvars32.bat
|
2022-07-27 09:05:46 +00:00
|
|
|
)
|
|
|
|
|
2022-07-28 09:31:42 +00:00
|
|
|
"%~dp0\sln\release\hgsetver.exe" "%~dp0\..\sdk\include\huagao\brand.h" -oem %OEM% -cpu %CPU% -pid %PID% %COMPILE_RANGE% %NOT_INCREASE_VER%
|
2022-08-05 09:34:18 +00:00
|
|
|
if %COMPILE_RANGE%=="none" (
|
2023-01-31 06:27:41 +00:00
|
|
|
MSBuild.exe "%~dp0\lang\lang.vcxproj" /p:Configuration=Release /p:Platform=%CPU%
|
2023-01-30 08:36:07 +00:00
|
|
|
MSBuild.exe "%~dp0\device\scanner.vcxproj" /p:Configuration=Release /p:Platform=%CPU%
|
|
|
|
MSBuild.exe "%~dp0\sane\sane.vcxproj" /p:Configuration=Release /p:Platform=%CPU%
|
2022-07-15 09:56:00 +00:00
|
|
|
)
|
2022-08-05 09:34:18 +00:00
|
|
|
MSBuild.exe "%~dp0\twain\twain.vcxproj" /p:Configuration=Release /p:Platform=%CPU%
|
2022-07-06 10:09:13 +00:00
|
|
|
|
|
|
|
|
2022-08-05 09:34:18 +00:00
|
|
|
:end
|