Skip to content

get hotfix error on win10  #4

@nmygb

Description

@nmygb

packages.cpp : EnumWin6Hotfixes
// with Windows Installer versions prior to v3.0.
if (ERROR_SUCCESS != (dwRetVal = RegOpenKeyEx(HKEY_LOCAL_MACHINE, HOTFIXES_REG_PATH, 0, KEY_READ, &hKey))) {
SetError(ERR_CRIT, dwRetVal, _T("Failed to enumerate installed hotfixes"));
return;
}
fix it to:

DWORD flag;
// Get handle to hotfixes registry key
// We could use MSI API but it won't return hotfixes built 
// with Windows Installer versions prior to v3.0.
if (IsWow64() )
{
	flag = KEY_WOW64_64KEY | KEY_READ;
}
else
	flag = KEY_READ;
if (ERROR_SUCCESS != (dwRetVal = RegOpenKeyEx(HKEY_LOCAL_MACHINE, HOTFIXES_REG_PATH, 0, flag, &hKey))) {
	SetError(ERR_CRIT, dwRetVal, _T("Failed to enumerate installed hotfixes"));
	return;
}

if (0 != wcsncmp(szBuffer, _T("Package_for_KB"), 14))
fix it to:
if (0 != wcsncmp(szBuffer, T("Package"), 8))

at last, comment some code:
// Ensure InstallName == "update.mum"
// if (NULL != (pszBuffer = GetRegString(hSubkey, _T("InstallName")))) {
// if (0 != wcsicmp(pszBuffer, _T("update.mum"))) {
// FREE(pszBuffer);
// goto cleanup_key;
// }
// }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions