s793016
24th January 2004 02:06 UTC
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
koder
24th January 2004 14:44 UTC
use this method
Exec '"explorer" "http://www.xxx.com"'
but it does not works on windows95.
s793016
24th January 2004 15:58 UTC
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
Joost Verburg
24th January 2004 22:44 UTC
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.
deguix
25th January 2004 03:24 UTC
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/"
s793016
25th January 2004 06:36 UTC
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.
koder
25th January 2004 08:18 UTC
ExecShell "opennew" "http://nsis.sourceforge.net/Docs/"
------
is this really works ?
This code does not works on my system (windows xp, ie)
deguix
25th January 2004 11:01 UTC
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...