[PATCH 3/3] msi: Remove properties from deferred custom actions.

Zebediah Figura z.figura12 at gmail.com
Tue Sep 19 00:23:39 CDT 2017


This effectively reverts 3c444ea350e0688247bd2056b3861dac4af08fbc,
which should not be necessary, and in fact does not affect the
linked application, MSN Messenger.

Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
---
 dlls/msi/custom.c | 89 +++++--------------------------------------------------
 1 file changed, 8 insertions(+), 81 deletions(-)

diff --git a/dlls/msi/custom.c b/dlls/msi/custom.c
index b463ab659c..267e139eb3 100644
--- a/dlls/msi/custom.c
+++ b/dlls/msi/custom.c
@@ -142,49 +142,6 @@ static BOOL check_execution_scheduling_options(MSIPACKAGE *package, LPCWSTR acti
     return TRUE;
 }
 
-/* stores the following properties before the action:
- *
- *    [CustomActionData<=>UserSID<=>ProductCode]Action
- */
-static LPWSTR msi_get_deferred_action(LPCWSTR action, LPCWSTR actiondata,
-                                      LPCWSTR usersid, LPCWSTR prodcode)
-{
-    LPWSTR deferred;
-    DWORD len;
-
-    static const WCHAR format[] = {
-            '[','%','s','<','=','>','%','s','<','=','>','%','s',']','%','s',0
-    };
-
-    if (!actiondata)
-        return strdupW(action);
-
-    len = lstrlenW(action) + lstrlenW(actiondata) +
-          lstrlenW(usersid) + lstrlenW(prodcode) +
-          lstrlenW(format) - 7;
-    deferred = msi_alloc(len * sizeof(WCHAR));
-
-    sprintfW(deferred, format, actiondata, usersid, prodcode, action);
-    return deferred;
-}
-
-static void set_deferred_action_props( MSIPACKAGE *package, const WCHAR *deferred_data )
-{
-    static const WCHAR sep[] = {'<','=','>',0};
-    const WCHAR *end, *beg = deferred_data + 1;
-
-    end = strstrW(beg, sep);
-    msi_set_property( package->db, szCustomActionData, beg, end - beg );
-    beg = end + 3;
-
-    end = strstrW(beg, sep);
-    msi_set_property( package->db, szUserSID, beg, end - beg );
-    beg = end + 3;
-
-    end = strchrW(beg, ']');
-    msi_set_property( package->db, szProductCode, beg, end - beg );
-}
-
 WCHAR *msi_create_temp_file( MSIDATABASE *db )
 {
     WCHAR *ret;
@@ -1125,38 +1082,22 @@ static UINT HANDLE_CustomType53_54( MSIPACKAGE *package, const WCHAR *source, co
 
 static UINT defer_custom_action( MSIPACKAGE *package, const WCHAR *action, UINT type )
 {
-    WCHAR *actiondata = msi_dup_property( package->db, action );
-    WCHAR *usersid = msi_dup_property( package->db, szUserSID );
-    WCHAR *prodcode = msi_dup_property( package->db, szProductCode );
-    WCHAR *deferred = msi_get_deferred_action( action, actiondata, usersid, prodcode );
-
-    if (!deferred)
-    {
-        msi_free( actiondata );
-        msi_free( usersid );
-        msi_free( prodcode );
-        return ERROR_OUTOFMEMORY;
-    }
     if (type & msidbCustomActionTypeCommit)
     {
-        TRACE("deferring commit action\n");
-        msi_schedule_action( package, SCRIPT_COMMIT, deferred );
+        TRACE("scheduling commit action %s\n", debugstr_w(action));
+        msi_schedule_action( package, SCRIPT_COMMIT, action );
     }
     else if (type & msidbCustomActionTypeRollback)
     {
-        TRACE("deferring rollback action\n");
-        msi_schedule_action( package, SCRIPT_ROLLBACK, deferred );
+        TRACE("scheduling rollback action %s\n", debugstr_w(action));
+        msi_schedule_action( package, SCRIPT_ROLLBACK, action );
     }
     else
     {
-        TRACE("deferring install action\n");
-        msi_schedule_action( package, SCRIPT_INSTALL, deferred );
+        TRACE("scheduling deferred action %s\n", debugstr_w(action));
+        msi_schedule_action( package, SCRIPT_INSTALL, action );
     }
 
-    msi_free( actiondata );
-    msi_free( usersid );
-    msi_free( prodcode );
-    msi_free( deferred );
     return ERROR_SUCCESS;
 }
 
@@ -1169,17 +1110,10 @@ UINT ACTION_CustomAction( MSIPACKAGE *package, LPCWSTR action )
     UINT rc = ERROR_SUCCESS;
     MSIRECORD *row;
     UINT type;
-    const WCHAR *source, *target, *ptr, *deferred_data = NULL;
+    const WCHAR *source, *target;
     WCHAR *deformated = NULL;
     int len;
 
-    /* deferred action: [properties]Action */
-    if ((ptr = strrchrW(action, ']')))
-    {
-        deferred_data = action;
-        action = ptr + 1;
-    }
-
     row = MSI_QueryGetRecord( package->db, query, action );
     if (!row)
         return ERROR_FUNCTION_NOT_CALLED;
@@ -1208,14 +1142,7 @@ UINT ACTION_CustomAction( MSIPACKAGE *package, LPCWSTR action )
         else
         {
             LPWSTR actiondata = msi_dup_property( package->db, action );
-
-            if (deferred_data)
-                set_deferred_action_props(package, deferred_data);
-            else if (actiondata)
-                msi_set_property( package->db, szCustomActionData, actiondata, -1 );
-            else
-                msi_set_property( package->db, szCustomActionData, szEmpty, -1 );
-
+            msi_set_property(package->db, szCustomActionData, actiondata, -1);
             msi_free(actiondata);
         }
     }
-- 
2.14.1




More information about the wine-patches mailing list