diff --git a/build.bat b/build.bat deleted file mode 100644 index 0cc7298..0000000 --- a/build.bat +++ /dev/null @@ -1,94 +0,0 @@ -@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 diff --git a/build_all.bat b/build_all.bat index 39a5895..d5e876c 100644 --- a/build_all.bat +++ b/build_all.bat @@ -1,85 +1,167 @@ +REM build_all.bat all|hg|hw|lsc|cts... x86|x64 echo off -set OEM="" -set NOV="" +set OEM=%1 +set CPU=%2 -if "%1"=="hw" ( - set OEM=%1 -) else if "%1"=="lsc" ( - set OEM=%1 -) else if "%1"=="cts" ( - set OEM=%1 -)else if "%2"=="hw" ( - set OEM=%2 -) else if "%2"=="lsc" ( - set OEM=%2 -) else if "%2"=="cts" ( - set OEM=%2 -)else if "%3"=="hw" ( - set OEM=%3 -) else if "%3"=="lsc" ( - set OEM=%3 -) else if "%3"=="cts" ( - set OEM=%3 -) -if "%1"=="nov" ( - set NOV=%1 -) else if "%2"=="nov" ( - set NOV=%2 -) else if "%3"=="nov" ( - set NOV=%3 -) -echo oem=%OEM% -if "%CPU%"=="" ( - set CPU=x86 -) +set BUILD_HG=false +set BUILD_HW=false +set BUILD_LSC=false +set BUILD_CTS=false +set BUILD_ZJ=false + +set BUILD_X86=true +set BUILD_X64=true -echo build -cpu %CPU% -oem %OEM% %NOV% -set CPU=x64 if "%OEM%"=="hw" ( - build.bat %OEM% x64 0x1000 %NOV% - build.bat %OEM% x64 onlytwain 0x1002 nov - build.bat %OEM% x64 onlytwain 0x7000 nov - build.bat %OEM% x64 onlytwain 0x7002 nov - build.bat %OEM% x64 onlytwain 0x7039 nov - build.bat %OEM% x64 onlytwain 0x8000 nov - build.bat %OEM% x64 onlytwain 0x9000 nov - set CPU=x86 - build.bat %OEM% x86 0x1000 nov - build.bat %OEM% x86 onlytwain 0x1002 nov - build.bat %OEM% x86 onlytwain 0x7000 nov - build.bat %OEM% x86 onlytwain 0x7002 nov - build.bat %OEM% x86 onlytwain 0x7039 nov - build.bat %OEM% x86 onlytwain 0x8000 nov - build.bat %OEM% x86 onlytwain 0x9000 nov + set BUILD_HW=true ) else if "%OEM%" == "lsc" ( - build.bat %OEM% x64 0x8420 %NOV% - build.bat %OEM% x64 onlytwain 0x8520 nov - build.bat %OEM% x64 onlytwain 0x8620 nov - build.bat %OEM% x64 onlytwain 0x8730 nov - set CPU=x86 - build.bat %OEM% x86 0x8420 nov - build.bat %OEM% x86 onlytwain 0x8520 nov - build.bat %OEM% x86 onlytwain 0x8620 nov - build.bat %OEM% x86 onlytwain 0x8730 nov + set BUILD_LSC=true ) else if "%OEM%" == "cts" ( - build.bat %OEM% x64 0x6006 %NOV% - build.bat %OEM% x64 onlytwain 0x6005 nov - build.bat %OEM% x64 onlytwain 0x0238 nov - build.bat %OEM% x64 onlytwain 0x0138 nov - set CPU=x86 - build.bat %OEM% x86 0x6006 nov - build.bat %OEM% x86 onlytwain 0x6005 nov - build.bat %OEM% x86 onlytwain 0x0238 nov - build.bat %OEM% x86 onlytwain 0x0138 nov + set BUILD_CTS=true +) else if "%OEM%" == "zj" ( + set BUILD_ZJ=true +) else if "%OEM%" == "all" ( + set BUILD_HG=true + set BUILD_HW=true + set BUILD_LSC=true + set BUILD_CTS=true + set BUILD_ZJ=true )else ( - build.bat x64 0x100 %NOV% - build.bat x64 onlytwain 0x200 nov - build.bat x64 onlytwain 0x300 nov - build.bat x64 onlytwain 0x400 nov - set CPU=x86 - build.bat x86 0x100 nov - build.bat x86 onlytwain 0x200 nov - build.bat x86 onlytwain 0x300 nov - build.bat x86 onlytwain 0x400 nov + set BUILD_HG=true + set OEM=hg ) + +if "%CPU%"=="x86" ( + set BUILD_X64=false +) else if "%CPU%"=="x64" ( + set BUILD_X86=false +) else ( + set CPU=x64 and x86 +) + +echo build OEM:%OEM%, ARCH:%CPU% + +rem ----------------------------------------------------------------------------------------------------------------------------------- + +if "%VSCMD_VER%" neq "" goto compile +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\vcvars64.bat + + + +rem ------------------------------------------------------------------------------------------------------------------------------------------------------ + +:compile + +if "%BUILD_HW%"=="true" ( + if "%BUILD_X86%"=="true" call :compile_hw hw x86 + if %ERRORLEVEL% neq 0 goto end + if "%BUILD_X64%"=="true" call :compile_hw hw x64 + if %ERRORLEVEL% neq 0 goto end +) +if "%BUILD_LSC%"=="true" ( + if "%BUILD_X86%"=="true" call :compile_lsc lsc x86 + if %ERRORLEVEL% neq 0 goto end + if "%BUILD_X64%"=="true" call :compile_lsc lsc x64 + if %ERRORLEVEL% neq 0 goto end +) +if "%BUILD_CTS%"=="true" ( + if "%BUILD_X86%"=="true" call :compile_ct cts x86 + if %ERRORLEVEL% neq 0 goto end + if "%BUILD_X64%"=="true" call :compile_ct cts x64 + if %ERRORLEVEL% neq 0 goto end +) +if "%BUILD_ZJ%"=="true" ( + if "%BUILD_X86%"=="true" call :compile_zj zj x86 + if %ERRORLEVEL% neq 0 goto end + if "%BUILD_X64%"=="true" call :compile_zj zj x64 + if %ERRORLEVEL% neq 0 goto end +) +if "%BUILD_HG%"=="true" ( + if "%BUILD_X86%"=="true" call :compile_hg hg x86 + if %ERRORLEVEL% neq 0 goto end + if "%BUILD_X64%"=="true" call :compile_hg hg x64 +) +goto end + + +rem ------------------------------------------------------------------------------------------------------------------------------------------------------ +REM parameters for all OEM compiling procedure are: oem cpu + +:compile_hg + call build_base.bat %1 %2 + if %ERRORLEVEL% neq 0 EXIT /B %ERRORLEVEL% + call build_ds.bat %1 %2 100 + if %ERRORLEVEL% neq 0 EXIT /B %ERRORLEVEL% + call build_ds.bat %1 %2 200 + if %ERRORLEVEL% neq 0 EXIT /B %ERRORLEVEL% + call build_ds.bat %1 %2 300 + if %ERRORLEVEL% neq 0 EXIT /B %ERRORLEVEL% + call build_ds.bat %1 %2 400 + if %ERRORLEVEL% neq 0 EXIT /B %ERRORLEVEL% +EXIT /B 0 + +:compile_hw + call build_base.bat %1 %2 + if %ERRORLEVEL% neq 0 EXIT /B %ERRORLEVEL% + call build_ds.bat %1 %2 1000 + if %ERRORLEVEL% neq 0 EXIT /B %ERRORLEVEL% + call build_ds.bat %1 %2 1002 + if %ERRORLEVEL% neq 0 EXIT /B %ERRORLEVEL% + call build_ds.bat %1 %2 7000 + if %ERRORLEVEL% neq 0 EXIT /B %ERRORLEVEL% + call build_ds.bat %1 %2 7002 + if %ERRORLEVEL% neq 0 EXIT /B %ERRORLEVEL% + call build_ds.bat %1 %2 7039 + if %ERRORLEVEL% neq 0 EXIT /B %ERRORLEVEL% + call build_ds.bat %1 %2 8000 + if %ERRORLEVEL% neq 0 EXIT /B %ERRORLEVEL% + call build_ds.bat %1 %2 9000 + if %ERRORLEVEL% neq 0 EXIT /B %ERRORLEVEL% +EXIT /B 0 + +:compile_lsc + call build_base.bat %1 %2 + if %ERRORLEVEL% neq 0 EXIT /B %ERRORLEVEL% + call build_ds.bat %1 %2 8420 + if %ERRORLEVEL% neq 0 EXIT /B %ERRORLEVEL% + call build_ds.bat %1 %2 8520 + if %ERRORLEVEL% neq 0 EXIT /B %ERRORLEVEL% + call build_ds.bat %1 %2 8620 + if %ERRORLEVEL% neq 0 EXIT /B %ERRORLEVEL% + call build_ds.bat %1 %2 8730 + if %ERRORLEVEL% neq 0 EXIT /B %ERRORLEVEL% +EXIT /B 0 + +:compile_ct + call build_base.bat %1 %2 + if %ERRORLEVEL% neq 0 EXIT /B %ERRORLEVEL% + call build_ds.bat %1 %2 138 + if %ERRORLEVEL% neq 0 EXIT /B %ERRORLEVEL% + call build_ds.bat %1 %2 238 + if %ERRORLEVEL% neq 0 EXIT /B %ERRORLEVEL% + call build_ds.bat %1 %2 6005 + if %ERRORLEVEL% neq 0 EXIT /B %ERRORLEVEL% + call build_ds.bat %1 %2 6006 + if %ERRORLEVEL% neq 0 EXIT /B %ERRORLEVEL% +EXIT /B 0 + +:compile_zj + call build_base.bat %1 %2 + if %ERRORLEVEL% neq 0 EXIT /B %ERRORLEVEL% + call build_ds.bat %1 %2 9200 + if %ERRORLEVEL% neq 0 EXIT /B %ERRORLEVEL% +EXIT /B 0 + + + +:end +echo final result = %ERRORLEVEL% diff --git a/build_all_2.bat b/build_all_2.bat deleted file mode 100644 index 9ce5c8c..0000000 --- a/build_all_2.bat +++ /dev/null @@ -1,57 +0,0 @@ -@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..." - - -call build.bat hg x86 0x100 0 all -call build.bat hg x86 0x200 0 onlytwain -call build.bat hg x86 0x300 0 onlytwain -call build.bat hg x86 0x400 0 onlytwain - -call build.bat hg x64 0x100 0 all -call build.bat hg x64 0x200 0 onlytwain -call build.bat hg x64 0x300 0 onlytwain -call build.bat hg x64 0x400 0 onlytwain - -call build.bat hw x86 0x1000 0 all -call build.bat hw x86 0x1002 0 onlytwain -call build.bat hw x86 0x7000 0 onlytwain -call build.bat hw x86 0x7002 0 onlytwain -call build.bat hw x86 0x7039 0 onlytwain -call build.bat hw x86 0x8000 0 onlytwain -call build.bat hw x86 0x9000 0 onlytwain - -call build.bat hw x64 0x1000 0 all -call build.bat hw x64 0x1002 0 onlytwain -call build.bat hw x64 0x7000 0 onlytwain -call build.bat hw x64 0x7002 0 onlytwain -call build.bat hw x64 0x7039 0 onlytwain -call build.bat hw x64 0x8000 0 onlytwain -call build.bat hw x64 0x9000 0 onlytwain - -call build.bat lsc x86 0x8420 0 all -call build.bat lsc x86 0x8520 0 onlytwain -call build.bat lsc x86 0x8620 0 onlytwain -call build.bat lsc x86 0x8730 0 onlytwain - -call build.bat lsc x64 0x8420 0 all -call build.bat lsc x64 0x8520 0 onlytwain -call build.bat lsc x64 0x8620 0 onlytwain -call build.bat lsc x64 0x8730 0 onlytwain - -call build.bat cts x86 0x6006 0 all -call build.bat cts x86 0x6005 0 onlytwain -call build.bat cts x86 0x0238 0 onlytwain -call build.bat cts x86 0x0138 0 onlytwain - -call build.bat cts x64 0x6006 0 all -call build.bat cts x64 0x6005 0 onlytwain -call build.bat cts x64 0x0238 0 onlytwain -call build.bat cts x64 0x0138 0 onlytwain - -call build.bat zj x64 0x9200 0 all - -call build.bat zj x86 0x9200 0 all \ No newline at end of file diff --git a/build_base.bat b/build_base.bat new file mode 100644 index 0000000..3fe03d0 --- /dev/null +++ b/build_base.bat @@ -0,0 +1,107 @@ +@echo off +echo "Parameter 1:hg | lsc| hw | zj | cts" +echo "Parameter 2:x86 | x64 " + +set OEM=%1 +set CPU=%2 +set OEM_DIR="" +set TMP_PATH=%~dp0..\tmp\%CPU% +set BIN_PATH=%~dp0..\release\win\%CPU% +set LIB_PATH=%~dp0..\sdk\lib\win\%CPU% + +rem ----------------------------------------------------------------------------------------------------------------------------------- + +if "%OEM%" equ "hg" ( + set OEM_DIR=huagao + set CL=/DOEM_HUAGAO /DBACKEND_NAME=hgsane + goto oem +) +if "%OEM%" equ "hw" ( + set OEM_DIR=hanvon + set CL=/DOEM_HANWANG /DBACKEND_NAME=hwsane + goto oem +) +if "%OEM%" equ "lsc" ( + set OEM_DIR=lanxum + set CL=/DOEM_LISICHENG /DBACKEND_NAME=lscsane + goto oem +) +if "%OEM%" equ "zj" ( + set OEM_DIR=zhongj + set CL=/DOEM_ZHONGJING /DBACKEND_NAME=zjsane + goto oem +) +if "%OEM%" equ "cts" ( + set OEM_DIR=cunten + set CL=/DOEM_CANGTIAN /DBACKEND_NAME=ctssane + 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 ----------------------------------------------------------------------------------------------------------------------------------- + +set TMP_PATH=%TMP_PATH%\%OEM_DIR%\Release +set BIN_PATH=%BIN_PATH%\OEM\%OEM_DIR% +set LIB_PATH=%LIB_PATH%\OEM\%OEM_DIR% + +rem ----------------------------------------------------------------------------------------------------------------------------------- + +echo oem=%OEM% +echo cpu=%CPU% +echo pe-path=%BIN_PATH% +echo lib-path=%LIB_PATH% +echo tmp-path=%TMP_PATH% + +rem ----------------------------------------------------------------------------------------------------------------------------------- + +if "%VSCMD_VER%" neq "" goto compile +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 +) +:env +call %dev%\..\..\..\vc\auxiliary\build\vcvars64.bat + + +rem ----------------------------------------------------------------------------------------------------------------------------------- + +:compile + +"%~dp0\sln\release\hgsetver.exe" "%~dp0\..\sdk\include\huagao\brand.h" -oem %OEM% -cpu %CPU% -nov + +mkdir %LIB_PATH% + +MSBuild.exe "%~dp0\lang\lang.vcxproj" /p:Configuration=Release /p:Platform=%CPU% /p:IntDir=%TMP_PATH%\lang\ /p:OutDir=%BIN_PATH%\ +if %ERRORLEVEL% neq 0 goto end +call :move_libs %BIN_PATH% lang %LIB_PATH% +MSBuild.exe "%~dp0\device\scanner.vcxproj" /p:Configuration=Release /p:Platform=%CPU% /p:IntDir=%TMP_PATH%\scanner\ /p:OutDir=%BIN_PATH%\ +if %ERRORLEVEL% neq 0 goto end +call :move_libs %BIN_PATH% scanner %LIB_PATH% +MSBuild.exe "%~dp0\sane\sane.vcxproj" /p:Configuration=Release /p:Platform=%CPU% /p:IntDir=%TMP_PATH%\sane\ /p:OutDir=%BIN_PATH%\ +if %ERRORLEVEL% neq 0 goto end +call :move_libs %BIN_PATH% sane %LIB_PATH% +goto end + +REM move_libs src_dir src_name dst_dir + +:move_libs +move /Y "%1\%2.exp" "%3" +move /Y "%1\%2.lib" "%3" +move /Y "%1\%2.pdb" "%3" +EXIT /B 0 + +:end diff --git a/build_ds.bat b/build_ds.bat new file mode 100644 index 0000000..25c764c --- /dev/null +++ b/build_ds.bat @@ -0,0 +1,115 @@ +@echo off +echo "Parameter 1:hg | lsc| hw | zj | cts" +echo "Parameter 2:x86 | x64 " +echo "Parameter 3: 100 | 200 ... " + +set OEM=%1 +set CPU=%2 +set PID=%3 +set OEM_DIR="" +set NAME=twain%3.ds +set TMP_PATH=%~dp0..\tmp\%CPU% +set BIN_PATH=%~dp0..\release\win\%CPU% +set LIB_PATH=%~dp0..\sdk\lib\win\%CPU% + +rem ----------------------------------------------------------------------------------------------------------------------------------- + +if "%OEM%" equ "hg" ( + set OEM_DIR=huagao + set CL=/DOEM_HUAGAO /DPRODUCT_ID=%PID% + set NAME=huagao%NAME% + goto oem +) +if "%OEM%" equ "hw" ( + set OEM_DIR=hanvon + set CL=/DOEM_HANWANG /DPRODUCT_ID=%PID% + set NAME=hanvon%NAME% + goto oem +) +if "%OEM%" equ "lsc" ( + set OEM_DIR=lanxum + set CL=/DOEM_LISICHENG /DPRODUCT_ID=%PID% + set NAME=lanxum%NAME% + goto oem +) +if "%OEM%" equ "zj" ( + set OEM_DIR=zhongj + set CL=/DOEM_ZHONGJING /DPRODUCT_ID=%PID% + set NAME=microtek%NAME% + goto oem +) +if "%OEM%" equ "cts" ( + set OEM_DIR=cunten + set CL=/DOEM_CANGTIAN /DPRODUCT_ID=%PID% + set NAME=cumtenn%NAME% + 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%" equ "" ( + echo "Lost PID parameter" + exit 1 +) + +set TMP_PATH=%TMP_PATH%\%OEM_DIR%\Release +set BIN_PATH=%BIN_PATH%\OEM\%OEM_DIR% +set LIB_PATH=%LIB_PATH%\OEM\%OEM_DIR% + +rem ----------------------------------------------------------------------------------------------------------------------------------- + +echo oem=%OEM% +echo cpu=%CPU% +echo pe-path=%BIN_PATH% +echo lib-path=%LIB_PATH% +echo tmp-path=%TMP_PATH% + +rem ----------------------------------------------------------------------------------------------------------------------------------- + +if "%VSCMD_VER%" neq "" goto compile +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 +) +:env +call %dev%\..\..\..\vc\auxiliary\build\vcvars64.bat + + +rem ----------------------------------------------------------------------------------------------------------------------------------- + +:compile + +mkdir %LIB_PATH% + +echo delete %TMP_PATH%\twain\huagaods.obj ... +del "%TMP_PATH%\twain\*.obj" /q /f +MSBuild.exe "%~dp0\twain\twain.vcxproj" /p:Configuration=Release /p:Platform=%CPU% /p:IntDir=%TMP_PATH%\twain\ /p:OutDir=%BIN_PATH% /p:TargetName=%NAME% +if %ERRORLEVEL% neq 0 goto end +move /Y "%BIN_PATH%\%NAME%.dll" "%BIN_PATH%\%NAME%" +call :move_libs %BIN_PATH% %NAME% %LIB_PATH% +goto end + +REM move_libs src_dir src_name dst_dir + +:move_libs +move /Y "%1\%2.exp" "%3" +move /Y "%1\%2.lib" "%3" +move /Y "%1\%2.pdb" "%3" +EXIT /B 0 + +:end diff --git a/device/scanner.vcxproj b/device/scanner.vcxproj index 8692835..eee4603 100644 --- a/device/scanner.vcxproj +++ b/device/scanner.vcxproj @@ -73,36 +73,36 @@ true $(SolutionDir)..\..\code_device\hgdriver\3rdparty\nick;$(SolutionDir)..\..\sdk\include\opencv\;$(SolutionDir)..\..\code_device\hgdriver\3rdparty\cyusb\inc\;$(SolutionDir)..\..\code_device\hgdriver\3rdparty\libtiff\include\;$(SolutionDir)..\..\code_device\hgdriver\3rdparty\log4cplus\include\;$(SolutionDir)..\..\code_device\sdk\;$(SolutionDir)..\..\code_device\hgdriver\ImageProcess\;$(SolutionDir)..\..\sdk\include\;$(SolutionDir)..\..\code_device\hgdriver\hgdev\;$(SolutionDir)..\..\code_device\hgdriver\wrapper\;$(ProjectDir);$(SolutionDir)..\..\code_device\hgdriver\3rdparty\tiff\include\;$(SolutionDir)..\..\code_device\hgdriver\3rdparty\openssl\include;$(IncludePath) - $(ProjectDir)..\..\sdk\lib\win\$(PlatformTarget)\$(Configuration);$(LibraryPath) - $(SolutionDir)..\..\tmp\$(PlatformTarget)\$(Configuration)\$(ProjectName)\ + $(ProjectDir)..\..\sdk\lib\win\$(PlatformTarget)\oem\huagao;$(SolutionDir)..\..\sdk\lib\win\$(PlatformTarget)\$(Configuration);$(LibraryPath) + $(SolutionDir)..\..\tmp\$(PlatformTarget)\huagao\$(Configuration)\$(ProjectName)\ $(SolutionDir)..\..\release\win\$(PlatformTarget)\OEM\huagao\ false $(SolutionDir)..\..\code_device\hgdriver\3rdparty\nick;$(SolutionDir)..\..\sdk\include\opencv\;$(SolutionDir)..\..\code_device\hgdriver\3rdparty\cyusb\inc\;$(SolutionDir)..\..\code_device\hgdriver\3rdparty\libtiff\include\;$(SolutionDir)..\..\code_device\hgdriver\3rdparty\log4cplus\include\;$(SolutionDir)..\..\code_device\sdk\;$(SolutionDir)..\..\code_device\hgdriver\ImageProcess\;$(SolutionDir)..\..\sdk\include\;$(SolutionDir)..\..\code_device\hgdriver\hgdev\;$(SolutionDir)..\..\code_device\hgdriver\wrapper\;$(ProjectDir);$(SolutionDir)..\..\code_device\hgdriver\3rdparty\tiff\include\;$(SolutionDir)..\..\code_device\hgdriver\3rdparty\openssl\include;$(IncludePath) - $(ProjectDir)..\..\sdk\lib\win\$(PlatformTarget)\$(Configuration);$(LibraryPath) - $(SolutionDir)..\..\tmp\$(PlatformTarget)\$(Configuration)\$(ProjectName)\ + $(ProjectDir)..\..\sdk\lib\win\$(PlatformTarget)\oem\huagao;$(SolutionDir)..\..\sdk\lib\win\$(PlatformTarget)\$(Configuration);$(LibraryPath) + $(SolutionDir)..\..\tmp\$(PlatformTarget)\huagao\$(Configuration)\$(ProjectName)\ $(SolutionDir)..\..\release\win\$(PlatformTarget)\OEM\huagao\ true $(SolutionDir)..\..\release\win\$(PlatformTarget)\OEM\huagao\ - $(SolutionDir)..\..\tmp\$(PlatformTarget)\$(Configuration)\$(ProjectName)\ + $(SolutionDir)..\..\tmp\$(PlatformTarget)\huagao\$(Configuration)\$(ProjectName)\ $(SolutionDir)..\..\code_device\hgdriver\3rdparty\nick;$(SolutionDir)..\..\sdk\include\opencv\;$(SolutionDir)..\..\code_device\hgdriver\3rdparty\cyusb\inc\;$(SolutionDir)..\..\code_device\hgdriver\3rdparty\libtiff\include\;$(SolutionDir)..\..\code_device\hgdriver\3rdparty\log4cplus\include\;$(SolutionDir)..\..\code_device\sdk\;$(SolutionDir)..\..\code_device\hgdriver\ImageProcess\;$(SolutionDir)..\..\sdk\include\;$(SolutionDir)..\..\code_device\hgdriver\hgdev\;$(SolutionDir)..\..\code_device\hgdriver\wrapper\;$(ProjectDir);$(SolutionDir)..\..\code_device\hgdriver\3rdparty\tiff\include\;$(SolutionDir)..\..\code_device\hgdriver\3rdparty\openssl\include;$(IncludePath) - $(ProjectDir)..\..\sdk\lib\win\$(PlatformTarget)\$(Configuration);$(LibraryPath) + $(ProjectDir)..\..\sdk\lib\win\$(PlatformTarget)\oem\huagao;$(SolutionDir)..\..\sdk\lib\win\$(PlatformTarget)\$(Configuration);$(LibraryPath) false $(SolutionDir)..\..\release\win\$(PlatformTarget)\OEM\huagao\ - $(SolutionDir)..\..\tmp\$(PlatformTarget)\$(Configuration)\$(ProjectName)\ + $(SolutionDir)..\..\tmp\$(PlatformTarget)\huagao\$(Configuration)\$(ProjectName)\ $(SolutionDir)..\..\code_device\hgdriver\3rdparty\nick;$(SolutionDir)..\..\sdk\include\opencv\;$(SolutionDir)..\..\code_device\hgdriver\3rdparty\cyusb\inc\;$(SolutionDir)..\..\code_device\hgdriver\3rdparty\libtiff\include\;$(SolutionDir)..\..\code_device\hgdriver\3rdparty\log4cplus\include\;$(SolutionDir)..\..\code_device\sdk\;$(SolutionDir)..\..\code_device\hgdriver\ImageProcess\;$(SolutionDir)..\..\sdk\include\;$(SolutionDir)..\..\code_device\hgdriver\hgdev\;$(SolutionDir)..\..\code_device\hgdriver\wrapper\;$(ProjectDir);$(SolutionDir)..\..\code_device\hgdriver\3rdparty\tiff\include\;$(SolutionDir)..\..\code_device\hgdriver\3rdparty\openssl\include;$(IncludePath) - $(ProjectDir)..\..\sdk\lib\win\$(PlatformTarget)\$(Configuration);$(LibraryPath) + $(ProjectDir)..\..\sdk\lib\win\$(PlatformTarget)\oem\huagao;$(SolutionDir)..\..\sdk\lib\win\$(PlatformTarget)\$(Configuration);$(LibraryPath) Level3 true - WIN32;HGSCANNER_EXPORT;CUSTOM_USBVIEW;OEM_NONE;_DIRECT_BUILD;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + WIN32;HGSCANNER_EXPORT;CUSTOM_USBVIEW;_DIRECT_BUILD;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) true 4996 MultiThreadedDebug @@ -118,15 +118,8 @@ - set FINAL_DIR=$(SolutionDir)..\..\sdk\lib\win\$(PlatformTarget)\$(Configuration)\..\oem\huagao -mkdir %FINAL_DIR% -copy "$(TargetPath)" "$(SolutionDir)..\..\release\win\$(PlatformTarget)\$(Configuration)" -copy "$(TargetPath)" C:\Program Files\HuaGoScan /y -copy "$(TargetPath)" F:\boxroom\HuaGoScan /y -move /Y "$(OutDirFullPath)$(ProjectName).exp" "%FINAL_DIR%" -move /Y "$(OutDirFullPath)$(ProjectName).lib" "%FINAL_DIR%" -move /Y "$(OutDirFullPath)$(ProjectName).pdb" "%FINAL_DIR%" - + + @@ -135,13 +128,11 @@ move /Y "$(OutDirFullPath)$(ProjectName).pdb" "%FINAL_DIR%" true true true - WIN32;HGSCANNER_EXPORT;CUSTOM_USBVIEW;OEM_NONE;_DIRECT_BUILD;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + WIN32;HGSCANNER_EXPORT;CUSTOM_USBVIEW;_DIRECT_BUILD;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) true 4996 stdcpp17 MultiThreaded - - Console @@ -156,19 +147,15 @@ move /Y "$(OutDirFullPath)$(ProjectName).pdb" "%FINAL_DIR%" - set FINAL_DIR=$(SolutionDir)..\..\sdk\lib\win\$(PlatformTarget)\$(Configuration)\..\oem\huagao -mkdir %FINAL_DIR% -move /Y "$(OutDirFullPath)$(ProjectName).exp" "%FINAL_DIR%" -move /Y "$(OutDirFullPath)$(ProjectName).lib" "%FINAL_DIR%" -move /Y "$(OutDirFullPath)$(ProjectName).pdb" "%FINAL_DIR%" - + + Level3 true - HGSCANNER_EXPORT;CUSTOM_USBVIEW;OEM_NONE;_DIRECT_BUILD;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + HGSCANNER_EXPORT;CUSTOM_USBVIEW;_DIRECT_BUILD;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) true 4996; MultiThreadedDebug @@ -182,14 +169,8 @@ move /Y "$(OutDirFullPath)$(ProjectName).pdb" "%FINAL_DIR%" $(ProjectDir)device.def - set FINAL_DIR=$(SolutionDir)..\..\sdk\lib\win\$(PlatformTarget)\$(Configuration)\..\oem\huagao -mkdir %FINAL_DIR% -copy "$(TargetPath)" "$(SolutionDir)..\..\release\win\$(PlatformTarget)\$(Configuration)" -copy "$(TargetPath)" "C:\Program Files\HuaGoScan" -move /Y "$(OutDirFullPath)$(ProjectName).exp" "%FINAL_DIR%" -move /Y "$(OutDirFullPath)$(ProjectName).lib" "%FINAL_DIR%" -move /Y "$(OutDirFullPath)$(ProjectName).pdb" "%FINAL_DIR%" - + + @@ -198,7 +179,7 @@ move /Y "$(OutDirFullPath)$(ProjectName).pdb" "%FINAL_DIR%" true true true - HGSCANNER_EXPORT;CUSTOM_USBVIEW;OEM_NONE;NDEBUG;_CONSOLE;_DIRECT_BUILD;%(PreprocessorDefinitions) + HGSCANNER_EXPORT;CUSTOM_USBVIEW;NDEBUG;_CONSOLE;_DIRECT_BUILD;%(PreprocessorDefinitions) true 4996; MultiThreaded @@ -215,11 +196,8 @@ move /Y "$(OutDirFullPath)$(ProjectName).pdb" "%FINAL_DIR%" $(ProjectDir)device.def - set FINAL_DIR=$(SolutionDir)..\..\sdk\lib\win\$(PlatformTarget)\$(Configuration)\..\oem\huagao -mkdir %FINAL_DIR% -move /Y "$(OutDirFullPath)$(ProjectName).exp" "%FINAL_DIR%" -move /Y "$(OutDirFullPath)$(ProjectName).lib" "%FINAL_DIR%" -move /Y "$(OutDirFullPath)$(ProjectName).pdb" "%FINAL_DIR%" + + diff --git a/lang/lang.vcxproj b/lang/lang.vcxproj index 934e19c..060a9cf 100644 --- a/lang/lang.vcxproj +++ b/lang/lang.vcxproj @@ -71,23 +71,23 @@ - $(SolutionDir)..\..\release\win\$(PlatformTarget)\OEM\lang - $(SolutionDir)..\..\tmp\$(PlatformTarget)\$(Configuration)\$(ProjectName)\ + $(SolutionDir)..\..\release\win\$(PlatformTarget)\OEM\huagao\ + $(SolutionDir)..\..\tmp\$(PlatformTarget)\huagao\$(Configuration)\$(ProjectName)\ $(SolutionDir)..\..\sdk\include;$(IncludePath) - $(SolutionDir)..\..\release\win\$(PlatformTarget)\OEM\lang\ - $(SolutionDir)..\..\tmp\$(PlatformTarget)\$(Configuration)\$(ProjectName)\ + $(SolutionDir)..\..\release\win\$(PlatformTarget)\OEM\huagao\ + $(SolutionDir)..\..\tmp\$(PlatformTarget)\huagao\$(Configuration)\$(ProjectName)\ $(SolutionDir)..\..\sdk\include;$(IncludePath) - $(SolutionDir)..\..\release\win\$(PlatformTarget)\OEM\lang - $(SolutionDir)..\..\tmp\$(PlatformTarget)\$(Configuration)\$(ProjectName)\ + $(SolutionDir)..\..\release\win\$(PlatformTarget)\OEM\huagao\ + $(SolutionDir)..\..\tmp\$(PlatformTarget)\huagao\$(Configuration)\$(ProjectName)\ $(SolutionDir)..\..\sdk\include;$(IncludePath) - $(SolutionDir)..\..\release\win\$(PlatformTarget)\OEM\lang\ - $(SolutionDir)..\..\tmp\$(PlatformTarget)\$(Configuration)\$(ProjectName)\ + $(SolutionDir)..\..\release\win\$(PlatformTarget)\OEM\huagao\ + $(SolutionDir)..\..\tmp\$(PlatformTarget)\huagao\$(Configuration)\$(ProjectName)\ $(SolutionDir)..\..\sdk\include;$(IncludePath) @@ -106,14 +106,8 @@ lang.def - set FINAL_DIR=$(SolutionDir)..\..\sdk\lib\win\$(PlatformTarget)\$(Configuration) -mkdir %FINAL_DIR% -move /Y "$(OutDirFullPath)$(ProjectName).exp" "%FINAL_DIR%" -move /Y "$(OutDirFullPath)$(ProjectName).lib" "%FINAL_DIR%" -move /Y "$(OutDirFullPath)$(ProjectName).pdb" "%FINAL_DIR%" - - - + + @@ -137,19 +131,9 @@ move /Y "$(OutDirFullPath)$(ProjectName).pdb" "%FINAL_DIR%" lang.def - set FINAL_DIR=$(SolutionDir)..\..\sdk\lib\win\$(PlatformTarget)\$(Configuration) -set FINAL_LANGDIR=$(SolutionDir)..\..\release\win\$(PlatformTarget)\Release -mkdir %FINAL_DIR% -move /Y "$(OutDirFullPath)$(ProjectName).exp" "%FINAL_DIR%" -move /Y "$(OutDirFullPath)$(ProjectName).lib" "%FINAL_DIR%" -move /Y "$(OutDirFullPath)$(ProjectName).pdb" "%FINAL_DIR%" -copy $(OutDir)$(TargetName)$(TargetExt) "%FINAL_LANGDIR%" /y - - - - + @@ -167,13 +151,8 @@ copy $(OutDir)$(TargetName)$(TargetExt) "%FINAL_LANGDIR%" /y lang.def - set FINAL_DIR=$(SolutionDir)..\..\sdk\lib\win\$(PlatformTarget)\$(Configuration) -mkdir %FINAL_DIR% -move /Y "$(OutDirFullPath)$(ProjectName).exp" "%FINAL_DIR%" -move /Y "$(OutDirFullPath)$(ProjectName).lib" "%FINAL_DIR%" -move /Y "$(OutDirFullPath)$(ProjectName).pdb" "%FINAL_DIR%" - - + + @@ -197,22 +176,9 @@ move /Y "$(OutDirFullPath)$(ProjectName).pdb" "%FINAL_DIR%" lang.def - set FINAL_DIR=$(SolutionDir)..\..\sdk\lib\win\$(PlatformTarget)\$(Configuration) -set FINAL_LANGDIR=$(SolutionDir)..\..\release\win\$(PlatformTarget)\Release -mkdir %FINAL_DIR% -move /Y "$(OutDirFullPath)$(ProjectName).exp" "%FINAL_DIR%" -move /Y "$(OutDirFullPath)$(ProjectName).lib" "%FINAL_DIR%" -move /Y "$(OutDirFullPath)$(ProjectName).pdb" "%FINAL_DIR%" -copy $(OutDir)$(TargetName)$(TargetExt) "%FINAL_LANGDIR%" /y - - - - - - - + diff --git a/sane/sane.vcxproj b/sane/sane.vcxproj index 50c311d..00fef52 100644 --- a/sane/sane.vcxproj +++ b/sane/sane.vcxproj @@ -74,36 +74,36 @@ true $(SolutionDir)..\..\sdk\include;$(SolutionDir)..\..\code_device\include\;$(IncludePath) - $(SolutionDir)..\..\sdk\lib\win\$(PlatformTarget)\$(Configuration);$(SolutionDir)..\..\sdk\lib\win\$(PlatformTarget)\OEM\huagao;$(LibraryPath) - $(SolutionDir)..\..\tmp\$(PlatformTarget)\$(Configuration)\$(ProjectName)\ + $(SolutionDir)..\..\sdk\lib\win\$(PlatformTarget)\$(Configuration);$(ProjectDir)..\..\sdk\lib\win\$(PlatformTarget)\oem\huagao;$(LibraryPath) + $(SolutionDir)..\..\tmp\$(PlatformTarget)\huagao\$(Configuration)\$(ProjectName)\ $(SolutionDir)..\..\release\win\$(PlatformTarget)\OEM\huagao\ false $(SolutionDir)..\..\sdk\include;$(SolutionDir)..\..\code_device\include\;$(IncludePath) - $(SolutionDir)..\..\sdk\lib\win\$(PlatformTarget)\$(Configuration);$(SolutionDir)..\..\sdk\lib\win\$(PlatformTarget)\OEM\huagao;$(LibraryPath) - $(SolutionDir)..\..\tmp\$(PlatformTarget)\$(Configuration)\$(ProjectName)\ + $(SolutionDir)..\..\sdk\lib\win\$(PlatformTarget)\$(Configuration);$(ProjectDir)..\..\sdk\lib\win\$(PlatformTarget)\oem\huagao;$(LibraryPath) + $(SolutionDir)..\..\tmp\$(PlatformTarget)\huagao\$(Configuration)\$(ProjectName)\ $(SolutionDir)..\..\release\win\$(PlatformTarget)\OEM\huagao\ true $(SolutionDir)..\..\release\win\$(PlatformTarget)\OEM\huagao\ - $(SolutionDir)..\..\tmp\$(PlatformTarget)\$(Configuration)\$(ProjectName)\ + $(SolutionDir)..\..\tmp\$(PlatformTarget)\huagao\$(Configuration)\$(ProjectName)\ $(SolutionDir)..\..\sdk\include;$(SolutionDir)..\..\code_device\include\;$(IncludePath) - $(SolutionDir)..\..\sdk\lib\win\$(PlatformTarget)\$(Configuration);$(SolutionDir)..\..\sdk\lib\win\$(PlatformTarget)\OEM\huagao;$(LibraryPath) + $(SolutionDir)..\..\sdk\lib\win\$(PlatformTarget)\$(Configuration);$(ProjectDir)..\..\sdk\lib\win\$(PlatformTarget)\oem\huagao;$(LibraryPath) false $(SolutionDir)..\..\release\win\$(PlatformTarget)\OEM\huagao\ - $(SolutionDir)..\..\tmp\$(PlatformTarget)\$(Configuration)\$(ProjectName)\ + $(SolutionDir)..\..\tmp\$(PlatformTarget)\huagao\$(Configuration)\$(ProjectName)\ $(SolutionDir)..\..\sdk\include;$(SolutionDir)..\..\code_device\include\;$(IncludePath) - $(SolutionDir)..\..\sdk\lib\win\$(PlatformTarget)\$(Configuration);$(SolutionDir)..\..\sdk\lib\win\$(PlatformTarget)\OEM\huagao;$(LibraryPath) + $(SolutionDir)..\..\sdk\lib\win\$(PlatformTarget)\$(Configuration);$(ProjectDir)..\..\sdk\lib\win\$(PlatformTarget)\oem\huagao;$(LibraryPath) Level3 true - BACKEND_NAME=hgsane;TWPP_IS_DS;EXPORT_SANE_API;WIN32;OEM_NONE;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + TWPP_IS_DS;EXPORT_SANE_API;WIN32;OEM_NONE;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) true stdcpp17 4996 @@ -118,14 +118,8 @@ - set FINAL_DIR=$(SolutionDir)..\..\sdk\lib\win\$(PlatformTarget)\$(Configuration)\..\oem\huagao -mkdir %FINAL_DIR% -copy "$(TargetPath)" "$(SolutionDir)..\..\release\win\$(PlatformTarget)\$(Configuration)" -copy "$(TargetPath)" F:\boxroom\HuaGoScan /y -move /Y "$(OutDirFullPath)$(ProjectName).exp" "%FINAL_DIR%" -move /Y "$(OutDirFullPath)$(ProjectName).lib" "%FINAL_DIR%" -move /Y "$(OutDirFullPath)$(ProjectName).pdb" "%FINAL_DIR%" - + + @@ -134,7 +128,7 @@ move /Y "$(OutDirFullPath)$(ProjectName).pdb" "%FINAL_DIR%" true true true - BACKEND_NAME=hgsane;TWPP_IS_DS;EXPORT_SANE_API;WIN32;OEM_NONE;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + TWPP_IS_DS;EXPORT_SANE_API;WIN32;OEM_NONE;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) true stdcpp17 4996 @@ -150,19 +144,15 @@ move /Y "$(OutDirFullPath)$(ProjectName).pdb" "%FINAL_DIR%" UseLinkTimeCodeGeneration - set FINAL_DIR=$(SolutionDir)..\..\sdk\lib\win\$(PlatformTarget)\$(Configuration)\..\oem\huagao -mkdir %FINAL_DIR% -move /Y "$(OutDirFullPath)$(ProjectName).exp" "%FINAL_DIR%" -move /Y "$(OutDirFullPath)$(ProjectName).lib" "%FINAL_DIR%" -move /Y "$(OutDirFullPath)$(ProjectName).pdb" "%FINAL_DIR%" - + + Level3 true - _DEBUG;_CONSOLE;%(PreprocessorDefinitions);BACKEND_NAME=hgsane;TWPP_IS_DS;EXPORT_SANE_API;OEM_NONE + _DEBUG;_CONSOLE;%(PreprocessorDefinitions);TWPP_IS_DS;EXPORT_SANE_API;OEM_NONE true 4996 MultiThreadedDebug @@ -174,13 +164,8 @@ move /Y "$(OutDirFullPath)$(ProjectName).pdb" "%FINAL_DIR%" $(ProjectDir)sane.def - set FINAL_DIR=$(SolutionDir)..\..\sdk\lib\win\$(PlatformTarget)\$(Configuration)\..\oem\huagao -mkdir %FINAL_DIR% -copy "$(TargetPath)" "$(SolutionDir)..\..\release\win\$(PlatformTarget)\$(Configuration)" -move /Y "$(OutDirFullPath)$(ProjectName).exp" "%FINAL_DIR%" -move /Y "$(OutDirFullPath)$(ProjectName).lib" "%FINAL_DIR%" -move /Y "$(OutDirFullPath)$(ProjectName).pdb" "%FINAL_DIR%" - + + @@ -189,7 +174,7 @@ move /Y "$(OutDirFullPath)$(ProjectName).pdb" "%FINAL_DIR%" true true true - NDEBUG;_CONSOLE;%(PreprocessorDefinitions);BACKEND_NAME=hgsane;TWPP_IS_DS;EXPORT_SANE_API;OEM_NONE + NDEBUG;_CONSOLE;%(PreprocessorDefinitions);TWPP_IS_DS;EXPORT_SANE_API;OEM_NONE true 4996 MultiThreaded @@ -204,12 +189,8 @@ move /Y "$(OutDirFullPath)$(ProjectName).pdb" "%FINAL_DIR%" UseLinkTimeCodeGeneration - set FINAL_DIR=$(SolutionDir)..\..\sdk\lib\win\$(PlatformTarget)\$(Configuration)\..\oem\huagao -mkdir %FINAL_DIR% -move /Y "$(OutDirFullPath)$(ProjectName).exp" "%FINAL_DIR%" -move /Y "$(OutDirFullPath)$(ProjectName).lib" "%FINAL_DIR%" -move /Y "$(OutDirFullPath)$(ProjectName).pdb" "%FINAL_DIR%" - + + diff --git a/sln/Release/hgsetver.exe b/sln/Release/hgsetver.exe index 6586f3a..8bb30d0 100644 Binary files a/sln/Release/hgsetver.exe and b/sln/Release/hgsetver.exe differ diff --git a/sln/hgsetver/hgsetver.cpp b/sln/hgsetver/hgsetver.cpp index 0c37583..5635c99 100644 --- a/sln/hgsetver/hgsetver.cpp +++ b/sln/hgsetver/hgsetver.cpp @@ -428,11 +428,11 @@ namespace rc if (bgn) str.erase(0, bgn); } - static bool get_version_from_file(const wchar_t* file, int* v1, int* v2, int* v3, int* v4, std::wstring* company_name, std::wstring* short_company_name, std::wstring* vendor_name) + static bool get_version_from_file(const wchar_t* file, oem o, int* v1, int* v2, int* v3, int* v4, std::wstring* company_name, std::wstring* short_company_name, std::wstring* vendor_name) { std::wstring cont(load_file(file, NULL)), line(L""), tag(L"#define VERSION_MAIN"); int end = -1, bgn = -1; - oem o = OEM_NONE; + // oem o = OEM_NONE; if (v1) { @@ -489,22 +489,22 @@ namespace rc *v4 = _wtoi(cont.c_str() + bgn); } - tag = L"#define OEM_"; - { - bgn = find_line(cont, tag.c_str(), &end); - if (bgn < 0) - return false; - - line = cont.substr(bgn, end - bgn); - if (line.find(oem_str(OEM_HANWANG)) != std::wstring::npos) - o = OEM_HANWANG; - else if (line.find(oem_str(OEM_LISICHENG)) != std::wstring::npos) - o = OEM_LISICHENG; - else if (line.find(oem_str(OEM_CANGTIAN)) != std::wstring::npos) - o = OEM_CANGTIAN; - else if (line.find(oem_str(OEM_ZHONGJING)) != std::wstring::npos) - o = OEM_ZHONGJING; - } + //tag = L"#define OEM_"; + //{ + // bgn = find_line(cont, tag.c_str(), &end); + // if (bgn < 0) + // return false; + // + // line = cont.substr(bgn, end - bgn); + // if (line.find(oem_str(OEM_HANWANG)) != std::wstring::npos) + // o = OEM_HANWANG; + // else if (line.find(oem_str(OEM_LISICHENG)) != std::wstring::npos) + // o = OEM_LISICHENG; + // else if (line.find(oem_str(OEM_CANGTIAN)) != std::wstring::npos) + // o = OEM_CANGTIAN; + // else if (line.find(oem_str(OEM_ZHONGJING)) != std::wstring::npos) + // o = OEM_ZHONGJING; + //} bool found = false, is_oem = false; std::vector embed; @@ -1023,7 +1023,11 @@ namespace rc { prev = L"_ctssane_"; if (cont.find(prev) == std::wstring::npos) - return false; + { + prev = L"_zjsane_"; + if (cont.find(prev) == std::wstring::npos) + return false; + } } } @@ -1218,7 +1222,8 @@ static bool set_ver(const wchar_t* file, oem vendor, bool x86, int pid, int main patch *= 1000; patch += cur->tm_yday + 1; - while (change_oem(unic, vendor)) + //while (change_oem(unic, vendor)) + do { if (!nov) { @@ -1235,8 +1240,8 @@ static bool set_ver(const wchar_t* file, oem vendor, bool x86, int pid, int main break; ret = true; - break; - } + // break; + } while (0); if (ret) { @@ -1262,14 +1267,14 @@ static bool set_ver(const wchar_t* file, oem vendor, bool x86, int pid, int main base += L"\\..\\..\\..\\code_twain\\twain"; STR_TO_ABSOLUTE_PATH(base); wprintf_s(L"aaaa=%s\r\n", file); - if (rc::get_version_from_file(file, &main, &sub, &build, &patch, &cn, &scn, &vs)) + if (rc::get_version_from_file(file, vendor, &main, &sub, &build, &patch, &cn, &scn, &vs)) { if (!twain_only) { - rcf = base + L"\\..\\sane\\sane.vcxproj"; - STR_SIMPLIFY_PATH(rcf); - if (!rc::change_vcxproj_predefine(rcf.c_str(), vendor)) - std::wcout << "change predefines failed: " << rcf.c_str() << std::endl; + //rcf = base + L"\\..\\sane\\sane.vcxproj"; + //STR_SIMPLIFY_PATH(rcf); + //if (!rc::change_vcxproj_predefine(rcf.c_str(), vendor)) + // std::wcout << "change predefines failed: " << rcf.c_str() << std::endl; rcf = base + L"\\..\\sane\\sane.rc"; STR_SIMPLIFY_PATH(rcf); @@ -1281,10 +1286,10 @@ static bool set_ver(const wchar_t* file, oem vendor, bool x86, int pid, int main if (!rc::change_file(rcf.c_str(), ¶m, rc::change_sane_def)) std::wcout << "change exporting-definition failed: " << rcf.c_str() << std::endl; - rcf = base + L"\\..\\device\\scanner.vcxproj"; - STR_SIMPLIFY_PATH(rcf); - if (!rc::change_vcxproj_predefine(rcf.c_str(), vendor)) - std::wcout << "change predefines failed: " << rcf.c_str() << std::endl; + //rcf = base + L"\\..\\device\\scanner.vcxproj"; + //STR_SIMPLIFY_PATH(rcf); + //if (!rc::change_vcxproj_predefine(rcf.c_str(), vendor)) + // std::wcout << "change predefines failed: " << rcf.c_str() << std::endl; rcf = base + L"\\..\\device\\scanner.rc"; STR_SIMPLIFY_PATH(rcf); @@ -1297,14 +1302,14 @@ static bool set_ver(const wchar_t* file, oem vendor, bool x86, int pid, int main std::wcout << "change exporting-definition failed: " << rcf.c_str() << std::endl;*/ } - rcf = base + L"\\..\\twain\\twain.vcxproj"; - STR_SIMPLIFY_PATH(rcf); - param.change_out_dir = !twain_only; - if (!rc::change_file(rcf.c_str(), ¶m, rc::change_output)) - { - std::wcout << "change exporting-definition failed: " << rcf.c_str() << std::endl; - ret = false; - } + //rcf = base + L"\\..\\twain\\twain.vcxproj"; + //STR_SIMPLIFY_PATH(rcf); + //param.change_out_dir = !twain_only; + //if (!rc::change_file(rcf.c_str(), ¶m, rc::change_output)) + //{ + // std::wcout << "change exporting-definition failed: " << rcf.c_str() << std::endl; + // ret = false; + //} rcf = base + L"\\..\\..\\code_device\\build.sh"; STR_SIMPLIFY_PATH(rcf); diff --git a/twain/twain.vcxproj b/twain/twain.vcxproj index 9d16847..7883cd3 100644 --- a/twain/twain.vcxproj +++ b/twain/twain.vcxproj @@ -76,7 +76,7 @@ true $(SolutionDir)..\..\sdk\include\;$(IncludePath) $(SolutionDir)..\..\release\win\$(PlatformTarget)\OEM\huagao\ - $(SolutionDir)..\..\tmp\$(PlatformTarget)\$(Configuration)\$(ProjectName)\ + $(SolutionDir)..\..\tmp\$(PlatformTarget)\huagao\$(Configuration)\$(ProjectName)\ $(LibraryPath) huagaotwain400.ds @@ -86,13 +86,13 @@ true $(SolutionDir)..\..\sdk\include\;$(IncludePath) $(SolutionDir)..\..\release\win\$(PlatformTarget)\OEM\huagao\ - $(SolutionDir)..\..\tmp\$(PlatformTarget)\$(Configuration)\$(ProjectName)\ + $(SolutionDir)..\..\tmp\$(PlatformTarget)\huagao\$(Configuration)\$(ProjectName)\ false $(SolutionDir)..\..\sdk\include\;$(IncludePath) $(SolutionDir)..\..\release\win\$(PlatformTarget)\OEM\huagao\ - $(SolutionDir)..\..\tmp\$(PlatformTarget)\$(Configuration)\$(ProjectName)\ + $(SolutionDir)..\..\tmp\$(PlatformTarget)\huagao\$(Configuration)\$(ProjectName)\ $(LibraryPath) huagaotwain400.ds @@ -102,7 +102,7 @@ false $(SolutionDir)..\..\sdk\include\;$(IncludePath) $(SolutionDir)..\..\release\win\$(PlatformTarget)\OEM\huagao\ - $(SolutionDir)..\..\tmp\$(PlatformTarget)\$(Configuration)\$(ProjectName)\ + $(SolutionDir)..\..\tmp\$(PlatformTarget)\huagao\$(Configuration)\$(ProjectName)\ @@ -123,13 +123,8 @@ - set FINAL_DIR=$(SolutionDir)..\..\sdk\lib\win\$(PlatformTarget)\$(Configuration)\..\oem\huagao -mkdir "%FINAL_DIR%" -move /Y "$(OutDirFullPath)$(TargetName).exp" "%FINAL_DIR%" -move /Y "$(OutDirFullPath)$(TargetName).lib" "%FINAL_DIR%" -move /Y "$(OutDirFullPath)$(TargetName).pdb" "%FINAL_DIR%" -move /Y "$(TargetPath)" "$(OutDirFullPath)$(TargetName)" -copy "$(OutDirFullPath)$(TargetName)" "$(WinDir)\twain_32\HuaGoTwain\x86" /y + + @@ -152,13 +147,8 @@ copy "$(OutDirFullPath)$(TargetName)" "$(WinDir)\twain_32\HuaGoTwain\x86" /y - set FINAL_DIR=$(SolutionDir)..\..\sdk\lib\win\$(PlatformTarget)\$(Configuration)\..\oem\huagao -mkdir "%FINAL_DIR%" -move /Y "$(OutDirFullPath)$(TargetName).exp" "%FINAL_DIR%" -move /Y "$(OutDirFullPath)$(TargetName).lib" "%FINAL_DIR%" -move /Y "$(OutDirFullPath)$(TargetName).pdb" "%FINAL_DIR%" -move /Y "$(TargetPath)" "$(OutDirFullPath)$(TargetName)" -copy "$(OutDirFullPath)$(TargetName)" "$(WinDir)\twain_32\HuaGoScan" /y + + @@ -183,12 +173,8 @@ copy "$(OutDirFullPath)$(TargetName)" "$(WinDir)\twain_32\HuaGoScan" /y - set FINAL_DIR=$(SolutionDir)..\..\sdk\lib\win\$(PlatformTarget)\$(Configuration)\..\oem\huagao -mkdir "%FINAL_DIR%" -move /Y "$(OutDirFullPath)$(TargetName).exp" "%FINAL_DIR%" -move /Y "$(OutDirFullPath)$(TargetName).lib" "%FINAL_DIR%" -move /Y "$(OutDirFullPath)$(TargetName).pdb" "%FINAL_DIR%" -move /Y "$(TargetPath)" "$(OutDirFullPath)$(TargetName)" + + @@ -214,12 +200,8 @@ move /Y "$(TargetPath)" "$(OutDirFullPath)$(TargetName)" - set FINAL_DIR=$(SolutionDir)..\..\sdk\lib\win\$(PlatformTarget)\$(Configuration)\..\oem\huagao -mkdir "%FINAL_DIR%" -move /Y "$(OutDirFullPath)$(TargetName).exp" "%FINAL_DIR%" -move /Y "$(OutDirFullPath)$(TargetName).lib" "%FINAL_DIR%" -move /Y "$(OutDirFullPath)$(TargetName).pdb" "%FINAL_DIR%" -move /Y "$(TargetPath)" "$(OutDirFullPath)$(TargetName)" + +