msi: Notify the external UI handler when changing media.

oldstable
James Hawkins 2006-11-13 14:18:54 -08:00 committed by Alexandre Julliard
parent 2f5824438e
commit 31a9b087c1
2 changed files with 15 additions and 1 deletions

View File

@ -3505,6 +3505,7 @@ UINT msi_spawn_error_dialog( MSIPACKAGE *package, LPWSTR error_dialog, LPWSTR er
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 *package, LPWSTR error_dialog, LPWSTR er
'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 );

View File

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