Added AllowSkipFiles - thanks Ramon!

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@2576 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
kichik 2003-05-26 17:55:15 +00:00
parent 190bc67448
commit c38b889fe8
11 changed files with 82 additions and 23 deletions

View file

@ -43,6 +43,7 @@ char *english_strings[] = {
"Space required: ",
"Uninstalling from:",
"Error opening file for writing: \r\n\t\"$0\"\r\nHit abort to abort installation,\r\nretry to retry writing the file, or\r\nignore to skip this file",
"Error opening file for writing: \r\n\t\"$0\"\r\nHit retry to retry writing the file, or\r\ncancel to abort installation",
"Can't write: ",
"Copy failed",
"Copy to ",
@ -183,6 +184,7 @@ int CEXEBuild::SetString(char *string, int id, int process, StringTable *table)
#ifdef NSIS_SUPPORT_FILE
HANDLE_STRING_C(NLF_FILE_ERROR, common.fileerrtext);
HANDLE_STRING_C(NLF_FILE_ERROR_NOIGNORE, common.fileerrtext_noignore);
#endif
default:
@ -540,9 +542,16 @@ void CEXEBuild::FillStringTable(StringTable *table, NLF *nlf/*=0*/) {
#endif
#ifdef NSIS_SUPPORT_FILE
if (m_inst_fileused && !table->common.fileerrtext)
if (m_inst_fileused)
{
table->common.fileerrtext=add_string_main(str(NLF_FILE_ERROR));
if (!table->common.fileerrtext)
{
table->common.fileerrtext=add_string_main(str(NLF_FILE_ERROR));
}
if (!table->common.fileerrtext_noignore)
{
table->common.fileerrtext_noignore=add_string_main(str(NLF_FILE_ERROR_NOIGNORE));
}
}
#endif
@ -579,9 +588,16 @@ void CEXEBuild::FillStringTable(StringTable *table, NLF *nlf/*=0*/) {
}
#ifdef NSIS_SUPPORT_FILE
if (m_uninst_fileused && !table->ucommon.fileerrtext)
if (m_uninst_fileused)
{
table->ucommon.fileerrtext=add_string_uninst(build_strlist.get() + table->common.fileerrtext);
if (!table->ucommon.fileerrtext)
{
table->ucommon.fileerrtext=add_string_uninst(build_strlist.get() + table->common.fileerrtext);
}
if (!table->ucommon.fileerrtext_noignore)
{
table->ucommon.fileerrtext_noignore=add_string_uninst(build_strlist.get() + table->common.fileerrtext_noignore);
}
}
#endif
@ -726,7 +742,7 @@ NLF::NLF(char *filename) {
if (strncmp(buf, "NLF v", 5)) throw runtime_error("Invalid language file!");
int nlf_version = atoi(buf+5);
if (nlf_version != NLF_VERSION) {
if (nlf_version != 2 && nlf_version != 3)
if (nlf_version != 2 && nlf_version != 3 && nlf_version != 4)
throw runtime_error("Language file version doesn't match NSIS version!");
}
@ -793,6 +809,14 @@ NLF::NLF(char *filename) {
}
}
if (nlf_version < 5) {
if (i == NLF_FILE_ERROR_NOIGNORE) {
m_szStrings[i] = new char[strlen(english_strings[i]) + 1];
strcpy(m_szStrings[i], english_strings[i]);
continue;
}
}
buf[0] = SkipComments(f);
fgets(buf+1, NSIS_MAX_STRLEN, f);