mgillespie
27th April 2005 10:21 UTC
Cannot get file /x to work in NSIS 2.06
Just upgraded our NSIS version to the latest, as we were on 2.02, and we need the file exclude /x functionality in 2.03 and later.
I have tried 2.06, and cannot get the exclude to work. What we want to do, is have a single file command with a wildcard to recursivly add everything, and overwrite ALL files, except a single file, where we want to leave it, if it's ready present.
The snippet of code that does not seem to be working is:
SetOverwrite try
SetOutPath "$INSTDIR"
File /nonfatal /r /x "DeployFolder\Dont_overwrite_me.pdf" "DeployFolder\*.*"
SetOverwrite off
File /nonfatal "DeployFolder\Dont_overwrite_me.pdf"
SetOverwrite try
Afrow UK
27th April 2005 13:58 UTC
Have you tried:
File /nonfatal /r /x "Dont_overwrite_me.pdf" "DeployFolder\*.*"
I think /x only works for file names not full paths.
-Stu
kichik
28th April 2005 18:03 UTC
/x works only with file names, not relative or absolute paths.
mgillespie
29th April 2005 23:03 UTC
You might want to consider updating the help file, as this was not obvious when I read it...or perhaps it was just me being thick.. :-)
richiebabes
4th July 2008 23:24 UTC
What if I have a folder with other subfolders and want to exclude certain files within those subfolders. E.g. let's say I have folder a which contains folders b, c and d. In b, c and d I want to exclude any .tmp files. Also in b, c and d there are files of the same name - bob.txt. But I only want to exclude bob.txt from the c folder. How would I code that? Would I be able to do it in one line or would I have to break it up?
LoRd_MuldeR
5th July 2008 02:51 UTC
Originally posted by richiebabes
Also in b, c and d there are files of the same name - bob.txt. But I only want to exclude bob.txt from the c folder. How would I code that? Would I be able to do it in one line or would I have to break it up?
I guess you would have to do it manually:
SetOutPath "$INSTDIR\a\b"
File "a\b\*.*"
SetOutPath "$INSTDIR\a\c"
File /x bob.txt "a\c\*.*"
SetOutPath "$INSTDIR\a\d"
File "a\d\*.*"
richiebabes
7th July 2008 16:53 UTC
Yeah, I figured as much. Oh well!