Old 22nd January 2007, 15:59   #1
mhoydis
Junior Member
 
Join Date: Feb 2006
Location: Nashua, NH
Posts: 5
Send a message via AIM to mhoydis
Allow for possibly non-existing recursive File instances

I am trying to make an NSIS script that will compile in 2 different file structures. I think the /nonfatal switch for File is what I want, however it does not seem to work recursively? Unless I'm making a stupid mistake?

Explanation...
I want to be able to use the File command, recursively, and nonfatally.
I want to be able to do something like...
File /r "../STUFF/*.*"
and have it just be ignored if the STUFF directory does not exists, OR if the STUFF directory is empty. If STUFF is present and does contain files I want them to be compressed and added to my archive.

File /r /nonfatal "../STUFF/*.*" does not seem to work!! It presents the "no files found" error at compilation.

What kind of logic can I write that would be able to test if a file/directory, relative to the compiler, is present? IfFileExists will not work for me because it is doing a compare of the end-user situation at runtime, and I require this kind of logic at the compiler. I'm familiar with {If} and all that logic, but how to I ask it about files relative to the compiler?

Any ideas?

Thanks
-Michael
mhoydis is offline   Reply With Quote
Old 22nd January 2007, 16:16   #2
Red Wine
Forum King
 
Red Wine's Avatar
 
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
Quote:
File /r /nonfatal "../STUFF/*.*" does not seem to work!! It presents the "no files found" error at compilation.
If /nonfatal switch was designed to operate with /r (recursively) then this code would produce an empty (without files to install) installer.
Why not just open windows explorer and see if ../STUFF/ exists?

Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV
Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS
Red Wine is offline   Reply With Quote
Old 22nd January 2007, 17:13   #3
mhoydis
Junior Member
 
Join Date: Feb 2006
Location: Nashua, NH
Posts: 5
Send a message via AIM to mhoydis
Quote:
Originally posted by Red Wine
If /nonfatal switch was designed to operate with /r (recursively) then this code would produce an empty (without files to install) installer.
Yes, I agree. This does not seem to be the case.

Quote:
Originally posted by Red Wine
Why not just open windows explorer and see if ../STUFF/ exists?
yeeeaaahhh see I know ../STUFF/ is empty. The act of determining if it exists or empty isn't for my own edification. I need the script to be flexible enough to determine this by itself.
(unless you mean there's a way to use "windows explorer" though scripting means to do this? If so, please elaborate.)
mhoydis is offline   Reply With Quote
Old 22nd January 2007, 17:51   #4
Red Wine
Forum King
 
Red Wine's Avatar
 
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
Quote:
yeeeaaahhh see I know ../STUFF/ is empty. The act of determining if it exists or empty isn't for my own edification. I need the script to be flexible enough to determine this by itself.
I see... apologies my mistake

Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV
Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS
Red Wine is offline   Reply With Quote
Old 22nd January 2007, 18:01   #5
mhoydis
Junior Member
 
Join Date: Feb 2006
Location: Nashua, NH
Posts: 5
Send a message via AIM to mhoydis
OK I've figured this out. Undocumented syntax alert....

File /r /nonfatal "../STUFF/*.*" does NOT work. "no files found" error during compile.

File /nonfatal /r "../STUFF/*.*" DOES work!! This allows for recursive inclusion of files or directories which may not exist.

Evidently the order of the switches is very important.

le sigh.
-Michael
mhoydis is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump