1
0
mirror of https://github.com/valinet/ExplorerPatcher.git synced 2024-11-13 18:50:46 +01:00

Setup: Moved uninstallation prompt dialog existence check to the GUI

This commit is contained in:
Amrsatrio 2024-03-13 07:18:48 +07:00
parent 95ea9e740b
commit 0589a251c1
2 changed files with 20 additions and 19 deletions

View File

@ -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)
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);

View File

@ -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));