- NSIS Discussion
- Exclude files/directories in File command
Archive: Exclude files/directories in File command
e-novative
24th June 2004 20:13 UTC
Exclude files/directories in File command
I know this has been discussed before, I just would like to know if there are any plans to add file exclusion to the file command (maybe) by adding another switch?
It would be cool for CVS (or, in my case, subversion) users. Also, Windows tends to create system files like thumbs.db in some directories. I find it annoying to package and deploy these files.
Kind regards,
Steve
kichik
24th June 2004 20:16 UTC
Plans? Of course. Time? No. Patches by users? Of course not...
rsegal
24th June 2004 22:16 UTC
I made a program to do this as I ran into the exact same problem you're describing "e-novative". The lengthy discussion of creating such a program can be found here.
http://forums.winamp.com/showthread....hreadid=150770
I believe there is a link somewhere in that discussion to the program. I really should have kichik or another admin make it available in the archives. I'm just lazy I suppose.
I've also been working on a custom tool which has this ability soon to be made available on SourceForge. I will post more details as that project progresses.
e-novative
25th June 2004 11:12 UTC
Some problems with exclusion
Rob,
thanks for your help. I am trying to use your solution, but I seem to do something wrong. I replaced
File /r "..\environment\*.*"
by
!insertmacro FOLDER_LIST_RECURSIVE "..\environment\*.*" ".svn"
to get rid of the .svn subdirectories (created by Subversion, a CVS-kind-of-thing). The removal does work as expected, also the recursion, but all files in those directories having subdirectories are missing.
Any idea what is wrong?
Steve
rsegal
25th June 2004 15:48 UTC
I'm quite familiar with Subversion, we use it at my workplace. Used CVS before that. That was really the main force behind creating this program.
I believe you need to have the full path name for the folder
you want to include. So instead of having this...
!insertmacroFOLDER_LIST_RECURSIVE"..\\environment\\*.*"".svn"
have something like this,
!insertmacroFOLDER_LIST_RECURSIVE"c:\\environment\\*.*"".svn\\"
I assume you have a different path to the environment folder but you get the idea. Folders that you want to ignore should also have a "\" character suffixed to them. Although you said it worked for you without a slash so maybe I'm wrong.
Anyways that should work for you. Let me know the results.
e-novative
29th June 2004 10:17 UTC
Rob,
thanks again for the help. I still do not quite get the desired results. Basically, the .svn subdirectories are excluded as desired, but I have non-excluded files missing on the target system.
This is what I am using:
!insertmacro FOLDER_LIST_RECURSIVE "C:\Dokumente und Einstellungen\Steve\Desktop\wamp\environment\*.*" ".svn\"
Now, the environment directory contains various subdirectories, which contain files and/or subdirectories.
I copy the environment dir to my installation dir using SetOutPath "$INSTDIR". Here's what happens: Subdirectories of environment that only contain files are okay; but for subdirectories of environment that contain files and subdirectories, the subdirectories (with the files in them) show up correctly, but the files in environment/subdirectory are missing
Needless to say that these files do not match the .svn exclusion rule. I suspect there might be a bug in the folderlist.exe that somehow skips the _files_ at the first subdirectory level but does process the _directories_ in there? Can someone confirm this or am I just plain stupid and doing something terribly wrong?
By the way, the behaviour seems the same when I use relative paths. Is there a way to get the current direcory at NSIS compile time, something like ${__DIR__}? If there is not, it might be a good idea to add this to make absolute path construction at compile time easier.
Kind regards,
Stefan
rsegal
29th June 2004 16:57 UTC
Stefan I'm hoping you just download an older version of FolderList, so here's the latest verison I have. I tried it and it works great for me. Hopefully it'll work for you as well.
e-novative
29th June 2004 22:11 UTC
Excluding .svn directories
Rob, you're the man. If you ever come to Munich, drop me a note, and I'll buy you a beer. Seriously.
I did not use the latest version of FolderList.exe since the one you posted did not work for me right away: msvcp71.dll and msvcr71.dll were missing on my system (the older versions of FolderList obviously did not require them). I guess they come with .net or some MS IDE's/compilers, but you can find and download them somewhere if you kindly ask Google.
I put them im the same directory as FolderList.exe, and since then things work perfectly.
Thanks again for all the help, Rob!
Steve
e-novative
29th June 2004 23:10 UTC
Just another short note: relative paths also work for me. This simplifies your life quite a bit ...
rsegal
29th June 2004 23:11 UTC
msvcp71.dll and msvcr71.dll were missing on my system (the older versions of FolderList obviously did not require them). I guess they come with .net or some MS IDE's/compilers, but you can find and download them somewhere if you kindly ask Google.
Yes the original version was created under Visual Studio 6, my latest version was created under Visual Studio .NET, I wasn't aware those DLL's weren't included with all Windows distributions. That's good to know, thanks.
Rob, you're the man. If you ever come to Munich, drop me a note, and I'll buy you a beer. Seriously.
Yeh sounds good to me. Isn't it against the law to turn down free beer? If you found FolderList useful you may find the new tool I created useful as well. You can find details on it here...
https://sourceforge.net/projects/installgenI'm constantly working on upgrading it but it is presently in a useable state. I will post updates to the tool on the NSIS forum as I make them here...
http://forums.winamp.com/showthread....hreadid=185006
rsegal
30th June 2004 15:19 UTC
Originally posted by e-novative
Just another short note: relative paths also work for me. This simplifies your life quite a bit ...
Indeed it does, thanks for the feedback.