Browse Source

Setup: Moved uninstallation prompt dialog existence check to the GUI

pull/3235/head
Amrsatrio 2 years ago
parent
commit
0589a251c1
  1. 8
      ep_gui/GUI.c
  2. 7
      ep_setup/ep_setup.c

8
ep_gui/GUI.c

@ -2183,6 +2183,13 @@ static BOOL GUI_Build(HDC hDC, HWND hwnd, POINT pt) @@ -2183,6 +2183,13 @@ static BOOL GUI_Build(HDC hDC, HWND hwnd, POINT pt)
}
}
else if (!strncmp(line + 1, "uninstall", 6))
{
HWND hwndExistingMb = FindWindowExW(NULL, NULL, L"#32770", _T(PRODUCT_NAME));
if (hwndExistingMb)
{
SwitchToThisWindow(hwndExistingMb, TRUE);
}
else
{
wchar_t uninstallLink[MAX_PATH];
ZeroMemory(uninstallLink, sizeof(uninstallLink));
@ -2198,6 +2205,7 @@ static BOOL GUI_Build(HDC hDC, HWND hwnd, POINT pt) @@ -2198,6 +2205,7 @@ static BOOL GUI_Build(HDC hDC, HWND hwnd, POINT pt)
sei.lpParameters = L"/uninstall";
ShellExecuteExW(&sei);
}
}
else if (!strncmp(line + 1, "update_weather", 14))
{
PostMessageW(FindWindowW(_T(EPW_WEATHER_CLASSNAME), NULL), EP_WEATHER_WM_FETCH_DATA, 0, 0);

7
ep_setup/ep_setup.c

@ -517,13 +517,6 @@ int WINAPI wWinMain( @@ -517,13 +517,6 @@ int WINAPI wWinMain(
bIsUpdate = (argc >= 1 && !_wcsicmp(wargv[0], L"/update_silent"));
if (!bInstall && (!_wcsicmp(wargv[0], L"/uninstall") || bForcePromptForUninstall))
{
HWND hwndExistingMb = FindWindowExW(NULL, NULL, L"#32770", _T(PRODUCT_NAME));
if (hwndExistingMb)
{
SwitchToThisWindow(hwndExistingMb, TRUE);
exit(0);
}
wchar_t mbText[256];
mbText[0] = 0;
LoadStringW(hInstance, IDS_SETUP_UNINSTALL_PROMPT, mbText, ARRAYSIZE(mbText));

Loading…
Cancel
Save