diff --git a/sln/Release/hgsetver.exe b/sln/Release/hgsetver.exe index 22edb9c..08f6c19 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 5e926a6..703de59 100644 --- a/sln/hgsetver/hgsetver.cpp +++ b/sln/hgsetver/hgsetver.cpp @@ -16,6 +16,7 @@ enum oem OEM_HANWANG, OEM_LISICHENG, OEM_CANGTIAN, + OEM_ZHONGJING, }; #define GET_ENUM_NAME_W(e, v) \ if(e == v) return L###e; @@ -93,6 +94,8 @@ int main() vendor = OEM_LISICHENG; else if (wcsicmp(cmd->parameter(L"-oem"), L"cts") == 0) vendor = OEM_CANGTIAN; + else if (wcsicmp(cmd->parameter(L"-oem"), L"zj") == 0) + vendor = OEM_ZHONGJING; else 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_LISICHENG, o); GET_ENUM_NAME_W(OEM_CANGTIAN, o); + GET_ENUM_NAME_W(OEM_ZHONGJING, o); } 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_HANWANG, 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; } static int oem_code(oem o) @@ -158,6 +162,8 @@ static int oem_code(oem o) return 14; else if (o == OEM_CANGTIAN) return 18; + else if (o == OEM_ZHONGJING) + return 20; else return 10; } @@ -169,6 +175,8 @@ static oem oem_from_code(int code) return OEM_LISICHENG; else if (code == 18) return OEM_CANGTIAN; + else if (code == 20) + return OEM_ZHONGJING; else return OEM_NONE; } @@ -493,6 +501,8 @@ namespace rc 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; @@ -599,8 +609,7 @@ namespace rc } while (end); if (!found) return false; - - // + bgn = end = 0; do { @@ -608,8 +617,10 @@ namespace rc line = L""; coding_util::pick_line(cont.c_str() + bgn, got_wstr, &line, &end); trim_left(line); + // wprintf(L"%s\r\n", line.c_str()); 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")); trim_left(line); @@ -657,6 +668,7 @@ namespace rc } } } while (end); + return true; } 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"; else if (o == OEM_CANGTIAN) os = L"cumtenn"; - + else if (o == OEM_ZHONGJING) + os = L"microtek"; while (len > bgn) { bgn += first.length(); @@ -758,7 +771,8 @@ namespace rc os = L"lanxum"; else if (o == OEM_CANGTIAN) os = L"cumtenn"; - + else if (o == OEM_ZHONGJING) + os = L"microtek"; while (len > bgn) { bgn += first.length(); @@ -927,6 +941,8 @@ namespace rc backend = L"lsc"; else if (o == OEM_CANGTIAN) backend = L"cts"; + else if (o == OEM_ZHONGJING) + backend = L"zj"; else backend = L"hg"; backend += L"sane"; @@ -988,6 +1004,8 @@ namespace rc backend.insert(0, L"_lsc"); else if (o == OEM_CANGTIAN) backend.insert(0, L"_cts"); + else if (o == OEM_ZHONGJING) + backend.insert(0, L"_zj"); else backend.insert(0, L"_hg"); @@ -1031,6 +1049,8 @@ namespace rc backend.insert(0, L"lsc"); else if (o == OEM_CANGTIAN) backend.insert(0, L"cts"); + else if (o == OEM_ZHONGJING) + backend.insert(0, L"zj"); else backend.insert(0, L"hg"); @@ -1076,6 +1096,8 @@ namespace rc target += L"lanxum\\"; else if (o == OEM_CANGTIAN) target += L"cumtenn\\"; + else if (o == OEM_ZHONGJING) + target += L"microtek\\"; else target += L"huagao\\"; @@ -1107,6 +1129,8 @@ namespace rc target = L"lanxum"; else if (param->o == OEM_CANGTIAN) target = L"cumtenn"; + else if (param->o == OEM_ZHONGJING) + target = L"microtek"; target += tail; 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); 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 (!twain_only)