编译win平台的版本时,同步更改linux版本

This commit is contained in:
gb 2022-08-04 13:57:19 +08:00
parent ae4b06be35
commit b63ad20e4a
2 changed files with 43 additions and 0 deletions

Binary file not shown.

View File

@ -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(), &param, rc::change_linux_minver);
}
else
{