|
|
@@ -1966,6 +1966,7 @@ bool CUpgradeTaskFSM::GetSysUpgradeResult(const char *pszResultLog, CSimpleStrin
|
|
|
auto arr2 = arr[i].Split('=');
|
|
|
if (arr2.GetCount() == 2)
|
|
|
{
|
|
|
+ //TODO: CrossPlaform 统一函数 [Gifur@2025630]
|
|
|
#ifdef RVC_OS_WIN
|
|
|
if (stricmp(arr2[0], "result") == 0)
|
|
|
eErrorCode = arr2[1];
|
|
|
@@ -2199,6 +2200,7 @@ int CUpgradeTaskFSM::ExecRunCmd(CSimpleStringA &strErrMsg,CInstallStep* ins)
|
|
|
}else{
|
|
|
//进一步看返回结果文件判断是否成功
|
|
|
CSimpleStringA strUnzipPath = GetFileDirectory(destPath.GetData());
|
|
|
+ //TODO: CrossPlaform SPLASH_STR [Gifur@2025630]
|
|
|
#ifdef RVC_OS_WIN
|
|
|
CSimpleStringA strResultLog = strUnzipPath + "\\result.log";//结果文件
|
|
|
#else
|
|
|
@@ -2647,6 +2649,7 @@ ErrorCodeEnum CUpgradeTaskFSM::CopyFileOperate(const char* srcPath, const char*
|
|
|
case 1:
|
|
|
{
|
|
|
if (bDestFileExists) {
|
|
|
+ //TODO: CrossPlaform [Gifur@2025630]
|
|
|
#ifdef RVC_OS_WIN
|
|
|
bRet = CopyFileA(srcPath, destPath, FALSE);
|
|
|
#else
|
|
|
@@ -2665,6 +2668,7 @@ ErrorCodeEnum CUpgradeTaskFSM::CopyFileOperate(const char* srcPath, const char*
|
|
|
break;
|
|
|
case 2:
|
|
|
{
|
|
|
+ //TODO: CrossPlaform [Gifur@2025630]
|
|
|
if (!bDestFileExists)
|
|
|
#ifdef RVC_OS_WIN
|
|
|
bRet = CopyFileA(srcPath, destPath, TRUE);
|
|
|
@@ -2681,6 +2685,7 @@ ErrorCodeEnum CUpgradeTaskFSM::CopyFileOperate(const char* srcPath, const char*
|
|
|
}
|
|
|
break;
|
|
|
case 3:
|
|
|
+ //TODO: CrossPlaform [Gifur@2025630]
|
|
|
#ifdef RVC_OS_WIN
|
|
|
bRet = CopyFileA(srcPath, destPath, FALSE);
|
|
|
#else
|
|
|
@@ -2730,6 +2735,7 @@ ErrorCodeEnum CUpgradeTaskFSM::SetRunSucceed(const char* pPackFile)
|
|
|
}
|
|
|
CSimpleStringA strSourcePath = CSimpleStringA::Format("%s" SPLIT_SLASH_STR "%s", (const char*)strDownloadPath, pPackFile);
|
|
|
CSimpleStringA strDestPath = CSimpleStringA::Format("%s" SPLIT_SLASH_STR "%s", (const char*)strUpgradedPath, pPackFile);
|
|
|
+ //TODO: CrossPlaform [Gifur@2025630]
|
|
|
#ifdef RVC_OS_WIN
|
|
|
CopyFileA(strSourcePath.GetData(), strDestPath.GetData(), FALSE);
|
|
|
#else
|
|
|
@@ -2827,6 +2833,7 @@ ErrorCodeEnum CUpgradeTaskFSM::UpgradeToNewVersion()
|
|
|
return Error_Succeed;
|
|
|
#else
|
|
|
bool backupSucc = true;
|
|
|
+ //TODO: BUGFix [Gifur@2025630]
|
|
|
CSimpleStringA strBackupActiveFile = CSimpleStringA::Format("%s\\back_active.txt", rootVerPath.GetData());
|
|
|
if (fileutil_copy_file( strBackupActiveFile.GetData(),strActiveFile.GetData())!=0) {
|
|
|
LogWarn(Severity_Middle, Error_Exception, ERR_TASK_UPDATE_ACTIVE_FAIL, CSimpleStringA::Format("UpgradeToNewVersion fail, back up active.txt fail, err=%d", errno).GetData());
|
|
|
@@ -3035,7 +3042,8 @@ void CUpgradeTaskFSM::RecursiveGetSubFiles(const char *pszDir, const char *pszTr
|
|
|
{
|
|
|
for (int i = 0; i < arr->nelts; ++i)
|
|
|
{
|
|
|
- char *file = ARRAY_IDX(arr, i, char*);
|
|
|
+ char *file = ARRAY_IDX(arr, i, char*);
|
|
|
+ //TODO: CrossPlaform [Gifur@2025630]
|
|
|
#ifdef RVC_OS_WIN
|
|
|
//不区分大小写
|
|
|
if (pszTrimStart != NULL && strnicmp(file, pszTrimStart, strlen(pszTrimStart))==0) {
|
|
|
@@ -3126,6 +3134,7 @@ bool CUpgradeTaskFSM::IsFileMatch(const char *pszFilter, const char *pszFileName
|
|
|
bool CUpgradeTaskFSM::RecursiveCopyDir(const char *pszSourceDir, const char *pszDestDir,CSimpleStringA &strErrInfo)
|
|
|
{
|
|
|
array_header_t *arr;
|
|
|
+ //TODO: CrossPlaform [Gifur@2025630]
|
|
|
#ifdef RVC_OS_WIN
|
|
|
if (!ExistsDirA(pszSourceDir))
|
|
|
{
|
|
|
@@ -3177,7 +3186,7 @@ bool CUpgradeTaskFSM::RecursiveCopyDir(const char *pszSourceDir, const char *psz
|
|
|
if (szDestFile[strlen(szDestFile) - 1] != SPLIT_SLASH)
|
|
|
strcat(szDestFile, SPLIT_SLASH_STR);
|
|
|
strcat(szDestFile, strrchr(file, SPLIT_SLASH) + 1);
|
|
|
-
|
|
|
+ //TODO: CrossPlaform [Gifur@2025630]
|
|
|
#ifdef RVC_OS_WIN
|
|
|
if (!CopyFileA(file, szDestFile, FALSE))
|
|
|
{
|
|
|
@@ -3211,7 +3220,7 @@ bool CUpgradeTaskFSM::RecursiveCopyDir(const char *pszSourceDir, const char *psz
|
|
|
if (szDestSubDir[strlen(szDestSubDir) - 1] != SPLIT_SLASH)
|
|
|
strcat(szDestSubDir, SPLIT_SLASH_STR);
|
|
|
strcat(szDestSubDir, strrchr(dir, SPLIT_SLASH) + 1);
|
|
|
-
|
|
|
+ //TODO: CrossPlaform [Gifur@2025630]
|
|
|
if (!RecursiveCopyDir(dir, szDestSubDir,strErrInfo))
|
|
|
{
|
|
|
#ifdef RVC_OS_WIN
|
|
|
@@ -5159,6 +5168,7 @@ int CUpgradeTaskFSM::ExecDepRunCmd(CSimpleStringA& strErrMsg, CInstallStep* ins)
|
|
|
else {
|
|
|
//进一步看返回结果文件判断是否成功
|
|
|
CSimpleStringA strUnzipPath = GetFileDirectory(destPath.GetData());
|
|
|
+ //TODO: CrossPlaform [Gifur@202571]
|
|
|
#ifdef RVC_OS_WIN
|
|
|
CSimpleStringA strResultLog = strUnzipPath + "\\result.log";//结果文件
|
|
|
#else
|
|
|
@@ -5808,7 +5818,7 @@ bool CUpgradeTaskFSM::CheckIfCanSwitchNow()
|
|
|
DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("CheckIfCanSwitchNow get CallState value is fail ,err=%d",(int)rc);
|
|
|
return false;
|
|
|
}
|
|
|
-
|
|
|
+ //TODO: CrossPlaform [Gifur@2025630]
|
|
|
#ifdef RVC_OS_WIN
|
|
|
SYSTEMTIME st = {};
|
|
|
GetLocalTime(&st);
|
|
|
@@ -5840,6 +5850,7 @@ bool CUpgradeTaskFSM::CheckIfCanSwitchNow()
|
|
|
DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("CheckIfCanSwitchNow get strUIState value is fail ,err=%d", (int)rc);
|
|
|
return false;
|
|
|
}
|
|
|
+ //TODO: CrossPlaform [Gifur@2025630]
|
|
|
#ifdef RVC_OS_WIN
|
|
|
CSimpleStringA nowStr = CSimpleStringA::Format("%d-%d-%d", st.wYear, st.wMonth, st.wDay).GetData();
|
|
|
#else
|
|
|
@@ -6039,6 +6050,7 @@ bool CUpgradeTaskFSM::isWork()
|
|
|
if((!m_currentTask.NewVersion.IsNullOrEmpty())&&(m_currentTask.cPendingState=="T"||m_currentTask.cPendingState=="C"||m_currentTask.cPendingState=="X")){
|
|
|
CSimpleStringA strRunInfo,strStartTime;
|
|
|
if (m_pEntity->GetFunction()->GetPath("RunInfo",strRunInfo) == Error_Succeed){
|
|
|
+ //TODO: CrossPlaform [Gifur@2025630]
|
|
|
#ifdef RVC_OS_WIN
|
|
|
strStartTime = strRunInfo + "\\runcfg\\starttime.dat";
|
|
|
#else
|