打包脚本增加得力OEM

This commit is contained in:
yangjiaxuan 2023-07-18 17:09:57 +08:00
parent 447e1e94b2
commit efb918742b
4 changed files with 92 additions and 6 deletions

View File

@ -10,6 +10,7 @@ set BUILD_CTS=false
set BUILD_ZJ=false set BUILD_ZJ=false
set BUILD_ZG=false set BUILD_ZG=false
set BUILD_NEU=false set BUILD_NEU=false
set BUILD_DL=false
set BUILD_X86=true set BUILD_X86=true
set BUILD_X64=true set BUILD_X64=true
@ -27,6 +28,8 @@ if "%OEM%"=="hw" (
set BUILD_ZG=true set BUILD_ZG=true
)else if "%OEM%" == "neu" ( )else if "%OEM%" == "neu" (
set BUILD_NEU=true set BUILD_NEU=true
)else if "%OEM%" == "dl" (
set BUILD_DL=true
)else if "%OEM%" == "all" ( )else if "%OEM%" == "all" (
set BUILD_HG=true set BUILD_HG=true
set BUILD_HW=true set BUILD_HW=true
@ -35,6 +38,7 @@ if "%OEM%"=="hw" (
set BUILD_ZJ=true set BUILD_ZJ=true
set BUILD_ZG=true set BUILD_ZG=true
set BUILD_NEU=true set BUILD_NEU=true
set BUILD_DL=true
)else ( )else (
set BUILD_HG=true set BUILD_HG=true
set OEM=hg set OEM=hg
@ -108,6 +112,12 @@ if "%BUILD_NEU%"=="true" (
if "%BUILD_X64%"=="true" call :compile_neu neu x64 if "%BUILD_X64%"=="true" call :compile_neu neu x64
if %ERRORLEVEL% neq 0 goto end 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 goto end
@ -202,6 +212,39 @@ EXIT /B 0
if %ERRORLEVEL% neq 0 EXIT /B %ERRORLEVEL% if %ERRORLEVEL% neq 0 EXIT /B %ERRORLEVEL%
EXIT /B 0 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 :end
echo final result = %ERRORLEVEL% echo final result = %ERRORLEVEL%

View File

@ -1,5 +1,5 @@
@echo off @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 " echo "Parameter 2:x86 | x64 "
set OEM=%1 set OEM=%1
@ -47,6 +47,11 @@ if "%OEM%" equ "neu" (
set CL=/DOEM_NEUTRAL /DBACKEND_NAME=hgsane set CL=/DOEM_NEUTRAL /DBACKEND_NAME=hgsane
goto oem 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" echo "Parameter 1:oem is fail"
exit 1 exit 1
:oem :oem

View File

@ -1,5 +1,5 @@
@echo off @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 2:x86 | x64 "
echo "Parameter 3: 100 | 200 ... " echo "Parameter 3: 100 | 200 ... "
@ -56,6 +56,12 @@ if "%OEM%" equ "neu" (
set NAME=neu%NAME% set NAME=neu%NAME%
goto oem 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" echo "Parameter 1:oem is fail"
exit 1 exit 1
:oem :oem

View File

@ -1,4 +1,4 @@
// hgsetver.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。 // hgsetver.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。
// //
#include <Windows.h> #include <Windows.h>
#include <iostream> #include <iostream>
@ -18,7 +18,8 @@ enum oem
OEM_CANGTIAN, OEM_CANGTIAN,
OEM_ZHONGJING, OEM_ZHONGJING,
OEM_ZIGUANG, OEM_ZIGUANG,
OEM_NEUTRAL OEM_NEUTRAL,
OEM_DELI
}; };
#define GET_ENUM_NAME_W(e, v) \ #define GET_ENUM_NAME_W(e, v) \
if(e == v) return L###e; if(e == v) return L###e;
@ -102,6 +103,8 @@ int main()
vendor = OEM_ZIGUANG; vendor = OEM_ZIGUANG;
else if (wcsicmp(cmd->parameter(L"-oem"), L"neu") == 0) else if (wcsicmp(cmd->parameter(L"-oem"), L"neu") == 0)
vendor = OEM_NEUTRAL; vendor = OEM_NEUTRAL;
else if (wcsicmp(cmd->parameter(L"-oem"), L"dl") == 0)
vendor = OEM_DELI;
else else
std::wcout << L" OEM '" << cmd->parameter(L"-oem") << L"' is not supported! set as OEM_NONE.\r\n"; 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_ZHONGJING, o);
GET_ENUM_NAME_W(OEM_ZIGUANG, o); GET_ENUM_NAME_W(OEM_ZIGUANG, o);
GET_ENUM_NAME_W(OEM_NEUTRAL, o); GET_ENUM_NAME_W(OEM_NEUTRAL, o);
GET_ENUM_NAME_W(OEM_DELI, o);
} }
static oem from_str(const wchar_t* str) 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_ZHONGJING, s);
GET_ENUM_VALUE_W(OEM_ZIGUANG, s); GET_ENUM_VALUE_W(OEM_ZIGUANG, s);
GET_ENUM_VALUE_W(OEM_NEUTRAL, s); GET_ENUM_VALUE_W(OEM_NEUTRAL, s);
GET_ENUM_VALUE_W(OEM_DELI, s);
return OEM_NOT; return OEM_NOT;
} }
static int oem_code(oem o) static int oem_code(oem o)
@ -178,6 +183,8 @@ static int oem_code(oem o)
return 20; return 20;
else if (o == OEM_ZIGUANG) else if (o == OEM_ZIGUANG)
return 22; return 22;
else if (o == OEM_DELI)
return 24;
else else
return 10; return 10;
} }
@ -193,6 +200,8 @@ static oem oem_from_code(int code)
return OEM_ZHONGJING; return OEM_ZHONGJING;
else if (code == 22) else if (code == 22)
return OEM_ZIGUANG; return OEM_ZIGUANG;
else if (code == 24)
return OEM_DELI;
else else
return OEM_NONE; return OEM_NONE;
} }
@ -764,6 +773,8 @@ namespace rc
os = L"unis"; os = L"unis";
else if (o == OEM_NEUTRAL) else if (o == OEM_NEUTRAL)
os = L"neutral"; os = L"neutral";
else if (o == OEM_DELI)
os = L"deli";
while (len > bgn) while (len > bgn)
{ {
bgn += first.length(); bgn += first.length();
@ -797,6 +808,8 @@ namespace rc
os = L"unis"; os = L"unis";
else if (o == OEM_NEUTRAL) else if (o == OEM_NEUTRAL)
os = L"neutral"; os = L"neutral";
else if (o == OEM_DELI)
os = L"deli";
while (len > bgn) while (len > bgn)
{ {
bgn += first.length(); bgn += first.length();
@ -969,6 +982,8 @@ namespace rc
backend = L"zj"; backend = L"zj";
else if (o == OEM_ZIGUANG) else if (o == OEM_ZIGUANG)
backend = L"zg"; backend = L"zg";
else if (o == OEM_DELI)
backend = L"dl";
else else
backend = L"hg"; backend = L"hg";
backend += L"sane"; backend += L"sane";
@ -1034,6 +1049,8 @@ namespace rc
backend.insert(0, L"_zj"); backend.insert(0, L"_zj");
else if (o == OEM_ZIGUANG) else if (o == OEM_ZIGUANG)
backend.insert(0, L"_zg"); backend.insert(0, L"_zg");
else if (o == OEM_DELI)
backend.insert(0, L"_dl");
else else
backend.insert(0, L"_hg"); backend.insert(0, L"_hg");
@ -1057,8 +1074,13 @@ namespace rc
prev = L"_zgsane_"; prev = L"_zgsane_";
if (cont.find(prev) == std::wstring::npos) 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"); backend.insert(0, L"zj");
else if (o == OEM_ZIGUANG) else if (o == OEM_ZIGUANG)
backend.insert(0, L"zg"); backend.insert(0, L"zg");
else if (o == OEM_DELI)
backend.insert(0, L"dl");
else else
backend.insert(0, L"hg"); backend.insert(0, L"hg");
@ -1111,7 +1135,11 @@ namespace rc
prev = L"zg_scanner_"; prev = L"zg_scanner_";
if (cont.find(prev) == std::wstring::npos) 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\\"; target += L"unis\\";
else if (o == OEM_NEUTRAL) else if (o == OEM_NEUTRAL)
target += L"neutral\\"; target += L"neutral\\";
else if (o == OEM_DELI)
target += L"deli\\";
else else
target += L"huagao\\"; target += L"huagao\\";
@ -1184,6 +1214,8 @@ namespace rc
target = L"unis"; target = L"unis";
else if (param->o == OEM_NEUTRAL) else if (param->o == OEM_NEUTRAL)
target = L"neutral"; target = L"neutral";
else if (param->o == OEM_DELI)
target = L"deli";
target += tail; target += tail;
while ((bgn = cont.find(first, bgn)) != std::wstring::npos) while ((bgn = cont.find(first, bgn)) != std::wstring::npos)