msi: Read the language info from the file.
This commit is contained in:
parent
1f3d6a9744
commit
4cc569cce6
|
@ -1622,11 +1622,15 @@ UINT WINAPI MsiGetFileVersionW(LPCWSTR szFilePath, LPWSTR lpVersionBuf,
|
||||||
static const WCHAR szVersionResource[] = {'\\',0};
|
static const WCHAR szVersionResource[] = {'\\',0};
|
||||||
static const WCHAR szVersionFormat[] = {
|
static const WCHAR szVersionFormat[] = {
|
||||||
'%','d','.','%','d','.','%','d','.','%','d',0};
|
'%','d','.','%','d','.','%','d','.','%','d',0};
|
||||||
|
static const WCHAR szLangResource[] = {
|
||||||
|
'\\','V','a','r','F','i','l','e','I','n','f','o','\\',
|
||||||
|
'T','r','a','n','s','l','a','t','i','o','n',0};
|
||||||
static const WCHAR szLangFormat[] = {'%','d',0};
|
static const WCHAR szLangFormat[] = {'%','d',0};
|
||||||
UINT ret = 0;
|
UINT ret = 0;
|
||||||
DWORD dwVerLen, gle;
|
DWORD dwVerLen, gle;
|
||||||
LPVOID lpVer = NULL;
|
LPVOID lpVer = NULL;
|
||||||
VS_FIXEDFILEINFO *ffi;
|
VS_FIXEDFILEINFO *ffi;
|
||||||
|
USHORT *lang;
|
||||||
UINT puLen;
|
UINT puLen;
|
||||||
WCHAR tmp[32];
|
WCHAR tmp[32];
|
||||||
|
|
||||||
|
@ -1687,16 +1691,22 @@ UINT WINAPI MsiGetFileVersionW(LPCWSTR szFilePath, LPWSTR lpVersionBuf,
|
||||||
|
|
||||||
if (pcchLangBuf)
|
if (pcchLangBuf)
|
||||||
{
|
{
|
||||||
DWORD lang = GetUserDefaultLangID();
|
if (VerQueryValueW(lpVer, szLangResource, (LPVOID*)&lang, &puLen) &&
|
||||||
|
(puLen > 0))
|
||||||
|
{
|
||||||
|
wsprintfW(tmp, szLangFormat, *lang);
|
||||||
|
if (lpLangBuf) lstrcpynW(lpLangBuf, tmp, *pcchLangBuf);
|
||||||
|
|
||||||
FIXME("Retrieve language from file\n");
|
if (lstrlenW(tmp) >= *pcchLangBuf)
|
||||||
wsprintfW(tmp, szLangFormat, lang);
|
ret = ERROR_MORE_DATA;
|
||||||
if (lpLangBuf) lstrcpynW(lpLangBuf, tmp, *pcchLangBuf);
|
|
||||||
|
|
||||||
if (lstrlenW(tmp) >= *pcchLangBuf)
|
*pcchLangBuf = lstrlenW(tmp);
|
||||||
ret = ERROR_MORE_DATA;
|
}
|
||||||
|
else
|
||||||
*pcchLangBuf = lstrlenW(tmp);
|
{
|
||||||
|
if (lpLangBuf) *lpLangBuf = 0;
|
||||||
|
*pcchLangBuf = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
end:
|
end:
|
||||||
|
|
Loading…
Reference in New Issue