Archive: How to skip an open file when compiling?


How to skip an open file when compiling?
My script was failing compilation due to an already opened file by another process (sharing violation I guess):

File: failed opening file "C:\EIVA\NaviPac\Data\J047NPOUT611-3-923.npd"

!include: error in script: "NaviPacSections.nsh" on line 31

Error in script "C:\EIVA\NaviPac\bin\Scripts\navipac.nsi" on line 166 -- aborting creation process


In that case I would like the script to skip the file and continue compilation, not aborting. Is that possible?


Try:

File /nonfatal "filename.ext"

main purpose for the nonfatal switch is to not abort if a file don't exists


I've already tried that with no luck.

Section "Data" NAVIPAC_DATA
SetOverwrite on
File /nonfatal /r ${SCRIPT_ARG_SOURCEDIR}\Data
DetailPrint ">>> $INSTDIR\Data extracted..."
SectionEnd

Thanks anyway.


Please open a bug report about this.


Ok, done that under ID

1143585 Failing when compiling an already opened file


Just to let you know, I have closed down the bug report and marked it as Won't Fix. As said in the report:

During a discussion of a similar feature for !include, I've come to a conclusion that this is the correct behavior. The desired effect of /nonfatal, as also documented, is to ignore missing files. If the file is there and can't be opened, an error is very much justified.

You're more than welcome to submit a feature request for another flag that will ignore even these error.