2 * Internet Explorer wrapper
4 * Copyright 2006 Mike McCormack
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
26 #include "wine/debug.h"
28 extern DWORD WINAPI
IEWinMain(const WCHAR
*, int);
30 static BOOL
check_native_ie(void)
38 WCHAR file_desc_strW
[48];
40 size
= GetFileVersionInfoSizeW(L
"browseui.dll", &handle
);
44 buf
= HeapAlloc(GetProcessHeap(), 0, size
);
45 GetFileVersionInfoW(L
"browseui.dll", 0, size
,buf
);
46 if (VerQueryValueW(buf
, L
"\\VarFileInfo\\Translation", (void **)&translation
, &bytes
))
48 wsprintfW(file_desc_strW
, L
"\\StringFileInfo\\%04x%04x\\FileDescription", translation
[0], translation
[1]);
49 ret
= !VerQueryValueW(buf
, file_desc_strW
, (void**)&file_desc
, &bytes
) || !wcsstr(file_desc
, L
"Wine");
52 HeapFree(GetProcessHeap(), 0, buf
);
56 static DWORD
register_iexplore(BOOL doregister
)
60 if (check_native_ie()) {
61 WINE_MESSAGE("Native IE detected, not doing registration\n");
65 hres
= RegInstallA(NULL
, doregister
? "RegisterIE" : "UnregisterIE", NULL
);
69 int WINAPI
wWinMain(HINSTANCE hInstance
, HINSTANCE prev
, WCHAR
*cmdline
, int show
)
71 SetProcessDpiAwarenessContext(DPI_AWARENESS_CONTEXT_SYSTEM_AWARE
);
73 if(*cmdline
== '-' || *cmdline
== '/') {
74 if(!wcsicmp(cmdline
+1, L
"regserver"))
75 return register_iexplore(TRUE
);
76 if(!wcsicmp(cmdline
+1, L
"unregserver"))
77 return register_iexplore(FALSE
);
80 return IEWinMain(cmdline
, show
);