Windows MSI: Fix error querying bootloader information
This commit is contained in:
parent
4dc3d9c1a7
commit
7bc4256c42
|
@ -1891,7 +1891,8 @@ BOOL UpgradeBootLoader_Dll (MSIHANDLE hInstaller, HWND hwndDlg)
|
||||||
{
|
{
|
||||||
MSILog(hInstaller, MSI_INFO_LEVEL, L"Begin UpgradeBootLoader_Dll");
|
MSILog(hInstaller, MSI_INFO_LEVEL, L"Begin UpgradeBootLoader_Dll");
|
||||||
|
|
||||||
BOOL bOK = FALSE;
|
BOOL bOK = FALSE, bNeedUnloadDriver = FALSE;
|
||||||
|
int status;
|
||||||
|
|
||||||
if (!SystemEncryptionUpdate)
|
if (!SystemEncryptionUpdate)
|
||||||
{
|
{
|
||||||
|
@ -1900,6 +1901,19 @@ BOOL UpgradeBootLoader_Dll (MSIHANDLE hInstaller, HWND hwndDlg)
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (hDriver == INVALID_HANDLE_VALUE)
|
||||||
|
{
|
||||||
|
status = DriverAttach();
|
||||||
|
if ((status == 0) && (hDriver != INVALID_HANDLE_VALUE))
|
||||||
|
{
|
||||||
|
bNeedUnloadDriver = TRUE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MSILog(hInstaller, MSI_INFO_LEVEL, L"UpgradeBootLoader_Dll: failed to attach to driver");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
BootEncryption bootEnc (hwndDlg);
|
BootEncryption bootEnc (hwndDlg);
|
||||||
|
@ -1928,6 +1942,11 @@ BOOL UpgradeBootLoader_Dll (MSIHANDLE hInstaller, HWND hwndDlg)
|
||||||
MSILog (hInstaller, MSI_ERROR_LEVEL, GetString("BOOT_LOADER_UPGRADE_FAILED"));
|
MSILog (hInstaller, MSI_ERROR_LEVEL, GetString("BOOT_LOADER_UPGRADE_FAILED"));
|
||||||
|
|
||||||
end:
|
end:
|
||||||
|
if (bNeedUnloadDriver)
|
||||||
|
{
|
||||||
|
CloseHandle (hDriver);
|
||||||
|
hDriver = INVALID_HANDLE_VALUE;
|
||||||
|
}
|
||||||
MSILog(hInstaller, MSI_INFO_LEVEL, L"End UpgradeBootLoader_Dll");
|
MSILog(hInstaller, MSI_INFO_LEVEL, L"End UpgradeBootLoader_Dll");
|
||||||
return bOK;
|
return bOK;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue