Skip to content
⌘ NSIS Forum Archive

possibility to recursive include (files) from directories

8 posts

Mosestycoon#

possibility to recursive include (files) from directories

Dear community,

I am looking for the possibility to integrate directories, and all included files.
Right now I use
...(blah)
SetOutPath "$INSTDIR\\Path\\to\\prog"
FILE "C:\\Path\\to\\file_1"
FILE "C:\\Path\\to\\file_2"
FILE "C:\\Path\\to\\file_n"
...(blah) 
Is there another method to integrate files? A package with ~20.000 files makes this uncomfortable.

Be patient please, cos I'm new with NSIS and haven't found all the tricks :-)

MosesTycoon
Mosestycoon#
KICHIK -

Another quick question. How is the behavior of this Parameter "FILE /r"?

If there are several recursive directories, like "dir\sub-dir1\sub-dir2", what do I have to be aware?

Seems that the installer doubles (even tribles) the recommended size of space.

Does this parameter creates the sub-dirs as well?

(EXAMPLE:
  Section "MySQL4.0.10" secMySQL4
  SetOutPath "$INSTDIR\\MySQL4"
  FILE /r "C:\\Path\\to\\MySQL4\\*.*"
 ;MySQL Binaries
  SetOutPath "$INSTDIR\\MySQL4\\bin"
  FILE /r "C:\\Path\\to\\MySQL4\\bin\\*.*"
 ;MySQL Data
  SetOutPath "$INSTDIR\\MySQL4\\data\\mysql"
  FILE /r "C:\\Path\\to\\MySQL4\\data\\mysql\\*.*"
 ;MySQL Share
  SetOutPath "$INSTDIR\\MySQL4\\share\\charsets"
  FILE /r "C:\\Path\\to\\MySQL4\\share\\charsets\\*.*"
  SetOutPath "$INSTDIR\\MySQL4\\share\\english"
  FILE /r "C:\\Path\\to\\MySQL4\\share\\english\\*.*"
  SetOutPath "$INSTDIR\\MySQL4\\share\\german"
  FILE /r "C:\\Path\\to\\MySQL4\\share\\german\\*.*" 
kichik#
If you add the /r flag (recursive) you don't need to add every sub-directory separately. /r means it will add every sub-directory too.

SetOutPath "$INSTDIR\MySQL4"
File /r "C:\Path\to\MySQL4\*.*" 
Is enough in your case.