NSIS Scroll License Plugin - nsis

Does anyone have experience with the NSIS Scroll License Plugin?
I am trying to get the scroll license plugin to force a scroll to the end of a EULA. I have the following lines of code included (see below); the problem I am running into is the Welcome Screen has the next button greyed out so I cant even get to the license page with this plugin :( Any ideas on this one?
Thanks much!
Defines
!define MUI_PAGE_CUSTOMFUNCTION_SHOW LicenseShow
INSERTMACROS
!insertmacro MUI_PAGE_LICENSE mylicense.txt
!insertmacro MUI_LANGUAGE English
Section -Main SEC0000
Lots of files
SectionEnd
Functions
LicenseForceSelection checkbox
Function LicenseShow
ScrollLicense::Set /NOUNLOAD
FunctionEnd
Function .onGUIEnd
ScrollLicense::Unload
FunctionEnd

You are missing a number of things in the code you provided to let us test your code. Note also that you need at least one section.
Here is a minimal running sample :
!include "MUI.nsh"
Name "ScrollLicense Test"
OutFile "ScrollLicense.exe"
!define MUI_PAGE_CUSTOMFUNCTION_SHOW LicenseShow
!insertmacro MUI_PAGE_LICENSE mylicense.txt
!insertmacro MUI_LANGUAGE English
LicenseForceSelection checkbox
Function LicenseShow
ScrollLicense::Set /NOUNLOAD
FunctionEnd
Function .onGUIEnd
ScrollLicense::Unload
FunctionEnd
Section "A Section"
;some things to install
;...
SectionEnd

Related

How to display a custom text on MUI_PAGE_INSTFILES in NSIS

I am beginner in NSIS, and I want to display the custom text in MUI_PAGE_INSTFILES page as I have two options in Components page 1. Installation and 2. UnInstallation.
So when I choose Below options I am expecting the corresponding text in MUI_PAGE_INSTFILES page.
For Installation Option the text should be "Installation completed"
For UnInstallation Option the text should be "UnInstallation Completed"
Thanks in advance for your help on this.
The CompletedText attribute supports variables:
var mycompletedtext
var myfinishsubtext
CompletedText $mycompletedtext
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_COMPONENTS
!define MUI_INSTFILESPAGE_FINISHHEADER_TEXT "$mycompletedtext"
!define MUI_INSTFILESPAGE_FINISHHEADER_SUBTEXT "$myfinishsubtext"
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_LANGUAGE "English"
Section Installer
StrCpy $mycompletedtext "Installation completed"
StrCpy $myfinishsubtext "Something something"
SectionEnd
Section Uninstaller
StrCpy $mycompletedtext "UnInstallation Completed"
StrCpy $myfinishsubtext "Bye bye"
SectionEnd

Remove header image in NSIS installer

I understand that NSIS uses the installer icon (or MUI_ICON) as the header image by default. And that using MUI_HEADERIMAGE without specifying MUI_HEADERIMAGE_BITMAP uses the default Contrib\Graphics\Header\nsis.bmp
But is it possible to not display a header image altogether? (Aside from the option of specifying a blank (all-white) image as MUI_HEADERIMAGE_BITMAP)
!define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_RIGHT
!define MUI_CUSTOMFUNCTION_GUIINIT HideHeaderImage
!include MUI2.nsh
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_LANGUAGE English
Function HideHeaderImage
!if "${MUI_SYSVERSION}" >= 2.0
ShowWindow $mui.Header.Image 0
!else
GetDlgItem $0 $hwndParent 0x416
ShowWindow $0 0
!endif
FunctionEnd
Alternatively you could edit one of the UIs in ${NSISDIR}\Contrib\UIs\modern*.exe with Resource Hacker to move the image control offscreen and then use MUI_UI or MUI_UI_HEADERIMAGE in your script to select your new UI file.
Can you show what function HideHeaderImage would look like for
!define MUI_WELCOMEFINISHPAGE_BITMAP "leftside.bmp"

Adding a checkbox to the NSIS Uninstaller Welcome Page

I'm trying to add a checkbox to the welcome screen of my NSIS uninstaller, but I'm having trouble finding an example. From the documentation for MUI2 I can't find any custom functions that can be run on the welcome page.
It looks like the finish page is more easy to customize based on the documentation and other answers I've found.
Is there a way to customize the Welcome Page? If not, what are the other options for accomplishing the intent?
The MUI(1) documentation you linked to has a note about how you can customize the welcome page in the pre/show callbacks. With MUI2 you can add controls in the show callback. See the nsDialogs documentation for more information about these custom controls...
!include MUI2.nsh
!insertmacro MUI_PAGE_INSTFILES
!define MUI_PAGE_CUSTOMFUNCTION_SHOW un.ModifyUnWelcome
!define MUI_PAGE_CUSTOMFUNCTION_LEAVE un.LeaveUnWelcome
!insertmacro MUI_UNPAGE_WELCOME
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_LANGUAGE English
Var mycheckbox ; You could just store the HWND in $1 etc if you don't want this extra variable
Function un.ModifyUnWelcome
${NSD_CreateCheckbox} 120u -18u 50% 12u "Do something special"
Pop $mycheckbox
SetCtlColors $mycheckbox "" ${MUI_BGCOLOR}
${NSD_Check} $mycheckbox ; Check it by default
FunctionEnd
Function un.LeaveUnWelcome
${NSD_GetState} $mycheckbox $0
${If} $0 <> 0
MessageBox mb_ok "I'm special"
${EndIf}
FunctionEnd
Section testuninstaller
Initpluginsdir
WriteUninstaller "$pluginsdir\u.exe"
ExecWait '"$pluginsdir\u.exe" _?=$pluginsdir'
Sectionend

Scroll License NSIS not scrolling to end of License

I am using the ScrollLicense Plugin with an attempt to force the user to scroll to the end of a License Agreement.
The problem I am hitting is they currently only have to scroll about 1/4th the way down the bar and it enables the "Next" button... has anyone run into this issue before?
Code is pretty straight forward and using everything from the plugin examples
LicenseForceSelection radiobuttons "I accept" "I decline"
!insertmacro MUI_PAGE_WELCOME
!define MUI_PAGE_CUSTOMFUNCTION_SHOW LicenseShow
!insertmacro MUI_PAGE_LICENSE "$(MUILicense)"
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
Function LicenseShow
ScrollLicense::Set /NOUNLOAD /RADIOBUTTONS
FunctionEnd
Section -Main
Files here
Section End
Function .onGUIEnd
ScrollLicense::Unload
FunctionEnd

NSIS Scroll License Welcome Screen

I have an installer that is having problems interacting with the scroll license plugin. The installer works great without the plugin, this is what the plugin has me include:
!
include MUI.nsh
!define MUI_PAGE_CUSTOMFUNCTION_SHOW LicenseShow
!insertmacro MUI_PAGE_LICENSE "EULA.txt"
unction LicenseShow
ScrollLicense::Set /NOUNLOAD
FunctionEnd
Function .onGUIEnd
ScrollLicense::Unload
FunctionEnd
Section A
Section End
The problem I run into is here. If the Welcome page displays BEFORE the License page it will not be able to progress to the next screen because it is looking for a scroll bar and accept button. If I remove the WELCOME page everything works fine. Does anyone have experience with this plugin? or how I can get the plugin to ignore the MUI_PAGE_WELCOME?
!insertmacro MUI_PAGE_WELCOME <--- If I remove this Welcome page everything works great!
!insertmacro MUI_PAGE_LICENSE "eula.rtf"
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
Try moving the line:
!define MUI_PAGE_CUSTOMFUNCTION_SHOW LicenseShow
Below the line (more specifically, directly above the MUI_PAGE_LICENSE line):
!insertmacro MUI_PAGE_WELCOME
I used ExampleCheckBox.nsi as supplied from the ScrollLicense plugin and reproduced your behavior when I had:
!define MUI_PAGE_CUSTOMFUNCTION_SHOW LicenseShow
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE ExampleCheckBox.nsi
The problem went away when I moved the !define line to after the MUI_PAGE_WELCOME.
!insertmacro MUI_PAGE_WELCOME
!define MUI_PAGE_CUSTOMFUNCTION_SHOW LicenseShow
!insertmacro MUI_PAGE_LICENSE ExampleCheckBox.nsi
I'm not familiar with this plugin but I suspect there is some kind of side-effect that disables the Next button of the next displayed page...
I think what you are missing is how the example needs to fit into the "flow" of the other MUI pages.
!include MUI.nsh
;;this goes before the License page if you want it first.
!insertmacro MUI_PAGE_WELCOME
;;now add the example stuff
!define MUI_PAGE_CUSTOMFUNCTION_SHOW LicenseShow
!insertmacro MUI_PAGE_LICENSE "EULA.txt" ;;update for what file you want to include!
Function LicenseShow
ScrollLicense::Set /NOUNLOAD
FunctionEnd
Function .onGUIEnd
ScrollLicense::Unload
FunctionEnd
;;now continue with the rest of the pages
;;and we *don't* repeat the MUI_PAGE_LICENSE
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES

Resources