Alexandre Julliard wrote:
The idea would be that there should be an easy way to uninstall it, so if Gecko is installed the app will try to use that, and if it doesn't work we can tell users to uninstall Gecko and let the app install IE instead. Ultimately of course the goal is that they never need to do that.
How about the attached patch? It adds registration code to iexplore.exe, so user may run $ wine iexplore -unregserver or even better, just for sure: $ WINEDLLOVERRIDES=shdocvw,iexplore.exe=b wine iexplore -unregserver to unregister iexplore. It would be wine specific as native doesn't support self registration in iexplore.exe. An other option would be to put a separate section in wine.inf so user could run rundll32 to unregister it, but IMO it is worse due to complexity of the command.
Thanks, Jacek
From 9076a5c4074f5db5ee2577bce5c6c615478e9e61 Mon Sep 17 00:00:00 2001
From: Jacek Caban jacek@codeweavers.com Date: Fri, 2 Nov 2007 16:19:28 +0100 Subject: [PATCH] iexplore: Added self-registration code. To: wine-patches wine-patches@winehq.org <S-Insert>
--- dlls/shdocvw/factory.c | 34 +++++++++++++++++++++++++--------- dlls/shdocvw/iexplore.c | 9 ++++++++- dlls/shdocvw/shdocvw.h | 1 + dlls/shdocvw/shdocvw.inf | 12 ++++++++++++ tools/wine.inf | 1 + 5 files changed, 47 insertions(+), 10 deletions(-)
diff --git a/dlls/shdocvw/factory.c b/dlls/shdocvw/factory.c index ad4330a..2ed62e6 100644 --- a/dlls/shdocvw/factory.c +++ b/dlls/shdocvw/factory.c @@ -172,6 +172,23 @@ HRESULT register_class_object(BOOL do_reg) return CoRevokeClassObject(cookie); }
+static HRESULT reg_install(LPCSTR section, STRTABLEA *strtable) +{ + typeof(RegInstallA) *pRegInstall; + HMODULE hadvpack; + HRESULT hres; + + static const WCHAR advpackW[] = {'a','d','v','p','a','c','k','.','d','l','l',0}; + + hadvpack = LoadLibraryW(advpackW); + pRegInstall = (typeof(RegInstallA)*)GetProcAddress(hadvpack, "RegInstall"); + + hres = pRegInstall(shdocvw_hinstance, section, strtable); + + FreeLibrary(hadvpack); + return hres; +} + static const GUID CLSID_MicrosoftBrowserArchitecture = {0xa5e46e3a, 0x8849, 0x11d1, {0x9d, 0x8c, 0x00, 0xc0, 0x4f, 0xc9, 0x9d, 0x61}}; static const GUID CLSID_MruLongList = @@ -188,15 +205,11 @@ static const GUID CLSID_MruLongList =
static HRESULT register_server(BOOL doregister) { - HRESULT hres; - HMODULE hAdvpack; - typeof(RegInstallA) *pRegInstall; STRTABLEA strtable; STRENTRYA pse[13]; static CLSID const *clsids[13]; int i = 0; - - static const WCHAR wszAdvpack[] = {'a','d','v','p','a','c','k','.','d','l','l',0}; + HRESULT hres;
INF_SET_CLSID(CUrlHistory); INF_SET_CLSID(Internet); @@ -223,10 +236,7 @@ static HRESULT register_server(BOOL doregister) strtable.cEntries = sizeof(pse)/sizeof(pse[0]); strtable.pse = pse;
- hAdvpack = LoadLibraryW(wszAdvpack); - pRegInstall = (typeof(RegInstallA)*)GetProcAddress(hAdvpack, "RegInstall"); - - hres = pRegInstall(shdocvw_hinstance, doregister ? "RegisterDll" : "UnregisterDll", &strtable); + hres = reg_install(doregister ? "RegisterDll" : "UnregisterDll", &strtable);
for(i=0; i < sizeof(pse)/sizeof(pse[0]); i++) HeapFree(GetProcessHeap(), 0, pse[i].pszValue); @@ -274,3 +284,9 @@ HRESULT WINAPI DllUnregisterServer(void)
return UnRegisterTypeLib(&LIBID_SHDocVw, 1, 1, LOCALE_SYSTEM_DEFAULT, SYS_WIN32); } + +DWORD register_iexplore(BOOL doregister) +{ + HRESULT hres = reg_install(doregister ? "RegisterIE" : "UnregisterIE", NULL); + return !SUCCEEDED(hres); +} diff --git a/dlls/shdocvw/iexplore.c b/dlls/shdocvw/iexplore.c index adcaeee..c8fa61d 100644 --- a/dlls/shdocvw/iexplore.c +++ b/dlls/shdocvw/iexplore.c @@ -192,7 +192,14 @@ DWORD WINAPI IEWinMain(LPSTR szCommandLine, int nShowWindow) MSG msg; HRESULT hres;
- FIXME("%s %d\n", debugstr_a(szCommandLine), nShowWindow); + TRACE("%s %d\n", debugstr_a(szCommandLine), nShowWindow); + + if(*szCommandLine == '-' || *szCommandLine == '/') { + if(!strcasecmp(szCommandLine+1, "regserver")) + return register_iexplore(TRUE); + if(!strcasecmp(szCommandLine+1, "unregserver")) + return register_iexplore(FALSE); + }
CoInitialize(NULL);
diff --git a/dlls/shdocvw/shdocvw.h b/dlls/shdocvw/shdocvw.h index db47b63..0b048eb 100644 --- a/dlls/shdocvw/shdocvw.h +++ b/dlls/shdocvw/shdocvw.h @@ -222,6 +222,7 @@ extern void unregister_iewindow_class(void);
HRESULT register_class_object(BOOL); HRESULT get_typeinfo(ITypeInfo**); +DWORD register_iexplore(BOOL);
/* memory allocation functions */
diff --git a/dlls/shdocvw/shdocvw.inf b/dlls/shdocvw/shdocvw.inf index 0cb6498..91de9ee 100644 --- a/dlls/shdocvw/shdocvw.inf +++ b/dlls/shdocvw/shdocvw.inf @@ -10,6 +10,14 @@ AddReg=Classes.Reg DelReg=Classes.Reg
+[RegisterIE] +AddReg=IE.Reg + + +[UnregisterIE] +DelReg=IE.Reg + + [Classes.Reg] HKCR,"CLSID%CLSID_InternetExplorer%",,,"Internet Explorer(Ver 1.0)" HKCR,"CLSID%CLSID_InternetExplorer%\LocalServer32",,,"iexplore.exe" @@ -101,5 +109,9 @@ HKCR,"Shell.Explorer.1",,,"" HKCR,"Shell.Explorer.1\CLSID",,,"%CLSID_WebBrowser_V1%"
+[IE.Reg] +HKLM,"Software\Microsoft\Internet Explorer","Version",,"6.0.2900.2180" + + [Strings] MODULE="shdocvw.dll" diff --git a/tools/wine.inf b/tools/wine.inf index e6f3dbd..fdb47b9 100644 --- a/tools/wine.inf +++ b/tools/wine.inf @@ -2174,6 +2174,7 @@ HKLM,%CurrentVersion%\Telephony\Country List\998,"SameAreaRule",,"G" 11,,dxdiagn.dll,1 11,,hhctrl.ocx,1 11,,hlink.dll,1 +11,,iexplore.exe,1 11,,infosoft.dll,1 11,,inseng.dll,1 11,,itss.dll,1