fixed bug #1626504 - VIAddVersionKey causes problems with localized installers
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@4869 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
e62f8b50aa
commit
db0d67633b
4 changed files with 63 additions and 36 deletions
|
@ -328,13 +328,12 @@ void CEXEBuild::InitLangTables() {
|
|||
keep_ref = true;
|
||||
}
|
||||
|
||||
LanguageTable* CEXEBuild::GetLangTable(LANGID &lang) {
|
||||
LanguageTable* CEXEBuild::GetLangTable(LANGID &lang, bool create/*=true*/) {
|
||||
int nlt = lang_tables.getlen() / sizeof(LanguageTable);
|
||||
LanguageTable *nla = (LanguageTable*)lang_tables.get();
|
||||
|
||||
lang = lang ? lang : last_used_lang;
|
||||
last_used_lang = lang;
|
||||
LanguageTable *table = 0;
|
||||
LanguageTable *table = NULL;
|
||||
|
||||
for (int i = 0; i < nlt; i++) {
|
||||
if (lang == nla[i].lang_id) {
|
||||
|
@ -342,7 +341,7 @@ LanguageTable* CEXEBuild::GetLangTable(LANGID &lang) {
|
|||
break;
|
||||
}
|
||||
}
|
||||
if (!table) {
|
||||
if (!table && create) {
|
||||
LanguageTable newtable;
|
||||
|
||||
newtable.lang_id = lang;
|
||||
|
@ -355,9 +354,32 @@ LanguageTable* CEXEBuild::GetLangTable(LANGID &lang) {
|
|||
table = (LanguageTable*)lang_tables.get() + nlt;
|
||||
}
|
||||
|
||||
if (table) // update last used language if a table was loaded
|
||||
last_used_lang = lang;
|
||||
|
||||
return table;
|
||||
}
|
||||
|
||||
char *CEXEBuild::GetLangNameAndCP(LANGID lang, unsigned int *codepage/*=NULL*/) {
|
||||
LanguageTable *table = GetLangTable(lang, false);
|
||||
|
||||
if (table && table->nlf.m_bLoaded) {
|
||||
if (codepage)
|
||||
*codepage = table->nlf.m_uCodePage;
|
||||
|
||||
return table->nlf.m_szName;
|
||||
}
|
||||
else {
|
||||
if (codepage)
|
||||
*codepage = 1252; // English US
|
||||
|
||||
if (lang == 1033)
|
||||
return "English";
|
||||
else
|
||||
return "???";
|
||||
}
|
||||
}
|
||||
|
||||
int CEXEBuild::DefineLangString(char *name, int process/*=-1*/) {
|
||||
int index, uindex, pos, ret, sn;
|
||||
pos = build_langstrings.get(name, &sn, &index, &uindex);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue