msi: Only apply a transform when its language id matches the system language id.

Fix for office 2007 sp1 installer.
This commit is contained in:
Hans Leidekker 2009-03-24 10:26:42 +01:00 committed by Alexandre Julliard
parent b8965ee7c9
commit 86af876987
2 changed files with 62 additions and 7 deletions

View File

@ -401,9 +401,13 @@ static LPWSTR* msi_split_string( LPCWSTR str, WCHAR sep )
static UINT msi_check_transform_applicable( MSIPACKAGE *package, IStorage *patch )
{
WCHAR szProductCode[] = { 'P','r','o','d','u','c','t','C','o','d','e',0 };
LPWSTR prod_code, patch_product;
UINT ret;
static const WCHAR szProductCode[] =
{ 'P','r','o','d','u','c','t','C','o','d','e',0 };
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;
UINT ret = ERROR_FUNCTION_FAILED;
prod_code = msi_dup_property( package, szProductCode );
patch_product = msi_get_suminfo_product( patch );
@ -411,12 +415,57 @@ static UINT msi_check_transform_applicable( MSIPACKAGE *package, IStorage *patch
TRACE("db = %s patch = %s\n", debugstr_w(prod_code), debugstr_w(patch_product));
if ( strstrW( patch_product, prod_code ) )
ret = ERROR_SUCCESS;
else
ret = ERROR_FUNCTION_FAILED;
{
static const WCHAR zero[] = {'0',0};
MSISUMMARYINFO *si;
const WCHAR *p;
si = MSI_GetSummaryInformationW( patch, 0 );
if (!si)
{
ERR("no summary information!\n");
goto end;
}
template = msi_suminfo_dup_string( si, PID_TEMPLATE );
if (!template)
{
ERR("no template property!\n");
msiobj_release( &si->hdr );
goto end;
}
if (!template[0])
{
ret = ERROR_SUCCESS;
msiobj_release( &si->hdr );
goto end;
}
langid = msi_dup_property( package, szSystemLanguageID );
if (!langid)
{
msiobj_release( &si->hdr );
goto end;
}
p = strchrW( template, ';' );
if (p && (!strcmpW( p + 1, langid ) || !strcmpW( p + 1, zero )))
{
TRACE("applicable transform\n");
ret = ERROR_SUCCESS;
}
/* FIXME: check platform */
msiobj_release( &si->hdr );
}
end:
msi_free( patch_product );
msi_free( prod_code );
msi_free( template );
msi_free( langid );
return ret;
}

View File

@ -440,11 +440,12 @@ static VOID set_installer_properties(MSIPACKAGE *package)
static const WCHAR szDate[] = {'D','a','t','e',0};
static const WCHAR szTime[] = {'T','i','m','e',0};
static const WCHAR szUserLangID[] = {'U','s','e','r','L','a','n','g','u','a','g','e','I','D',0};
static const WCHAR szSystemLangID[] = {'S','y','s','t','e','m','L','a','n','g','u','a','g','e','I','D',0};
/*
* Other things that probably should be set:
*
* SystemLanguageID ComputerName UserLanguageID LogonUser VirtualMemory
* ComputerName LogonUser VirtualMemory
* ShellAdvSupport DefaultUIFont PackagecodeChanging
* ProductState CaptionHeight BorderTop BorderSide TextHeight
* RedirectedDllSupport
@ -640,6 +641,11 @@ static VOID set_installer_properties(MSIPACKAGE *package)
sprintfW(bufstr, szIntFormat, langid);
MSI_SetPropertyW( package, szUserLangID, bufstr );
langid = GetSystemDefaultLangID();
sprintfW(bufstr, szIntFormat, langid);
MSI_SetPropertyW( package, szSystemLangID, bufstr );
}
static UINT msi_load_summary_properties( MSIPACKAGE *package )