1

I have added a checkbox successfully to nsis installer's finish page defining functions for MUI_PAGE_CUSTOMFUNCTION_PRE and MUI_PAGE_CUSTOMFUNCTION_SHOW in finish page using MUI.

But if I include MUI2 instead of MUI, the check box is not displayed. I suppose there is something different in MUI2 than MUI with respect to this. I could not find documentation on that an if anyone knows that, can I please know???

Thank you

Machavity
  • 30,841
  • 27
  • 92
  • 100
Dulini Atapattu
  • 2,735
  • 8
  • 33
  • 47

1 Answers1

7

MUI1 uses InstallOptions for the Welcome and Finish pages and MUI2 uses nsDialogs.

This is documented in the MUI2 readme:

The welcome and finish page are no longer implemented using InstallOptions. Instead, the new nsDialogs plug-in is used. nsDialogs allows you to create custom pages or customize existing pages directly from the script.

Edit: Customize the page by using the nsDialogs commands in the show callback:

var Checkbox

Function MyFinishShow
${NSD_CreateCheckbox} 120u 110u 100% 10u "&Something"
Pop $Checkbox
SetCtlColors $Checkbox "" "ffffff"
FunctionEnd

Function MyFinishLeave
${NSD_GetState} $Checkbox $0
${If} $0 <> 0
    MessageBox mb_ok "Custom checkbox was checked..."
${EndIf}
FunctionEnd

!define MUI_FINISHPAGE_RUN "calc.exe" ;See note after the code...
!define MUI_PAGE_CUSTOMFUNCTION_SHOW MyFinishShow
!define MUI_PAGE_CUSTOMFUNCTION_LEAVE MyFinishLeave
!insertmacro MUI_PAGE_FINISH

Or if you are not using the existing finish page checkboxes, you can use those for custom stuff without using the show callback...

Community
  • 1
  • 1
Anders
  • 97,548
  • 12
  • 110
  • 164
  • Thanks for your anwer. I ve found those words in MUI2. Also I referred to Winamp forums. http://forums.winamp.com/showthread.php?t=314012 exactly describes my question and it refers to http://forums.winamp.com/showthread.php?threadid=310323 where it says to add a custom page for finish page. But the above readme says we can customize an exsisting page... I just want to know how to achieve that? Thanks – Dulini Atapattu Jul 01 '11 at 03:50
  • 1
    @dia: Again, from the docs "Then, the show function is called, which can be used to customize the interface" – Anders Jul 01 '11 at 19:10
  • I can't manage this to work. [Documentation says](https://nsis.sourceforge.io/Docs/nsDialogs/Readme.html): "`NSD_Create*` - A dialog must exist for this to work, so `nsDialogs::Create` must be called prior to this function.". – Paul Aug 05 '21 at 07:04
  • @Paul Make sure you are using MUI2.nsh if you want to use the code from this answer – Anders Aug 05 '21 at 10:14
  • The problem is that I'm trying to apply that to an uninstall dialog, and [you said it's not supported](https://stackoverflow.com/a/43258310/2604492). Too bad that it's so complicated to add a checkbox. – Paul Aug 05 '21 at 10:35
  • 1
    @Paul That answer you linked to has all the information. MUI_UI is the easy route. – Anders Aug 05 '21 at 10:50