MCPcopy Create free account
hub / github.com/Squirrel/Squirrel.Windows / DisplayErrorMessage

Method DisplayErrorMessage

src/Setup/UpdateRunner.cpp:7–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5#include <vector>
6
7void 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
37HRESULT CUpdateRunner::AreWeUACElevated()
38{

Callers

nothing calls this directly

Calls 5

SetButtonsMethod · 0.45
SetContentTextMethod · 0.45
SetMainIconMethod · 0.45
DoModalMethod · 0.45

Tested by

no test coverage detected