diff --git a/build.bat b/build.bat index 8a89256..61fe668 100644 --- a/build.bat +++ b/build.bat @@ -1,88 +1,128 @@ echo off -echo "build.bat [hw | lsc] [x86 | x64] [0x100 | 0x...] [onlytwain]" +echo "build.bat [hw | lsc] [x86 | x64] [0x100 | 0x...] [onlytwain] [nov]" set OEM=hg set CPU=x86 set PID=0x100 set COMPILE_RANGE="" +set NOT_INCREASE_VER="" set VAL=%1 -if "%1"=="onlytwain" ( +if "%VAL%"=="onlytwain" ( set COMPILE_RANGE="-only-twain" -) else if "%1"=="hw" ( -set OEM=%1 -)else if "%1"=="lsc" ( -set OEM=%1 +) else if "%VAL%"=="hw" ( +set OEM=%VAL% +)else if "%VAL%"=="lsc" ( +set OEM=%VAL% ) else ( - if "%1"=="x64" ( - set CPU=%1 - ) else if "%1"=="x86" ( - set CPU=%1 + if "%VAL%"=="x64" ( + set CPU=%VAL% + ) else if "%VAL%"=="x86" ( + set CPU=%VAL% ) else if "%VAL:~0,2%"=="0x" ( set PID=%VAL% + ) else if "%VAL%"=="nov" ( + set NOT_INCREASE_VER="-nov" ) ) set VAL=%2 -if "%2"=="onlytwain" ( +if "%VAL%"=="onlytwain" ( set COMPILE_RANGE="-only-twain" -) else if "%2"=="hw" ( -set OEM=%2 -)else if "%2"=="lsc" ( -set OEM=%2 +) else if "%VAL%"=="hw" ( +set OEM=%VAL% +)else if "%VAL%"=="lsc" ( +set OEM=%VAL% ) else ( - if "%2"=="x64" ( - set CPU=%2 - ) else if "%2"=="x86" ( - set CPU=%2 + if "%VAL%"=="x64" ( + set CPU=%VAL% + ) else if "%VAL%"=="x86" ( + set CPU=%VAL% ) else if "%VAL:~0,2%"=="0x" ( set PID=%VAL% + ) else if "%VAL%"=="nov" ( + set NOT_INCREASE_VER="-nov" ) ) set VAL=%3 -if "%3"=="onlytwain" ( +if "%VAL%"=="onlytwain" ( set COMPILE_RANGE="-only-twain" -) else if "%3"=="hw" ( -set OEM=%3 -)else if "%3"=="lsc" ( -set OEM=%3 +) else if "%VAL%"=="hw" ( +set OEM=%VAL% +)else if "%VAL%"=="lsc" ( +set OEM=%VAL% ) else ( - if "%3"=="x64" ( - set CPU=%3 - ) else if "%3"=="x86" ( - set CPU=%3 + if "%VAL%"=="x64" ( + set CPU=%VAL% + ) else if "%VAL%"=="x86" ( + set CPU=%VAL% ) else if "%VAL:~0,2%"=="0x" ( set PID=%VAL% + ) else if "%VAL%"=="nov" ( + set NOT_INCREASE_VER="-nov" ) ) set VAL=%4 -if "%4"=="onlytwain" ( +if "%VAL%"=="onlytwain" ( set COMPILE_RANGE="-only-twain" -) else if "%4"=="hw" ( -set OEM=%4 -)else if "%4"=="lsc" ( -set OEM=%4 +) else if "%VAL%"=="hw" ( +set OEM=%VAL% +)else if "%VAL%"=="lsc" ( +set OEM=%VAL% ) else ( - if "%4"=="x64" ( - set CPU=%4 - ) else if "%4"=="x86" ( - set CPU=%4 + if "%VAL%"=="x64" ( + set CPU=%VAL% + ) else if "%VAL%"=="x86" ( + set CPU=%VAL% ) else if "%VAL:~0,2%"=="0x" ( set PID=%VAL% + ) else if "%VAL%"=="nov" ( + set NOT_INCREASE_VER="-nov" + ) +) + +set VAL=%5 +if "%VAL%"=="onlytwain" ( + set COMPILE_RANGE="-only-twain" +) else if "%VAL%"=="hw" ( +set OEM=%VAL% +)else if "%VAL%"=="lsc" ( +set OEM=%VAL% +) else ( + if "%VAL%"=="x64" ( + set CPU=%VAL% + ) else if "%VAL%"=="x86" ( + set CPU=%VAL% + ) else if "%VAL:~0,2%"=="0x" ( + set PID=%VAL% + ) else if "%VAL%"=="nov" ( + set NOT_INCREASE_VER="-nov" ) ) echo oem=%OEM% echo cpu=%CPU% echo pid=%PID% -set BUILD_CMD="C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\MSBuild.exe" -"%~dp0\sln\release\hgsetver.exe" "%~dp0\twain\brand.h" -oem %OEM% -cpu %CPU% -pid %PID% %COMPILE_RANGE% -if %COMPILE_RANGE%=="" ( -%BUILD_CMD% "%~dp0\device\scanner.vcxproj" /p:Configuration=Release /p:Platform=x86 -%BUILD_CMD% "%~dp0\sane\sane.vcxproj" /p:Configuration=Release /p:Platform=x86 + +if "%COMPILE_RANGE%"=="" ( +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 ) -%BUILD_CMD% "%~dp0\twain\twain.vcxproj" /p:Configuration=Release /p:Platform=x86 +call %dev%\..\..\..\vc\auxiliary\build\vcvars32.bat +) + +"%~dp0\sln\release\hgsetver.exe" "%~dp0\twain\brand.h" -oem %OEM% -cpu %CPU% -pid %PID% %COMPILE_RANGE% %NOT_INCREASE_VER% +if %COMPILE_RANGE%=="" ( +MSBuild.exe "%~dp0\device\scanner.vcxproj" /p:Configuration=Release /p:Platform=x86 +MSBuild.exe "%~dp0\sane\sane.vcxproj" /p:Configuration=Release /p:Platform=x86 +) +MSBuild.exe "%~dp0\twain\twain.vcxproj" /p:Configuration=Release /p:Platform=x86 diff --git a/build_all.bat b/build_all.bat index 2b31b88..e423dd6 100644 --- a/build_all.bat +++ b/build_all.bat @@ -1,29 +1,39 @@ echo off -if "%1"=="hw" ( -build.bat hw x86 0x1000 -build.bat hw onlytwain 0x1002 -build.bat hw onlytwain 0x7000 -build.bat hw onlytwain 0x7002 -build.bat hw onlytwain 0x7039 -build.bat hw onlytwain 0x8000 -build.bat hw onlytwain 0x9000 -) else if "%1" == "lsc" ( -build.bat lsc x86 0x8200 -build.bat lsc onlytwain 0x8420 -build.bat lsc onlytwain 0x8429 -build.bat lsc onlytwain 0x8520 -build.bat lsc onlytwain 0x8529 -build.bat lsc onlytwain 0x8620 -build.bat lsc onlytwain 0x8629 -build.bat lsc onlytwain 0x8730 -build.bat lsc onlytwain 0x8739 +set OEM="" +set NOV="" +if "%1"=="nov" ( + set NOV=%1 + set OEM=%2 ) else ( -build.bat x86 0x100 -build.bat onlytwain 0x200 -build.bat onlytwain 0x300 -build.bat onlytwain 0x400 -build.bat onlytwain 0x139 -build.bat onlytwain 0x239 -build.bat onlytwain 0x439 -build.bat onlytwain 0x402 + set OEM=%1 + set NOV=%2 +) + +if "%OEM%"=="hw" ( +build.bat hw x86 0x1000 %NOV% +build.bat hw onlytwain 0x1002 %NOV% +build.bat hw onlytwain 0x7000 %NOV% +build.bat hw onlytwain 0x7002 %NOV% +build.bat hw onlytwain 0x7039 %NOV% +build.bat hw onlytwain 0x8000 %NOV% +build.bat hw onlytwain 0x9000 %NOV% +) else if "%OEM%" == "lsc" ( +build.bat lsc x86 0x8200 %NOV% +build.bat lsc onlytwain 0x8420 %NOV% +build.bat lsc onlytwain 0x8429 %NOV% +build.bat lsc onlytwain 0x8520 %NOV% +build.bat lsc onlytwain 0x8529 %NOV% +build.bat lsc onlytwain 0x8620 %NOV% +build.bat lsc onlytwain 0x8629 %NOV% +build.bat lsc onlytwain 0x8730 %NOV% +build.bat lsc onlytwain 0x8739 %NOV% +) else ( +build.bat x86 0x100 %NOV% +build.bat onlytwain 0x200 %NOV% +build.bat onlytwain 0x300 %NOV% +build.bat onlytwain 0x400 %NOV% +build.bat onlytwain 0x139 %NOV% +build.bat onlytwain 0x239 %NOV% +build.bat onlytwain 0x439 %NOV% +build.bat onlytwain 0x402 %NOV% ) diff --git a/device/scanner.rc b/device/scanner.rc index 3076267..f04662f 100644 --- a/device/scanner.rc +++ b/device/scanner.rc @@ -51,8 +51,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,1026,2022,7261 - PRODUCTVERSION 4,1026,2022,7261 + FILEVERSION 4,1030,2022,7271 + PRODUCTVERSION 4,1030,2022,7271 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -69,12 +69,12 @@ BEGIN BEGIN VALUE "CompanyName", "宁波华高信息科技有限公司" VALUE "FileDescription", "华高扫描仪应用程序" - VALUE "FileVersion", "4.1026.2022.7261" + VALUE "FileVersion", "4.1030.2022.7271" VALUE "InternalName", "scanner.dll" VALUE "LegalCopyright", "Copyright (C) 2022" VALUE "OriginalFilename", "scanner.dll" VALUE "ProductName", "HUAGOScan" - VALUE "ProductVersion", "4.1026.2022.7261" + VALUE "ProductVersion", "4.1030.2022.7271" END END BLOCK "VarFileInfo" diff --git a/device/scanner.vcxproj b/device/scanner.vcxproj index 542ac13..e71fa37 100644 --- a/device/scanner.vcxproj +++ b/device/scanner.vcxproj @@ -75,25 +75,25 @@ $(SolutionDir)..\..\code_device\hgdriver\3rdparty\nick;$(SolutionDir)..\..\code_device\hgdriver\3rdparty\opencv\include\win;$(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\;$(IncludePath) $(ProjectDir)lib\$(PlatformTarget)\$(Configuration);$(ProjectDir)..\..\sdk\lib\win\$(PlatformTarget)\$(Configuration);$(LibraryPath) $(SolutionDir)..\..\tmp\$(PlatformTarget)\$(Configuration)\$(ProjectName)\ - $(SolutionDir)..\..\release\win\$(PlatformTarget)\$(Configuration)\ + $(SolutionDir)..\..\release\win\$(PlatformTarget)\OEM\huagao\ false $(SolutionDir)..\..\code_device\hgdriver\3rdparty\nick;$(SolutionDir)..\..\code_device\hgdriver\3rdparty\opencv\include\win;$(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\;$(IncludePath) $(ProjectDir)lib\$(PlatformTarget)\$(Configuration);$(ProjectDir)..\..\sdk\lib\win\$(PlatformTarget)\$(Configuration);$(LibraryPath) $(SolutionDir)..\..\tmp\$(PlatformTarget)\$(Configuration)\$(ProjectName)\ - $(SolutionDir)..\..\release\win\$(PlatformTarget)\$(Configuration)\ + $(SolutionDir)..\..\release\win\$(PlatformTarget)\OEM\huagao\ true - $(SolutionDir)..\..\release\win\$(PlatformTarget)\$(Configuration)\ + $(SolutionDir)..\..\release\win\$(PlatformTarget)\OEM\huagao\ $(SolutionDir)..\..\tmp\$(PlatformTarget)\$(Configuration)\$(ProjectName)\ $(SolutionDir)..\..\code_device\hgdriver\3rdparty\nick;$(SolutionDir)..\..\code_device\hgdriver\3rdparty\opencv\include\win;$(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\;$(IncludePath) $(ProjectDir)lib\$(PlatformTarget)\$(Configuration);$(ProjectDir)..\..\sdk\lib\win\$(PlatformTarget)\$(Configuration);$(LibraryPath) false - $(SolutionDir)..\..\release\win\$(PlatformTarget)\$(Configuration)\ + $(SolutionDir)..\..\release\win\$(PlatformTarget)\OEM\huagao\ $(SolutionDir)..\..\tmp\$(PlatformTarget)\$(Configuration)\$(ProjectName)\ $(SolutionDir)..\..\code_device\hgdriver\3rdparty\nick;$(SolutionDir)..\..\code_device\hgdriver\3rdparty\opencv\include\win;$(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\;$(IncludePath) $(ProjectDir)lib\$(PlatformTarget)\$(Configuration);$(ProjectDir)..\..\sdk\lib\win\$(PlatformTarget)\$(Configuration);$(LibraryPath) @@ -120,6 +120,7 @@ mkdir $(SolutionDir)..\..\sdk\lib\win\$(PlatformTarget)\$(Configuration) +copy "$(TargetPath)" "$(SolutionDir)..\..\release\win\$(PlatformTarget)\$(Configuration)" move /Y "$(OutDirFullPath)$(ProjectName).exp" "$(SolutionDir)..\..\sdk\lib\win\$(PlatformTarget)\$(Configuration)" move /Y "$(OutDirFullPath)$(ProjectName).lib" "$(SolutionDir)..\..\sdk\lib\win\$(PlatformTarget)\$(Configuration)" move /Y "$(OutDirFullPath)$(ProjectName).pdb" "$(SolutionDir)..\..\sdk\lib\win\$(PlatformTarget)\$(Configuration)" diff --git a/sane/sane.rc b/sane/sane.rc index fd20cdc..10aaee5 100644 --- a/sane/sane.rc +++ b/sane/sane.rc @@ -248,8 +248,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,1026,2022,7261 - PRODUCTVERSION 4,1026,2022,7261 + FILEVERSION 4,1030,2022,7271 + PRODUCTVERSION 4,1030,2022,7271 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -266,12 +266,12 @@ BEGIN BEGIN VALUE "CompanyName", "宁波华高信息科技有限公司" VALUE "FileDescription", "华高扫描仪应用程序" - VALUE "FileVersion", "4.1026.2022.7261" + VALUE "FileVersion", "4.1030.2022.7271" VALUE "InternalName", "sane.dll" VALUE "LegalCopyright", "Copyright (C) 2022" VALUE "OriginalFilename", "sane.dll" VALUE "ProductName", "HUAGOScan" - VALUE "ProductVersion", "4.1026.2022.7261" + VALUE "ProductVersion", "4.1030.2022.7271" END END BLOCK "VarFileInfo" diff --git a/sane/sane.vcxproj b/sane/sane.vcxproj index 39c9a7f..2fde2bf 100644 --- a/sane/sane.vcxproj +++ b/sane/sane.vcxproj @@ -76,25 +76,25 @@ $(SolutionDir)..\..\sdk\include;$(SolutionDir)..\..\code_device\include\;$(IncludePath) $(SolutionDir)..\..\sdk\lib\win\$(PlatformTarget)\;$(LibraryPath) $(SolutionDir)..\..\tmp\$(PlatformTarget)\$(Configuration)\$(ProjectName)\ - $(SolutionDir)..\..\release\win\$(PlatformTarget)\$(Configuration)\ + $(SolutionDir)..\..\release\win\$(PlatformTarget)\OEM\huagao\ false $(SolutionDir)..\..\sdk\include;$(SolutionDir)..\..\code_device\include\;$(IncludePath) $(SolutionDir)..\..\sdk\lib\win\$(PlatformTarget)\;$(LibraryPath) $(SolutionDir)..\..\tmp\$(PlatformTarget)\$(Configuration)\$(ProjectName)\ - $(SolutionDir)..\..\release\win\$(PlatformTarget)\$(Configuration)\ + $(SolutionDir)..\..\release\win\$(PlatformTarget)\OEM\huagao\ true - $(SolutionDir)..\..\release\win\$(PlatformTarget)\$(Configuration)\ + $(SolutionDir)..\..\release\win\$(PlatformTarget)\OEM\huagao\ $(SolutionDir)..\..\tmp\$(PlatformTarget)\$(Configuration)\$(ProjectName)\ $(SolutionDir)..\..\sdk\include;$(SolutionDir)..\..\code_device\include\;$(IncludePath) $(SolutionDir)..\..\sdk\lib\win\$(PlatformTarget)\;$(LibraryPath) false - $(SolutionDir)..\..\release\win\$(PlatformTarget)\$(Configuration)\ + $(SolutionDir)..\..\release\win\$(PlatformTarget)\OEM\huagao\ $(SolutionDir)..\..\tmp\$(PlatformTarget)\$(Configuration)\$(ProjectName)\ $(SolutionDir)..\..\sdk\include;$(SolutionDir)..\..\code_device\include\;$(IncludePath) $(SolutionDir)..\..\sdk\lib\win\$(PlatformTarget)\;$(LibraryPath) @@ -116,6 +116,7 @@ mkdir $(SolutionDir)..\..\sdk\lib\win\$(PlatformTarget)\$(Configuration) +copy "$(TargetPath)" "$(SolutionDir)..\..\release\win\$(PlatformTarget)\$(Configuration)" move /Y "$(OutDirFullPath)$(ProjectName).exp" "$(SolutionDir)..\..\sdk\lib\win\$(PlatformTarget)\$(Configuration)" move /Y "$(OutDirFullPath)$(ProjectName).lib" "$(SolutionDir)..\..\sdk\lib\win\$(PlatformTarget)\$(Configuration)" move /Y "$(OutDirFullPath)$(ProjectName).pdb" "$(SolutionDir)..\..\sdk\lib\win\$(PlatformTarget)\$(Configuration)" diff --git a/sln/Release/hgsetver.exe b/sln/Release/hgsetver.exe index 2e7a139..005bfa8 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 494ae17..d9b641b 100644 --- a/sln/hgsetver/hgsetver.cpp +++ b/sln/hgsetver/hgsetver.cpp @@ -21,7 +21,7 @@ enum oem #define GET_ENUM_VALUE_W(e, v) \ if(L###e == v) return e; -static bool set_ver(const wchar_t* file, oem vendor, bool x86, int pid, int main = 0, bool twain_only = false); +static bool set_ver(const wchar_t* file, oem vendor, bool x86, int pid, int main = 0, bool twain_only = false, bool nov = false); int main() { @@ -37,7 +37,7 @@ int main() if (pos != std::wstring::npos) pe.erase(pos); - std::wcout << L"Usage: " << pe.c_str() << L" [-pid product_id lead with '0x'] [-main main-ver, all version will be omitted if this was not given or be ZERO] [-cpu x86|x64] [-oem hw|lsc] [-only-twain change twain project only]\r\n"; + std::wcout << L"Usage: " << pe.c_str() << L" [-pid product_id lead with '0x'] [-main main-ver, all version will be omitted if this was not given or be ZERO] [-cpu x86|x64] [-oem hw|lsc] [-only-twain change twain project only] [-nov not change version]\r\n"; cmd->release(); DWORD pid = process_util::get_parent_process(GetCurrentProcessId()); @@ -52,9 +52,21 @@ int main() return -1; } + + { + wchar_t* buf = NULL; + int len = 0; + + cmd->to_command_line(buf, &len); + buf = new wchar_t[len + 4]; + cmd->to_command_line(buf, &len); + buf[len] = 0; + std::wcout << buf << std::endl; + delete[] buf; + } oem vendor = OEM_NONE; - bool x86 = true, twain_only = cmd->has(L"-only-twain"); + bool x86 = true, twain_only = cmd->has(L"-only-twain"), nov = cmd->has(L"-nov"); int main = 0, pid = 0x100; if (cmd->parameter(L"-main")) @@ -85,7 +97,7 @@ int main() std::wstring file(cmd->parameter(1)); STR_TO_ABSOLUTE_PATH(file); - set_ver(file.c_str(), vendor, x86, pid, main, twain_only); + set_ver(file.c_str(), vendor, x86, pid, main, twain_only, nov); cmd->release(); return 0; @@ -312,7 +324,10 @@ namespace rc { oem o; int product_id; + bool change_out_dir; }CHGPARAM, *LPCHGPARAM; + bool __stdcall change_out_dir(std::wstring& cont, oem o); + static std::wstring load_file(const wchar_t* file, bom* bm) { std::string cont(""); @@ -778,6 +793,8 @@ namespace rc pos = cont.find(L"OEM_", end); } + change_out_dir(cont, o); + std::string bomstr(""); if (bm == BOM_UNICODE) coding_util::bom::from_unicode(cont.c_str(), cont.length() * 2, got_str, &bomstr); @@ -867,6 +884,34 @@ namespace rc return true; } + bool __stdcall change_out_dir(std::wstring& cont, oem o) + { + bool ok = false; + std::wstring first = L"", last(first), target(L"$(SolutionDir)..\\..\\release\\win\\$(PlatformTarget)\\OEM\\"); + int bgn = 0, end = 0; + + last.insert(1, L"/"); + if (o == OEM_HANWANG) + target += L"hanvon\\"; + else if (o == OEM_LISICHENG) + target += L"lanxum\\"; + else + target += L"huagao\\"; + + while ((bgn = cont.find(first, bgn)) != std::wstring::npos) + { + bgn += first.length(); + end = cont.find(last, bgn); + if (end != std::wstring::npos) + { + ok = true; + cont.replace(bgn, end - bgn, target); + bgn += target.length() + last.length(); + } + } + + return ok; + } bool __stdcall change_output(std::wstring& cont, LPCHGPARAM param) { std::wstring target(L"huagao"), first(L""), last(L""); @@ -893,11 +938,14 @@ namespace rc } } + if (ok && param->change_out_dir) + ok = change_out_dir(cont, param->o); + return ok; } }; -static bool set_ver(const wchar_t* file, oem vendor, bool x86, int pid, int main, bool twain_only) +static bool set_ver(const wchar_t* file, oem vendor, bool x86, int pid, int main, bool twain_only, bool nov) { bool ret = false; bom bm = BOM_UTF8; @@ -925,17 +973,17 @@ static bool set_ver(const wchar_t* file, oem vendor, bool x86, int pid, int main while (change_oem(unic, vendor)) { - if (!twain_only) + if (!nov) { if (main && !change_main(unic, main)) break; if (!change_sub(unic, sub, main)) break; - if (!change_build(unic, build)) - break; - if (!change_patch(unic, patch)) - break; } + if (!change_build(unic, build)) + break; + if (!change_patch(unic, patch)) + break; if (!change_product_id(unic, pid)) break; @@ -1001,6 +1049,7 @@ static bool set_ver(const wchar_t* file, oem vendor, bool x86, int pid, int main 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; diff --git a/twain/brand.h b/twain/brand.h index 2272393..6133be8 100644 --- a/twain/brand.h +++ b/twain/brand.h @@ -6,15 +6,15 @@ #define OEM_NONE #define VERSION_MAIN 4 -#define VERSION_SUB 1026 +#define VERSION_SUB 1030 #define VERSION_BUILD 2022 -#define VERSION_PATCH 7261 +#define VERSION_PATCH 7271 #define TO_STR(a) #a #define TO_VER_STR(vs) TO_STR(v##vs) #define VERSION_STR(a, b, c, d) TO_VER_STR(a.b.c.d) -#define PRODUCT_ID 402 +#define PRODUCT_ID 239 #define MAKE_PID(pid) 0x##pid #define PASTE_DEF(a, b) a##b #define FINAL_STR(a, b, c) TO_STR(a##b##c) diff --git a/twain/twain.vcxproj b/twain/twain.vcxproj index 86c1afc..c44c49e 100644 --- a/twain/twain.vcxproj +++ b/twain/twain.vcxproj @@ -46,18 +46,18 @@ true $(SolutionDir)..\..\sdk\include\;$(IncludePath) - $(SolutionDir)..\..\release\win\$(PlatformTarget)\$(Configuration)\ + $(SolutionDir)..\..\release\win\$(PlatformTarget)\OEM\huagao\ $(SolutionDir)..\..\tmp\$(PlatformTarget)\$(Configuration)\$(ProjectName)\ $(LibraryPath) - huagaotwain402.ds + huagaotwain239.ds false $(SolutionDir)..\..\sdk\include\;$(IncludePath) - $(SolutionDir)..\..\release\win\$(PlatformTarget)\$(Configuration)\ + $(SolutionDir)..\..\release\win\$(PlatformTarget)\OEM\huagao\ $(SolutionDir)..\..\tmp\$(PlatformTarget)\$(Configuration)\$(ProjectName)\ $(LibraryPath) - huagaotwain402.ds + huagaotwain239.ds