Load existing Language Strings into custom page.
Hello all..
I am trying to create a custom page and load already existing language strings into it. For example "MUI_TEXT_WELCOME_INFO_TITLE".
I am using the following code, but it doesn't seem to work.
;--------------------------------
;Include all libs
!include "MUI.nsh" ; --- MUI 1.66 compatible
!include "LogicLib.nsh" ; --- Include logic statement capabilities
!include "nsDialogs.nsh" ; --- Include custom pages capabilities
;--------------------------------
;General Information
Name
BrandingText
OutFile
InstallDir
Var Dialog
Var Label
Var mui.WelcomePage.Title
Var mui.WelcomePage.Title.Font
Var mui.WelcomePage.Text
;--------------------------------
;Define images and include pages
!define MUI_ABORTWARNING
Page custom nsDialogsPage
!insertmacro MUI_PAGE_INSTFILES
;--------------------------------
;Languages
!insertmacro MUI_LANGUAGE "English" ;first language is the default language
!insertmacro MUI_DEFAULT MUI_WELCOMEPAGE_TITLE "$(MUI_TEXT_WELCOME_INFO_TITLE)"
!insertmacro MUI_DEFAULT MUI_WELCOMEPAGE_TEXT "$(MUI_TEXT_WELCOME_INFO_TEXT)"
!insertmacro MUI_UNSET MUI_WELCOMEPAGE_TITLE
!insertmacro MUI_UNSET MUI_WELCOMEPAGE_TITLE_3LINES
!insertmacro MUI_UNSET MUI_WELCOMEPAGE_TEXT
;--------------------------------
;Custom Page - Welcome
Function nsDialogsPage
nsDialogs::Create 1018
Pop $Dialog
${NSD_CreateLabel} 0 0 100% 12u "Hello, welcome to nsDialogs!"
Pop $Label
;Positiong of controls
;Title
!ifndef MUI_WELCOMEPAGE_TITLE_3LINES
!define MUI_WELCOMEPAGE_TITLE_HEIGHT 28
!else
!define MUI_WELCOMEPAGE_TITLE_HEIGHT 38
!endif
;Text
;17 = 10 (top margin) + 7 (distance between texts)
!define /math MUI_WELCOMEPAGE_TEXT_TOP 17 + ${MUI_WELCOMEPAGE_TITLE_HEIGHT}
;Title
${NSD_CreateLabel} 120u 10u 195u ${MUI_WELCOMEPAGE_TITLE_HEIGHT}u "$(MUI_WELCOMEPAGE_TITLE)"
Pop $mui.WelcomePage.Title
CreateFont $mui.WelcomePage.Title.Font "$(^Font)" "12" "700"
SendMessage $mui.WelcomePage.Title ${WM_SETFONT} $mui.WelcomePage.Title.Font 0
;Welcome text
${NSD_CreateLabel} 120u ${MUI_WELCOMEPAGE_TEXT_TOP}u 195u 130u "${MUI_WELCOMEPAGE_TEXT}"
Pop $mui.WelcomePage.Text
!insertmacro MUI_UNSET MUI_WELCOMEPAGE_TITLE_HEIGHT
!insertmacro MUI_UNSET MUI_WELCOMEPAGE_TEXT_TOP
nsDialogs::Show
FunctionEnd
Section
SectionEnd
This only displays: "$(MUI_WELCOMEPAGE_TITLE)" and "${MUI_WELCOMEPAGE_TEXT}".
If I replace "${MUI_WELCOMEPAGE_TEXT}" with (as according to the manual) $(^MUI_TEXT_WELCOME_INFO_TEXT) it stays blank.
Am I missing something?
All I am trying to do is recreate the Welcome page but include a piece of text. Because as far as I can't include a custom text string into the welcome page?
MUI_TEXT_WELCOME_INFO_TITLE
*Some Custom Text*
MUI_TEXT_WELCOME_INFO_TEXT
Thanks in advanced,
Ruud