msi 1: Notify the external UI handler when changing media

James Hawkins truiken at gmail.com
Mon Nov 13 16:18:54 CST 2006


Hi,

This fixes the first issue of bug 6595.
http://bugs.winehq.org/show_bug.cgi?id=6595

Changelog:
* Notify the external UI handler when changing media.

 dlls/msi/dialog.c |    4 ++++
 dlls/msi/files.c  |   12 +++++++++++-
 2 files changed, 15 insertions(+), 1 deletions(-)

-- 
James Hawkins
-------------- next part --------------
diff --git a/dlls/msi/dialog.c b/dlls/msi/dialog.c
index d928edc..a134aea 100644
--- a/dlls/msi/dialog.c
+++ b/dlls/msi/dialog.c
@@ -3505,6 +3505,7 @@ UINT msi_spawn_error_dialog( MSIPACKAGE 
     DWORD size = MAX_PATH;
     int res;
 
+    static const WCHAR szUILevel[] = {'U','I','L','e','v','e','l',0};
     static const WCHAR pn_prop[] = {'P','r','o','d','u','c','t','N','a','m','e',0};
     static const WCHAR title_fmt[] = {'%','s',' ','W','a','r','n','i','n','g',0};
     static const WCHAR error_abort[] = {'E','r','r','o','r','A','b','o','r','t',0};
@@ -3512,6 +3513,9 @@ UINT msi_spawn_error_dialog( MSIPACKAGE 
         'M','S','I','E','r','r','o','r','D','i','a','l','o','g','R','e','s','u','l','t',0
     };
 
+    if ( msi_get_property_int(package, szUILevel, 0) == INSTALLUILEVEL_NONE )
+        return ERROR_SUCCESS;
+
     if ( !error_dialog )
     {
         LPWSTR product_name = msi_dup_property( package, pn_prop );
diff --git a/dlls/msi/files.c b/dlls/msi/files.c
index 38b1f8f..953307c 100644
--- a/dlls/msi/files.c
+++ b/dlls/msi/files.c
@@ -69,21 +69,31 @@ struct media_info {
 
 static UINT msi_change_media( MSIPACKAGE *package, struct media_info *mi )
 {
+    LPSTR msg;
     LPWSTR error, error_dialog;
     UINT r = ERROR_SUCCESS;
 
     static const WCHAR szUILevel[] = {'U','I','L','e','v','e','l',0};
     static const WCHAR error_prop[] = {'E','r','r','o','r','D','i','a','l','o','g',0};
 
-    if ( msi_get_property_int(package, szUILevel, 0) == INSTALLUILEVEL_NONE )
+    if ( msi_get_property_int(package, szUILevel, 0) == INSTALLUILEVEL_NONE && !gUIHandlerA )
         return ERROR_SUCCESS;
 
     error = generate_error_string( package, 1302, 1, mi->disk_prompt );
     error_dialog = msi_dup_property( package, error_prop );
 
     while ( r == ERROR_SUCCESS && GetFileAttributesW( mi->source ) == INVALID_FILE_ATTRIBUTES )
+    {
         r = msi_spawn_error_dialog( package, error_dialog, error );
 
+        if (gUIHandlerA)
+        {
+            msg = strdupWtoA( error );
+            gUIHandlerA( gUIContext, MB_RETRYCANCEL | INSTALLMESSAGE_ERROR, msg );
+            msi_free(msg);
+        }
+    }
+
     msi_free( error );
     msi_free( error_dialog );
 
-- 
1.4.2.4



More information about the wine-patches mailing list