Skip to content
⌘ NSIS Forum Archive

skipping pages without MUI & WIKI example (almost have it)

4 posts

1123581321#

skipping pages without MUI & WIKI example (almost have it)

Hey all,
Yes yes, I'm an NSIS newcomer and I'm pleased to say I've extensively searched for an answer to my issue with no avail!!! >🙂 so I feel I can rightfully post on the forum.
I'm Scott, by the way, and I'm writing an installer for my research-group's open-src platform (see http://warp.rice.edu)

Anyways, here goes with the issue:

I essentially need a multiple installer -- and I've figured it out (complete with using strings to make the default directory). The issue is in skipping the directory pages. For example, my code structure looks like this:

------------------------------------------------------------

!include "Sections.nsh"
...
...
Page Components
...
...
VAR Install_path1
PageEx directory
PageCallbacks skip_inst1 "" ""
DirVar $inst1_default
DirText "blah blah blah"
PageExEnd

VAR Install_path2
PageEx directory
PageCallbacks skip_inst2 "" ""
DirVar $inst2_default
DirText "blah blah blah"
PageExEnd

...
...

Function .onInit
...
StrCpy $inst1_default "C:\inst1"
StrCpy $inst2_default "C:\inst2"
FunctionEnd

...
...

Section "Install 1" inst1
SectionEnd
Section "Install 2" inst2
SectionEnd

...
...

Function skip_inst1
!insertmacro SectionFlagIsSet inst1 1 checked notchecked
notchecked: Abort
checked:
FunctionEnd

Function skip_inst2
!insertmacro SectionFlagIsSet inst2 1 checked2 notchecked2
notchecked2: Abort
checked2:
FunctionEnd

------------------------------------------------------------

OK, so this KIND of works, but not completely correctly. Which normally I'd say there must be a completely logical answer as to why, but what occurs is completely illogical to me. The problem:

If I uncheck inst1, it totally skips both inst1 AND inst2 install pages. That goes for any combination of checked boxes with inst1 UNCHECKED.

If I uncheck inst2, it still shows up...

I'd really like to somehow implement the page skipping in this way, because it would otherwise mean a fair amount of recoding the entire file. I feel I'm very close and this should somehow work...

Any thoughts/help would be appreciated!!! Thanks
-Scott
Afrow UK#
!insertmacro SectionFlagIsSet inst1 1 checked notchecked
->
!insertmacro SectionFlagIsSet ${inst1} 1 checked notchecked


!insertmacro SectionFlagIsSet inst2 1 checked2 notchecked2
->
!insertmacro SectionFlagIsSet ${inst2} 1 checked2 notchecked2

You could have searched the forum for SectionFlagIsSet and you'd find the problem straight away. 😛

-Stu
1123581321#
wicked! will be checkin it out in a bit!

yeah I searched the forums, but for things like "multiple installations" "skipping pages" etc. etc. and I went through all pages! I can't believe I didn't think of searching for that function/looking for it.

Apologies -- and much thanks!