Skip to content
⌘ NSIS Forum Archive

Copying a bunch of files

6 posts

mluggy2#

Copying a bunch of files

Hi there,

How can I copy a bunch of files, stored on 1 directory under my current .nsi file?

i.e -
myfile.nsi
res\res1.bmp
res\res2.dat
res\res3.txt

I'm looking for a function that will do, for every file on that list:
1) check if file exists
2) copy file if not exists

Is this possible?

Thanks!
Comm@nder21#
# set overwrite mode, used by the file-command
SetOverwrite off # also available: on, ifnewer, ifdiff, lastused

Section "section1" s1
# set out-path to chosen directory
SetOutPath $INSTDIR
# copy files, using overwrite-setting
File /r ".\res\*.*"
SectionEnd
mluggy2#
Thanks!! However- how can I call this Section in a list loop, and/or by passing a parameter (filename)?

Thanks!
Joost Verburg#
The File commands can be used to specify a file on your system that should be included and extracted during installation.

It accepts wildcards so there is no need to create a list yourself.