mirror of
https://github.com/valinet/ExplorerPatcher.git
synced 2024-11-23 23:21:08 +01:00
Setup: Moved uninstallation prompt dialog existence check to the GUI
This commit is contained in:
parent
95ea9e740b
commit
0589a251c1
32
ep_gui/GUI.c
32
ep_gui/GUI.c
@ -2184,19 +2184,27 @@ static BOOL GUI_Build(HDC hDC, HWND hwnd, POINT pt)
|
||||
}
|
||||
else if (!strncmp(line + 1, "uninstall", 6))
|
||||
{
|
||||
wchar_t uninstallLink[MAX_PATH];
|
||||
ZeroMemory(uninstallLink, sizeof(uninstallLink));
|
||||
SHGetFolderPathW(NULL, SPECIAL_FOLDER, NULL, SHGFP_TYPE_CURRENT, uninstallLink);
|
||||
wcscat_s(uninstallLink, MAX_PATH, _T(APP_RELATIVE_PATH) L"\\" _T(SETUP_UTILITY_NAME));
|
||||
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));
|
||||
SHGetFolderPathW(NULL, SPECIAL_FOLDER, NULL, SHGFP_TYPE_CURRENT, uninstallLink);
|
||||
wcscat_s(uninstallLink, MAX_PATH, _T(APP_RELATIVE_PATH) L"\\" _T(SETUP_UTILITY_NAME));
|
||||
|
||||
SHELLEXECUTEINFOW sei;
|
||||
ZeroMemory(&sei, sizeof(SHELLEXECUTEINFOW));
|
||||
sei.cbSize = sizeof(sei);
|
||||
sei.hwnd = hwnd;
|
||||
sei.lpFile = uninstallLink;
|
||||
sei.nShow = SW_NORMAL;
|
||||
sei.lpParameters = L"/uninstall";
|
||||
ShellExecuteExW(&sei);
|
||||
SHELLEXECUTEINFOW sei;
|
||||
ZeroMemory(&sei, sizeof(SHELLEXECUTEINFOW));
|
||||
sei.cbSize = sizeof(sei);
|
||||
sei.hwnd = hwnd;
|
||||
sei.lpFile = uninstallLink;
|
||||
sei.nShow = SW_NORMAL;
|
||||
sei.lpParameters = L"/uninstall";
|
||||
ShellExecuteExW(&sei);
|
||||
}
|
||||
}
|
||||
else if (!strncmp(line + 1, "update_weather", 14))
|
||||
{
|
||||
|
@ -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…
Reference in New Issue
Block a user