Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 14th February 2003, 16:31   #1
NoahPhense
Junior Member
 
Join Date: Feb 2003
Location: Orlando, FL
Posts: 4
Send a message via ICQ to NoahPhense Send a message via AIM to NoahPhense Send a message via Yahoo to NoahPhense
Nothing Too Complicated

I'm using NSIS v.2.0 b1 and am wanting to add multiple files for disty. Say a readme.html, and possibly even a .chm file.

How does one script that out?

np
NoahPhense is offline   Reply With Quote
Old 14th February 2003, 16:48   #2
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,336
There are a few examples in your Examples directory (unless you chose not to install them). example1.nsi copies makensisw.exe to the user selected directory. Modern UI\Basic.nsi copies modern.exe to the user selected directory and makes the installer modern. Just replace the file names with your file names and if in need add more File commands to add more files.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 14th February 2003, 18:42   #3
NoahPhense
Junior Member
 
Join Date: Feb 2003
Location: Orlando, FL
Posts: 4
Send a message via ICQ to NoahPhense Send a message via AIM to NoahPhense Send a message via Yahoo to NoahPhense
Thanks. So I could just add on here:

SetOutPath "$INSTDIR"
File "${NSISDIR}\Contrib\UIs\modern.exe"
File "${NSISDIR}\Contrib\UIs\more.html
File "${NSISDIR}\Contrib\UIs\files.txt"
File "${NSISDIR}\Contrib\UIs\to_distribute.txt"

Would this be correct?
NoahPhense is offline   Reply With Quote
Old 14th February 2003, 18:46   #4
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,336
Almost. You don't have to put your files there. ${NSISDIR} maps to the path of your NSIS isntallation. You can use File C:\development\myfiles\more.html and even File test.html if the test.html is in the same directory as the script.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 14th February 2003, 22:27   #5
NoahPhense
Junior Member
 
Join Date: Feb 2003
Location: Orlando, FL
Posts: 4
Send a message via ICQ to NoahPhense Send a message via AIM to NoahPhense Send a message via Yahoo to NoahPhense
Ah yes. I need to the files to be in the same directory as my script to use it this way: (correct?)

File "modern.exe"
File "blah.ext"
File "whatever.txt"

And if I have/create a deployment directory, I just need to: (right?)

File "c:\my wonderful applications\laughing\grin.exe"
File "c:\my wonderful applications\laughing\sorry.im"
File "c:\my wonderful applications\laughing\pretty.tired"

..next question:

Where does this variable get defined -- so that I may make use of it:
SetOutPath "$INSTDIR"

Or am I misunderstanding its value.
NoahPhense is offline   Reply With Quote
Old 14th February 2003, 22:40   #6
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,336
Indeed. The path can also be relative. If for example you script is in C:\nsis and the files are in C:\NSIS\files then you can use:
File files\blah.txt. You can also use !cd to change the directory in which the compiler will look for files.

$INSTDIR is defined as follows:
If InstallDirRegKey is defined, and the value was found in the registry $INSTDIR will be initiated as this value. If it wasn't found, or wasn't defined InstallDir's value will be used. Later, after the directory selection page (if present) $INSTDIR will be set to whatever the user chose. You can change $INSTDIR anytime in between using StrCpy or any other command that accepts an output variable.

SetOutPath sets the path in which the installer will extract files. That means that if you use (and also creates it):
PHP Code:
SetOutPath $INSTDIR
File blah
.txt 
then blah.txt will be extracted to $INSTDIR.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 15th February 2003, 01:09   #7
NoahPhense
Junior Member
 
Join Date: Feb 2003
Location: Orlando, FL
Posts: 4
Send a message via ICQ to NoahPhense Send a message via AIM to NoahPhense Send a message via Yahoo to NoahPhense
10-4 !!

Awesome on the quick responses and thorough answers!

np
NoahPhense is offline   Reply With Quote
Reply
Go Back   Winamp Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump