jus
17th February 2005 08:55 UTC
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?
flizebogen
17th February 2005 12:29 UTC
Try:
File /nonfatal "filename.ext"
main purpose for the nonfatal switch is to not abort if a file don't exists
jus
17th February 2005 13:02 UTC
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.
kichik
17th February 2005 17:59 UTC
Please open a bug report about this.
jus
18th February 2005 07:28 UTC
Ok, done that under ID
1143585 Failing when compiling an already opened file
kichik
2nd December 2005 22:00 UTC
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.