[4/5] msi: Implement the Reinstall control event.
Hans Leidekker
hans at codeweavers.com
Fri Mar 26 06:12:06 CDT 2010
See http://bugs.winehq.org/show_bug.cgi?id=21989
---
dlls/msi/events.c | 19 +++++++++++++++++++
1 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/dlls/msi/events.c b/dlls/msi/events.c
index e8f2297..1f63c72 100644
--- a/dlls/msi/events.c
+++ b/dlls/msi/events.c
@@ -383,6 +383,24 @@ static UINT ControlEvent_ReinstallMode(MSIPACKAGE *package, LPCWSTR 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,
msi_dialog *dialog)
{
@@ -417,6 +435,7 @@ static const struct _events Events[] = {
{ "DirectoryListUp",ControlEvent_DirectoryListUp },
{ "SelectionBrowse",ControlEvent_SpawnDialog },
{ "ReinstallMode",ControlEvent_ReinstallMode },
+ { "Reinstall",ControlEvent_Reinstall },
{ "ValidateProductID",ControlEvent_ValidateProductID },
{ NULL,NULL },
};
--
1.7.0
More information about the wine-patches
mailing list