Mike McCormack : msi: Only ever write the long path for InProcServers.

Alexandre Julliard julliard at wine.codeweavers.com
Wed Aug 2 06:48:55 CDT 2006


Module: wine
Branch: refs/heads/master
Commit: b73dca23023a6d405d1f986aca121b2aa9b42f1e
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=b73dca23023a6d405d1f986aca121b2aa9b42f1e

Author: Mike McCormack <mike at codeweavers.com>
Date:   Wed Aug  2 13:41:13 2006 +0200

msi: Only ever write the long path for InProcServers.

---

 dlls/msi/classes.c |   74 +++++++++++++---------------------------------------
 1 files changed, 19 insertions(+), 55 deletions(-)

diff --git a/dlls/msi/classes.c b/dlls/msi/classes.c
index e4cfcbb..9d9d7b2 100644
--- a/dlls/msi/classes.c
+++ b/dlls/msi/classes.c
@@ -797,7 +797,6 @@ UINT ACTION_RegisterClassInfo(MSIPACKAGE
     static const WCHAR szVIProgID[] = { 'V','e','r','s','i','o','n','I','n','d','e','p','e','n','d','e','n','t','P','r','o','g','I','D',0 };
     static const WCHAR szAppID[] = { 'A','p','p','I','D',0 };
     static const WCHAR szSpace[] = {' ',0};
-    static const WCHAR szInprocServer32[] = {'I','n','p','r','o','c','S','e','r','v','e','r','3','2',0};
     static const WCHAR szFileType_fmt[] = {'F','i','l','e','T','y','p','e','\\','%','s','\\','%','i',0};
     HKEY hkey,hkey2,hkey3;
     MSICLASS *cls;
@@ -811,7 +810,7 @@ UINT ACTION_RegisterClassInfo(MSIPACKAGE
     {
         MSICOMPONENT *comp;
         MSIFILE *file;
-        DWORD size, sz;
+        DWORD size;
         LPWSTR argument;
         MSIFEATURE *feature;
 
@@ -846,64 +845,29 @@ UINT ACTION_RegisterClassInfo(MSIPACKAGE
         RegCreateKeyW( hkey2, cls->Context, &hkey3 );
         file = get_loaded_file( package, comp->KeyPath );
 
-
-        /* the context server is a short path name 
-         * except for if it is InprocServer32... 
+        /*
+         * FIXME: Implement install on demand (advertised components).
+         *
+         * ole32.dll should call msi.MsiProvideComponentFromDescriptor()
+         *  when it needs an InProcServer that doesn't exist.
+         * The component advertise string should be in the "InProcServer" value.
          */
-        if (strcmpiW( cls->Context, szInprocServer32 )!=0)
-        {
-            sz = GetShortPathNameW( file->TargetPath, NULL, 0 );
-            if (sz == 0)
-            {
-                ERR("Unable to find short path for CLSID COM Server\n");
-                argument = NULL;
-            }
-            else
-            {
-                size = sz * sizeof(WCHAR);
-
-                if (cls->Argument)
-                {
-                    size += strlenW(cls->Argument) * sizeof(WCHAR);
-                    size += sizeof(WCHAR);
-                }
-
-                argument = msi_alloc( size + sizeof(WCHAR));
-                GetShortPathNameW( file->TargetPath, argument, sz );
-
-                if (cls->Argument)
-                {
-                    strcatW(argument,szSpace);
-                    strcatW( argument, cls->Argument );
-                }
-            }
-        }
-        else
-        {
-            size = lstrlenW( file->TargetPath ) * sizeof(WCHAR);
-
-            if (cls->Argument)
-            {
-                size += strlenW(cls->Argument) * sizeof(WCHAR);
-                size += sizeof(WCHAR);
-            }
-
-            argument = msi_alloc( size + sizeof(WCHAR));
-            strcpyW( argument, file->TargetPath );
+        size = lstrlenW( file->TargetPath )+1;
+        if (cls->Argument)
+            size += lstrlenW(cls->Argument)+1;
 
-            if (cls->Argument)
-            {
-                strcatW(argument,szSpace);
-                strcatW( argument, cls->Argument );
-            }
-        }
+        argument = msi_alloc( size * sizeof(WCHAR) );
+        lstrcpyW( argument, file->TargetPath );
 
-        if (argument)
+        if (cls->Argument)
         {
-            msi_reg_set_val_str( hkey3, NULL, argument );
-            msi_free(argument);
+            lstrcatW( argument, szSpace );
+            lstrcatW( argument, cls->Argument );
         }
 
+        msi_reg_set_val_str( hkey3, NULL, argument );
+        msi_free(argument);
+
         RegCloseKey(hkey3);
 
         if (cls->ProgID || cls->ProgIDText)
@@ -925,7 +889,7 @@ UINT ACTION_RegisterClassInfo(MSIPACKAGE
         }
 
         if (cls->AppID)
-        { 
+        {
             MSIAPPID *appid = cls->AppID;
 
             msi_reg_set_val_str( hkey2, szAppID, appid->AppID );




More information about the wine-cvs mailing list