msi: Add initial implementation of the DirectoryListUp event.

This commit is contained in:
James Hawkins 2006-08-25 14:22:16 -07:00 committed by Alexandre Julliard
parent a97962eef4
commit a1b16d2d96
3 changed files with 38 additions and 0 deletions

View File

@ -1995,9 +1995,35 @@ static UINT msi_dialog_directory_combo( msi_dialog *dialog, MSIRECORD *rec )
/******************** Directory List ***************************************/
UINT msi_dialog_directorylist_up( msi_dialog *dialog )
{
msi_control *control;
LPWSTR prop, path, ptr;
BOOL indirect;
control = msi_dialog_find_control( dialog, szDirectoryList );
indirect = control->attributes & msidbControlAttributesIndirect;
prop = msi_dialog_dup_property( dialog, control->property, indirect );
path = msi_dup_property( dialog->package, prop );
/* strip off the last directory */
ptr = PathFindFileNameW( path );
if (ptr != path) *(ptr - 1) = '\0';
PathAddBackslashW( path );
MSI_SetPropertyW( dialog->package, prop, path );
msi_free( path );
msi_free( prop );
return ERROR_SUCCESS;
}
static UINT msi_dialog_directory_list( msi_dialog *dialog, MSIRECORD *rec )
{
msi_control *control;
LPCWSTR prop;
DWORD style;
style = LVS_LIST | LVS_EDITLABELS | WS_VSCROLL | LVS_SHAREIMAGELISTS |
@ -2007,6 +2033,10 @@ static UINT msi_dialog_directory_list( msi_dialog *dialog, MSIRECORD *rec )
if (!control)
return ERROR_FUNCTION_FAILED;
control->attributes = MSI_RecordGetInteger( rec, 8 );
prop = MSI_RecordGetString( rec, 9 );
control->property = msi_dialog_dup_property( dialog, prop, FALSE );
return ERROR_SUCCESS;
}

View File

@ -379,6 +379,12 @@ static UINT ControlEvent_SetInstallLevel(MSIPACKAGE* package, LPCWSTR argument,
return MSI_SetInstallLevel( package, iInstallLevel );
}
static UINT ControlEvent_DirectoryListUp(MSIPACKAGE *package, LPCWSTR argument,
msi_dialog *dialog)
{
return msi_dialog_directorylist_up( dialog );
}
static const struct _events Events[] = {
{ "EndDialog",ControlEvent_EndDialog },
{ "NewDialog",ControlEvent_NewDialog },
@ -391,6 +397,7 @@ static const struct _events Events[] = {
{ "SetTargetPath",ControlEvent_SetTargetPath },
{ "Reset",ControlEvent_Reset },
{ "SetInstallLevel",ControlEvent_SetInstallLevel },
{ "DirectoryListUp",ControlEvent_DirectoryListUp },
{ NULL,NULL },
};

View File

@ -454,6 +454,7 @@ extern BOOL msi_dialog_register_class( void );
extern void msi_dialog_unregister_class( void );
extern void msi_dialog_handle_event( msi_dialog*, LPCWSTR, LPCWSTR, MSIRECORD * );
extern UINT msi_dialog_reset( msi_dialog *dialog );
extern UINT msi_dialog_directorylist_up( msi_dialog *dialog );
/* preview */
extern MSIPREVIEW *MSI_EnableUIPreview( MSIDATABASE * );