Archive: Beginner Question


Beginner Question
NSIS Beginner here.

I'm struggling with some basics. Given the documentation, its not clear to me the basic mechanics of how this works.

1. I need to build an installer that installs and configures existing open-source software. End result is:

; On destination machine
INSTDIR/
-java1.4
-tomcat5.0 + my_config_files.
-additional jar files.



to prepare this I have a source_environment directory.
; on my machine
my_source_dir/
-myscript.nsi
-java1.4_xx.exe
-tomcat_5.0.exe
-my jar files.
-my custom config files.


2. As I understand that my nsi script needs to:
a. package my_source_dir
b. extract to INSTDIR
c. execute java, tomcat installs
(I think...)
Exec '"$INSTDIR/jakarta-tomcat-5.0.30.exe"'
d. copy over special config files.


Question: How do I do a. and b.


Section "Type Your Section Name Here"

...

SetOutPath $INSTDIR
SetCompress Auto
SetOverwrite IfNewer
File /x *.nsi *.*

...

SectionEnd


The important command is the File command. It takes all files in the folder of your myscript.nsi except the myscript.nsi itself and packages them in the installer. All those files were installed in the $INSTDIR directory. SetCompress and SetOverwrite could be altered to fit your needs.

how do I specify the directory of my input or source files?


Originally posted by tmonteit
how do I specify the directory of my input or source files?
What is the difficulty in that point? Hopefully some examples will show you how to do.

Lets say we have a script "C:\MyLittleNSISProjekt\sample.nsi" and we have a folder with all source files which should be included in the installer "C:\MyLittleNSISProject\source\"

You could use absolute path ...

File "C:\MyLittleNSISProjekt\source\*.*"


... or you could use relative path. The start directory of the relative path is the directory of your nsi-Script (sample.nsi):

File "source\*.*"


If you mean all files in the same directory as your .nsi, you could simple use (relative path) ...

File *.*


... but it makes no sence to package the nsi-Script in your installer, so u rather mean all files except your .nsi-Script:

File /x *.nsi *.*