|
|
#1 |
|
Junior Member
|
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
|
|
|
|
|
|
#2 |
|
M.I.A.
[NSIS Dev, Mod] 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 |
|
|
|
|
|
#3 |
|
Junior Member
|
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? |
|
|
|
|
|
#4 |
|
M.I.A.
[NSIS Dev, Mod] 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 |
|
|
|
|
|
#5 |
|
Junior Member
|
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. |
|
|
|
|
|
#6 |
|
M.I.A.
[NSIS Dev, Mod] 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:
NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
|
|
|
|
|
#7 |
|
Junior Member
|
10-4 !!
Awesome on the quick responses and thorough answers! np |
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|