Archive: Popup and bold text


Popup and bold text
There are two things I like to accomplish with NSIS, but i don't know if this is possible.

1) I want when clicked on a Link (in a custom page) A popup shows up with an scrollable field for a license.

2) I want the text of my radio buttons in Bold

Anyone? Thanks anyway


You could write another NSIS executable which only contains a license page that you extract to $PLUGINSDIR from your main installer. Your main installer executes it with ExecWait in your Leave function of your custom page (the Link control needs NOTIFY flag). The license page installer will have to write something to the registry in the license page's Leave function to show that the user accepted the license agreement rather than simply pressed the Cancel button.

To make text bold you need to use GetDlgItem, CreateFont and SendMessage.

-Stu


Afrow UK thanks, but is there any example for the Bold text.

Its very hard for me to code it from zero, my english is also not so good, thats why some Tuts are difficult.

Thanks in advance


OutFile license.exe
Page License "" LicenseShow LicenseLeave
LicenseForceSelection RadioButtons
LicenseData license.nsi
XPStyle on

!include WinMessages.nsh

!define LicenseRadioButton1 1034
!define LicenseRadioButton2 1035

Function LicenseShow

FindWindow $R0 "#32770" "" $HWNDPARENT
CreateFont $R2 $(^Font) $(^FontSize) 700

GetDlgItem $R1 $R0 ${LicenseRadioButton1}
SendMessage $R1 ${WM_SETFONT} $R2 1

GetDlgItem $R1 $R0 ${LicenseRadioButton2}
SendMessage $R1 ${WM_SETFONT} $R2 1

FunctionEnd

Function LicenseLeave
WriteRegStr HKCU "Software\My Product" "LicenseAgreed" "1"
FunctionEnd

Section
SectionEnd


-Stu

About lanching this License page, this must happen (only) when a user clicks on a link. Because now it just lauches when i click next. How to solve this?

License Page, I have created a simple License page (see code) But how do i hide the Cancel button and if possible the line displayed above thise buttons. The tips on this on the forum didn't work for me.

!define TEMP1 $R0

Name "Save! License Agreement"
OutFile "..\save_license.exe"
ShowInstDetails show
ReserveFile "${NSISDIR}\Plugins\InstallOptions.dll"
ReserveFile "save_license.ini"
BrandingText " "

Page custom PageShow LeavePage

Section "Components"
;Get Install Options dialog user input
SectionEnd

Function .onInit
InitPluginsDir
File /oname=$PLUGINSDIR\save_license.ini "save_license.ini"
FunctionEnd

Function PageShow

Push ${TEMP1}
InstallOptions::dialog "$PLUGINSDIR\save_license.ini"
Pop ${TEMP1}
Pop ${TEMP1}

FunctionEnd

Function LeavePage
FunctionEnd

Firstly make sure you have Flags=NOTIFY for your Link Field (control).

Then your Leave Function should look like this:


!define LinkField 5

Function LeavePage

Push ${TEMP1}
ReadINIStr ${TEMP1} "$PLUGINSDIR\save_license.ini" "Settings" "State"
StrCmp ${TEMP1} ${LinkField} 0 End

ExecWait "$PLUGINSDIR\license.exe"

ReadRegStr ${TEMP1} HKCU "Software\My Product" "LicenseAgreed"
StrCmp ${TEMP1} 1 End
Abort #User clicked Cancel

End:
Pop ${TEMP1}

FunctionEnd


You should define LinkField to the Field # of your Link control.

I'm not sure how you want it to work exactly, but currently if the user clicks Cancel it will go back to the save_license.ini page. Otherwise it will continue to the next page.

-Stu

Try the ExperienceUI; it allows you to set a custom function for your link on the Finish page. That way you can skip modifying Modern UI files.

http://xpui.sourceforge.net

-dandaman32