Archive: MUI Custom Page


MUI Custom Page
Hi, in my actual IS installer i have two pages
One "Licence" and the other "Lastest Information"
In this one ive put my Readme File, because i dont want THE final user avoid to read it.

I think the way to do that in NSIS is by a Custom Page.
Anyone know how or send to me an example?

Thanks


Easily you may add a second license page and modify it to look like a readme page :-)


LOL

There is the problem, How I "Easily add a second license page and modify it to look like a readme page "??
Because de license page its predefined like this
!insertmacro MUI_PAGE_LICENSE $(MUILicense)

TIA


Look in the plugins section of the wiki for a license page plugin



;license page
!insertmacro MUI_PAGE_LICENSE "path_to_license\license.txt/rtf"

; ReadMe created from the license page
!define MUI_PAGE_HEADER_TEXT "Read Me"
!define MUI_PAGE_HEADER_SUBTEXT "Please read the following important information."
!define MUI_LICENSEPAGE_TEXT_TOP "About my program:"
!define MUI_LICENSEPAGE_TEXT_BOTTOM "$\n* Click on the arrows or use the PageDown \
button to scroll down to the end of the text."
!define MUI_LICENSEPAGE_BUTTON "Next >"
!insertmacro MUI_PAGE_LICENSE "path_to_readme\readme.txt/rtf"

Thanks a lot RW, you are my idol :-D


Just uploaded a header at wiki regarding to the subject, aimed in help users to add a MUI multilang readme page.

http://nsis.sourceforge.net/Readme_P...I_License_Page


Thanks again


How to make custom page or something like that to show big bitmap? I need some kind of licence page but show image instead of text there. And it would be great to be able to goto that page upon .onSelChange.


Custom page (InstallOptions plugin) is powerful and adds many amazing abilities to nsis, however painful sometimes, (I guess the one wouldn't exist without the other ;)).

OutFile 'test.exe'

Page Custom custcreate

Section

SectionEnd


Function custcreate
InstallOptions::Dialog "$PLUGINSDIR\custom.ini"
FunctionEnd

Function .onInit
InitPluginsDir
File /oname=$PLUGINSDIR\sample_image.bmp sample_image.bmp
GetTempFileName $0
Rename $0 "$PLUGINSDIR\custom.ini"

WriteINIStr "$PLUGINSDIR\custom.ini" "settings" "numfields" "1"
WriteINIStr "$PLUGINSDIR\custom.ini" "field 1" "type" "bitmap"
WriteINIStr "$PLUGINSDIR\custom.ini" "field 1" "text" "$PLUGINSDIR\sample_image.bmp"
WriteINIStr "$PLUGINSDIR\custom.ini" "field 1" "left" "0"
WriteINIStr "$PLUGINSDIR\custom.ini" "field 1" "right" "-1"
WriteINIStr "$PLUGINSDIR\custom.ini" "field 1" "top" "0"
WriteINIStr "$PLUGINSDIR\custom.ini" "field 1" "bottom" "-1"
WriteINIStr "$PLUGINSDIR\custom.ini" "field 1" "flags" "RESIZETOFIT"
FunctionEnd
you need an image named sample_image.bmp into the same folder where compiling the script.

Here is what I have now:

Page directory
!insertmacro MUI_PAGE_COMPONENTS
Page instfiles

Function custcreate
InitPluginsDir
File /oname=$PLUGINSDIR\bmp_nsi.bmp bmp_nsi.bmp
GetTempFileName $0
Rename $0 "$PLUGINSDIR\custom.ini"

WriteINIStr "$PLUGINSDIR\custom.ini" "settings" "numfields" "1"
WriteINIStr "$PLUGINSDIR\custom.ini" "field 1" "type" "bitmap"
WriteINIStr "$PLUGINSDIR\custom.ini" "field 1" "text" "$PLUGINSDIR\bmp_nsi.bmp"
WriteINIStr "$PLUGINSDIR\custom.ini" "field 1" "left" "0"
WriteINIStr "$PLUGINSDIR\custom.ini" "field 1" "right" "-1"
WriteINIStr "$PLUGINSDIR\custom.ini" "field 1" "top" "0"
WriteINIStr "$PLUGINSDIR\custom.ini" "field 1" "bottom" "-1"
WriteINIStr "$PLUGINSDIR\custom.ini" "field 1" "flags" "RESIZETOFIT"

InstallOptions::Dialog "$PLUGINSDIR\custom.ini"
FunctionEnd

Function .onSelChange

!insertmacro StartRadioButtons $1

${If} ${SectionIsSelected} ${variant_1}
!insertmacro RadioButton ${variant_1}
MessageBox MB_ICONEXCLAMATION|MB_OK "1"
Call custcreate
${EndIf}

FunctionEnd

After first component selected custom page appears but it`s "Back" button throws me to directory page and not back to components. How to handle it right?


I got it. This picture is just over components so that I don`t see them.
But how call new page or something like that from


${If} ${SectionIsSelected} ${variant_1}
...
${EndIf}