Commit c98319ae9a9bbcc39f3bbbd7fa0c8f7bb490236a
1 parent
344cf4b0
feat<auto-updata>修改自动升级检查版本时闪对话框
Showing
2 changed files
with
13 additions
and
19 deletions
client_auto_updata/AutoUpdate/AutoUpdate.cpp
... | ... | @@ -100,8 +100,6 @@ BOOL CAUAutoUpdateApp::InitInstance() |
100 | 100 | SetRegistryKey(_T("应用程序向导生成的本地应用程序")); |
101 | 101 | |
102 | 102 | CAUAutoUpdateDlg dlgUpdate; |
103 | - m_pMainWnd = &dlgUpdate; | |
104 | - | |
105 | 103 | do |
106 | 104 | { |
107 | 105 | if (dlgUpdate.m_pDataManage->m_stuConfigData.sAppName.IsEmpty()) |
... | ... | @@ -110,7 +108,15 @@ BOOL CAUAutoUpdateApp::InitInstance() |
110 | 108 | Log("读取本地配置文件失败!"); |
111 | 109 | break; |
112 | 110 | } |
111 | + | |
112 | + Log("检查更新。"); | |
113 | + if (dlgUpdate.m_pDataManage->CheckVersion()) | |
114 | + { | |
115 | + Log("已经是最新版本。"); | |
116 | + break; | |
117 | + } | |
113 | 118 | |
119 | + m_pMainWnd = &dlgUpdate; | |
114 | 120 | INT_PTR nResponse = dlgUpdate.DoModal(); |
115 | 121 | if (nResponse == IDOK) |
116 | 122 | { |
... | ... | @@ -128,11 +134,8 @@ BOOL CAUAutoUpdateApp::InitInstance() |
128 | 134 | TRACE(traceAppMsg, 0, "警告: 如果您在对话框上使用 MFC 控件,则无法 #define _AFX_NO_MFC_CONTROLS_IN_DIALOGS。\n"); |
129 | 135 | } |
130 | 136 | |
131 | - | |
132 | 137 | } while (0); |
133 | 138 | |
134 | - | |
135 | - | |
136 | 139 | CAUDataManage::Instantialize()->DestoryInstance(); |
137 | 140 | |
138 | 141 | // 删除上面创建的 shell 管理器。 | ... | ... |
client_auto_updata/AutoUpdate/AutoUpdateDlg.cpp
... | ... | @@ -63,24 +63,15 @@ BOOL CAUAutoUpdateDlg::OnInitDialog() |
63 | 63 | |
64 | 64 | ShowWindow(SW_HIDE); |
65 | 65 | |
66 | - Log("检查更新。"); | |
67 | - if (!m_pDataManage->CheckVersion()) | |
66 | + if (IDOK == MessageBox(_T("检查到有新版本,是否升级?"), _T("版本升级"), MB_OKCANCEL)) | |
68 | 67 | { |
69 | - if (IDOK == MessageBox(_T("检查到有新版本,是否升级?"), _T("版本升级"), MB_OKCANCEL)) | |
70 | - { | |
71 | - Log("确认升级。"); | |
72 | - SetUpdateView(); | |
73 | - AfxBeginThread(Updata, NULL, THREAD_PRIORITY_NORMAL, 0, 0, NULL); | |
74 | - } | |
75 | - else | |
76 | - { | |
77 | - Log("暂不升级。"); | |
78 | - SendMessage(WM_CLOSE); | |
79 | - } | |
68 | + Log("确认升级。"); | |
69 | + SetUpdateView(); | |
70 | + AfxBeginThread(Updata, NULL, THREAD_PRIORITY_NORMAL, 0, 0, NULL); | |
80 | 71 | } |
81 | 72 | else |
82 | 73 | { |
83 | - Log("已经是最新版本。"); | |
74 | + Log("暂不升级。"); | |
84 | 75 | SendMessage(WM_CLOSE); |
85 | 76 | } |
86 | 77 | ... | ... |