Archive: Simple Help


Simple Help
Ok, this is stupid, but I am at a loss as to how to do this. All I need to do is have a series of sections that a user can pick and show/hide different pages based on their choices. I have the sections working just fine, but I can't seem to find a good way to show or hide the pages. I figured that setting a variable in the section and then checking it at the begining of the custom page and calling abort or not would be a good solution. But I can't seem to get the dang thing to work. Rather then attach my rather lengthy installer, could someone just post a simple example?

I have read the docs extensivly and I am just missing it. I have also searched this board and archives and I am not seeing what I need. I have tried using the var command and it just errors. I think that is related to the version of NSIS I have, but I don't want to change it now. I've tried pushing a variable onto the stack and then popping it off and doing StrCmp (of which I can't find ANY significant mention here: http://nsis.sourceforge.net/Docs/ ??) but it is not working the way I would expect. Basically I do this:

Section "Test" TestSection
push "Test_True"
SectionEnd

Function PageToDisplayIfTestSectionIsInstalled
pop $0
StrCmp "$0" "Test_True" 0 runPage
Abort
runPage:
; do stuff here
FunctionEnd

And abort is called only if I DO install TestSection?! Anyways, any help would be greatly appreciated!

Mike


Have you tried using a COMPONENTS page in your installer? This makes it easy for the user to choose which "sections" get installed.

Several examples of scripts using COMPONENTS pages are supplied with NSIS.

Without knowing which version of NSIS you are using and whether or not you are using MUI, it is difficult to give more specific advice.


If the custom page is displayed before the installation, the sections have not been executed yet. There have been a lot of topics about this issue, please use the search. You have to check which sections have been selected.


Thanks for the quick reply. That's the trick, how does a custom page check "which sections have been selected". I have everything else working to that point (and after).


Ah ha! Thanks to your verbiage Joost, I was about to use a different search that came up with this page:
http://nsis.sourceforge.net/archive/...php?pageid=320
Which is precisly what I need. Thanks for the help!

Mike