Archive: Problem with File command


Problem with File command
Hello.

I have the following directories in the source path:

bin
mysql\bin
Copy of mysql\bin

When I use

File /r "bin"

it will install all of the three directories.

I tried

File /r ".\bin"

but without success... Any idea (using 2.06)?


Regards,
JOERN


What should be installed in the destination directory?


With File /r bin you're telling NSIS to include all files and folders named bin under the working directory. Use:

SetOutPath $INSTDIR\bin
File /r bin\*

Originally posted by kichik
With File /r bin you're telling NSIS to include all files and folders named bin under the working directory. Use:
SetOutPath $INSTDIR\bin
File /r bin\*
Yes, that would do...
But it's very complicated...
I used

CreateDirectory "$INSTDIR\bin"
SetOutPath "$INSTDIR\bin"
File "bin\w32"
SetOutPath "$INSTDIR"

but there should be a better solution I think. Just think of an huge install directory, where many (sub-)directories of that kind exist. For that developer has to use the four lines for each directory if he's not definetly sure, there isn't another directory of that name somewhere below.

I would be nice if there's a way like

File /r ".\bin"
or
File /r "^bin" (Perl-Pattern)

I think it's a necessary enhancement...

Thanks for your answers though.

JOERN

You don't need to use CreateDirectory (SetOutPath automatically does that if it's needed) and you don't need to go back to $INSTDIR after each directory.


Originally posted by Pidgeot
You don't need to use CreateDirectory (SetOutPath automatically does that if it's needed) and you don't need to go back to $INSTDIR after each directory.
Sure, but for me this is not the way it should be (or there has to be a notice in the documentation about it) :(.

Thanks anyway.

There are two notices in the documentation about it. One in the release notes of version 2.03 and one in the documentation for File.