Commit 9d80b367 authored by Alex Henrie's avatar Alex Henrie Committed by Alexandre Julliard

winemenubuilder: Skip desktop integration for certain associations.

parent fac1aabb
......@@ -1974,6 +1974,46 @@ static BOOL is_extension_banned(LPCWSTR extension)
return FALSE;
}
static BOOL on_exclude_list(const WCHAR *command)
{
static const WCHAR default_exclude_list[] = L"ieframe.dll\0iexplore.exe\0notepad.exe\0"
L"winebrowser.exe\0wordpad.exe\0";
WCHAR *exclude_list = NULL;
const WCHAR *pattern;
HKEY key;
DWORD size;
LSTATUS status;
BOOL found = FALSE;
if ((key = open_associations_reg_key()))
{
status = RegGetValueW(key, NULL, L"Exclude", RRF_RT_REG_MULTI_SZ, NULL, NULL, &size);
if (status == ERROR_SUCCESS)
{
exclude_list = xmalloc(size);
status = RegGetValueW(key, NULL, L"Exclude", RRF_RT_REG_MULTI_SZ, NULL, exclude_list, &size);
if (status != ERROR_SUCCESS)
{
heap_free(exclude_list);
exclude_list = NULL;
}
}
RegCloseKey(key);
}
for (pattern = exclude_list ? exclude_list : default_exclude_list; *pattern; pattern += wcslen(pattern) + 1)
{
if (wcsstr(command, pattern))
{
found = TRUE;
break;
}
}
heap_free(exclude_list);
return found;
}
static WCHAR *get_special_mime_type(LPCWSTR extension)
{
if (!wcsicmp(extension, L".lnk"))
......@@ -2054,6 +2094,15 @@ static BOOL generate_associations(const WCHAR *packages_dir, const WCHAR *applic
WCHAR *mimeProgId = NULL;
struct rb_string_entry *entry;
commandW = assoc_query(ASSOCSTR_COMMAND, extensionW, L"open");
if (commandW == NULL)
/* no command => no application is associated */
goto end;
if (on_exclude_list(commandW))
/* command is on the exclude list => desktop integration is not desirable */
goto end;
wcslwr(extensionW);
friendlyDocNameW = assoc_query(ASSOCSTR_FRIENDLYDOCNAME, extensionW, NULL);
......@@ -2093,11 +2142,6 @@ static BOOL generate_associations(const WCHAR *packages_dir, const WCHAR *applic
hasChanged = TRUE;
}
commandW = assoc_query(ASSOCSTR_COMMAND, extensionW, L"open");
if (commandW == NULL)
/* no command => no application is associated */
goto end;
executableW = assoc_query(ASSOCSTR_EXECUTABLE, extensionW, L"open");
if (executableW)
openWithIcon = compute_native_identifier(0, executableW, NULL);
......
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