- NSIS Discussion
- Editing License page text
Archive: Editing License page text
miraz.zaidi
22nd May 2013 13:11 UTC
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.
MSG
22nd May 2013 13:26 UTC
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.
miraz.zaidi
23rd May 2013 10:09 UTC
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.
aerDNA
23rd May 2013 11:25 UTC
My guess is that you used Linker without /NOUNLOAD.
miraz.zaidi
23rd May 2013 13:04 UTC
@aerDNA It still crashes.
aerDNA
23rd May 2013 13:58 UTC
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
miraz.zaidi
23rd May 2013 14:39 UTC
@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.
aerDNA
23rd May 2013 17:09 UTC
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"
miraz.zaidi
24th May 2013 07:03 UTC
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?
aerDNA
24th May 2013 09:42 UTC
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"
miraz.zaidi
24th May 2013 11:04 UTC
Doing this causes the installer to crash.
aerDNA
24th May 2013 11:35 UTC
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.
miraz.zaidi
24th May 2013 12:15 UTC
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
aerDNA
24th May 2013 12:21 UTC
Apply transparency before using Linker, not after.
miraz.zaidi
24th May 2013 12:29 UTC
In that case it doesn't work.
aerDNA
24th May 2013 13:29 UTC
I guess Linker resets the control's bgcolor as well as text color. How about using a button instead of a link (ButtonEvent plugin)?
aerDNA
24th May 2013 13:49 UTC
I don't think there was much point in starting another thread on this.
miraz.zaidi
24th May 2013 13:56 UTC
As per the client requirement I have to use link only. Could use button instead if it was possible to add image on it.
aerDNA
24th May 2013 14:45 UTC
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.
miraz.zaidi
24th May 2013 14:52 UTC
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. :)