From efb918742b594559b9c394f56521bfcaab4e77b0 Mon Sep 17 00:00:00 2001 From: yangjiaxuan <171295266@qq.com> Date: Tue, 18 Jul 2023 17:09:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=93=E5=8C=85=E8=84=9A=E6=9C=AC=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=BE=97=E5=8A=9BOEM?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build_all.bat | 43 +++++++++++++++++++++++++++++++++++++++ build_base.bat | 7 ++++++- build_ds.bat | 8 +++++++- sln/hgsetver/hgsetver.cpp | 40 ++++++++++++++++++++++++++++++++---- 4 files changed, 92 insertions(+), 6 deletions(-) diff --git a/build_all.bat b/build_all.bat index a12d9ad..b27668e 100644 --- a/build_all.bat +++ b/build_all.bat @@ -10,6 +10,7 @@ set BUILD_CTS=false set BUILD_ZJ=false set BUILD_ZG=false set BUILD_NEU=false +set BUILD_DL=false set BUILD_X86=true set BUILD_X64=true @@ -27,6 +28,8 @@ if "%OEM%"=="hw" ( set BUILD_ZG=true )else if "%OEM%" == "neu" ( set BUILD_NEU=true +)else if "%OEM%" == "dl" ( + set BUILD_DL=true )else if "%OEM%" == "all" ( set BUILD_HG=true set BUILD_HW=true @@ -35,6 +38,7 @@ if "%OEM%"=="hw" ( set BUILD_ZJ=true set BUILD_ZG=true set BUILD_NEU=true + set BUILD_DL=true )else ( set BUILD_HG=true set OEM=hg @@ -108,6 +112,12 @@ if "%BUILD_NEU%"=="true" ( if "%BUILD_X64%"=="true" call :compile_neu neu x64 if %ERRORLEVEL% neq 0 goto end ) +if "%BUILD_DL%"=="true" ( + if "%BUILD_X86%"=="true" call :compile_dl dl x86 + if %ERRORLEVEL% neq 0 goto end + if "%BUILD_X64%"=="true" call :compile_dl dl x64 + if %ERRORLEVEL% neq 0 goto end +) goto end @@ -202,6 +212,39 @@ EXIT /B 0 if %ERRORLEVEL% neq 0 EXIT /B %ERRORLEVEL% EXIT /B 0 +:compile_dl + call build_base.bat %1 %2 + if %ERRORLEVEL% neq 0 EXIT /B %ERRORLEVEL% + call build_ds.bat %1 %2 401C + if %ERRORLEVEL% neq 0 EXIT /B %ERRORLEVEL% + call build_ds.bat %1 %2 401D + if %ERRORLEVEL% neq 0 EXIT /B %ERRORLEVEL% + call build_ds.bat %1 %2 401E + if %ERRORLEVEL% neq 0 EXIT /B %ERRORLEVEL% + call build_ds.bat %1 %2 401F + if %ERRORLEVEL% neq 0 EXIT /B %ERRORLEVEL% + call build_ds.bat %1 %2 4020 + if %ERRORLEVEL% neq 0 EXIT /B %ERRORLEVEL% + call build_ds.bat %1 %2 4021 + if %ERRORLEVEL% neq 0 EXIT /B %ERRORLEVEL% + call build_ds.bat %1 %2 4022 + if %ERRORLEVEL% neq 0 EXIT /B %ERRORLEVEL% + call build_ds.bat %1 %2 4015 + if %ERRORLEVEL% neq 0 EXIT /B %ERRORLEVEL% + call build_ds.bat %1 %2 4016 + if %ERRORLEVEL% neq 0 EXIT /B %ERRORLEVEL% + call build_ds.bat %1 %2 4017 + if %ERRORLEVEL% neq 0 EXIT /B %ERRORLEVEL% + call build_ds.bat %1 %2 4018 + if %ERRORLEVEL% neq 0 EXIT /B %ERRORLEVEL% + call build_ds.bat %1 %2 4019 + if %ERRORLEVEL% neq 0 EXIT /B %ERRORLEVEL% + call build_ds.bat %1 %2 401A + if %ERRORLEVEL% neq 0 EXIT /B %ERRORLEVEL% + call build_ds.bat %1 %2 401B + if %ERRORLEVEL% neq 0 EXIT /B %ERRORLEVEL% +EXIT /B 0 + :end echo final result = %ERRORLEVEL% diff --git a/build_base.bat b/build_base.bat index 3941e5f..26a6562 100644 --- a/build_base.bat +++ b/build_base.bat @@ -1,5 +1,5 @@ @echo off -echo "Parameter 1:hg | lsc| hw | zj | cts | neu" +echo "Parameter 1:hg | lsc| hw | zj | cts | neu | dl" echo "Parameter 2:x86 | x64 " set OEM=%1 @@ -47,6 +47,11 @@ if "%OEM%" equ "neu" ( set CL=/DOEM_NEUTRAL /DBACKEND_NAME=hgsane goto oem ) +if "%OEM%" equ "dl" ( + set OEM_DIR=deli + set CL=/DOEM_DELI /DBACKEND_NAME=dlsane + goto oem +) echo "Parameter 1:oem is fail" exit 1 :oem diff --git a/build_ds.bat b/build_ds.bat index ab0703d..3e75489 100644 --- a/build_ds.bat +++ b/build_ds.bat @@ -1,5 +1,5 @@ @echo off -echo "Parameter 1:hg | lsc| hw | zj | cts | zg" +echo "Parameter 1:hg | lsc| hw | zj | cts | zg | dl" echo "Parameter 2:x86 | x64 " echo "Parameter 3: 100 | 200 ... " @@ -56,6 +56,12 @@ if "%OEM%" equ "neu" ( set NAME=neu%NAME% goto oem ) +if "%OEM%" equ "dl" ( + set OEM_DIR=deli + set CL=/DOEM_DELI /DPRODUCT_ID=%PID% + set NAME=deli%NAME% + goto oem +) echo "Parameter 1:oem is fail" exit 1 :oem diff --git a/sln/hgsetver/hgsetver.cpp b/sln/hgsetver/hgsetver.cpp index 6301d88..6916df8 100644 --- a/sln/hgsetver/hgsetver.cpp +++ b/sln/hgsetver/hgsetver.cpp @@ -1,4 +1,4 @@ -// hgsetver.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。 +// hgsetver.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。 // #include #include @@ -18,7 +18,8 @@ enum oem OEM_CANGTIAN, OEM_ZHONGJING, OEM_ZIGUANG, - OEM_NEUTRAL + OEM_NEUTRAL, + OEM_DELI }; #define GET_ENUM_NAME_W(e, v) \ if(e == v) return L###e; @@ -102,6 +103,8 @@ int main() vendor = OEM_ZIGUANG; else if (wcsicmp(cmd->parameter(L"-oem"), L"neu") == 0) vendor = OEM_NEUTRAL; + else if (wcsicmp(cmd->parameter(L"-oem"), L"dl") == 0) + vendor = OEM_DELI; else std::wcout << L" OEM '" << cmd->parameter(L"-oem") << L"' is not supported! set as OEM_NONE.\r\n"; @@ -153,6 +156,7 @@ static std::wstring oem_str(oem o) GET_ENUM_NAME_W(OEM_ZHONGJING, o); GET_ENUM_NAME_W(OEM_ZIGUANG, o); GET_ENUM_NAME_W(OEM_NEUTRAL, o); + GET_ENUM_NAME_W(OEM_DELI, o); } static oem from_str(const wchar_t* str) { @@ -164,6 +168,7 @@ static oem from_str(const wchar_t* str) GET_ENUM_VALUE_W(OEM_ZHONGJING, s); GET_ENUM_VALUE_W(OEM_ZIGUANG, s); GET_ENUM_VALUE_W(OEM_NEUTRAL, s); + GET_ENUM_VALUE_W(OEM_DELI, s); return OEM_NOT; } static int oem_code(oem o) @@ -178,6 +183,8 @@ static int oem_code(oem o) return 20; else if (o == OEM_ZIGUANG) return 22; + else if (o == OEM_DELI) + return 24; else return 10; } @@ -193,6 +200,8 @@ static oem oem_from_code(int code) return OEM_ZHONGJING; else if (code == 22) return OEM_ZIGUANG; + else if (code == 24) + return OEM_DELI; else return OEM_NONE; } @@ -764,6 +773,8 @@ namespace rc os = L"unis"; else if (o == OEM_NEUTRAL) os = L"neutral"; + else if (o == OEM_DELI) + os = L"deli"; while (len > bgn) { bgn += first.length(); @@ -797,6 +808,8 @@ namespace rc os = L"unis"; else if (o == OEM_NEUTRAL) os = L"neutral"; + else if (o == OEM_DELI) + os = L"deli"; while (len > bgn) { bgn += first.length(); @@ -969,6 +982,8 @@ namespace rc backend = L"zj"; else if (o == OEM_ZIGUANG) backend = L"zg"; + else if (o == OEM_DELI) + backend = L"dl"; else backend = L"hg"; backend += L"sane"; @@ -1034,6 +1049,8 @@ namespace rc backend.insert(0, L"_zj"); else if (o == OEM_ZIGUANG) backend.insert(0, L"_zg"); + else if (o == OEM_DELI) + backend.insert(0, L"_dl"); else backend.insert(0, L"_hg"); @@ -1057,8 +1074,13 @@ namespace rc prev = L"_zgsane_"; if (cont.find(prev) == std::wstring::npos) { - return false; + prev = L"_dlsane_"; + if (cont.find(prev) == std::wstring::npos) + { + return false; + } } + } } } @@ -1091,6 +1113,8 @@ namespace rc backend.insert(0, L"zj"); else if (o == OEM_ZIGUANG) backend.insert(0, L"zg"); + else if (o == OEM_DELI) + backend.insert(0, L"dl"); else backend.insert(0, L"hg"); @@ -1111,7 +1135,11 @@ namespace rc prev = L"zg_scanner_"; if (cont.find(prev) == std::wstring::npos) { - return false; + prev = L"dl_scanner_"; + if (cont.find(prev) == std::wstring::npos) + { + return false; + } } } } @@ -1147,6 +1175,8 @@ namespace rc target += L"unis\\"; else if (o == OEM_NEUTRAL) target += L"neutral\\"; + else if (o == OEM_DELI) + target += L"deli\\"; else target += L"huagao\\"; @@ -1184,6 +1214,8 @@ namespace rc target = L"unis"; else if (param->o == OEM_NEUTRAL) target = L"neutral"; + else if (param->o == OEM_DELI) + target = L"deli"; target += tail; while ((bgn = cont.find(first, bgn)) != std::wstring::npos)