Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=41275 Signed-off-by: Alex Henrie alexhenrie24@gmail.com --- loader/wine.inf.in | 6 +++ programs/winemenubuilder/winemenubuilder.c | 43 +++++++++++++++++++--- 2 files changed, 44 insertions(+), 5 deletions(-)
diff --git a/loader/wine.inf.in b/loader/wine.inf.in index 49f45e6eed3..75c22288547 100644 --- a/loader/wine.inf.in +++ b/loader/wine.inf.in @@ -507,6 +507,12 @@ HKCR,MIME\Database\Charset\us-ascii,"AliasForCharset",,iso-8859-1 HKCR,MIME\Database\Charset\visual,"AliasForCharset",,iso-8859-8 HKCR,MIME\Database\Charset\Windows-1254,"AliasForCharset",,iso-8859-9
+HKCU,Software\Wine\FileOpenNoIntegration,"ieframe",,"ieframe.dll" +HKCU,Software\Wine\FileOpenNoIntegration,"iexplore",,"iexplore.exe" +HKCU,Software\Wine\FileOpenNoIntegration,"notepad",,"notepad.exe" +HKCU,Software\Wine\FileOpenNoIntegration,"winebrowser",,"winebrowser.exe" +HKCU,Software\Wine\FileOpenNoIntegration,"wordpad",,"wordpad.exe" + [ContentIndex] HKLM,System\CurrentControlSet\Control\ContentIndex\Language\Neutral,"WBreakerClass",,"{369647e0-17b0-11ce-9950-00aa004bbb1f}" HKLM,System\CurrentControlSet\Control\ContentIndex\Language\Neutral,"StemmerClass",,"" diff --git a/programs/winemenubuilder/winemenubuilder.c b/programs/winemenubuilder/winemenubuilder.c index 16dc32a8859..a88cec1d76c 100644 --- a/programs/winemenubuilder/winemenubuilder.c +++ b/programs/winemenubuilder/winemenubuilder.c @@ -1956,6 +1956,35 @@ static BOOL is_extension_banned(LPCWSTR extension) return FALSE; }
+static BOOL on_exclude_list(const WCHAR *command) +{ + static const WCHAR FileOpenNoIntegrationW[] = L"Software\Wine\FileOpenNoIntegration"; + HKEY key; + WCHAR program_name[MAX_PATH], *pattern_to_exclude; + DWORD len = ARRAY_SIZE(program_name); + DWORD i = 0; + + if (RegOpenKeyExW(HKEY_CURRENT_USER, FileOpenNoIntegrationW, 0, KEY_QUERY_VALUE, &key) != ERROR_SUCCESS) + return FALSE; + + while (RegEnumValueW(key, i, program_name, &len, NULL, NULL, NULL, NULL) == ERROR_SUCCESS) + { + pattern_to_exclude = reg_get_valW(HKEY_CURRENT_USER, FileOpenNoIntegrationW, program_name); + if (wcsstr(command, pattern_to_exclude)) + { + heap_free(pattern_to_exclude); + RegCloseKey(key); + return TRUE; + } + heap_free(pattern_to_exclude); + len = ARRAY_SIZE(program_name); + i++; + } + + RegCloseKey(key); + return FALSE; +} + static WCHAR *get_special_mime_type(LPCWSTR extension) { if (!wcsicmp(extension, L".lnk")) @@ -2036,6 +2065,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);
@@ -2075,11 +2113,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);