Archive: Editing License page text


Editing License page text
Hi ,

I dont want to use the regular text box on my installer license page , rather I want to put a link to my website's License page.

So I want to replace the default text with

Click here to read the License Agreement

Where "here" will be having the link in it.

How can I make it work ?


Thanks.


Simply create a custom nsDialogs page (using CreateLink), using the onclick callback on the link to call ExecShell "http://example.com/" . Or perhaps a link does the execshell automatically? Well, just try it and see what happens, I guess.


I dont want to create a custom license page as there are some other thing I have done on license page. How can I make it work on License page only. Tried using Linker plugin but it caused the License page to crash.


My guess is that you used Linker without /NOUNLOAD.


@aerDNA It still crashes.


Dunno then, but here's a quick script that puts a link on lic page and doesn't crash (for me).


OutFile "LicLinkerTest.exe"
Name "LicLinkerTest"

!include "MUI2.nsh"
!define MUI_PAGE_CUSTOMFUNCTION_SHOW LicPage_Show
!insertmacro MUI_PAGE_LICENSE "${NSISDIR}\COPYING"
!insertmacro MUI_LANGUAGE "English"

Function LicPage_Show
FindWindow $R0 "#32770" "" $HWNDPARENT
System::Call 'User32::CreateWindowEx(i 0, t "STATIC", t "Visit NSIS homepage", i ${WS_CHILD}|${WS_VISIBLE}, i 165, i 205, i 100, i 20, i R0, i 0, i 0, i 0) i.R1'
CreateFont $1 $(^Font) $(^FontSize) "400"
SendMessage $R1 ${WM_SETFONT} $1 0
linker::link /NOUNLOAD $R1 "http://nsis.sourceforge.net"
FunctionEnd

Section Blank
SectionEnd

Function .onGUIEnd
Linker::unload
FunctionEnd

@aerDNA thanks a lot man. Its a great help. What I was trying to do was making the link of ID 1006 , may be that was the problem.


Any label will do, so ID 1006 can be used as well. This works fine and crash-free for me:

FindWindow $R0 "#32770" "" $HWNDPARENT
GetDlgItem $R1 $R0 1006
Linker::link /NOUNLOAD $R1 "http://nsis.sourceforge.net"

Yeah , right. Actually I am using a bitmap image as installer background, so I set the controls transparent. Just figured out the installer crashes everytime I set the control having the link transparent. Linker perhaps dont like tranparency. ;)

I tried doing this :

System::Call 'User32::CreateWindowEx(i 0, t "STATIC", t "Visit NSIS homepage", i ${WS_CHILD}|${WS_VISIBLE}|${WS_EX_TRANSPARENT}, i 165, i 205, i 100, i 20, i R0, i 0, i 0, i 0) i.R1'

But its not working.

Any idea what else I can try?

You misplaced WS_EX_TRANSPARENT - it's an extended style and should be the first param of CreateWindowEx. But it's not the solution you're looking for anyway. Have you tried this:
SetCtlColors $R1 0 "transparent"


Doing this causes the installer to crash.


Well, it really shouldn't, and it doesn't under normal circumstances. Linker doesn't mind transparency as such, so the reason must be the combo of transparency and bitmap background. Anyway, the answer lies in your script and my ESP ain't what it used to be, so you should post some code, otherwise I can only wish you good luck.


I am afraid, but linker seem to be incompatible with transparency.

I tried your code with this and it crashed as well.


Function LicPage_Show
FindWindow $R0 "#32770" "" $HWNDPARENT
System::Call 'User32::CreateWindowEx(i 0, t "STATIC", t "Visit NSIS homepage", i ${WS_CHILD}|${WS_VISIBLE}, i 165, i 205, i 100, i 20, i R0, i 666, i 0, i 0) i.R1'
CreateFont $1 $(^Font) $(^FontSize) "400"
SendMessage $R1 ${WM_SETFONT} $1 0
linker::link /NOUNLOAD $R1 "http://nsis.sourceforge.net"
SetCtlColors $R1 0xFFFFFF transparent

FunctionEnd

Apply transparency before using Linker, not after.


In that case it doesn't work.


I guess Linker resets the control's bgcolor as well as text color. How about using a button instead of a link (ButtonEvent plugin)?


I don't think there was much point in starting another thread on this.


As per the client requirement I have to use link only. Could use button instead if it was possible to add image on it.


There's the SkinnedButton plugin but I've never used it and I don't know if it will skin custom buttons too or just the standard ones; in any case, I don't think it can be used to skin a single button.
I think your best course of action would be to take MSG's advice and create a full custom page.


Yeah , I guess so. I just wish Linker plugin issue could be resolved. It would save me a lot of trouble. :/
Well thanks a lot for your help. :)