Archive: Insert string/text at the bottom of MUI_WELCOME page


Insert string/text at the bottom of MUI_WELCOME page
Hello Everybody,

I want a little modification in the MUI_WELCOME page. Everything is fine with the default Welcome page, but
I'm unable to insert a string/text at the bottom of the
Welcome Page. I want to use the default MUI_WELCOME page
with this feature.

I've searched it in the forum, but didn't found. Its urgent, so please help me.

With regards,


The MUI welcome page is just a custom page that you may easily change by modifying the respective MUI_SPECIALINI.
See MUI documentation chapter Customize standard dialogs.
http://nsis.sourceforge.net/Docs/Mod...UI/Readme.html


Thanks for the response Red Wine.

Actually I'm running out of time, as I've to despatch the Installer. Can you/somebody please show the coding how to do it - insert one string/text at the bottom of the Welcome page.


This is a modified version of MUI included example WlcomeFinish.nsi :)

;NSIS Modern User Interface
;Welcome/Finish Page Example Script
;Written by Joost Verburg

;--------------------------------
;Include Modern UI

!include "MUI.nsh"

;--------------------------------
;General

;Name and file
Name "Modern UI Test"
OutFile "WelcomeFinish.exe"

;Default installation folder
InstallDir "$PROGRAMFILES\Modern UI Test"

;Get installation folder from registry if available
InstallDirRegKey HKCU "Software\Modern UI Test" ""

;--------------------------------
;Interface Settings

!define MUI_ABORTWARNING

;--------------------------------
;Pages
!define MUI_PAGE_CUSTOMFUNCTION_PRE 'WelPre'
!define MUI_PAGE_CUSTOMFUNCTION_SHOW 'WelShow'

!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE "${NSISDIR}\Docs\Modern UI\License.txt"
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH

!insertmacro MUI_UNPAGE_WELCOME
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_UNPAGE_FINISH

;--------------------------------
;Languages

!insertmacro MUI_LANGUAGE "English"

Function WelPre
WriteINIStr '$PLUGINSDIR\iospecial.ini' 'Settings' 'NumFields' '4'
WriteINIStr '$PLUGINSDIR\iospecial.ini' 'Field 4' 'Type' 'Link'
WriteINIStr '$PLUGINSDIR\iospecial.ini' 'Field 4' 'Top' '185'
WriteINIStr '$PLUGINSDIR\iospecial.ini' 'Field 4' 'Bottom' '195'
WriteINIStr '$PLUGINSDIR\iospecial.ini' 'Field 4' 'Left' '120'
WriteINIStr '$PLUGINSDIR\iospecial.ini' 'Field 4' 'Right' '315'
WriteINIStr '$PLUGINSDIR\iospecial.ini' 'Field 4' 'Text' \
'Visit $(^name) on the web'
WriteINIStr '$PLUGINSDIR\iospecial.ini' 'Field 4' 'State' \
'http://nsis.sourceforge.net/Docs/Modern%20UI/Readme.html'
FunctionEnd

Function WelShow
ReadIniStr $0 '$PLUGINSDIR\iospecial.ini' 'Field 4' 'HWND'
SetCtlColors $0 '0x0000FF' '0xFFFFFF'
FunctionEnd

;--------------------------------
;Installer Sections

Section "Dummy Section" SecDummy

SetOutPath "$INSTDIR"

;ADD YOUR OWN FILES HERE...

;Store installation folder
WriteRegStr HKCU "Software\Modern UI Test" "" $INSTDIR

;Create uninstaller
WriteUninstaller "$INSTDIR\Uninstall.exe"

SectionEnd

;--------------------------------
;Descriptions

;Language strings
LangString DESC_SecDummy ${LANG_ENGLISH} "A test section."

;Assign language strings to sections
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${SecDummy} $(DESC_SecDummy)
!insertmacro MUI_FUNCTION_DESCRIPTION_END

;--------------------------------
;Uninstaller Section

Section "Uninstall"

;ADD YOUR OWN FILES HERE...

Delete "$INSTDIR\Uninstall.exe"

RMDir "$INSTDIR"

DeleteRegKey /ifempty HKCU "Software\Modern UI Test"

SectionEnd

Thanks a lot Red Wine for your wonderful response. It was beyond my expectation that you supplied the actual coding for the purpose.

Actually, last night after your first response (suggestion for reading docs.), I found one example in the NSIS site to add a link in the welcome page (http://nsis.sourceforge.net/Add_link...page_%28MUI%29). But was already too late at office, and had to return to home. Your example, made me sure that this is the only way to tackle my issue.

I'm yet to finish my issue completely, but with your help I've started it. The first change I've made is:

Function WelPre
WriteINIStr '$PLUGINSDIR\iospecial.ini' 'Field 4' 'Type' 'Label'

(I've changed the Type to 'Label' instead of 'Link')


The background color of the inserted label is not matching with the background color of the rest of the page. How to make it similar?

Thanks!


Originally posted by Swapan Das
The background color of the inserted label is not matching with the background color of the rest of the page. How to make it similar?

Thanks!
It's on the example above. SetCtlColors on Welcome page show function.

Thanks once again. I'll check it.


Yes it has worked Red Wine!

Can I add one more line? Space is there for another line.

With your code and with help from the thread I've mentioned, I've been able to get the desired output.
I've changed the Type to 'Label'. I think it is actually meant for the website link. Now I can forsee one more requirement from my authority- they will ask now to add website link to it!

Yes how can I insert one more line at the bottom of the Welcome Page? This time it will be a website link.


You may add more lines. You need to decrease the height of field 3 so fields would not overlap each other and increase the NumFields to the desired. Of course you should take care of field 3 to be enough space for the welcome/finish text.


Red Wine it was wonderful to have your constant support for this thread as well as for my other posts. I'll try out this one, and will wait for my authority to ask this feature from me!