Commit c2e91588 authored by James Hawkins's avatar James Hawkins Committed by Alexandre Julliard

msi: Perform a forced reboot if a custom action returns ERROR_INSTALL_SUSPEND.

parent b8e0b3c1
......@@ -3851,7 +3851,7 @@ static UINT ACTION_InstallFinalize(MSIPACKAGE *package)
return rc;
}
static UINT ACTION_ForceReboot(MSIPACKAGE *package)
UINT ACTION_ForceReboot(MSIPACKAGE *package)
{
static const WCHAR RunOnce[] = {
'S','o','f','t','w','a','r','e','\\',
......
......@@ -389,7 +389,7 @@ static UINT custom_get_process_return( HANDLE process )
return ERROR_SUCCESS;
}
static UINT custom_get_thread_return( HANDLE thread )
static UINT custom_get_thread_return( MSIPACKAGE *package, HANDLE thread )
{
DWORD rc = 0;
......@@ -404,6 +404,9 @@ static UINT custom_get_thread_return( HANDLE thread )
return rc;
case ERROR_NO_MORE_ITEMS:
return ERROR_SUCCESS;
case ERROR_INSTALL_SUSPEND:
ACTION_ForceReboot( package );
return ERROR_SUCCESS;
default:
ERR("Invalid Return Code %d\n",rc);
return ERROR_INSTALL_FAILURE;
......@@ -475,7 +478,7 @@ static UINT wait_thread_handle( msi_custom_action_info *info )
msi_dialog_check_messages( info->handle );
if (!(info->type & msidbCustomActionTypeContinue))
rc = custom_get_thread_return( info->handle );
rc = custom_get_thread_return( info->package, info->handle );
free_custom_action_data( info );
}
......
......@@ -580,6 +580,7 @@ extern void append_storage_to_db( MSIDATABASE *db, IStorage *stg );
extern UINT MSI_InstallPackage( MSIPACKAGE *, LPCWSTR, LPCWSTR );
extern void ACTION_free_package_structures( MSIPACKAGE* );
extern UINT ACTION_DialogBox( MSIPACKAGE*, LPCWSTR);
extern UINT ACTION_ForceReboot(MSIPACKAGE *package);
extern UINT MSI_Sequence( MSIPACKAGE *package, LPCWSTR szTable, INT iSequenceMode );
extern UINT MSI_SetFeatureStates( MSIPACKAGE *package );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment