Commit b73dca23 authored by Mike McCormack's avatar Mike McCormack Committed by Alexandre Julliard

msi: Only ever write the long path for InProcServers.

parent 244405af
...@@ -797,7 +797,6 @@ UINT ACTION_RegisterClassInfo(MSIPACKAGE *package) ...@@ -797,7 +797,6 @@ UINT ACTION_RegisterClassInfo(MSIPACKAGE *package)
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 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 szAppID[] = { 'A','p','p','I','D',0 };
static const WCHAR szSpace[] = {' ',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}; static const WCHAR szFileType_fmt[] = {'F','i','l','e','T','y','p','e','\\','%','s','\\','%','i',0};
HKEY hkey,hkey2,hkey3; HKEY hkey,hkey2,hkey3;
MSICLASS *cls; MSICLASS *cls;
...@@ -811,7 +810,7 @@ UINT ACTION_RegisterClassInfo(MSIPACKAGE *package) ...@@ -811,7 +810,7 @@ UINT ACTION_RegisterClassInfo(MSIPACKAGE *package)
{ {
MSICOMPONENT *comp; MSICOMPONENT *comp;
MSIFILE *file; MSIFILE *file;
DWORD size, sz; DWORD size;
LPWSTR argument; LPWSTR argument;
MSIFEATURE *feature; MSIFEATURE *feature;
...@@ -846,64 +845,29 @@ UINT ACTION_RegisterClassInfo(MSIPACKAGE *package) ...@@ -846,64 +845,29 @@ UINT ACTION_RegisterClassInfo(MSIPACKAGE *package)
RegCreateKeyW( hkey2, cls->Context, &hkey3 ); RegCreateKeyW( hkey2, cls->Context, &hkey3 );
file = get_loaded_file( package, comp->KeyPath ); file = get_loaded_file( package, comp->KeyPath );
/*
/* the context server is a short path name * FIXME: Implement install on demand (advertised components).
* except for if it is InprocServer32... *
* 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) size = lstrlenW( file->TargetPath )+1;
{ if (cls->Argument)
sz = GetShortPathNameW( file->TargetPath, NULL, 0 ); size += lstrlenW(cls->Argument)+1;
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 );
if (cls->Argument) argument = msi_alloc( size * sizeof(WCHAR) );
{ lstrcpyW( argument, file->TargetPath );
strcatW(argument,szSpace);
strcatW( argument, cls->Argument );
}
}
if (argument) if (cls->Argument)
{ {
msi_reg_set_val_str( hkey3, NULL, argument ); lstrcatW( argument, szSpace );
msi_free(argument); lstrcatW( argument, cls->Argument );
} }
msi_reg_set_val_str( hkey3, NULL, argument );
msi_free(argument);
RegCloseKey(hkey3); RegCloseKey(hkey3);
if (cls->ProgID || cls->ProgIDText) if (cls->ProgID || cls->ProgIDText)
...@@ -925,7 +889,7 @@ UINT ACTION_RegisterClassInfo(MSIPACKAGE *package) ...@@ -925,7 +889,7 @@ UINT ACTION_RegisterClassInfo(MSIPACKAGE *package)
} }
if (cls->AppID) if (cls->AppID)
{ {
MSIAPPID *appid = cls->AppID; MSIAPPID *appid = cls->AppID;
msi_reg_set_val_str( hkey2, szAppID, appid->AppID ); msi_reg_set_val_str( hkey2, szAppID, appid->AppID );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment