From 845d2b55c98ac4ad13fb87e760c7f5af62935263 Mon Sep 17 00:00:00 2001 From: Amrsatrio Date: Wed, 25 Oct 2023 21:25:27 +0700 Subject: [PATCH] Setup: Fixed uninstallation of EP installations that have went through upgrades before the proper Pin to Start fix --- ExplorerPatcher/symbols.c | 15 ++++++--------- ExplorerPatcher/utility.h | 2 +- ep_setup/ep_setup.c | 14 ++++++++++++-- 3 files changed, 19 insertions(+), 12 deletions(-) diff --git a/ExplorerPatcher/symbols.c b/ExplorerPatcher/symbols.c index 057f38863..ca47cf07f 100644 --- a/ExplorerPatcher/symbols.c +++ b/ExplorerPatcher/symbols.c @@ -556,9 +556,8 @@ LoadSymbolsResult LoadSymbols(symbols_addr* symbols_PTRS) { szStoredHash[0] = 0; dwSize = sizeof(szStoredHash); - RegQueryValueExA(hKey, "Hash", 0, NULL, szStoredHash, &dwSize); - - if (!_stricmp(szHash, szStoredHash)) + if (RegQueryValueExA(hKey, "Hash", 0, NULL, szStoredHash, &dwSize) == ERROR_SUCCESS + && !_stricmp(szHash, szStoredHash)) { dwSize = sizeof(DWORD); RegQueryValueExW(hKey, TEXT(TWINUI_PCSHELL_SB_0), 0, NULL, &symbols_PTRS->twinui_pcshell_PTRS[0], &dwSize); @@ -613,9 +612,8 @@ LoadSymbolsResult LoadSymbols(symbols_addr* symbols_PTRS) { szStoredHash[0] = 0; dwSize = sizeof(szStoredHash); - RegQueryValueExA(hKey, "Hash", 0, NULL, szStoredHash, &dwSize); - - if (!_stricmp(szHash, szStoredHash)) + if (RegQueryValueExA(hKey, "Hash", 0, NULL, szStoredHash, &dwSize) == ERROR_SUCCESS + && !_stricmp(szHash, szStoredHash)) { dwSize = sizeof(DWORD); RegQueryValueExW(hKey, TEXT(STARTDOCKED_SB_0), 0, NULL, &symbols_PTRS->startdocked_PTRS[0], &dwSize); @@ -663,9 +661,8 @@ LoadSymbolsResult LoadSymbols(symbols_addr* symbols_PTRS) { szStoredHash[0] = 0; dwSize = sizeof(szStoredHash); - RegQueryValueExA(hKey, "Hash", 0, NULL, szStoredHash, &dwSize); - - if (!_stricmp(szHash, szStoredHash)) + if (RegQueryValueExA(hKey, "Hash", 0, NULL, szStoredHash, &dwSize) == ERROR_SUCCESS + && !_stricmp(szHash, szStoredHash)) { dwSize = sizeof(DWORD); RegQueryValueExW(hKey, TEXT(STARTUI_SB_0), 0, NULL, &symbols_PTRS->startui_PTRS[0], &dwSize); diff --git a/ExplorerPatcher/utility.h b/ExplorerPatcher/utility.h index 095187a8d..3cf566397 100644 --- a/ExplorerPatcher/utility.h +++ b/ExplorerPatcher/utility.h @@ -343,7 +343,7 @@ inline LSTATUS SHRegGetValueFromHKCUHKLMWithOpt( return lRes; } -static HWND(WINAPI* CreateWindowInBand)( +HWND(WINAPI* CreateWindowInBand)( _In_ DWORD dwExStyle, _In_opt_ LPCWSTR lpClassName, _In_opt_ LPCWSTR lpWindowName, diff --git a/ep_setup/ep_setup.c b/ep_setup/ep_setup.c index e2b2c1208..dcf40369d 100644 --- a/ep_setup/ep_setup.c +++ b/ep_setup/ep_setup.c @@ -977,10 +977,20 @@ int WINAPI wWinMain( if (bOk && IsWindows11()) { GetWindowsDirectoryW(wszPath, MAX_PATH); - wcscat_s(wszPath, MAX_PATH, L"\\SystemApps\\Microsoft.Windows.StartMenuExperienceHost_cw5n1h2txyewy\\en-US\\StartTileDataLegacy.dll.mui"); + wcscat_s(wszPath, MAX_PATH, L"\\SystemApps\\Microsoft.Windows.StartMenuExperienceHost_cw5n1h2txyewy\\en-US"); if (FileExistsW(wszPath)) { - bOk = DeleteFileW(wszPath); + wcscat_s(wszPath, MAX_PATH, L"\\StartTileDataLegacy.dll.mui"); + if (FileExistsW(wszPath)) + { + bOk = DeleteFileW(wszPath); + } + PathRemoveExtensionW(wszPath); + wcscat_s(wszPath, MAX_PATH, L".prev"); + if (FileExistsW(wszPath)) + { + bOk = DeleteFileW(wszPath); + } if (bOk) { GetWindowsDirectoryW(wszPath, MAX_PATH);