LangStrings now act as functions, they don't need to be defined before used. Uninstaller LangStrings must now be refernced with un.
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@1982 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
389f90b78d
commit
352c5a87ab
4 changed files with 43 additions and 44 deletions
|
@ -415,7 +415,7 @@ int CEXEBuild::preprocess_string(char *out, const char *in)
|
|||
strncpy(tbuf,p,63);
|
||||
tbuf[63]=0;
|
||||
if (strstr(tbuf," ")) strstr(tbuf," ")[0]=0;
|
||||
warning("unknown variable \"%s\" detected, ignoring\n",tbuf);
|
||||
warning("unknown variable \"%s\" detected, ignoring",tbuf);
|
||||
i = '$';
|
||||
}
|
||||
}
|
||||
|
@ -436,10 +436,16 @@ int CEXEBuild::add_string_main(const char *string, int process) // returns offse
|
|||
char *p = strchr(cp, ')');
|
||||
if (p) {
|
||||
*p = 0;
|
||||
if (!strnicmp(cp,"un.",3)) {
|
||||
warning("Installer language strings can't start with un. (%s)!", string);
|
||||
free(cp);
|
||||
return 0;
|
||||
}
|
||||
if (build_userlangstrings.find(cp, 0, &idx) < 0) idx = -1;
|
||||
}
|
||||
free(cp);
|
||||
if (idx >= 0) return -((int)(idx+1+(sizeof(common_strings)+sizeof(installer_strings))/sizeof(int)));
|
||||
if (idx < 0) SetUserString(cp, 0, 0, process);
|
||||
return -((int)(idx+1+(sizeof(common_strings)+sizeof(installer_strings))/sizeof(int)));
|
||||
}
|
||||
|
||||
if (!process) return build_strlist.add(string,2);
|
||||
|
@ -459,10 +465,16 @@ int CEXEBuild::add_string_uninst(const char *string, int process) // returns off
|
|||
char *p = strchr(cp, ')');
|
||||
if (p) {
|
||||
*p = 0;
|
||||
if (strnicmp(cp,"un.",3)) {
|
||||
warning("Uninstaller language strings must start with un. (%s)!", string);
|
||||
free(cp);
|
||||
return 0;
|
||||
}
|
||||
if (ubuild_userlangstrings.find(cp, 0, &idx) < 0) idx = -1;
|
||||
}
|
||||
free(cp);
|
||||
if (idx >= 0) return -((int)(idx+1+(sizeof(common_strings)+sizeof(uninstall_strings))/sizeof(int)));
|
||||
if (idx < 0) SetUserString(cp, 0, 0, process);
|
||||
return -((int)(idx+1+(sizeof(common_strings)+sizeof(uninstall_strings))/sizeof(int)));
|
||||
}
|
||||
|
||||
if (!process) return ubuild_strlist.add(string,2);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue