Archive: How to open a web-link in a new window?


How to open a web-link in a new window?
Sorry, my English is very very poor.

I want to make a install to open a serious web links.
But they always open at the same window.

Does anyone knows how to open a web links in a new window?

Thank you.


OutFile "NewWindowTest.exe"
Name "NewWindowTest"
XPStyle "on"

Section "-bbo" b2
Sectionin RO
;
SectionEnd

Function ".onInit"
ExecShell "" "http://nsis.sourceforge.net/Docs/"
sleep 1500
ExecShell "" "http://nsis.sourceforge.net/site/Changelog.24.0.html"
sleep 1500
ExecShell "" "http://nsis.sourceforge.net/site/Download.6.0.html"
sleep 1500

Quit
FunctionEnd

use this method

Exec '"explorer" "http://www.xxx.com"'


but it does not works on windows95.


Sorry, my English is very poor.

Originally posted by koder
use this method

Exec '"explorer" "http://www.xxx.com"'

but it does not works on windows95.
Thanks a lot.

It looks like only work for IE.

I changed something, now it should work for "default web browser" fine (only test with Opera, IE, Mozilla & MozillaFirebird).


OutFile "NewWindowTest.exe"
Name "NewWindowTest"
XPStyle "on"

Section "-bbo" b2
Sectionin RO
;
SectionEnd

Function ".onInit"
ReadRegStr $R0 HKCR "http\shell\open\command" ""
StrLen $r1 $r0
IntOP $r2 $r1 - 10
StrCpy $r3 $r0 10 $r2

;this flow control is for Mozilla & MozillaFirebird only.
StrCmp $r3 ' -url "%1"' 0 +2
StrCpy $R0 $R0 $r2

Exec '$r0 http://nsis.sourceforge.net/Docs/'
sleep 1500
Exec '$r0 http://nsis.sourceforge.net/site/Changelog.24.0.html'
sleep 1500
Exec '$r0 http://nsis.sourceforge.net/site/Download.6.0.html'
sleep 1500

Quit
FunctionEnd

That code isn't really compatible with all browsers. To get it really compatible you will have get and parse some registry keys (registry keys can also refer to others etc.).

ExecShell is usually the best solution, but unfortunately it won't open a new window.


Why not? Just use "opennew", I don't know if this is supportable for other browsers, but for Internet Explorer this works. I.e.:

ExecShell "opennew" "http://nsis.sourceforge.net/Docs/"

Originally posted by deguix
Why not? Just use "opennew", I don't know if this is supportable for other browsers, but for Internet Explorer this works. I.e.:

ExecShell "opennew" "http://nsis.sourceforge.net/Docs/"
This method can not work with Mozilla.

ExecShell "opennew" "http://nsis.sourceforge.net/Docs/"
------

is this really works ?

This code does not works on my system (windows xp, ie)


Oppps! Maybe this code doesn't work with online pages, just with offline pages. I did that because I tested it, and I replaced the offline page link with the online one without testing. This WILL work:

ExecShell "opennew" "${NSISDIR}\Contrib\Modern UI\Readme.html"


Yeah, this is not what you want...

I think the one is working is that function from s793016...