|
@@ -1430,6 +1430,7 @@ namespace Task
|
|
|
if(remove(dPackPath)==0){
|
|
|
DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("delete download old pack succ ", dPackPath);
|
|
|
if(rename(dPackPathTemp.GetData(),dPackPath)!=0){
|
|
|
+ //TODO: CrossPlaform [Gifur@2025730]
|
|
|
#ifdef RVC_OS_WIN
|
|
|
errMsg = CSimpleStringA::Format("exist old file,remove temp file fail, error=%d",(int)GetLastError()).GetData();
|
|
|
#else
|
|
@@ -1443,6 +1444,7 @@ namespace Task
|
|
|
return 1;//成功返回
|
|
|
}
|
|
|
}else{
|
|
|
+ //TODO: CrossPlaform [Gifur@2025730]
|
|
|
#ifdef RVC_OS_WIN
|
|
|
errMsg = CSimpleStringA::Format("delete download old pack fail ,error:%d",(int)GetLastError()).GetData();
|
|
|
#else
|
|
@@ -1454,6 +1456,7 @@ namespace Task
|
|
|
}
|
|
|
}else{
|
|
|
if(rename(dPackPathTemp.GetData(),dPackPath)!=0){
|
|
|
+ //TODO: CrossPlaform [Gifur@2025730]
|
|
|
#ifdef RVC_OS_WIN
|
|
|
errMsg = CSimpleStringA::Format("not exist old file,remove temp file fail, error=%d",(int)GetLastError()).GetData();
|
|
|
#else
|
|
@@ -1474,6 +1477,7 @@ namespace Task
|
|
|
if(remove(dPackPathTemp.GetData())==0){
|
|
|
DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("delete download temp pack succ ,%s", dPackPathTemp.GetData());
|
|
|
}else{
|
|
|
+ //TODO: CrossPlaform [Gifur@2025730]
|
|
|
#ifdef RVC_OS_WIN
|
|
|
DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("delete download temp pack fail ,%s error:%d", dPackPathTemp.GetData(), GetLastError());
|
|
|
#else
|
|
@@ -1779,6 +1783,7 @@ ErrorCodeEnum CUpgradeTaskFSM::CreateNewVersion(CVersion NewSoftwareVersion,CSim
|
|
|
{
|
|
|
DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("new version dir [%s] already exist, delete it", strNewVerPath.GetData());
|
|
|
if(!RemoveDirRecursiveA(strNewVerPath.GetData())){
|
|
|
+ //TODO: CrossPlaform [Gifur@2025730]
|
|
|
#ifdef RVC_OS_WIN
|
|
|
DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("Create new version fail, delete already exist new version is fail:%d",GetLastError());
|
|
|
strErrInfo = CSimpleStringA::Format("Create new version fail, delete already exist new version is fail:%d",(int)GetLastError());
|
|
@@ -1792,6 +1797,7 @@ ErrorCodeEnum CUpgradeTaskFSM::CreateNewVersion(CVersion NewSoftwareVersion,CSim
|
|
|
|
|
|
if (!CreateDirA(strNewVerPath.GetData(), TRUE))
|
|
|
{
|
|
|
+ //TODO: CrossPlaform [Gifur@2025730]
|
|
|
#ifdef RVC_OS_WIN
|
|
|
DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("Create new version dir fail: %d", GetLastError());
|
|
|
strErrInfo = CSimpleStringA::Format("create new version dir fail: %d", (int)GetLastError());
|
|
@@ -1917,6 +1923,7 @@ ErrorCodeEnum CUpgradeTaskFSM::ClearUpgradeFailVersion(CVersion NewSoftwareVersi
|
|
|
if (ExistsDirA(strNewVerPath.GetData()))
|
|
|
{
|
|
|
if(!RemoveDirRecursiveA(strNewVerPath.GetData())){
|
|
|
+ //TODO: CrossPlaform [Gifur@2025730]
|
|
|
#ifdef RVC_OS_WIN
|
|
|
DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("ClearUpgradeFailVersion fail, delete temp Version [%s] is fail:%d",strNewVerPath.GetData(),(int)GetLastError());
|
|
|
#else
|
|
@@ -1974,6 +1981,7 @@ bool CUpgradeTaskFSM::GetSysUpgradeResult(const char *pszResultLog, CSimpleStrin
|
|
|
auto arr2 = arr[i].Split('=');
|
|
|
if (arr2.GetCount() == 2)
|
|
|
{
|
|
|
+ //TODO: CrossPlaform [Gifur@2025730]
|
|
|
#ifdef RVC_OS_WIN
|
|
|
if (stricmp(arr2[0], "result") == 0)
|
|
|
eErrorCode = arr2[1];
|
|
@@ -2194,6 +2202,7 @@ int CUpgradeTaskFSM::ExecRunCmd(CSimpleStringA &strErrMsg,CInstallStep* ins)
|
|
|
}
|
|
|
#endif
|
|
|
if(ret!=0){
|
|
|
+ //TODO: CrossPlaform [Gifur@2025730]
|
|
|
//程序执行异常,结果未知
|
|
|
#ifdef RVC_OS_WIN
|
|
|
DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("ExecRunCmd is fail, system_on exec unknown ,err=%s",err.GetData());
|
|
@@ -2208,6 +2217,7 @@ int CUpgradeTaskFSM::ExecRunCmd(CSimpleStringA &strErrMsg,CInstallStep* ins)
|
|
|
}else{
|
|
|
//进一步看返回结果文件判断是否成功
|
|
|
CSimpleStringA strUnzipPath = GetFileDirectory(destPath.GetData());
|
|
|
+ //TODO: CrossPlaform [Gifur@2025730]
|
|
|
#ifdef RVC_OS_WIN
|
|
|
CSimpleStringA strResultLog = strUnzipPath + "\\result.log";//结果文件
|
|
|
#else
|
|
@@ -2227,6 +2237,7 @@ int CUpgradeTaskFSM::ExecRunCmd(CSimpleStringA &strErrMsg,CInstallStep* ins)
|
|
|
DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("ExecRunCmd is succ,[%s] ", destPath.GetData());
|
|
|
return 1;//成功
|
|
|
}else{
|
|
|
+ //TODO: CrossPlaform [Gifur@2025730]
|
|
|
#ifdef RVC_OS_WIN
|
|
|
DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("ExecRunCmd is fail,errorCode = %s", eErrorCode.GetData());
|
|
|
strErrMsg = CSimpleStringA::Format("ExecRunCmd is fail,errorCode = %s", eErrorCode.GetData());
|
|
@@ -2656,6 +2667,7 @@ ErrorCodeEnum CUpgradeTaskFSM::CopyFileOperate(const char* srcPath, const char*
|
|
|
case 1:
|
|
|
{
|
|
|
if (bDestFileExists) {
|
|
|
+ //TODO: CrossPlaform [Gifur@2025730]
|
|
|
#ifdef RVC_OS_WIN
|
|
|
bRet = CopyFileA(srcPath, destPath, FALSE);
|
|
|
#else
|
|
@@ -2675,6 +2687,7 @@ ErrorCodeEnum CUpgradeTaskFSM::CopyFileOperate(const char* srcPath, const char*
|
|
|
case 2:
|
|
|
{
|
|
|
if (!bDestFileExists)
|
|
|
+ //TODO: CrossPlaform [Gifur@2025730]
|
|
|
#ifdef RVC_OS_WIN
|
|
|
bRet = CopyFileA(srcPath, destPath, TRUE);
|
|
|
#else
|
|
@@ -2690,6 +2703,7 @@ ErrorCodeEnum CUpgradeTaskFSM::CopyFileOperate(const char* srcPath, const char*
|
|
|
}
|
|
|
break;
|
|
|
case 3:
|
|
|
+ //TODO: CrossPlaform [Gifur@2025730]
|
|
|
#ifdef RVC_OS_WIN
|
|
|
bRet = CopyFileA(srcPath, destPath, FALSE);
|
|
|
#else
|
|
@@ -2715,6 +2729,7 @@ ErrorCodeEnum CUpgradeTaskFSM::CopyFileOperate(const char* srcPath, const char*
|
|
|
if (bRet){
|
|
|
RemoveFileReadOnlyAttributeA(destPath);
|
|
|
}else{
|
|
|
+ //TODO: CrossPlaform [Gifur@2025730]
|
|
|
#ifdef RVC_OS_WIN
|
|
|
strErrMsg = CSimpleStringA::Format("CopyFileOperate copy file fail:%d", GetLastError());
|
|
|
#else
|
|
@@ -2739,6 +2754,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@2025730]
|
|
|
#ifdef RVC_OS_WIN
|
|
|
CopyFileA(strSourcePath.GetData(), strDestPath.GetData(), FALSE);
|
|
|
#else
|
|
@@ -3141,7 +3157,7 @@ bool CUpgradeTaskFSM::IsFileMatch(const char *pszFilter, const char *pszFileName
|
|
|
}
|
|
|
|
|
|
bool CUpgradeTaskFSM::RecursiveCopyDir(const char *pszSourceDir, const char *pszDestDir,CSimpleStringA &strErrInfo)
|
|
|
-{
|
|
|
+{//TODO: CrossPlaform [Gifur@2025730]
|
|
|
array_header_t *arr;
|
|
|
#ifdef RVC_OS_WIN
|
|
|
if (!ExistsDirA(pszSourceDir))
|
|
@@ -3194,7 +3210,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@2025730]
|
|
|
#ifdef RVC_OS_WIN
|
|
|
if (!CopyFileA(file, szDestFile, FALSE))
|
|
|
{
|
|
@@ -3231,6 +3247,7 @@ bool CUpgradeTaskFSM::RecursiveCopyDir(const char *pszSourceDir, const char *psz
|
|
|
|
|
|
if (!RecursiveCopyDir(dir, szDestSubDir,strErrInfo))
|
|
|
{
|
|
|
+ //TODO: CrossPlaform [Gifur@2025730]
|
|
|
#ifdef RVC_OS_WIN
|
|
|
DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM)("copy dir [%s] fail: %d", dir, GetLastError());
|
|
|
if(strErrInfo.IsNullOrEmpty()){
|
|
@@ -3551,6 +3568,7 @@ ErrorCodeEnum CUpgradeTaskFSM::DeleteUnzipDir()
|
|
|
if (ExistsDirA(strUnzipDir.GetData()))
|
|
|
{
|
|
|
if(!RemoveDirRecursiveA(strUnzipDir.GetData())){
|
|
|
+ //TODO: CrossPlaform [Gifur@2025730]
|
|
|
#ifdef RVC_OS_WIN
|
|
|
DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM)("DeleteUnzipDir fail , temp unzip dir [%s] fail,err=%d",strUnzipDir.GetData(),(int)GetLastError());
|
|
|
#else
|
|
@@ -4032,7 +4050,7 @@ ErrorCodeEnum CUpgradeTaskFSM::loadCenterCfgInfo()
|
|
|
}
|
|
|
return Error_Succeed;
|
|
|
}
|
|
|
-
|
|
|
+//TODO: CrossPlaform [Gifur@2025730]
|
|
|
bool CUpgradeTaskFSM::GetFileLength(const char* filePath,long &fileLen)
|
|
|
{
|
|
|
FILE* file = fopen(filePath, "rb");
|
|
@@ -4710,6 +4728,7 @@ ErrorCodeEnum CUpgradeTaskFSM::CreateNewDepVersion(CSimpleStringA NewSoftwareVer
|
|
|
{
|
|
|
DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("new version dir [%s] already exist, delete it", strNewVerPath.GetData());
|
|
|
if (!RemoveDirRecursiveA(strNewVerPath.GetData())) {
|
|
|
+ //TODO: CrossPlaform [Gifur@2025730]
|
|
|
#ifdef RVC_OS_WIN
|
|
|
DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("Create new dep version fail, delete already exist new dep version is fail:%d", GetLastError());
|
|
|
strErrInfo = CSimpleStringA::Format("Create new dep version fail, delete already exist new dep version is fail:%d", (int)GetLastError());
|
|
@@ -4723,6 +4742,7 @@ ErrorCodeEnum CUpgradeTaskFSM::CreateNewDepVersion(CSimpleStringA NewSoftwareVer
|
|
|
|
|
|
if (!CreateDirA(strNewVerPath.GetData(), TRUE))
|
|
|
{
|
|
|
+ //TODO: CrossPlaform [Gifur@2025730]
|
|
|
#ifdef RVC_OS_WIN
|
|
|
DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("Create new dep version dir fail: %d", GetLastError());
|
|
|
strErrInfo = CSimpleStringA::Format("create new dep version dir fail: %d", (int)GetLastError());
|
|
@@ -4807,6 +4827,7 @@ ErrorCodeEnum CUpgradeTaskFSM::ClearUpgradeFailDepVersion(CSimpleStringA NewSoft
|
|
|
if (ExistsDirA(strNewVerPath.GetData()))
|
|
|
{
|
|
|
if (!RemoveDirRecursiveA(strNewVerPath.GetData())) {
|
|
|
+ //TODO: CrossPlaform [Gifur@2025730]
|
|
|
#ifdef RVC_OS_WIN
|
|
|
DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("ClearUpgradeFailDepVersion fail, delete temp Version [%s] is fail:%d", strNewVerPath.GetData(), (int)GetLastError());
|
|
|
#else
|
|
@@ -5071,6 +5092,7 @@ int CUpgradeTaskFSM::ExecDepRunCmd(CSimpleStringA& strErrMsg, CInstallStep* ins)
|
|
|
#endif
|
|
|
if (ret != 0) {
|
|
|
//程序执行异常,结果未知
|
|
|
+ //TODO: CrossPlaform [Gifur@2025730]
|
|
|
#ifdef RVC_OS_WIN
|
|
|
DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("ExecRunCmd is fail, system_on exec unknown ,err=%s", err.GetData());
|
|
|
strErrMsg = CSimpleStringA::Format("ExecRunCmd is fail, system_on exec unknown ,err=%s", err.GetData());
|
|
@@ -5085,6 +5107,7 @@ int CUpgradeTaskFSM::ExecDepRunCmd(CSimpleStringA& strErrMsg, CInstallStep* ins)
|
|
|
else {
|
|
|
//进一步看返回结果文件判断是否成功
|
|
|
CSimpleStringA strUnzipPath = GetFileDirectory(destPath.GetData());
|
|
|
+ //TODO: CrossPlaform [Gifur@2025730]
|
|
|
#ifdef RVC_OS_WIN
|
|
|
CSimpleStringA strResultLog = strUnzipPath + "\\result.log";//结果文件
|
|
|
#else
|
|
@@ -5105,6 +5128,7 @@ int CUpgradeTaskFSM::ExecDepRunCmd(CSimpleStringA& strErrMsg, CInstallStep* ins)
|
|
|
return 1;//成功
|
|
|
}
|
|
|
else {
|
|
|
+ //TODO: CrossPlaform [Gifur@2025730]
|
|
|
#ifdef RVC_OS_WIN
|
|
|
DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("ExecRunCmd is fail,errorCode = %s", eErrorCode.GetData());
|
|
|
strErrMsg = CSimpleStringA::Format("ExecRunCmd is fail,errorCode = %s", eErrorCode.GetData());
|
|
@@ -5720,6 +5744,7 @@ bool CUpgradeTaskFSM::DownloadFileWrite(byte* content,long contentLen,const char
|
|
|
fclose(tempFp);
|
|
|
|
|
|
if(ret!=1){
|
|
|
+ //TODO: CrossPlaform [Gifur@2025730]
|
|
|
#ifdef RVC_OS_WIN
|
|
|
DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("DownloadFileWrite write file fail,ret = %d,errno = %d",ret,(int)GetLastError());
|
|
|
return false;
|
|
@@ -5990,6 +6015,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@2025730]
|
|
|
#ifdef RVC_OS_WIN
|
|
|
strStartTime = strRunInfo + "\\runcfg\\starttime.dat";
|
|
|
#else
|
|
@@ -5998,6 +6024,7 @@ bool CUpgradeTaskFSM::isWork()
|
|
|
if(!ExistsFileA(strStartTime.GetData())){
|
|
|
return true;//完成升级过程,通过
|
|
|
}else{
|
|
|
+ //TODO: CrossPlaform [Gifur@2025730]
|
|
|
#ifdef RVC_OS_WIN
|
|
|
DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM)("upgrade process is not end ,file \\runcfg\\starttime is exist");
|
|
|
#else
|