|
|
@@ -288,6 +288,7 @@ void CVtmLoaderFSM::s0_on_entry()
|
|
|
NetWorkCheckAndGetSettingTask* task = new NetWorkCheckAndGetSettingTask(this);
|
|
|
GetEntityBase()->GetFunction()->PostThreadPoolTask(task);
|
|
|
}
|
|
|
+ GetOsVersion();
|
|
|
}
|
|
|
|
|
|
void CVtmLoaderFSM::s0_on_exit()
|
|
|
@@ -3133,26 +3134,31 @@ CSimpleStringA CVtmLoaderFSM::GetOsVersion()
|
|
|
return "";
|
|
|
}
|
|
|
runInfoPath += "\\runcfg\\osverion";
|
|
|
+ CSimpleStringA csCmd;
|
|
|
+ csCmd = CSimpleStringA::Format("cmd /c ver >%s", runInfoPath);
|
|
|
+ WinExec((LPCSTR)csCmd, SW_HIDE);
|
|
|
+
|
|
|
ifstream is;
|
|
|
is.open(runInfoPath.GetData(), ios::binary);
|
|
|
- if (!is.is_open())
|
|
|
+ if (is.is_open())
|
|
|
+ {
|
|
|
+ string line;
|
|
|
+ while (!is.eof()) {
|
|
|
+ getline(is, line);
|
|
|
+ int start = line.find("版本");
|
|
|
+ if (start != string::npos)
|
|
|
+ {
|
|
|
+ DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("ver:[%s]", line.c_str());
|
|
|
+ return CSimpleStringA(line.c_str());
|
|
|
+ }
|
|
|
+ else
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
{
|
|
|
DWORD dwErr = GetLastError();
|
|
|
DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("open runcfg\\osverion file failed. [%d]", dwErr);
|
|
|
- CSimpleStringA csCmd;
|
|
|
- csCmd = CSimpleStringA::Format("cmd /c ver >%s", runInfoPath);
|
|
|
- WinExec((LPCSTR)csCmd, SW_HIDE);
|
|
|
- }
|
|
|
- is.seekg(0, std::ios::beg);
|
|
|
- string line;
|
|
|
- while (!is.eof()) {
|
|
|
- getline(is, line);
|
|
|
- int start = line.find("版本");
|
|
|
- if (start != string::npos)
|
|
|
- //return CSimpleStringA(line.substr(start + 5, line.length() - start - 7).c_str());
|
|
|
- return CSimpleStringA(line.c_str());
|
|
|
- else
|
|
|
- continue;
|
|
|
}
|
|
|
return "";
|
|
|
#else
|