Old 20th June 2010, 20:33   #1
markfsi
Junior Member
 
Join Date: Jun 2010
Posts: 2
Add Link to Components Page

I'm attempting to add a link to the "Components Page" but I can't seem to figure it out.

Similar to this example:
http://nsis.sourceforge.net/Add_link...page_%28MUI%29

But this example pertains to the "Welcome Page"

Any help would be appreciated.

Thanks!
markfsi is offline   Reply With Quote
Old 21st June 2010, 03:42   #2
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,892
That example assumes you're using MUI1. If you're using MUI2, you can add a link control for example through editing the appriopriate header file in NSIS\Contrib\Modern UI 2.
MSG is offline   Reply With Quote
Old 21st June 2010, 05:00   #3
markfsi
Junior Member
 
Join Date: Jun 2010
Posts: 2
Ok, thanks.

I found a solution, I just used reshacker, seemed to work.
markfsi is offline   Reply With Quote
Old 21st June 2010, 10:56   #4
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Using Resource Hacker with Linker should be the only way. The components page does not use nsDialogs.

Stu
Afrow UK is offline   Reply With Quote
Old 23rd June 2010, 03:02   #5
jiake
Senior Member
 
jiake's Avatar
 
Join Date: Oct 2007
Location: Shanghai, China
Posts: 207
You may use the System plugin to create one:
Before creating, first you should get the position of another control and calculate a position using the gotten coordinate for the new control.

FindWindow $0 "#32770" "" $HWNDPARENT
GetDlgItem $1 $0 control_id
!insertmacro GetDlgItemRect $1 $2 $3 $4 $0 $1
IntOp $2 $2 + 15
!insertmacro CreateLinker "View my site" $1 $2 50 8 $0 1600 "http://xxx.xxx.xxx/"

Maybe you would destroy some control and put yours there:
GetDlgItem $1 $0 control_id
System::Call 'User32::DestroyWindow(i r1)'

Some macro written by bluenet:

ButtonLinker plugin is a joint one with the ButtonEvent and the Linker plugin.
In the following macro, you may replace it with the linker plugin.
http://nsis.sourceforge.net/ButtonEvent_plug-in
http://nsis.sourceforge.net/Linker_plug-in

PHP Code:
!macro GetDlgItemRect OUT_LEFT OUT_TOP OUT_RIGHT OUT_BOTTOM HWNDDLG HWNDCTL
    Push 
${HWNDCTL}
    
Push ${HWNDDLG}
    
Exch $R0 ;HWND
    Exch
    Exch $R1 
;handle of control
    Push $R2
    System
::Call /NOUNLOAD "*(i, i, t, i, i, i, i, i, i, i, i) i.s"
    
Pop $R2
    System
::Call /NOUNLOAD 'User32::GetWindowRect(i, i) i (R1, R2)'
    
System::Call /NOUNLOAD 'User32::ScreenToClient(i, i) i (R0, R2)'
    
IntOp $R1 $R2 ;sizeof(LPPOINT)*8
    System
::Call /NOUNLOAD 'User32::ScreenToClient(i, i) i (R0, R1)'
    
Exch 2
    Pop $R0
    Pop $R1
    System
::Call /NOUNLOAD "*$R2(i .s, i .s, i .s, i .s)"
    
System::Free $R2
    Exch 4
    Pop $R2
    Pop 
${OUT_TOP}
    
Pop ${OUT_RIGHT}
    
Pop ${OUT_BOTTOM}
    
Pop ${OUT_LEFT}
!
macroend 
PHP Code:
!macro CreateLinker TEXT LEFT TOP WIDTH HEIGHT HWNDPARENT CTLID LINKADD
    System
::Call /NOUNLOAD 'Kernel32::GetModuleHandle(t) i (0) .s'
    
;Style WS_CHILD WS_VISIBLE WS_CLIPSIBLINGS
    System
::Call 'User32::CreateWindowEx(i,t,t,i,i,i,i,i,i,i,i,v) i (0,"STATIC","${TEXT}",0x54000000,${LEFT},${TOP},${WIDTH},${HEIGHT},${HWNDPARENT},${CTLID},s,0) .s'
    
Exch $R0
    Push $R1
    CreateFont $R1 
$(^Font) $(^FontSize)
    
SendMessage $R0 ${WM_SETFONT$R1 0
    GetDlgItem $R2 
${HWNDPARENT} ${CTLID}
    
ButtonLinker::CreateLinker /NOUNLOAD $R2 ${LINKADD}
    
Pop $R2
    Pop $R1
    Pop $R0
!macroend 
jiake is offline   Reply With Quote
Old 23rd June 2010, 03:25   #6
jiake
Senior Member
 
jiake's Avatar
 
Join Date: Oct 2007
Location: Shanghai, China
Posts: 207
I write an example. It destroy the "Space Required" text on components page and create a link there.
This example needs the "Linker" plugin. If you don't have this plugin, download it yourself first.
http://nsis.sourceforge.net/Linker_plug-in
Attached Files
File Type: nsi components.nsi (2.2 KB, 246 views)

Last edited by jiake; 23rd June 2010 at 06:01.
jiake is offline   Reply With Quote
Old 4th August 2010, 16:34   #7
theaskingman
Junior Member
 
Join Date: Jul 2010
Posts: 16
hi,
I need exactly this for my MUI2 Installation.
Unfortunalety, your example isn't working on my system ("go to google" is shown, but nothing happens when I click on it)
Windows Vista, latest nsis installation, linker 1.1 plugin
theaskingman is offline   Reply With Quote
Old 10th October 2010, 07:53   #8
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,892
The zip with version 1.1 of the linker plug-in is no longer online, and I can't find it with google. Could someone please recompile and reupload it, preferably directly into the wiki this time?
http://nsis.sourceforge.net/Linker_plug-in


Edit: Or maybe someone still has v1.1 lying around and can upload it?
MSG is offline   Reply With Quote
Old 12th August 2013, 09:10   #9
tony18
Junior Member
 
Join Date: Feb 2013
Posts: 7
Thanx a lot, Jiake!
Would you please add an example with a button instead of link?
Many thanks.
tony18 is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump