Commit 86af8769 authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

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

Fix for office 2007 sp1 installer.
parent b8965ee7
......@@ -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;
}
......
......@@ -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 )
......
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