trying to make two different buttons for restart & restart later in NSIS - nsis

As i am working with the NSIS code, i was trying to make two different buttons for restart & restart later in NSIS. Based on the nsis Docuementaion
we need to use following commands(MUI_FINISHPAGE_TEXT_REBOOTNOW,MUI_FINISHPAGE_TEXT_REBOOTLATER)
But i was getting an error called "macro named MUI_FINISHPAGE_TEXT_REBOOTNOW. not found". Could you plese let me know how can we do this tricky task.
!define MUI_FINISHPAGE_TEXT_REBOOTNOW "Yes, restart the computer now"
!define MUI_FINISHPAGE_TEXT_REBOOTLATER "No, I will restart the computer later"
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_FINISHPAGE_TEXT_REBOOTNOW
!insertmacro MUI_FINISHPAGE_TEXT_REBOOTLATER
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_LANGUAGE "English"
; MUI end ------
Section test
SectionEnd

Those are defines to customize the page, not macros you can call.
!include MUI2.nsh
!insertmacro MUI_PAGE_INSTFILES
!define MUI_FINISHPAGE_REBOOTLATER_DEFAULT ; Make "later" the default option
!define MUI_FINISHPAGE_TEXT_REBOOTNOW "Reboot now!!!!" ; Custom text
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_LANGUAGE English
Section
Sleep 2222
SetRebootFlag True # Pretend we did something that requires a reboot
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

Custom functions by pages in NSIS disappear

I have the following script:
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_COMPONENTS
!define MUI_PAGE_CUSTOMFUNCTION_PRE ComponentPost
!insertmacro MUI_PAGE_DIRECTORY
!define MUI_PAGE_CUSTOMFUNCTION_SHOW DirectoryShow
!define MUI_PAGE_CUSTOMFUNCTION_LEAVE DirectoryLeave
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
Unfortunately, after the first directory selection dialog, directory page returns to default, what am i doing wrong?
When using multiple directory pages you also normally want to store the selected paths in different variables:
Var SomeOtherFolder
!define MUI_DIRECTORYPAGE_VARIABLE $SomeOtherFolder
!insertmacro MUI_PAGE_DIRECTORY
...
Section
SetOutPath $SomeOtherFolder
File /r "c:\otherfiles"
Section
All of this information can be found in the Modern UI readme...

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

NSIS Localisation problem

I'm having trouble with a Nullsoft Installer script.
I'm using the MUI2 interface with the latest (2.46) version of NSIS.
Just after the MUI_PAGE macros:
!define MUI_LANGDLL_ALLLANGUAGES
!insertmacro MUI_LANGUAGE "English"
!insertmacro MUI_LANGUAGE "German"
!insertmacro MUI_LANGUAGE "French"
!insertmacro MUI_RESERVEFILE_LANGDLL
First thing in onInit:
!insertmacro MUI_LANGDLL_DISPLAY
The error I get is:
unknown variable/constant
"{MUI_LANGDLL_LANGUAGES_CP}" detected,
ignoring
(macro:MUI_LANGDLL_DISPLAY:35)
Any ideas? I'm pulling my hair out. the only help i can find through google is in Japanese/Chinese
Every time !insertmacro MUI_LANGUAGE xyz is used, it appends the language to a define used by MUI_LANGDLL_DISPLAY...
!define MUI_LANGDLL_ALLLANGUAGES
!insertmacro MUI_LANGUAGE "English"
!insertmacro MUI_LANGUAGE "German"
!insertmacro MUI_LANGUAGE "French"
!insertmacro MUI_RESERVEFILE_LANGDLL
Function .onInit
!insertmacro MUI_LANGDLL_DISPLAY ;This has to come after the language macros
FunctionEnd

Resources