Skip to content

Commit

Permalink
setup fix install path search between channels
Browse files Browse the repository at this point in the history
  • Loading branch information
jxy-s committed Oct 9, 2024
1 parent 14c269b commit af782e8
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions tools/CustomSetupTool/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -923,16 +923,20 @@ PPH_STRING GetApplicationInstallPath(
HANDLE keyHandle;
PPH_STRING installPath = NULL;

if (NT_SUCCESS(PhOpenKey(
&keyHandle,
KEY_READ | KEY_WOW64_64KEY,
PH_KEY_LOCAL_MACHINE,
&UninstallKeyNames[PH_RELEASE_CHANNEL_ID],
0
)))
for (ULONG i = 0; i < RTL_NUMBER_OF(UninstallKeyNames); i++)
{
installPath = PhQueryRegistryStringZ(keyHandle, L"InstallLocation");
NtClose(keyHandle);
if (NT_SUCCESS(PhOpenKey(
&keyHandle,
KEY_READ | KEY_WOW64_64KEY,
PH_KEY_LOCAL_MACHINE,
&UninstallKeyNames[i],
0
)))
{
installPath = PhQueryRegistryStringZ(keyHandle, L"InstallLocation");
NtClose(keyHandle);
break;
}
}

#ifdef FORCE_TEST_UPDATE_LOCAL_INSTALL
Expand Down

0 comments on commit af782e8

Please sign in to comment.