diff --git a/sln/Release/hgsetver.exe b/sln/Release/hgsetver.exe index d86cae3..62286ea 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 86ad4fb..e6be7ce 100644 --- a/sln/hgsetver/hgsetver.cpp +++ b/sln/hgsetver/hgsetver.cpp @@ -373,6 +373,8 @@ namespace rc { oem o; int product_id; + int ver1; + int ver2; bool change_out_dir; }CHGPARAM, *LPCHGPARAM; bool __stdcall change_out_dir(std::wstring& cont, oem o); @@ -1082,6 +1084,41 @@ namespace rc return ok; } + + static bool __stdcall change_linux_minver(std::wstring& cont, LPCHGPARAM param) + { + std::wstring tag(L"minver=\""); + int min_ver = param->ver2; + size_t pos = cont.find(tag), end = 0; + wchar_t v[20] = { 0 }; + + if (pos == std::wstring::npos) + return false; + + swprintf_s(v, _countof(v) - 1, L"%d", min_ver); + pos += tag.length(); + end = cont.find(L"\"", pos); + if (end == std::wstring::npos) + return false; + if (cont.find(L"\n", pos) < end) + return false; + cont.replace(pos, end - pos, v); + + tag = L"mainverstr=\"s/ver_1/"; + pos = cont.find(tag); + if (pos == std::wstring::npos) + return false; + pos += tag.length(); + end = cont.find(L"/", pos); + if (end == std::wstring::npos) + return false; + if (cont.find(L"\n", pos) < end) + return false; + swprintf_s(v, _countof(v) - 1, L"%d", param->ver1); + cont.replace(pos, end - pos, v); + + return true; + } }; static bool set_ver(const wchar_t* file, oem vendor, bool x86, int pid, int main, bool twain_only, bool nov) @@ -1199,6 +1236,12 @@ static bool set_ver(const wchar_t* file, oem vendor, bool x86, int pid, int main std::wcout << "change exporting-definition failed: " << rcf.c_str() << std::endl; ret = false; } + + rcf = base + L"\\..\\..\\code_device\\build.sh"; + STR_SIMPLIFY_PATH(rcf); + param.ver1 = main; + param.ver2 = sub; + rc::change_file(rcf.c_str(), ¶m, rc::change_linux_minver); } else {