Old 21st July 2010, 13:36   #1
Junior Member
Join Date: Nov 2009
Location: Szeged
Posts: 4
Unhappy Select and execute files from a directory


I want to do an installer, but i don't know a good solution for some problem. I want to make an installer which get the executable files from a directory next to the installer, what is named "Plugins", and i want it to show that plugins in the components page, the names on the components page would be the executable file names.

My problems: i don't know how to read the file list of a directory, but if it is not possible, i can generate a ini file what the installer will read for the files, so this is not a big deal.

Main problem: on the components page i only can show the section names, and i would enerate sections only when i compile the script, not in runtime.
If there is no solution for this, can i make a custom page what is very similar to component page?

Thanks every help, and sorry for my bad English.
Avvoltoio is offline   Reply With Quote
Old 21st July 2010, 13:49   #2
Afrow UK
Afrow UK's Avatar
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
You can enumerate the plugins using FindFirst, FindNext and FindClose. You cannot dynamically add sections in NSIS so you will need to create a custom page with your executable list using nsDialogs.

Afrow UK is offline   Reply With Quote
Old 21st July 2010, 14:03   #3
Major Dude
Join Date: Oct 2006
Posts: 1,892
As far as I know sections are defined at compile time, so I don't think there's a way to populate the Components Page's sections list depending on what 'plugins' exist next to the installer. That is assuming of course that you want to do this at runtime. One workaround you can use is create 50 hidden (and disabled) sections, and during runtime enumerate all plugin filenames and rename and un-hide one section for every plugin.

You could also create a fake components page using nsDialogs, and add one fake section for every plugin, but I doubt if that's going to be easier.

If you want to populate the list at compile time you can use a vbs script or something to enumerate all plugin filenames and use them to write to an nsh file which you can then !include. There's a post somewhere in these forums that explains how to execute a vbs script during installer compilation.
MSG is offline   Reply With Quote
Old 22nd July 2010, 09:57   #4
Junior Member
Join Date: Nov 2009
Location: Szeged
Posts: 4
Smile Thanks

Thanks for the replies
Now i can continue make the installer whith this help
Avvoltoio is offline   Reply With Quote
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

component page, filelist, nsis, runtime, section

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