msi: Implement the Reinstall control event.

This commit is contained in:
Hans Leidekker 2010-03-26 12:12:06 +01:00 committed by Alexandre Julliard
parent e5869d5d5c
commit 2c5e1f686b
1 changed files with 19 additions and 0 deletions

View File

@ -383,6 +383,24 @@ static UINT ControlEvent_ReinstallMode(MSIPACKAGE *package, LPCWSTR argument,
return MSI_SetPropertyW( package, szReinstallMode, argument ); return MSI_SetPropertyW( package, szReinstallMode, argument );
} }
static UINT ControlEvent_Reinstall( MSIPACKAGE *package, LPCWSTR argument,
msi_dialog *dialog )
{
static const WCHAR szReinstallEq[] = {'R','E','I','N','S','T','A','L','L','=',0};
UINT r = ERROR_OUTOFMEMORY;
WCHAR *cmd;
cmd = msi_alloc( (strlenW( szReinstallEq ) + strlenW( argument ) + 1) * sizeof(WCHAR) );
if (cmd)
{
strcpyW( cmd, szReinstallEq );
strcatW( cmd, argument );
r = MsiConfigureProductExW( package->ProductCode, INSTALLLEVEL_DEFAULT, INSTALLSTATE_DEFAULT, cmd );
msi_free( cmd );
}
return r;
}
static UINT ControlEvent_ValidateProductID(MSIPACKAGE *package, LPCWSTR argument, static UINT ControlEvent_ValidateProductID(MSIPACKAGE *package, LPCWSTR argument,
msi_dialog *dialog) msi_dialog *dialog)
{ {
@ -417,6 +435,7 @@ static const struct _events Events[] = {
{ "DirectoryListUp",ControlEvent_DirectoryListUp }, { "DirectoryListUp",ControlEvent_DirectoryListUp },
{ "SelectionBrowse",ControlEvent_SpawnDialog }, { "SelectionBrowse",ControlEvent_SpawnDialog },
{ "ReinstallMode",ControlEvent_ReinstallMode }, { "ReinstallMode",ControlEvent_ReinstallMode },
{ "Reinstall",ControlEvent_Reinstall },
{ "ValidateProductID",ControlEvent_ValidateProductID }, { "ValidateProductID",ControlEvent_ValidateProductID },
{ NULL,NULL }, { NULL,NULL },
}; };