Archive: copying files from compiled EXE


copying files from compiled EXE
Searched the forum and can't find a solution/suggestion for my very basic NEWB issue.

Can't get NSIS to copy 3 files that are added into the
EXE file at time of compile.


File "Mapifix.exe"
File "ETSTempfix.exe"
File "ETS Temp fix.bat"
CopyFiles "$EXEDIR\ETSTempFix.exe" "$INSTDIR\ETSTempfix.exe"
CopyFiles "$EXEDIR\Mapifix.exe" "$INSTDIR\Mapifix.exe"
CopyFiles "$EXEDIR\ETS Temp Fix.bat" "$INSTDIR\ETS Temp fix.bat"


Do I have to define the EXEDIR? Isn't that predefined variable which means the files are part of the compiled EXE?

Any assistance would be appreciated.. I'm not understanding the User Manual when it comes to copying files from the EXE

Your installer extracts files to the destination machine. You've done this with "File." CopyFiles is for copying files from one spot on the destination machine to another, which I don't think you want to do in this case.


SetOutPath $INSTDIR
File "Mapifix.exe"
File "ETSTempfix.exe"
File "ETS Temp fix.bat"

Try running that (assuming those 3 files are in the same directory on your computer as your script--if not, enter their full paths). You'll see those files in are now on the destination machine in $INSTDIR. So you had the right code...you were just trying to do an extra step that's not necessary.

OK... now I'm not getting the copied failed errors..thank you
but no files were copied into the Directory
The directory is there.. but empty.

The 3 files are in the same directory as the script..but how do I know they were added to the EXE when it was compiled?

I searched the user manual.. but can't find the command to ensure they are added to the EXE.. so I think my EXE doesn't have the 3 files compressed into it.

Do I need to put something in the "Function .onInit" command?


If you want to test your script, then why don't you try setting the OutPath to a different folder than your script? Otherwise, how are you going to know that anything actually happened?

Also:
The compiler does a pretty good job of complaining if there are any errors adding files to your EXE. If there were any problems, compiling will stop.

And if you look closely at the compiler's log, you'll see where each file was added. It will look something like this:


File: "example1.nsi" [compress] 388/831 bytes


If you need more help, I suggest you look at some of the examples included with NSIS. (The compiler example above came from the EXAMPLE1.NSI script located in the NSIS install folder.)