Skip to content
⌘ NSIS Forum Archive

Show a second Install Directory page conditionally

4 posts

DropF#

Show a second Install Directory page conditionally

Hi,

I need some help: I would like to display a second Install Directory page only if a section is selected.

I'm able to display an InstallOptions dialog only if a section has been selected. I'm also able to show a second Install Directory page whenever. But I don't know how to mix the both 😁.

Some detailed code would be nice, because I'm a beginner.

Thank you 👍
n0On3#
I use this to skip the components page when desired:

Page Directory
Page Components NoComp
Page InstFiles
Function NoComp
  ClearErrors
  ReadRegStr $R6 HKLM "Software\NAME" "SKIP"
  IfErrors "Cont"
  Abort
  Cont:
FunctionEnd 
In fact, I read this in NSIS Documentation.

I am pretty sure you can tweak it to meet your requirements. If not, try reading the documentation, or posting again (attaching script preferably).
DropF#
That's ok, my problem is resolved. In fact, I thought the function "Abort" would stop the installer, and not skip a page. So the solution is to always skip the second directory page (with "Abort"), and show it only if the good section has been selected.

Thank you 😉
n0On3#
yes, I asked the same.

'Abort' stops installer in a section, but in this function skips the page.