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

oldstable
James Hawkins 2007-05-29 12:03:05 -07:00 committed by Alexandre Julliard
parent b8e0b3c1c8
commit c2e91588e9
3 changed files with 7 additions and 3 deletions

View File

@ -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','\\',

View File

@ -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 );
}

View File

@ -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 );