Commit d888d36e authored by Chris Morgan's avatar Chris Morgan Committed by Alexandre Julliard

Added winebrowser app that launches a Unix browser.

parent 72ecbb06
......@@ -1650,6 +1650,7 @@ programs/uninstaller/Makefile
programs/view/Makefile
programs/wcmd/Makefile
programs/wineboot/Makefile
programs/winebrowser/Makefile
programs/winecfg/Makefile
programs/wineconsole/Makefile
programs/winedbg/Makefile
......
......@@ -22,6 +22,7 @@ SUBDIRS = \
view \
wcmd \
wineboot \
winebrowser \
winecfg \
wineconsole \
winedbg \
......@@ -50,6 +51,7 @@ INSTALLSUBDIRS = \
uninstaller \
wcmd \
wineboot \
winebrowser \
winecfg \
wineconsole \
winedbg \
......@@ -71,6 +73,7 @@ INSTALLPROGS = \
uninstaller \
wcmd \
wineboot \
winebrowser \
winecfg \
wineconsole \
winedbg \
......@@ -99,6 +102,7 @@ SYMLINKS = \
view.exe \
wcmd.exe \
wineboot.exe \
winebrowser.exe \
winecfg.exe \
wineconsole.exe \
winedbg.exe \
......@@ -208,6 +212,9 @@ wcmd.exe$(DLLEXT): wcmd/wcmd.exe$(DLLEXT)
wineboot.exe$(DLLEXT): wineboot/wineboot.exe$(DLLEXT)
$(RM) $@ && $(LN_S) wineboot/wineboot.exe$(DLLEXT) $@
winebrowser.exe$(DLLEXT): winebrowser/winebrowser.exe$(DLLEXT)
$(RM) $@ && $(LN_S) winebrowser/winebrowser.exe$(DLLEXT) $@
winecfg.exe$(DLLEXT): winecfg/winecfg.exe$(DLLEXT)
$(RM) $@ && $(LN_S) winecfg/winecfg.exe$(DLLEXT) $@
......@@ -259,6 +266,7 @@ uninstaller/uninstaller.exe$(DLLEXT): uninstaller
view/view.exe$(DLLEXT): view
wcmd/wcmd.exe$(DLLEXT): wcmd
wineboot/wineboot.exe$(DLLEXT): wineboot
winebrowser/winebrowser.exe$(DLLEXT): winebrowser
winecfg/winecfg.exe$(DLLEXT): winecfg
wineconsole/wineconsole.exe$(DLLEXT): wineconsole
winedbg/winedbg.exe$(DLLEXT): winedbg
......
......@@ -36,6 +36,7 @@ my %bin_install =
"uninstaller" => 1,
"wcmd" => 1,
"wineboot" => 1,
"winebrowser" => 1,
"winecfg" => 1,
"wineconsole" => 1,
"winedbg" => 1,
......
Makefile
winebrowser.exe.dbg.c
winebrowser.exe.spec.c
TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = winebrowser.exe
APPMODE = cui
IMPORTS = shell32 user32 advapi32 kernel32
C_SRCS = \
main.c
@MAKE_PROG_RULES@
### Dependencies:
/*
* winebrowser - winelib app to launch native OS browser
*
* Copyright (C) 2004 Chris Morgan
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* NOTES:
* Winebrowser is a winelib application that will start the appropriate
* native browser up for a wine installation that lacks a windows browser.
* Thus you will be able to open urls via native mozilla if no browser
* has yet been installed in wine.
*/
#include "config.h"
#include "wine/port.h"
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
/*****************************************************************************
* Main entry point. This is a console application so we have a main() not a
* winmain().
*/
int main (int argc, char *argv[])
{
const char *argv_new[3];
DWORD maxLength;
CHAR szBrowsers[256];
DWORD type;
CHAR *defaultBrowsers = "mozilla,netscape,konqueror,galeon,opera";
char *browser;
HKEY hkey;
LONG r;
/* ensure that mozilla or other browsers don't think the */
/* temp directory is "E:\\" */
unsetenv("TEMP");
unsetenv("TMP");
maxLength = sizeof(szBrowsers);
if(RegCreateKeyEx( HKEY_CURRENT_USER,
"Software\\Wine\\WineBrowser", 0, NULL,
REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL,
&hkey, NULL))
{
fprintf( stderr, "winebrowser: cannot create config key\n" );
return 1;
}
r = RegQueryValueExA( hkey, "Browsers", 0, &type, szBrowsers, &maxLength);
if(r != ERROR_SUCCESS)
{
/* set value to the default */
RegSetValueExA(hkey, "Browsers", 0, REG_SZ,
(LPBYTE)defaultBrowsers, lstrlen(defaultBrowsers) + 1);
strcpy( szBrowsers, defaultBrowsers );
}
RegCloseKey(hkey);
/* now go through the list of browsers until we run out or we find one that */
/* works */
browser = strtok(szBrowsers, ",");
while(browser)
{
argv_new[0] = browser;
argv_new[1] = argv[1];
argv_new[2] = NULL;
spawnvp(_P_OVERLAY, browser, argv_new); /* only returns on error */
browser = strtok(NULL, ","); /* grab the next browser */
}
fprintf( stderr, "winebrowser: could not find a browser to run\n" );
return 1;
}
......@@ -145,6 +145,7 @@ function configure_wine_applications {
link_app uninstaller "$CROOT/windows/uninstall.exe"
link_app winhelp "$CROOT/windows/winhelp.exe"
link_app winhelp "$CROOT/windows/winhlp32.exe"
link_app winebrowser "$CROOT/windows/winebrowser.exe"
}
# startup...
......
......@@ -4610,6 +4610,9 @@
[HKEY_CLASSES_ROOT\txtfile\shell\print\command]
@="C:\\WINDOWS\\NOTEPAD.EXE /p %1"
# Map requests to open "http" entries to winebroswer
[HKEY_CLASSES_ROOT\http\shell\open\command]
@="winebrowser %1"
#
# Entries for DirectShow
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment