Skip to content
⌘ NSIS Forum Archive

Runtime customizable sections

6 posts

BigWillyStyle42#

Runtime customizable sections

I've created a NSIS webinstaller to install available skins for the Overnet filesharing program. Currently the available skins are hardcoded into the installer and then downloaded from my website. This means that I have to release a new installer each time a new skin is created.

What I was hoping to do was to have a list in text format on the webserver that would allow the installer to be configured at runtime with the available skins. Does anyone have any ideas on how I could do this?

P.S. The current webinstaller is available at www.bigwillystyle42.com?dest=skins&sub=skinpack only the v0.52 skin pack is a NSIS installer.
Comm@nder21#
u could read out any textfile with:

FileOpen $handle "file" r
FileRead $handle $variable_to_set $line_to_read
FileClose $handle

for ini-files use
ReadINIStr $var_to_set "label" "field" "setting"

more information in the docs 🙂
(scripting reference -> basic instructions -> file instructions / -> registry, inifiles)
BigWillyStyle42#
Reading the text file is the easy part. What I'm more concerned with is adding the sections at runtime instead of compile time as I haven't seen any documentation to that extent. I was hoping to continue using the MUI_COMPONENTS_PAGE if at all possible (really like the way it looks).
kichik#
It's possible. You can create lots of hidden sections and set their names using SectionSetText (in the show function of the page) to show them. In each section call a function which will download a certain file from the list.

An easier solution would be constructing an InstallOptions custom page in which you can simply fill a list.
BigWillyStyle42#
Thanks kichik I created a _bunch_ of hidden sections and it works great now.

One other question, is there a way to run a program in the background? The skins are packaged in .7z files and I'm running the commandline version of 7zip in order to extract them, however, it pops up a DOS box for each file and spews out some progress info (unfortunately there doesn't seem to be a quiet switch).
kichik#
Why not simply use the LZMA compression built into NSIS? You can try running the command line 7zip with nsExec which hides any DOS boxes and captures the input.