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

James Hawkins truiken at gmail.com
Tue May 29 14:03:05 CDT 2007


Hi,

Fixes bug 8461.  http://bugs.winehq.org/show_bug.cgi?id=8461

Changelog:
* Perform a forced reboot if a custom action returns ERROR_INSTALL_SUSPEND.

 dlls/msi/action.c  |    2 +-
 dlls/msi/custom.c  |    7 +++++--
 dlls/msi/msipriv.h |    1 +
 3 files changed, 7 insertions(+), 3 deletions(-)

-- 
James Hawkins
-------------- next part --------------
diff --git a/dlls/msi/action.c b/dlls/msi/action.c
index 689f9c4..41c474f 100644
--- a/dlls/msi/action.c
+++ b/dlls/msi/action.c
@@ -3851,7 +3851,7 @@ static UINT ACTION_InstallFinalize(MSIPA
     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','\\',
diff --git a/dlls/msi/custom.c b/dlls/msi/custom.c
index c8d889e..eaf5ce9 100644
--- a/dlls/msi/custom.c
+++ b/dlls/msi/custom.c
@@ -389,7 +389,7 @@ static UINT custom_get_process_return( H
     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( HA
         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_cust
         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 );
     }
diff --git a/dlls/msi/msipriv.h b/dlls/msi/msipriv.h
index bcb7512..f8f1d3d 100644
--- a/dlls/msi/msipriv.h
+++ b/dlls/msi/msipriv.h
@@ -580,6 +580,7 @@ extern void append_storage_to_db( MSIDAT
 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 );
 
-- 
1.4.1


More information about the wine-patches mailing list