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:
parent
b8965ee7c9
commit
86af876987
|
@ -401,9 +401,13 @@ static LPWSTR* msi_split_string( LPCWSTR str, WCHAR sep )
|
||||||
|
|
||||||
static UINT msi_check_transform_applicable( MSIPACKAGE *package, IStorage *patch )
|
static UINT msi_check_transform_applicable( MSIPACKAGE *package, IStorage *patch )
|
||||||
{
|
{
|
||||||
WCHAR szProductCode[] = { 'P','r','o','d','u','c','t','C','o','d','e',0 };
|
static const WCHAR szProductCode[] =
|
||||||
LPWSTR prod_code, patch_product;
|
{ 'P','r','o','d','u','c','t','C','o','d','e',0 };
|
||||||
UINT ret;
|
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 );
|
prod_code = msi_dup_property( package, szProductCode );
|
||||||
patch_product = msi_get_suminfo_product( patch );
|
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));
|
TRACE("db = %s patch = %s\n", debugstr_w(prod_code), debugstr_w(patch_product));
|
||||||
|
|
||||||
if ( strstrW( patch_product, prod_code ) )
|
if ( strstrW( patch_product, prod_code ) )
|
||||||
ret = ERROR_SUCCESS;
|
{
|
||||||
else
|
static const WCHAR zero[] = {'0',0};
|
||||||
ret = ERROR_FUNCTION_FAILED;
|
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( patch_product );
|
||||||
msi_free( prod_code );
|
msi_free( prod_code );
|
||||||
|
msi_free( template );
|
||||||
|
msi_free( langid );
|
||||||
|
|
||||||
return ret;
|
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 szDate[] = {'D','a','t','e',0};
|
||||||
static const WCHAR szTime[] = {'T','i','m','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 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:
|
* Other things that probably should be set:
|
||||||
*
|
*
|
||||||
* SystemLanguageID ComputerName UserLanguageID LogonUser VirtualMemory
|
* ComputerName LogonUser VirtualMemory
|
||||||
* ShellAdvSupport DefaultUIFont PackagecodeChanging
|
* ShellAdvSupport DefaultUIFont PackagecodeChanging
|
||||||
* ProductState CaptionHeight BorderTop BorderSide TextHeight
|
* ProductState CaptionHeight BorderTop BorderSide TextHeight
|
||||||
* RedirectedDllSupport
|
* RedirectedDllSupport
|
||||||
|
@ -640,6 +641,11 @@ static VOID set_installer_properties(MSIPACKAGE *package)
|
||||||
sprintfW(bufstr, szIntFormat, langid);
|
sprintfW(bufstr, szIntFormat, langid);
|
||||||
|
|
||||||
MSI_SetPropertyW( package, szUserLangID, bufstr );
|
MSI_SetPropertyW( package, szUserLangID, bufstr );
|
||||||
|
|
||||||
|
langid = GetSystemDefaultLangID();
|
||||||
|
sprintfW(bufstr, szIntFormat, langid);
|
||||||
|
|
||||||
|
MSI_SetPropertyW( package, szSystemLangID, bufstr );
|
||||||
}
|
}
|
||||||
|
|
||||||
static UINT msi_load_summary_properties( MSIPACKAGE *package )
|
static UINT msi_load_summary_properties( MSIPACKAGE *package )
|
||||||
|
|
Loading…
Reference in New Issue