| 5 | #include <vector> |
| 6 | |
| 7 | void CUpdateRunner::DisplayErrorMessage(CString& errorMessage, wchar_t* logFile) |
| 8 | { |
| 9 | CTaskDialog dlg; |
| 10 | TASKDIALOG_BUTTON buttons[] = { |
| 11 | { 1, L"Open Setup Log", }, |
| 12 | { 2, L"Close", }, |
| 13 | }; |
| 14 | |
| 15 | // TODO: Something about contacting support? |
| 16 | if (logFile == NULL) { |
| 17 | dlg.SetButtons(&buttons[1], 1, 1); |
| 18 | } else { |
| 19 | dlg.SetButtons(buttons, 2, 1); |
| 20 | } |
| 21 | |
| 22 | dlg.SetMainInstructionText(L"Installation has failed"); |
| 23 | dlg.SetContentText(errorMessage); |
| 24 | dlg.SetMainIcon(TD_ERROR_ICON); |
| 25 | |
| 26 | int nButton; |
| 27 | |
| 28 | if (FAILED(dlg.DoModal(::GetActiveWindow(), &nButton))) { |
| 29 | return; |
| 30 | } |
| 31 | |
| 32 | if (nButton == 1 && logFile != NULL) { |
| 33 | ShellExecute(NULL, NULL, logFile, NULL, NULL, SW_SHOW); |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | HRESULT CUpdateRunner::AreWeUACElevated() |
| 38 | { |
nothing calls this directly
no test coverage detected