|
|
#1 |
|
Junior Member
Join Date: Jan 2008
Posts: 3
|
Section with options, howto?
Dear All,
While this is not my first nsis script, I think I have not grabbed the full NSIS spirit yet..., and I am ckoking on this seemingly very simple problem: My install script needs an user-selectable section, with an user-selectable option. By default, this option is checked or not depending on the value of a registry key. Obviously, if the section is not selected, the option should be grayed out. The action of this section (if selected) is something like: "execwait myprog.exe -myoption" or "execwait myprog" depending if the option is checked or not. I tried using sections inside sections (does not work), then SectionGroups. But I have not been able to to get a consistent checking logic. Any help would be *really* welcome! Michel |
|
|
|
|
|
#2 |
|
Forum King
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
|
Something like this I guess,
code: Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Jan 2008
Posts: 3
|
Thanks a lot, Red Wine for your fast++ answer! At least I have now a working solution.
But could it be possible to have "MyOption" indented, like when using SectionGroup? This makes sense, as MyOption is a MyProg option, not an install option. Again thanks, Michel |
|
|
|
|
|
#4 |
|
Forum King
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
|
code: Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS |
|
|
|
|
|
#5 |
|
Junior Member
Join Date: Jan 2008
Posts: 3
|
Red Wine, You rock!
As this could be of great use for the next newbie, I have created a new wiki page here: http://nsis.sourceforge.net/Simple_s...on_with_option Again thanks, Michel |
|
|
|
|
|
#6 |
|
Forum King
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
|
Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS |
|
|
|
|
|
#7 | |
|
Junior Member
Join Date: Mar 2008
Posts: 5
|
Quote:
If there is a lot similar "slaved" sections, then code will be like this: code: A question: how to iterate across all sections from "opt1" to "optN" to avoid "Copy/Paste" in code? Thanks. /* Sorry for my poor English. */ |
|
|
|
|
|
|
#8 |
|
Junior Member
Join Date: Mar 2008
Posts: 5
|
Solution:
As sinse section indexes is sequential, it possible simple iterate them from first section ("Common") till <Section Group End> flag is occured: code: Thanks a lot. |
|
|
|
|
|
#9 |
|
Junior Member
Join Date: Mar 2008
Posts: 5
|
Just in case, full source code:
code: |
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|