Skip to content
⌘ NSIS Forum Archive

License pages inside sections/functions

2 posts

wu5mike#

License pages inside sections/functions

Hi all, I'm new to NSIS and trying to make an installer that installs prerequisite apps but I also have to display the TOS for those apps and wanted to use the Page License command (as I want the apps to be otherwise silent).

However as I'm sure most of you know you can't have a Page inside a Function/Section, however I also need control flow like ${If} which I get errors about not being valid outside Functions/Sections.

I thought about calling the Page outside any Function and calling the Function afterwards but I can't use Call outside the Functions either.

How do people go about handling situations like these?

Thanks!
Comperio#
My suggestion would be to include all the pages you think you'll need and then use the ${If} logic inside a pre function (using !insertmacro MUI_PAGE_CUSTOMFUNCTION_PRE). If you call ABORT in the pre function, you will skip over that page.

Review the MUI docs and search the forum for examples.