|
|
#1 |
|
Junior Member
Join Date: Sep 2006
Posts: 5
|
Select files to install from a list
Hello all,
I want to have an installer with files loaded in so that I would have a list (with checkboxes) and I can check what I want to install and what not... so far I created a listbox with the Embeddedlists plugin and it works fine .. my problem is .. how do I load the files to be inside the installer and dynamicly tell the installer what to copy(install) and what not according to my list I hope my problem is clear thanx Eli |
|
|
|
|
|
#2 |
|
Major Dude
Join Date: Jun 2001
Posts: 1,173
|
To include files in your installer, you can use either "ReserveFile <file>" at the top of your script, or "File <filespec>" in a section or Function - even if you never end up using that section or Function. E.g. a hidden unselected section, or just never call that function.
As for when to install files or not, check the examples for EmbeddedLists. I found the following bit in ListView_CheckBoxes.nsi: code: All this does is create a string with each checked item's name delimited by a "|" character. You can easily retool this to install files, or not: code: Note that this would start installing files as soon as you leave the ListView page. If you want this done later, then you should retool the original code to put the "|"-delimited in a variable that you'll access from a later page. You can then use the StrCpy and StrCmp commands to go over that list and do much the same as in the adjusted example above. |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Sep 2006
Posts: 5
|
Do I HAVE to specify every file I want to work with ?
can't I pass File a parameter ? Its just that the files are dynamicly changing (thers a script that creates th ini file automaticly) |
|
|
|
|
|
#4 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
Using the File instruction puts the file into your installer executable. If you just want to copy the file from one place to another, use CopyFiles.
-Stu |
|
|
|
|
|
#5 |
|
Junior Member
Join Date: Sep 2006
Posts: 5
|
can CopyFile copy from inside the installer ??
How do I direct it ? |
|
|
|
|
|
#6 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
As I've already explained, File puts the file into your installer and extracts it to $OUTDIR.
Use the SetOutPath instruction to set the current output folder. -Stu |
|
|
|
|
|
#7 |
|
Junior Member
Join Date: Sep 2006
Posts: 5
|
ok .. but this is the thing
I need to extract only files that have been selected in the list. and the file list is dynamic, so I need to put parameter in File, but I can't is there something else that I can do ? |
|
|
|
|
|
#8 |
|
Junior Member
Join Date: Sep 2006
Posts: 5
|
What I eventualy did is
to extract akk the files to a directory in $TEMP copy what I need and then delete that directory .. if there is a smarter way .. pls share
|
|
|
|
|
|
#9 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
You can jump over the File instructions if they aren't in your list. It might be easiest to store your file names in an array using the NSISArray plugin.
-Stu |
|
|
|
|
|
#10 |
|
Junior Member
Join Date: Sep 2006
Posts: 4
|
how do I load the files to be inside the installer according to my list, so that I don't have to change my script every time when the files to be installed changed.
|
|
|
|
|
|
#11 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
I'm confused now. Surely your list needs to be read at run time? You can't modify which files are in the installer at run time, because the files are placed in the installer at compile time!
All you can do, is include all the files inside the installer, and extract only those required. -Stu |
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|