|
@@ -1826,11 +1826,16 @@ void COTA::UpgradeCheck(std::string factoryNum)
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
+ if (MessageBox(NULL, _T("found out lastest software version, you have to update."), _T("Tips"), MB_YESNO | MB_TOPMOST | MB_ICONINFORMATION) == IDNO)
|
|
|
+ return;
|
|
|
+
|
|
|
// 保存成文件;
|
|
|
if (!DownloadFile(upresult.upcontent.fileurl, szNewPath))
|
|
|
{
|
|
|
LOG4C((LOG_NOTICE, "下载升级文件失败"));
|
|
|
+ MessageBox(NULL, _T("Download failure."), _T("Tips"), MB_OK | MB_TOPMOST | MB_ICONINFORMATION);
|
|
|
ReportUpgrade(FALSE, szVersion, factoryNum);
|
|
|
+ return;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -1839,7 +1844,7 @@ void COTA::UpgradeCheck(std::string factoryNum)
|
|
|
|
|
|
Sleep(500);
|
|
|
|
|
|
- MessageBox(NULL, _T("found out lastest software version, you need restart apps."), _T("Tips"), MB_OK | MB_TOPMOST | MB_ICONINFORMATION);
|
|
|
+ MessageBox(NULL, _T("Complete the download, you need restart apps."), _T("Tips"), MB_OK | MB_TOPMOST | MB_ICONINFORMATION);
|
|
|
|
|
|
// 启动程序;
|
|
|
::CoInitializeEx(NULL, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE); //某些情况下要初始化COM才能使用ShellExecuteEx;
|
|
@@ -1857,7 +1862,8 @@ void COTA::UpgradeCheck(std::string factoryNum)
|
|
|
if (!ShellExecuteEx(&stuExecInfo))
|
|
|
{
|
|
|
DWORD dwError = GetLastError();
|
|
|
- LOG4C((LOG_ERROR, "执行rename程序失败,错误码=%d", dwError))
|
|
|
+ LOG4C((LOG_ERROR, "执行rename程序失败,错误码=%d", dwError));
|
|
|
+ MessageBox(NULL, _T("Upgrade failure."), _T("Tips"), MB_OK | MB_TOPMOST | MB_ICONINFORMATION);
|
|
|
return;
|
|
|
}
|
|
|
|