static UINT msi_change_media(MSIPACKAGE *package, MSIMEDIAINFO *mi)
{
- LPSTR msg;
LPWSTR error, error_dialog;
LPWSTR source_dir;
UINT r = ERROR_SUCCESS;
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_MASK) ==
- INSTALLUILEVEL_NONE && !gUIHandlerA)
+ INSTALLUILEVEL_NONE && !gUIHandlerA && !gUIHandlerW && !gUIHandlerRecord)
return ERROR_SUCCESS;
error = generate_error_string(package, 1302, 1, mi->disk_prompt);
error_dialog = msi_dup_property(package, error_prop);
source_dir = msi_dup_property(package, cszSourceDir);
- while (r == ERROR_SUCCESS &&
- !source_matches_volume(mi, source_dir))
+ while (r == ERROR_SUCCESS && !source_matches_volume(mi, source_dir))
{
r = msi_spawn_error_dialog(package, error_dialog, error);
- if (gUIHandlerA)
+ if (gUIHandlerW)
{
- msg = strdupWtoA(error);
+ gUIHandlerW(gUIContext, MB_RETRYCANCEL | INSTALLMESSAGE_ERROR, error);
+ }
+ else if (gUIHandlerA)
+ {
+ char *msg = strdupWtoA(error);
gUIHandlerA(gUIContext, MB_RETRYCANCEL | INSTALLMESSAGE_ERROR, msg);
msi_free(msg);
}
+ else if (gUIHandlerRecord)
+ {
+ MSIHANDLE rec = MsiCreateRecord(1);
+ MsiRecordSetStringW(rec, 0, error);
+ gUIHandlerRecord(gUIContext, MB_RETRYCANCEL | INSTALLMESSAGE_ERROR, rec);
+ MsiCloseHandle(rec);
+ }
}
msi_free(error);