新增中晶
This commit is contained in:
parent
e358f73af8
commit
8313c3c454
Binary file not shown.
|
@ -16,6 +16,7 @@ enum oem
|
||||||
OEM_HANWANG,
|
OEM_HANWANG,
|
||||||
OEM_LISICHENG,
|
OEM_LISICHENG,
|
||||||
OEM_CANGTIAN,
|
OEM_CANGTIAN,
|
||||||
|
OEM_ZHONGJING,
|
||||||
};
|
};
|
||||||
#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;
|
||||||
|
@ -93,6 +94,8 @@ int main()
|
||||||
vendor = OEM_LISICHENG;
|
vendor = OEM_LISICHENG;
|
||||||
else if (wcsicmp(cmd->parameter(L"-oem"), L"cts") == 0)
|
else if (wcsicmp(cmd->parameter(L"-oem"), L"cts") == 0)
|
||||||
vendor = OEM_CANGTIAN;
|
vendor = OEM_CANGTIAN;
|
||||||
|
else if (wcsicmp(cmd->parameter(L"-oem"), L"zj") == 0)
|
||||||
|
vendor = OEM_ZHONGJING;
|
||||||
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";
|
||||||
}
|
}
|
||||||
|
@ -140,6 +143,7 @@ static std::wstring oem_str(oem o)
|
||||||
GET_ENUM_NAME_W(OEM_HANWANG, o);
|
GET_ENUM_NAME_W(OEM_HANWANG, o);
|
||||||
GET_ENUM_NAME_W(OEM_LISICHENG, o);
|
GET_ENUM_NAME_W(OEM_LISICHENG, o);
|
||||||
GET_ENUM_NAME_W(OEM_CANGTIAN, o);
|
GET_ENUM_NAME_W(OEM_CANGTIAN, o);
|
||||||
|
GET_ENUM_NAME_W(OEM_ZHONGJING, o);
|
||||||
}
|
}
|
||||||
static oem from_str(const wchar_t* str)
|
static oem from_str(const wchar_t* str)
|
||||||
{
|
{
|
||||||
|
@ -147,7 +151,7 @@ static oem from_str(const wchar_t* str)
|
||||||
GET_ENUM_VALUE_W(OEM_NONE, s);
|
GET_ENUM_VALUE_W(OEM_NONE, s);
|
||||||
GET_ENUM_VALUE_W(OEM_HANWANG, s);
|
GET_ENUM_VALUE_W(OEM_HANWANG, s);
|
||||||
GET_ENUM_VALUE_W(OEM_LISICHENG, s);
|
GET_ENUM_VALUE_W(OEM_LISICHENG, s);
|
||||||
GET_ENUM_VALUE_W(OEM_CANGTIAN, s);
|
GET_ENUM_VALUE_W(OEM_ZHONGJING, s);
|
||||||
return OEM_NOT;
|
return OEM_NOT;
|
||||||
}
|
}
|
||||||
static int oem_code(oem o)
|
static int oem_code(oem o)
|
||||||
|
@ -158,6 +162,8 @@ static int oem_code(oem o)
|
||||||
return 14;
|
return 14;
|
||||||
else if (o == OEM_CANGTIAN)
|
else if (o == OEM_CANGTIAN)
|
||||||
return 18;
|
return 18;
|
||||||
|
else if (o == OEM_ZHONGJING)
|
||||||
|
return 20;
|
||||||
else
|
else
|
||||||
return 10;
|
return 10;
|
||||||
}
|
}
|
||||||
|
@ -169,6 +175,8 @@ static oem oem_from_code(int code)
|
||||||
return OEM_LISICHENG;
|
return OEM_LISICHENG;
|
||||||
else if (code == 18)
|
else if (code == 18)
|
||||||
return OEM_CANGTIAN;
|
return OEM_CANGTIAN;
|
||||||
|
else if (code == 20)
|
||||||
|
return OEM_ZHONGJING;
|
||||||
else
|
else
|
||||||
return OEM_NONE;
|
return OEM_NONE;
|
||||||
}
|
}
|
||||||
|
@ -493,6 +501,8 @@ namespace rc
|
||||||
o = OEM_LISICHENG;
|
o = OEM_LISICHENG;
|
||||||
else if (line.find(oem_str(OEM_CANGTIAN)) != std::wstring::npos)
|
else if (line.find(oem_str(OEM_CANGTIAN)) != std::wstring::npos)
|
||||||
o = OEM_CANGTIAN;
|
o = OEM_CANGTIAN;
|
||||||
|
else if (line.find(oem_str(OEM_ZHONGJING)) != std::wstring::npos)
|
||||||
|
o = OEM_ZHONGJING;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool found = false, is_oem = false;
|
bool found = false, is_oem = false;
|
||||||
|
@ -600,7 +610,6 @@ namespace rc
|
||||||
if (!found)
|
if (!found)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
//
|
|
||||||
bgn = end = 0;
|
bgn = end = 0;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
|
@ -608,8 +617,10 @@ namespace rc
|
||||||
line = L"";
|
line = L"";
|
||||||
coding_util::pick_line(cont.c_str() + bgn, got_wstr, &line, &end);
|
coding_util::pick_line(cont.c_str() + bgn, got_wstr, &line, &end);
|
||||||
trim_left(line);
|
trim_left(line);
|
||||||
|
// wprintf(L"%s\r\n", line.c_str());
|
||||||
if (line.find(L"#define OEM_NAME") == 0)
|
if (line.find(L"#define OEM_NAME") == 0)
|
||||||
{
|
{
|
||||||
|
//wprintf(L"1:%s\r\n", line.c_str());
|
||||||
line.erase(0, lstrlenW(L"#define OEM_NAME"));
|
line.erase(0, lstrlenW(L"#define OEM_NAME"));
|
||||||
trim_left(line);
|
trim_left(line);
|
||||||
|
|
||||||
|
@ -657,6 +668,7 @@ namespace rc
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} while (end);
|
} while (end);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
static bool change_file(const wchar_t* file, LPCHGPARAM param, bool(__stdcall* modify)(std::wstring& cont, LPCHGPARAM param))
|
static bool change_file(const wchar_t* file, LPCHGPARAM param, bool(__stdcall* modify)(std::wstring& cont, LPCHGPARAM param))
|
||||||
{
|
{
|
||||||
|
@ -730,7 +742,8 @@ namespace rc
|
||||||
os = L"lanxum";
|
os = L"lanxum";
|
||||||
else if (o == OEM_CANGTIAN)
|
else if (o == OEM_CANGTIAN)
|
||||||
os = L"cumtenn";
|
os = L"cumtenn";
|
||||||
|
else if (o == OEM_ZHONGJING)
|
||||||
|
os = L"microtek";
|
||||||
while (len > bgn)
|
while (len > bgn)
|
||||||
{
|
{
|
||||||
bgn += first.length();
|
bgn += first.length();
|
||||||
|
@ -758,7 +771,8 @@ namespace rc
|
||||||
os = L"lanxum";
|
os = L"lanxum";
|
||||||
else if (o == OEM_CANGTIAN)
|
else if (o == OEM_CANGTIAN)
|
||||||
os = L"cumtenn";
|
os = L"cumtenn";
|
||||||
|
else if (o == OEM_ZHONGJING)
|
||||||
|
os = L"microtek";
|
||||||
while (len > bgn)
|
while (len > bgn)
|
||||||
{
|
{
|
||||||
bgn += first.length();
|
bgn += first.length();
|
||||||
|
@ -927,6 +941,8 @@ namespace rc
|
||||||
backend = L"lsc";
|
backend = L"lsc";
|
||||||
else if (o == OEM_CANGTIAN)
|
else if (o == OEM_CANGTIAN)
|
||||||
backend = L"cts";
|
backend = L"cts";
|
||||||
|
else if (o == OEM_ZHONGJING)
|
||||||
|
backend = L"zj";
|
||||||
else
|
else
|
||||||
backend = L"hg";
|
backend = L"hg";
|
||||||
backend += L"sane";
|
backend += L"sane";
|
||||||
|
@ -988,6 +1004,8 @@ namespace rc
|
||||||
backend.insert(0, L"_lsc");
|
backend.insert(0, L"_lsc");
|
||||||
else if (o == OEM_CANGTIAN)
|
else if (o == OEM_CANGTIAN)
|
||||||
backend.insert(0, L"_cts");
|
backend.insert(0, L"_cts");
|
||||||
|
else if (o == OEM_ZHONGJING)
|
||||||
|
backend.insert(0, L"_zj");
|
||||||
else
|
else
|
||||||
backend.insert(0, L"_hg");
|
backend.insert(0, L"_hg");
|
||||||
|
|
||||||
|
@ -1031,6 +1049,8 @@ namespace rc
|
||||||
backend.insert(0, L"lsc");
|
backend.insert(0, L"lsc");
|
||||||
else if (o == OEM_CANGTIAN)
|
else if (o == OEM_CANGTIAN)
|
||||||
backend.insert(0, L"cts");
|
backend.insert(0, L"cts");
|
||||||
|
else if (o == OEM_ZHONGJING)
|
||||||
|
backend.insert(0, L"zj");
|
||||||
else
|
else
|
||||||
backend.insert(0, L"hg");
|
backend.insert(0, L"hg");
|
||||||
|
|
||||||
|
@ -1076,6 +1096,8 @@ namespace rc
|
||||||
target += L"lanxum\\";
|
target += L"lanxum\\";
|
||||||
else if (o == OEM_CANGTIAN)
|
else if (o == OEM_CANGTIAN)
|
||||||
target += L"cumtenn\\";
|
target += L"cumtenn\\";
|
||||||
|
else if (o == OEM_ZHONGJING)
|
||||||
|
target += L"microtek\\";
|
||||||
else
|
else
|
||||||
target += L"huagao\\";
|
target += L"huagao\\";
|
||||||
|
|
||||||
|
@ -1107,6 +1129,8 @@ namespace rc
|
||||||
target = L"lanxum";
|
target = L"lanxum";
|
||||||
else if (param->o == OEM_CANGTIAN)
|
else if (param->o == OEM_CANGTIAN)
|
||||||
target = L"cumtenn";
|
target = L"cumtenn";
|
||||||
|
else if (param->o == OEM_ZHONGJING)
|
||||||
|
target = L"microtek";
|
||||||
target += tail;
|
target += tail;
|
||||||
|
|
||||||
while ((bgn = cont.find(first, bgn)) != std::wstring::npos)
|
while ((bgn = cont.find(first, bgn)) != std::wstring::npos)
|
||||||
|
@ -1236,6 +1260,7 @@ static bool set_ver(const wchar_t* file, oem vendor, bool x86, int pid, int main
|
||||||
STR_PARENT_FOLDER(base);
|
STR_PARENT_FOLDER(base);
|
||||||
base += L"\\..\\..\\..\\code_twain\\twain";
|
base += L"\\..\\..\\..\\code_twain\\twain";
|
||||||
STR_TO_ABSOLUTE_PATH(base);
|
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, &main, &sub, &build, &patch, &cn, &scn, &vs))
|
||||||
{
|
{
|
||||||
if (!twain_only)
|
if (!twain_only)
|
||||||
|
|
Loading…
Reference in New Issue