Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
d795c283
Commit
d795c283
authored
Jun 06, 2007
by
Jacek Caban
Committed by
Alexandre Julliard
Jun 07, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Added support for coexisting different Gecko versions installation.
parent
6ee356fc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
89 additions
and
25 deletions
+89
-25
install.c
dlls/mshtml/install.c
+41
-11
nsembed.c
dlls/mshtml/nsembed.c
+45
-14
nsiface.idl
dlls/mshtml/nsiface.idl
+3
-0
No files found.
dlls/mshtml/install.c
View file @
d795c283
...
...
@@ -31,6 +31,8 @@
#include "ole2.h"
#include "commctrl.h"
#include "advpub.h"
#include "wininet.h"
#include "shellapi.h"
#include "wine/debug.h"
#include "wine/unicode.h"
...
...
@@ -76,20 +78,26 @@ static void set_status(DWORD id)
static
void
set_registry
(
LPCSTR
install_dir
)
{
WCHAR
mshtml_key
[
100
];
LPWSTR
gecko_path
;
HKEY
hkey
;
DWORD
res
,
len
,
size
;
static
const
WCHAR
wszMshtmlKey
[]
=
{
'S'
,
'o'
,
'f'
,
't'
,
'w'
,
'a'
,
'r'
,
'e'
,
'\\'
,
'W'
,
'i'
,
'n'
,
'e'
,
'\\'
,
'M'
,
'S'
,
'H'
,
'T'
,
'M'
,
'L'
,
0
};
'\\'
,
'M'
,
'S'
,
'H'
,
'T'
,
'M'
,
'L'
,
'\\'
};
static
const
WCHAR
wszGeckoPath
[]
=
{
'G'
,
'e'
,
'c'
,
'k'
,
'o'
,
'P'
,
'a'
,
't'
,
'h'
,
0
};
static
const
WCHAR
wszWineGecko
[]
=
{
'w'
,
'i'
,
'n'
,
'e'
,
'_'
,
'g'
,
'e'
,
'c'
,
'k'
,
'o'
,
0
};
/* @@ Wine registry key: HKCU\Software\Wine\MSHTML */
res
=
RegOpenKeyW
(
HKEY_CURRENT_USER
,
wszMshtmlKey
,
&
hkey
);
memcpy
(
mshtml_key
,
wszMshtmlKey
,
sizeof
(
wszMshtmlKey
));
MultiByteToWideChar
(
CP_ACP
,
0
,
GECKO_VERSION
,
sizeof
(
GECKO_VERSION
),
mshtml_key
+
sizeof
(
wszMshtmlKey
)
/
sizeof
(
WCHAR
),
(
sizeof
(
mshtml_key
)
-
sizeof
(
wszMshtmlKey
))
/
sizeof
(
WCHAR
));
/* @@ Wine registry key: HKCU\Software\Wine\MSHTML\<version> */
res
=
RegCreateKeyW
(
HKEY_CURRENT_USER
,
mshtml_key
,
&
hkey
);
if
(
res
!=
ERROR_SUCCESS
)
{
ERR
(
"Faild to
open
MSHTML key: %d
\n
"
,
res
);
ERR
(
"Faild to
create
MSHTML key: %d
\n
"
,
res
);
return
;
}
...
...
@@ -189,8 +197,9 @@ static HRESULT WINAPI InstallCallback_OnStopBinding(IBindStatusCallback *iface,
LPSTR
file_name
;
DWORD
len
;
HMODULE
advpack
;
char
program_files
[
MAX_PATH
];
char
install_dir
[
MAX_PATH
];
typeof
(
ExtractFilesA
)
*
pExtractFilesA
;
BOOL
res
;
HRESULT
hres
;
static
const
WCHAR
wszAdvpack
[]
=
{
'a'
,
'd'
,
'v'
,
'p'
,
'a'
,
'c'
,
'k'
,
'.'
,
'd'
,
'l'
,
'l'
,
0
};
...
...
@@ -206,6 +215,21 @@ static HRESULT WINAPI InstallCallback_OnStopBinding(IBindStatusCallback *iface,
set_status
(
IDS_INSTALLING
);
GetWindowsDirectoryA
(
install_dir
,
sizeof
(
install_dir
));
strcat
(
install_dir
,
"
\\
gecko
\\
"
);
res
=
CreateDirectoryA
(
install_dir
,
NULL
);
if
(
!
res
&&
GetLastError
()
!=
ERROR_ALREADY_EXISTS
)
{
ERR
(
"Could not create directory: %08u
\n
"
,
GetLastError
());
return
S_OK
;
}
strcat
(
install_dir
,
GECKO_VERSION
);
res
=
CreateDirectoryA
(
install_dir
,
NULL
);
if
(
!
res
&&
GetLastError
()
!=
ERROR_ALREADY_EXISTS
)
{
ERR
(
"Could not create directory: %08u
\n
"
,
GetLastError
());
return
S_OK
;
}
advpack
=
LoadLibraryW
(
wszAdvpack
);
pExtractFilesA
=
(
typeof
(
ExtractFilesA
)
*
)
GetProcAddress
(
advpack
,
"ExtractFiles"
);
...
...
@@ -213,10 +237,8 @@ static HRESULT WINAPI InstallCallback_OnStopBinding(IBindStatusCallback *iface,
file_name
=
mshtml_alloc
(
len
);
WideCharToMultiByte
(
CP_ACP
,
0
,
tmp_file_name
,
-
1
,
file_name
,
-
1
,
NULL
,
NULL
);
GetEnvironmentVariableA
(
"ProgramFiles"
,
program_files
,
sizeof
(
program_files
));
/* FIXME: Use unicode version (not yet implemented) */
hres
=
pExtractFilesA
(
file_name
,
program_files
,
0
,
NULL
,
NULL
,
0
);
hres
=
pExtractFilesA
(
file_name
,
install_dir
,
0
,
NULL
,
NULL
,
0
);
FreeLibrary
(
advpack
);
mshtml_free
(
file_name
);
if
(
FAILED
(
hres
))
{
...
...
@@ -224,7 +246,7 @@ static HRESULT WINAPI InstallCallback_OnStopBinding(IBindStatusCallback *iface,
clean_up
();
}
set_registry
(
program_files
);
set_registry
(
install_dir
);
clean_up
();
return
S_OK
;
...
...
@@ -283,13 +305,15 @@ static LPWSTR get_url(void)
{
HKEY
hkey
;
DWORD
res
,
type
;
DWORD
size
=
512
*
sizeof
(
WCHAR
);
DWORD
size
=
INTERNET_MAX_URL_LENGTH
*
sizeof
(
WCHAR
);
LPWSTR
url
;
static
const
WCHAR
wszMshtmlKey
[]
=
{
'S'
,
'o'
,
'f'
,
't'
,
'w'
,
'a'
,
'r'
,
'e'
,
'\\'
,
'W'
,
'i'
,
'n'
,
'e'
,
'\\'
,
'M'
,
'S'
,
'H'
,
'T'
,
'M'
,
'L'
,
0
};
static
const
WCHAR
wszGeckoUrl
[]
=
{
'G'
,
'e'
,
'c'
,
'k'
,
'o'
,
'U'
,
'r'
,
'l'
,
0
};
static
const
WCHAR
httpW
[]
=
{
'h'
,
't'
,
't'
,
'p'
};
static
const
WCHAR
v_formatW
[]
=
{
'?'
,
'v'
,
'='
,
0
};
/* @@ Wine registry key: HKCU\Software\Wine\MSHTML */
res
=
RegOpenKeyW
(
HKEY_CURRENT_USER
,
wszMshtmlKey
,
&
hkey
);
...
...
@@ -305,6 +329,12 @@ static LPWSTR get_url(void)
return
NULL
;
}
if
(
size
>
sizeof
(
httpW
)
&&
!
memcmp
(
url
,
httpW
,
sizeof
(
httpW
)))
{
strcatW
(
url
,
v_formatW
);
MultiByteToWideChar
(
CP_ACP
,
0
,
GECKO_VERSION
,
-
1
,
url
+
strlenW
(
url
),
-
1
);
}
TRACE
(
"Got URL %s
\n
"
,
debugstr_w
(
url
));
return
url
;
}
...
...
@@ -369,7 +399,7 @@ BOOL install_wine_gecko(void)
WaitForSingleObject
(
hsem
,
INFINITE
);
}
else
{
if
((
url
=
get_url
()))
DialogBoxW
(
hInst
,
MAKEINTRESOURCEW
(
ID_DWL_DIALOG
),
0
,
installer_proc
);
DialogBoxW
(
hInst
,
MAKEINTRESOURCEW
(
ID_DWL_DIALOG
),
0
,
installer_proc
);
}
ReleaseSemaphore
(
hsem
,
1
,
NULL
);
...
...
dlls/mshtml/nsembed.c
View file @
d795c283
...
...
@@ -165,7 +165,7 @@ static BOOL load_xpcom(const PRUnichar *gre_path)
return
TRUE
;
}
static
void
check_version
(
LPCWSTR
gre_path
)
static
BOOL
check_version
(
LPCWSTR
gre_path
,
const
char
*
version_string
)
{
WCHAR
file_name
[
MAX_PATH
];
char
version
[
128
];
...
...
@@ -180,42 +180,73 @@ static void check_version(LPCWSTR gre_path)
hfile
=
CreateFileW
(
file_name
,
GENERIC_READ
,
FILE_SHARE_READ
,
NULL
,
OPEN_EXISTING
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
if
(
hfile
==
INVALID_HANDLE_VALUE
)
{
TRACE
(
"unknown version
\n
"
);
return
;
ERR
(
"Could not open VERSION file
\n
"
);
return
FALSE
;
}
ReadFile
(
hfile
,
version
,
sizeof
(
version
),
&
read
,
NULL
);
version
[
read
]
=
0
;
CloseHandle
(
hfile
);
TRACE
(
"%s
\n
"
,
debugstr_a
(
version
));
CloseHandle
(
hfile
);
if
(
strcmp
(
version
,
version_string
))
{
ERR
(
"Unexpected version %s, expected %s
\n
"
,
debugstr_a
(
version
),
debugstr_a
(
version_string
));
return
FALSE
;
}
return
TRUE
;
}
static
BOOL
load_wine_gecko_v
(
PRUnichar
*
gre_path
,
HKEY
mshtml_key
,
const
char
*
version
,
const
char
*
version_string
)
{
DWORD
res
,
type
,
size
=
MAX_PATH
;
HKEY
hkey
=
mshtml_key
;
static
const
WCHAR
wszGeckoPath
[]
=
{
'G'
,
'e'
,
'c'
,
'k'
,
'o'
,
'P'
,
'a'
,
't'
,
'h'
,
0
};
if
(
version
)
{
/* @@ Wine registry key: HKCU\Software\Wine\MSHTML\<version> */
res
=
RegOpenKeyA
(
mshtml_key
,
version
,
&
hkey
);
if
(
res
!=
ERROR_SUCCESS
)
return
FALSE
;
}
res
=
RegQueryValueExW
(
hkey
,
wszGeckoPath
,
NULL
,
&
type
,
(
LPBYTE
)
gre_path
,
&
size
);
if
(
hkey
!=
mshtml_key
)
RegCloseKey
(
hkey
);
if
(
res
!=
ERROR_SUCCESS
||
type
!=
REG_SZ
)
return
FALSE
;
if
(
!
check_version
(
gre_path
,
version_string
))
return
FALSE
;
return
load_xpcom
(
gre_path
);
}
static
BOOL
load_wine_gecko
(
PRUnichar
*
gre_path
)
{
HKEY
hkey
;
DWORD
res
,
type
,
size
=
MAX_PATH
;
DWORD
res
;
BOOL
ret
;
static
const
WCHAR
wszMshtmlKey
[]
=
{
'S'
,
'o'
,
'f'
,
't'
,
'w'
,
'a'
,
'r'
,
'e'
,
'\\'
,
'W'
,
'i'
,
'n'
,
'e'
,
'\\'
,
'M'
,
'S'
,
'H'
,
'T'
,
'M'
,
'L'
,
0
};
static
const
WCHAR
wszGeckoPath
[]
=
{
'G'
,
'e'
,
'c'
,
'k'
,
'o'
,
'P'
,
'a'
,
't'
,
'h'
,
0
};
/* @@ Wine registry key: HKCU\Software\Wine\MSHTML */
res
=
RegOpenKeyW
(
HKEY_CURRENT_USER
,
wszMshtmlKey
,
&
hkey
);
if
(
res
!=
ERROR_SUCCESS
)
return
FALSE
;
res
=
RegQueryValueExW
(
hkey
,
wszGeckoPath
,
NULL
,
&
type
,
(
LPBYTE
)
gre_path
,
&
size
);
if
(
res
!=
ERROR_SUCCESS
||
type
!=
REG_SZ
)
return
FALSE
;
if
(
TRACE_ON
(
mshtml
))
check_version
(
gre_path
);
ret
=
load_wine_gecko_v
(
gre_path
,
hkey
,
GECKO_VERSION
,
GECKO_VERSION_STRING
)
||
load_wine_gecko_v
(
gre_path
,
hkey
,
NULL
,
"Wine Gecko 0.0.1
\n
"
);
return
load_xpcom
(
gre_path
);
RegCloseKey
(
hkey
);
return
ret
;
}
static
void
set_profile
(
void
)
...
...
dlls/mshtml/nsiface.idl
View file @
d795c283
...
...
@@ -23,6 +23,9 @@
*
useable
in
C
code
.
*/
cpp_quote
(
"#define GECKO_VERSION \"
0.0.1
\
""
)
;
cpp_quote
(
"#define GECKO_VERSION_STRING \"
Wine
Gecko
\
" GECKO_VERSION \"
\
n
\
""
)
;
import
"wtypes.idl"
;
typedef
HRESULT
nsresult
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment