use shellexecute() for urls on windows

git-svn-id: file:///home/svn/framework3/trunk@5333 4d416f70-5f16-0410-b530-b9f4589650da
This commit is contained in:
HD Moore 2008-01-24 04:03:10 +00:00
parent af9999bb73
commit 8b321341b9
1 changed files with 6 additions and 2 deletions

View File

@ -49,7 +49,9 @@ end
def self.open_browser(url='http://metasploit.com/')
case RUBY_PLATFORM
when /mswin32/
system("start #{url}")
@s32 ||= DL.dlopen("shell32.dll")
se = @s32['ShellExecute', 'LPPPPPL')
se.call(nil, "open".to_s, url, nil, nil, 0)
when /darwin/
system("open #{url}")
else
@ -60,7 +62,9 @@ end
def self.open_email(addr)
case RUBY_PLATFORM
when /mswin32/
system("start mailto:#{addr}")
@s32 ||= DL.dlopen("shell32.dll")
se = @s32['ShellExecute', 'LPPPPPL')
se.call(nil, "open".to_s, url, nil, nil, 0)
when /darwin/
system("open mailto:#{addr}")
else