Skip to content

Commit

Permalink
Setup: Fixed uninstallation of EP installations that have went throug…
Browse files Browse the repository at this point in the history
…h upgrades before the proper Pin to Start fix
  • Loading branch information
Amrsatrio committed Oct 25, 2023
1 parent bdc06de commit 845d2b5
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 12 deletions.
15 changes: 6 additions & 9 deletions ExplorerPatcher/symbols.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion ExplorerPatcher/utility.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
14 changes: 12 additions & 2 deletions ep_setup/ep_setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 845d2b5

Please sign in to comment.