diff --git a/Source/script.cpp b/Source/script.cpp index 7f280037..31388bb8 100644 --- a/Source/script.cpp +++ b/Source/script.cpp @@ -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() } } } diff --git a/Source/tokens.cpp b/Source/tokens.cpp index 7083877b..6abad57e 100644 --- a/Source/tokens.cpp +++ b/Source/tokens.cpp @@ -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"},