Archive: File Copying - Easy Questions


File Copying - Easy Questions
I have my compiler working great but want to shrink it's size and make it compatible more with Win98SE and for some reason my current config will not work. I want to copy ALL files within a folder to the persons computer, within that folder is 4 more folders (WinXP,Me,2000,98SE) and within each windows folder there is about 6 files.

Here is what I have and it only makes the folder, does not copy any files. I swithced to this from having about 25 lines of copy code for each of the seperate file links.
;-----------------------
SetOutPath "$INSTDIR\USB Drivers"
CopyFiles "${NSISDIR}\Make1" "$INSTDIR\USB Drivers\Make1"
;-----------------------
What it should install is the folder USB Drivers\Make 1\then the 4 operating sytem sub-folders and then all files within each sub folder.

I've even tried the /r and to test, \r, function but that does not work.

;-----------------------
SetOutPath "$INSTDIR\USB Drivers"
CopyFiles /r "${NSISDIR}\Make1" "$INSTDIR\USB Drivers\Make1"
;-----------------------

Thanks, any help is appreciated.


CopyFiles will not work if the directory does not already exist (something that should DEFINITELY be indicated in the manual).

SetOutPath is only for when using the "File" command.


So you need is something like this:

CreateDirectory "$INSTDIR\USB Drivers"
CopyFiles "${NSISDIR}\Make1" "$INSTDIR\USB Drivers"


{NSISDIR} contains the path where NSIS is installed (on your local system). Use $EXEDIR if you want copy files on the target (user's) system. NSIS Help 4.2.3


You are getting confused with compile-time constants and run-time constants / variables.

${NSISDIR} is a constant on compile-time which contains the path to your NSIS directory (e.g. C:\Progra~1\NSIS).
On run time, you should use $EXEDIR (like Takhir says), which will contain the path to the installer on run-time.

-Stu