BigWillyStyle42
27th January 2004 05:18 UTC
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
27th January 2004 13:19 UTC
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
27th January 2004 16:17 UTC
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
27th January 2004 16:26 UTC
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
29th January 2004 00:57 UTC
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
29th January 2004 01:03 UTC
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.