msi: Only ever write the long path for InProcServers.
This commit is contained in:
parent
244405af47
commit
b73dca2302
|
@ -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)
|
||||||
{
|
{
|
||||||
MSICOMPONENT *comp;
|
MSICOMPONENT *comp;
|
||||||
MSIFILE *file;
|
MSIFILE *file;
|
||||||
DWORD size, sz;
|
DWORD size;
|
||||||
LPWSTR argument;
|
LPWSTR argument;
|
||||||
MSIFEATURE *feature;
|
MSIFEATURE *feature;
|
||||||
|
|
||||||
|
@ -846,63 +845,28 @@ 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)
|
|
||||||
{
|
argument = msi_alloc( size * sizeof(WCHAR) );
|
||||||
ERR("Unable to find short path for CLSID COM Server\n");
|
lstrcpyW( argument, file->TargetPath );
|
||||||
argument = NULL;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
size = sz * sizeof(WCHAR);
|
|
||||||
|
|
||||||
if (cls->Argument)
|
if (cls->Argument)
|
||||||
{
|
{
|
||||||
size += strlenW(cls->Argument) * sizeof(WCHAR);
|
lstrcatW( argument, szSpace );
|
||||||
size += sizeof(WCHAR);
|
lstrcatW( argument, cls->Argument );
|
||||||
}
|
}
|
||||||
|
|
||||||
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)
|
|
||||||
{
|
|
||||||
strcatW(argument,szSpace);
|
|
||||||
strcatW( argument, cls->Argument );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (argument)
|
|
||||||
{
|
|
||||||
msi_reg_set_val_str( hkey3, NULL, argument );
|
msi_reg_set_val_str( hkey3, NULL, argument );
|
||||||
msi_free(argument);
|
msi_free(argument);
|
||||||
}
|
|
||||||
|
|
||||||
RegCloseKey(hkey3);
|
RegCloseKey(hkey3);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue