diff --git a/dlls/mshtml/nsembed.c b/dlls/mshtml/nsembed.c
index 452be8b..2f77370 100644
--- a/dlls/mshtml/nsembed.c
+++ b/dlls/mshtml/nsembed.c
@@ -165,7 +165,7 @@ static BOOL load_xpcom(PRUnichar *gre_path)
return TRUE;
}
-static void check_version(LPCWSTR gre_path)
+static BOOL check_version(LPCWSTR gre_path)
{
WCHAR file_name[MAX_PATH];
char version[128];
@@ -181,15 +181,16 @@ static void check_version(LPCWSTR gre_path)
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if(hfile == INVALID_HANDLE_VALUE) {
TRACE("unknown version\n");
- return;
+ return FALSE;
}
ReadFile(hfile, version, sizeof(version), &read, NULL);
version[read] = 0;
+ CloseHandle(hfile);
TRACE("%s\n", debugstr_a(version));
- CloseHandle(hfile);
+ return !strcmp(version, GECKO_VERSION_STRING);
}
static BOOL load_wine_gecko(PRUnichar *gre_path)
@@ -212,8 +213,10 @@ static BOOL load_wine_gecko(PRUnichar *gre_path)
if(res != ERROR_SUCCESS || type != REG_SZ)
return FALSE;
- if(TRACE_ON(mshtml))
- check_version(gre_path);
+ /* We may consider message box here */
+ if(ERR_ON(mshtml) && !check_version(gre_path))
+ MESSAGE("Found a version of Wine Gecko package that is not dedicated "
+ "to your Wine version. Reinstalation is recommended.\n");
return load_xpcom(gre_path);
}