编译win平台的版本时,同步更改linux版本
This commit is contained in:
parent
ae4b06be35
commit
b63ad20e4a
Binary file not shown.
|
@ -373,6 +373,8 @@ namespace rc
|
||||||
{
|
{
|
||||||
oem o;
|
oem o;
|
||||||
int product_id;
|
int product_id;
|
||||||
|
int ver1;
|
||||||
|
int ver2;
|
||||||
bool change_out_dir;
|
bool change_out_dir;
|
||||||
}CHGPARAM, *LPCHGPARAM;
|
}CHGPARAM, *LPCHGPARAM;
|
||||||
bool __stdcall change_out_dir(std::wstring& cont, oem o);
|
bool __stdcall change_out_dir(std::wstring& cont, oem o);
|
||||||
|
@ -1082,6 +1084,41 @@ namespace rc
|
||||||
|
|
||||||
return ok;
|
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)
|
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;
|
std::wcout << "change exporting-definition failed: " << rcf.c_str() << std::endl;
|
||||||
ret = false;
|
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
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue