Browse Source

Setup: Fixed uninstallation of EP installations that have went through upgrades before the proper Pin to Start fix

pull/2350/head 22621.2428.59.1_845d2b5
Amrsatrio 2 years ago
parent
commit
845d2b55c9
  1. 15
      ExplorerPatcher/symbols.c
  2. 2
      ExplorerPatcher/utility.h
  3. 12
      ep_setup/ep_setup.c

15
ExplorerPatcher/symbols.c

@ -556,9 +556,8 @@ LoadSymbolsResult LoadSymbols(symbols_addr* symbols_PTRS) @@ -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) @@ -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) @@ -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);

2
ExplorerPatcher/utility.h

@ -343,7 +343,7 @@ inline LSTATUS SHRegGetValueFromHKCUHKLMWithOpt( @@ -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,

12
ep_setup/ep_setup.c

@ -977,10 +977,20 @@ int WINAPI wWinMain( @@ -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))
{
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);

Loading…
Cancel
Save