File /nonfatal option added

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@1450 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
kichik 2002-10-20 17:27:37 +00:00
parent 9ca4265d78
commit 5ae1f8d494
2 changed files with 9 additions and 5 deletions

View file

@ -2407,7 +2407,11 @@ int CEXEBuild::doCommand(int which_token, LineParser &line, FILE *fp, const char
case TOK_FILE:
#ifdef NSIS_SUPPORT_FILE
{
int a=1,attrib=0,rec=0;
int a=1,attrib=0,rec=0,fatal=1;
if (!stricmp(line.gettoken_str(a),"/nonfatal")) {
fatal=0;
a++;
}
if (which_token == TOK_FILE && !stricmp(line.gettoken_str(a),"/a"))
{
attrib=1;
@ -2431,7 +2435,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line, FILE *fp, const char
if (!tf)
{
ERROR_MSG("%sFile: \"%s\" -> no files found.\n",(which_token == TOK_FILE)?"":"Reserve",line.gettoken_str(a));
PRINTHELP()
if (fatal) PRINTHELP()
}
return PS_OK;
@ -2455,7 +2459,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line, FILE *fp, const char
if (!tf)
{
ERROR_MSG("%sFile: \"%s\" -> no files found.\n",(which_token == TOK_FILE)?"":"Reserve",t);
PRINTHELP()
if (fatal) PRINTHELP()
}
}
}

View file

@ -61,8 +61,8 @@ static tokenType tokenlist[TOK__LAST] =
{TOK_FINDCLOSE,"FindClose",1,0,"$(user_var: handle input)"},
{TOK_FINDFIRST,"FindFirst",3,0,"$(user_var: handle output) $(user_var: filename output) filespec"},
{TOK_FINDNEXT,"FindNext",2,0,"$(user_var: handle input) $(user_var: filename output)"},
{TOK_FILE,"File",1,-1,"([/a] [/r] filespec [...]|/oname=outfile one_file_only)"},
{TOK_RESERVEFILE,"ReserveFile",1,-1,"[/r] file [file...]"},
{TOK_FILE,"File",1,-1,"[/nonfatal] ([/a] [/r] filespec [...]|/oname=outfile one_file_only)"},
{TOK_RESERVEFILE,"ReserveFile",1,-1,"[/nonfatal] [/r] file [file...]"},
{TOK_FILECLOSE,"FileClose",1,0,"$(user_var: handle input)"},
{TOK_FILEERRORTEXT,"FileErrorText",0,2,"[/LANG=lang_id] [text (can contain $0)]"},
{TOK_FILEOPEN,"FileOpen",3,0,"$(user_var: handle output) filename openmode\n openmode=r|w|a"},