I have a working NSIS Modern UI 2 script that has five components. One of them is the main application, and there are four helper applications. Due to the nature of the applications, none of them requires the other to run; hence, they are all optional installs. This includes the main application.
At the finish page, I can have an option to start the main application with
!define MUI_FINISHPAGE_RUN "$INSTDIR\MyProgram.exe"
!define MUI_FINISHPAGE_RUN_TEXT "Start the main program"
as long as that goes before the
!insertmacro MUI_PAGE_FINISH
command. However, I don't want the checkbox to be visible (or at least enabled) if the user doesn't install the main application.
I've tried putting the first two lines inside the Section MainSection
, but it doesn't show the box because by then, the UI has already been created.
I'd prefer not to always have it enabled and point to a function that runs if it's been installed, and shows a MessageBox
otherwise.
Is there a way to do this?