Hans Leidekker : msi: Check the transform language against the package language instead of the system language .

Alexandre Julliard julliard at winehq.org
Thu Jul 7 13:33:45 CDT 2011


Module: wine
Branch: master
Commit: 6083fd5e530c34e17b125f00d7777177984d8b1a
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=6083fd5e530c34e17b125f00d7777177984d8b1a

Author: Hans Leidekker <hans at codeweavers.com>
Date:   Thu Jul  7 09:22:48 2011 +0200

msi: Check the transform language against the package language instead of the system language.

---

 dlls/msi/patch.c |   26 +++++++++++++++-----------
 1 files changed, 15 insertions(+), 11 deletions(-)

diff --git a/dlls/msi/patch.c b/dlls/msi/patch.c
index a31802e..b7ee8e7 100644
--- a/dlls/msi/patch.c
+++ b/dlls/msi/patch.c
@@ -32,11 +32,21 @@
 
 WINE_DEFAULT_DEBUG_CHANNEL(msi);
 
+static BOOL match_language( MSIPACKAGE *package, LANGID langid )
+{
+    UINT i;
+
+    if (!package->num_langids || !langid) return TRUE;
+    for (i = 0; i < package->num_langids; i++)
+    {
+        if (package->langids[i] == langid) return TRUE;
+    }
+    return FALSE;
+}
+
 static UINT check_transform_applicable( MSIPACKAGE *package, IStorage *patch )
 {
-    static const WCHAR szSystemLanguageID[] = {
-        'S','y','s','t','e','m','L','a','n','g','u','a','g','e','I','D',0};
-    LPWSTR prod_code, patch_product, langid = NULL, template = NULL;
+    LPWSTR prod_code, patch_product, template = NULL;
     UINT ret = ERROR_FUNCTION_FAILED;
 
     prod_code = msi_dup_property( package->db, szProductCode );
@@ -68,14 +78,9 @@ static UINT check_transform_applicable( MSIPACKAGE *package, IStorage *patch )
             msiobj_release( &si->hdr );
             goto end;
         }
-        langid = msi_dup_property( package->db, szSystemLanguageID );
-        if (!langid)
-        {
-            msiobj_release( &si->hdr );
-            goto end;
-        }
+        TRACE("template: %s\n", debugstr_w(template));
         p = strchrW( template, ';' );
-        if (p && (!strcmpW( p + 1, langid ) || !strcmpW( p + 1, szZero )))
+        if (p && match_language( package, atoiW( p + 1 ) ))
         {
             TRACE("applicable transform\n");
             ret = ERROR_SUCCESS;
@@ -88,7 +93,6 @@ end:
     msi_free( patch_product );
     msi_free( prod_code );
     msi_free( template );
-    msi_free( langid );
     return ret;
 }
 




More information about the wine-cvs mailing list