The big change here is rewriting the patches to avoid the term "blacklist", which I have replaced with "naughty list". I like "naughty list" and "nice list" because (thanks to Santa Claus) they are already familiar to English speakers, much like the words "needle" and "haystack" that have become accepted technical terms due to the popular expression "it's like finding a needle in a haystack".
Alex Henrie (2): ntdll: Add RtlGetElementGenericTable stub ntdll: Add RtlLookupElementGenericTable stub
dlls/ntdll/ntdll.spec | 4 ++-- dlls/ntdll/rtl.c | 18 ++++++++++++++++++ dlls/ntoskrnl.exe/ntoskrnl.exe.spec | 4 ++-- 3 files changed, 22 insertions(+), 4 deletions(-)
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=41275 Signed-off-by: Alex Henrie alexhenrie24@gmail.com --- dlls/mshtml/mshtml.inf | 6 +++ loader/wine.inf.in | 10 +++++ programs/winemenubuilder/winemenubuilder.c | 50 +++++++++++++++++++--- 3 files changed, 61 insertions(+), 5 deletions(-)
diff --git a/dlls/mshtml/mshtml.inf b/dlls/mshtml/mshtml.inf index 4a650b444f..86260590f6 100644 --- a/dlls/mshtml/mshtml.inf +++ b/dlls/mshtml/mshtml.inf @@ -111,6 +111,7 @@ HKCR,"giffile\shell\open\ddeexec",,,"""file:%%1"",,-1,,,,," HKCR,"giffile\shell\open\ddeexec\Application",,,"IExplore" HKCR,"giffile\shell\open\ddeexec\Topic",,,"WWW_OpenURL" ;; HKCR,"giffile\DefaultIcon",,,"%16422%\Internet Explorer\iexplore.exe,9" +HKCU,Software\Wine\FileOpenNaughtyList.gif,"iexplore",,"""%16422%\Internet Explorer\iexplore.exe"" -nohome"
;; GZIP HKCR,"MIME\Database\Content Type\application/x-gzip","Extension",,".gz" @@ -158,6 +159,7 @@ HKCR,"jpegfile\shell\open\ddeexec",,,"""file:%%1"",,-1,,,,," HKCR,"jpegfile\shell\open\ddeexec\Application",,,"IExplore" HKCR,"jpegfile\shell\open\ddeexec\Topic",,,"WWW_OpenURL" ;; HKCR,"jpegfile\DefaultIcon",,,"%16422%\Internet Explorer\iexplore.exe,8" +HKCU,Software\Wine\FileOpenNaughtyList.jpe,"iexplore",,"""%16422%\Internet Explorer\iexplore.exe"" -nohome"
;; JPEG HKCR,"MIME\Database\Content Type\image/jpeg","CLSID",,"%CLSID_HTMLDocument%" @@ -173,6 +175,7 @@ HKCR,"jpegfile\shell\open\ddeexec",,,"""file:%%1"",,-1,,,,," HKCR,"jpegfile\shell\open\ddeexec\Application",,,"IExplore" HKCR,"jpegfile\shell\open\ddeexec\Topic",,,"WWW_OpenURL" ;; HKCR,"jpegfile\DefaultIcon",,,"%16422%\Internet Explorer\iexplore.exe,8" +HKCU,Software\Wine\FileOpenNaughtyList.jpeg,"iexplore",,"""%16422%\Internet Explorer\iexplore.exe"" -nohome"
;; JPG HKCR,".jpg",,2,"jpegfile" @@ -184,6 +187,7 @@ HKCR,"jpegfile\shell\open\ddeexec",,,"""file:%%1"",,-1,,,,," HKCR,"jpegfile\shell\open\ddeexec\Application",,,"IExplore" HKCR,"jpegfile\shell\open\ddeexec\Topic",,,"WWW_OpenURL" ;; HKCR,"jpegfile\DefaultIcon",,,"%16422%\Internet Explorer\iexplore.exe,8" +HKCU,Software\Wine\FileOpenNaughtyList.jpg,"iexplore",,"""%16422%\Internet Explorer\iexplore.exe"" -nohome"
;; MHTML HKCR,"MIME\Database\Content Type\message/rfc822","CLSID",,"%CLSID_MHTMLDocument%" @@ -221,6 +225,7 @@ HKCR,"pjpegfile\shell\open\ddeexec",,,"""file:%%1"",,-1,,,,," HKCR,"pjpegfile\shell\open\ddeexec\Application",,,"IExplore" HKCR,"pjpegfile\shell\open\ddeexec\Topic",,,"WWW_OpenURL" ;; HKCR,"pjpegfile\DefaultIcon",,,"%16422%\Internet Explorer\iexplore.exe,8" +HKCU,Software\Wine\FileOpenNaughtyList.jfif,"iexplore",,"""%16422%\Internet Explorer\iexplore.exe"" -nohome"
;; PNG HKCR,"MIME\Database\Content Type\image/png","Extension",,".png" @@ -234,6 +239,7 @@ HKCR,"pngfile\shell\open\ddeexec",,,"""file:%%1"",,-1,,,,," HKCR,"pngfile\shell\open\ddeexec\Application",,,"IExplore" HKCR,"pngfile\shell\open\ddeexec\Topic",,,"WWW_OpenURL" ;; HKCR,"pngfile\DefaultIcon",,,"%16422%\Internet Explorer\iexplore.exe,9" +HKCU,Software\Wine\FileOpenNaughtyList.png,"iexplore",,"""%16422%\Internet Explorer\iexplore.exe"" -nohome"
;; PS HKCR,"MIME\Database\Content Type\application/postscript","Extension",,".ps" diff --git a/loader/wine.inf.in b/loader/wine.inf.in index de0dd4e455..f6ecc01b72 100644 --- a/loader/wine.inf.in +++ b/loader/wine.inf.in @@ -501,6 +501,16 @@ 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\FileOpenNaughtyList.htm,"winebrowser",,"""%11%\winebrowser.exe"" -nohome" +HKCU,Software\Wine\FileOpenNaughtyList.html,"winebrowser",,"""%11%\winebrowser.exe"" -nohome" +HKCU,Software\Wine\FileOpenNaughtyList.ini,"notepad",,"%11%\notepad.exe %1" +HKCU,Software\Wine\FileOpenNaughtyList.pdf,"winebrowser",,"""%11%\winebrowser.exe"" -nohome" +HKCU,Software\Wine\FileOpenNaughtyList.rtf,"wordpad",,"""%16422%\Windows NT\Accessories\wordpad.exe"" %1" +HKCU,Software\Wine\FileOpenNaughtyList.txt,"notepad",,"%11%\notepad.exe %1" +HKCU,Software\Wine\FileOpenNaughtyList.url,"ieframe",,"rundll32.exe ieframe.dll,OpenURL %l" +HKCU,Software\Wine\FileOpenNaughtyList.wri,"wordpad",,"""%16422%\Windows NT\Accessories\wordpad.exe"" %1" +HKCU,Software\Wine\FileOpenNaughtyList.xml,"winebrowser",,"""%11%\winebrowser.exe"" -nohome" + [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 ee53619bb9..ffdfe7d8a4 100644 --- a/programs/winemenubuilder/winemenubuilder.c +++ b/programs/winemenubuilder/winemenubuilder.c @@ -2484,6 +2484,42 @@ static BOOL is_extension_banned(LPCWSTR extension) return FALSE; }
+static BOOL on_naughty_list(const WCHAR *extension, const WCHAR *command) +{ + static const WCHAR FileOpenNaughtyListW[] = {'S','o','f','t','w','a','r','e','\', + 'W','i','n','e','\', + 'F','i','l','e','O','p','e','n','N','a','u','g','h','t','y','L','i','s','t','\',0}; + WCHAR naughty_list_key_path[MAX_PATH]; + HKEY naughty_list_key; + WCHAR program_name[MAX_PATH], *naughty_command; + DWORD len = ARRAY_SIZE(program_name); + DWORD i = 0; + + if (ARRAY_SIZE(FileOpenNaughtyListW) + lstrlenW(extension) > ARRAY_SIZE(naughty_list_key_path)) + return FALSE; + + lstrcpyW(naughty_list_key_path, FileOpenNaughtyListW); + lstrcatW(naughty_list_key_path, extension); + + if (RegOpenKeyExW(HKEY_CURRENT_USER, naughty_list_key_path, 0, KEY_QUERY_VALUE, &naughty_list_key) != ERROR_SUCCESS) + return FALSE; + + while (RegEnumValueW(naughty_list_key, i, program_name, &len, NULL, NULL, NULL, NULL) == ERROR_SUCCESS) + { + naughty_command = reg_get_valW(HKEY_CURRENT_USER, naughty_list_key_path, program_name); + if (strcmpW(command, naughty_command) == 0) + { + RegCloseKey(naughty_list_key); + return TRUE; + } + len = ARRAY_SIZE(program_name); + i++; + } + + RegCloseKey(naughty_list_key); + return FALSE; +} + static const char* get_special_mime_type(LPCWSTR extension) { static const WCHAR lnkW[] = {'.','l','n','k',0}; @@ -2582,6 +2618,15 @@ static BOOL generate_associations(const char *xdg_data_home, const char *package char *progIdA = NULL; char *mimeProgId = NULL;
+ commandW = assoc_query(ASSOCSTR_COMMAND, extensionW, openW); + if (commandW == NULL) + /* no command => no application is associated */ + goto end; + + if (on_naughty_list(extensionW, commandW)) + /* command is on naughty list => desktop integration is not desirable */ + goto end; + extensionA = wchars_to_utf8_chars(strlwrW(extensionW)); if (extensionA == NULL) { @@ -2650,11 +2695,6 @@ static BOOL generate_associations(const char *xdg_data_home, const char *package } }
- commandW = assoc_query(ASSOCSTR_COMMAND, extensionW, openW); - if (commandW == NULL) - /* no command => no application is associated */ - goto end; - executableW = assoc_query(ASSOCSTR_EXECUTABLE, extensionW, openW); if (executableW) openWithIconA = extract_icon(executableW, 0, NULL, FALSE);
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=22904 Signed-off-by: Alex Henrie alexhenrie24@gmail.com --- loader/wine.inf.in | 4 + programs/winemenubuilder/winemenubuilder.c | 228 ++++++++++++--------- 2 files changed, 131 insertions(+), 101 deletions(-)
diff --git a/loader/wine.inf.in b/loader/wine.inf.in index f6ecc01b72..858960ea4d 100644 --- a/loader/wine.inf.in +++ b/loader/wine.inf.in @@ -510,6 +510,10 @@ HKCU,Software\Wine\FileOpenNaughtyList.txt,"notepad",,"%11%\notepad.exe %1" HKCU,Software\Wine\FileOpenNaughtyList.url,"ieframe",,"rundll32.exe ieframe.dll,OpenURL %l" HKCU,Software\Wine\FileOpenNaughtyList.wri,"wordpad",,"""%16422%\Windows NT\Accessories\wordpad.exe"" %1" HKCU,Software\Wine\FileOpenNaughtyList.xml,"winebrowser",,"""%11%\winebrowser.exe"" -nohome" +HKCU,Software\Wine\FileOpenNaughtyList\ftp,"winebrowser",,"""%11%\winebrowser.exe"" -nohome" +HKCU,Software\Wine\FileOpenNaughtyList\http,"winebrowser",,"""%11%\winebrowser.exe"" -nohome" +HKCU,Software\Wine\FileOpenNaughtyList\https,"winebrowser",,"""%11%\winebrowser.exe"" -nohome" +HKCU,Software\Wine\FileOpenNaughtyList\mailto,"winebrowser",,"%11%\winebrowser %1"
[ContentIndex] HKLM,System\CurrentControlSet\Control\ContentIndex\Language\Neutral,"WBreakerClass",,"{369647e0-17b0-11ce-9950-00aa004bbb1f}" diff --git a/programs/winemenubuilder/winemenubuilder.c b/programs/winemenubuilder/winemenubuilder.c index ffdfe7d8a4..b65743b971 100644 --- a/programs/winemenubuilder/winemenubuilder.c +++ b/programs/winemenubuilder/winemenubuilder.c @@ -2258,10 +2258,13 @@ static BOOL has_association_changed(LPCWSTR extensionW, LPCSTR mimeType, LPCWSTR ret = TRUE; HeapFree(GetProcessHeap(), 0, valueA);
- value = reg_get_valW(assocKey, extensionW, ProgIDW); - if (!value || strcmpW(value, progId)) - ret = TRUE; - HeapFree(GetProcessHeap(), 0, value); + if (progId) + { + value = reg_get_valW(assocKey, extensionW, ProgIDW); + if (!value || strcmpW(value, progId)) + ret = TRUE; + HeapFree(GetProcessHeap(), 0, value); + }
valueA = reg_get_val_utf8(assocKey, extensionW, AppNameW); if (!valueA || lstrcmpA(valueA, appName)) @@ -2345,7 +2348,7 @@ static void update_association(LPCWSTR extension, LPCSTR mimeType, LPCWSTR progI }
RegSetValueExW(subkey, MimeTypeW, 0, REG_SZ, (const BYTE*) mimeTypeW, (lstrlenW(mimeTypeW) + 1) * sizeof(WCHAR)); - RegSetValueExW(subkey, ProgIDW, 0, REG_SZ, (const BYTE*) progId, (lstrlenW(progId) + 1) * sizeof(WCHAR)); + if (progId) RegSetValueExW(subkey, ProgIDW, 0, REG_SZ, (const BYTE*) progId, (lstrlenW(progId) + 1) * sizeof(WCHAR)); RegSetValueExW(subkey, AppNameW, 0, REG_SZ, (const BYTE*) appNameW, (lstrlenW(appNameW) + 1) * sizeof(WCHAR)); RegSetValueExW(subkey, DesktopFileW, 0, REG_SZ, (const BYTE*) desktopFileW, (lstrlenW(desktopFileW) + 1) * sizeof(WCHAR)); if (openWithIcon) @@ -2484,7 +2487,7 @@ static BOOL is_extension_banned(LPCWSTR extension) return FALSE; }
-static BOOL on_naughty_list(const WCHAR *extension, const WCHAR *command) +static BOOL on_naughty_list(const WCHAR *win_type, const WCHAR *command) { static const WCHAR FileOpenNaughtyListW[] = {'S','o','f','t','w','a','r','e','\', 'W','i','n','e','\', @@ -2495,11 +2498,11 @@ static BOOL on_naughty_list(const WCHAR *extension, const WCHAR *command) DWORD len = ARRAY_SIZE(program_name); DWORD i = 0;
- if (ARRAY_SIZE(FileOpenNaughtyListW) + lstrlenW(extension) > ARRAY_SIZE(naughty_list_key_path)) + if (ARRAY_SIZE(FileOpenNaughtyListW) + lstrlenW(win_type) > ARRAY_SIZE(naughty_list_key_path)) return FALSE;
lstrcpyW(naughty_list_key_path, FileOpenNaughtyListW); - lstrcatW(naughty_list_key_path, extension); + lstrcatW(naughty_list_key_path, win_type);
if (RegOpenKeyExW(HKEY_CURRENT_USER, naughty_list_key_path, 0, KEY_QUERY_VALUE, &naughty_list_key) != ERROR_SUCCESS) return FALSE; @@ -2528,7 +2531,7 @@ static const char* get_special_mime_type(LPCWSTR extension) return NULL; }
-static BOOL write_freedesktop_association_entry(const char *desktopPath, const char *dot_extension, +static BOOL write_freedesktop_association_entry(const char *desktopPath, const char *winType, const char *friendlyAppName, const char *mimeType, const char *progId, const char *openWithIcon) { @@ -2537,8 +2540,8 @@ static BOOL write_freedesktop_association_entry(const char *desktopPath, const c const char *prefix = getenv("WINEPREFIX"); const char *home = getenv("HOME");
- WINE_TRACE("writing association for file type %s, friendlyAppName=%s, MIME type %s, progID=%s, icon=%s to file %s\n", - wine_dbgstr_a(dot_extension), wine_dbgstr_a(friendlyAppName), wine_dbgstr_a(mimeType), + WINE_TRACE("writing association for type %s, friendlyAppName=%s, MIME type %s, progID=%s, icon=%s to file %s\n", + wine_dbgstr_a(winType), wine_dbgstr_a(friendlyAppName), wine_dbgstr_a(mimeType), wine_dbgstr_a(progId), wine_dbgstr_a(openWithIcon), wine_dbgstr_a(desktopPath));
desktop = fopen(desktopPath, "w"); @@ -2549,11 +2552,15 @@ static BOOL write_freedesktop_association_entry(const char *desktopPath, const c fprintf(desktop, "Name=%s\n", friendlyAppName); fprintf(desktop, "MimeType=%s;\n", mimeType); if (prefix) - fprintf(desktop, "Exec=env WINEPREFIX="%s" wine start /ProgIDOpen %s %%f\n", prefix, progId); + fprintf(desktop, "Exec=env WINEPREFIX="%s" wine start", prefix); else if (home) - fprintf(desktop, "Exec=env WINEPREFIX="%s/.wine" wine start /ProgIDOpen %s %%f\n", home, progId); + fprintf(desktop, "Exec=env WINEPREFIX="%s/.wine" wine start", home); else - fprintf(desktop, "Exec=wine start /ProgIDOpen %s %%f\n", progId); + fprintf(desktop, "Exec=wine start"); + if (progId) /* file association */ + fprintf(desktop, " /ProgIDOpen %s %%f\n", progId); + else /* protocol association */ + fprintf(desktop, " %%u\n"); fprintf(desktop, "NoDisplay=true\n"); fprintf(desktop, "StartupNotify=true\n"); if (openWithIcon) @@ -2569,6 +2576,7 @@ static BOOL write_freedesktop_association_entry(const char *desktopPath, const c static BOOL generate_associations(const char *xdg_data_home, const char *packages_dir, const char *applications_dir) { static const WCHAR openW[] = {'o','p','e','n',0}; + static const WCHAR UrlProtocolW[] = {'U','R','L',' ','P','r','o','t','o','c','o','l',0}; struct wine_rb_tree mimeProgidTree = { winemenubuilder_rb_string_compare }; struct list nativeMimeTypes = LIST_INIT(nativeMimeTypes); LSTATUS ret = 0; @@ -2583,26 +2591,33 @@ static BOOL generate_associations(const char *xdg_data_home, const char *package
for (i = 0; ; i++) { - WCHAR *extensionW = NULL; + WCHAR *winTypeW = NULL; DWORD size = 1024; + BOOL is_protocol_type = FALSE;
do { - HeapFree(GetProcessHeap(), 0, extensionW); - extensionW = HeapAlloc(GetProcessHeap(), 0, size * sizeof(WCHAR)); - if (extensionW == NULL) + HeapFree(GetProcessHeap(), 0, winTypeW); + winTypeW = HeapAlloc(GetProcessHeap(), 0, size * sizeof(WCHAR)); + if (winTypeW == NULL) { WINE_ERR("out of memory\n"); ret = ERROR_OUTOFMEMORY; break; } - ret = RegEnumKeyExW(HKEY_CLASSES_ROOT, i, extensionW, &size, NULL, NULL, NULL, NULL); + ret = RegEnumKeyExW(HKEY_CLASSES_ROOT, i, winTypeW, &size, NULL, NULL, NULL, NULL); size *= 2; } while (ret == ERROR_MORE_DATA);
- if (ret == ERROR_SUCCESS && extensionW[0] == '.' && !is_extension_banned(extensionW)) + if (ret == ERROR_SUCCESS && winTypeW[0] != '.') + { + if (RegGetValueW(HKEY_CLASSES_ROOT, winTypeW, UrlProtocolW, RRF_RT_ANY, NULL, NULL, NULL) == ERROR_SUCCESS) + is_protocol_type = TRUE; + } + + if (ret == ERROR_SUCCESS && (is_protocol_type || (winTypeW[0] == '.' && !is_extension_banned(winTypeW)))) { - char *extensionA = NULL; + char *winTypeA = NULL; WCHAR *commandW = NULL; WCHAR *executableW = NULL; char *openWithIconA = NULL; @@ -2618,23 +2633,23 @@ static BOOL generate_associations(const char *xdg_data_home, const char *package char *progIdA = NULL; char *mimeProgId = NULL;
- commandW = assoc_query(ASSOCSTR_COMMAND, extensionW, openW); + commandW = assoc_query(ASSOCSTR_COMMAND, winTypeW, openW); if (commandW == NULL) /* no command => no application is associated */ goto end;
- if (on_naughty_list(extensionW, commandW)) + if (on_naughty_list(winTypeW, commandW)) /* command is on naughty list => desktop integration is not desirable */ goto end;
- extensionA = wchars_to_utf8_chars(strlwrW(extensionW)); - if (extensionA == NULL) + winTypeA = wchars_to_utf8_chars(strlwrW(winTypeW)); + if (winTypeA == NULL) { WINE_ERR("out of memory\n"); goto end; }
- friendlyDocNameW = assoc_query(ASSOCSTR_FRIENDLYDOCNAME, extensionW, NULL); + friendlyDocNameW = assoc_query(ASSOCSTR_FRIENDLYDOCNAME, winTypeW, NULL); if (friendlyDocNameW) { friendlyDocNameA = wchars_to_utf8_chars(friendlyDocNameW); @@ -2645,61 +2660,105 @@ static BOOL generate_associations(const char *xdg_data_home, const char *package } }
- iconW = assoc_query(ASSOCSTR_DEFAULTICON, extensionW, NULL); + iconW = assoc_query(ASSOCSTR_DEFAULTICON, winTypeW, NULL);
- contentTypeW = assoc_query(ASSOCSTR_CONTENTTYPE, extensionW, NULL); + contentTypeW = assoc_query(ASSOCSTR_CONTENTTYPE, winTypeW, NULL); if (contentTypeW) strlwrW(contentTypeW);
- if (!freedesktop_mime_type_for_extension(&nativeMimeTypes, extensionA, extensionW, &mimeTypeA)) - goto end; - - if (mimeTypeA == NULL) + if (is_protocol_type) { - if (contentTypeW != NULL && strchrW(contentTypeW, '/')) - mimeTypeA = wchars_to_utf8_chars(contentTypeW); - else if ((get_special_mime_type(extensionW))) - mimeTypeA = strdupA(get_special_mime_type(extensionW)); - else - mimeTypeA = heap_printf("application/x-wine-extension-%s", &extensionA[1]); + mimeTypeA = heap_printf("x-scheme-handler/%s", winTypeA); + } + else + { + if (!freedesktop_mime_type_for_extension(&nativeMimeTypes, winTypeA, winTypeW, &mimeTypeA)) + goto end;
- if (mimeTypeA != NULL) + if (mimeTypeA == NULL) { - /* GNOME seems to ignore the <icon> tag in MIME packages, - * and the default name is more intuitive anyway. - */ - if (iconW) + if (contentTypeW != NULL && strchrW(contentTypeW, '/')) + mimeTypeA = wchars_to_utf8_chars(contentTypeW); + else if ((get_special_mime_type(winTypeW))) + mimeTypeA = strdupA(get_special_mime_type(winTypeW)); + else + mimeTypeA = heap_printf("application/x-wine-extension-%s", winTypeA+1); + + if (mimeTypeA != NULL) { - char *flattened_mime = slashes_to_minuses(mimeTypeA); - if (flattened_mime) + /* GNOME seems to ignore the <icon> tag in MIME packages, + * and the default name is more intuitive anyway. + */ + if (iconW) { - int index = 0; - WCHAR *comma = strrchrW(iconW, ','); - if (comma) + char *flattened_mime = slashes_to_minuses(mimeTypeA); + if (flattened_mime) { - *comma = 0; - index = atoiW(comma + 1); + int index = 0; + WCHAR *comma = strrchrW(iconW, ','); + if (comma) + { + *comma = 0; + index = atoiW(comma + 1); + } + iconA = extract_icon(iconW, index, flattened_mime, FALSE); + HeapFree(GetProcessHeap(), 0, flattened_mime); } - iconA = extract_icon(iconW, index, flattened_mime, FALSE); - HeapFree(GetProcessHeap(), 0, flattened_mime); } + + write_freedesktop_mime_type_entry(packages_dir, winTypeA, mimeTypeA, friendlyDocNameA); + hasChanged = TRUE; + } + else + { + WINE_FIXME("out of memory\n"); + goto end; } + }
- write_freedesktop_mime_type_entry(packages_dir, extensionA, mimeTypeA, friendlyDocNameA); - hasChanged = TRUE; + progIdW = reg_get_valW(HKEY_CLASSES_ROOT, winTypeW, NULL); + if (progIdW) + { + progIdA = escape(progIdW); + if (progIdA == NULL) + { + WINE_ERR("out of memory\n"); + goto end; + } } else + goto end; /* no progID => not a file type association */ + + /* Do not allow duplicate ProgIDs for a MIME type, it causes unnecessary duplication in Open dialogs */ + mimeProgId = heap_printf("%s=>%s", mimeTypeA, progIdA); + if (mimeProgId) { - WINE_FIXME("out of memory\n"); - goto end; + struct rb_string_entry *entry; + if (wine_rb_get(&mimeProgidTree, mimeProgId)) + { + HeapFree(GetProcessHeap(), 0, mimeProgId); + goto end; + } + entry = HeapAlloc(GetProcessHeap(), 0, sizeof(struct rb_string_entry)); + if (!entry) + { + WINE_ERR("out of memory allocating rb_string_entry\n"); + goto end; + } + entry->string = mimeProgId; + if (wine_rb_put(&mimeProgidTree, mimeProgId, &entry->entry)) + { + WINE_ERR("error updating rb tree\n"); + goto end; + } } }
- executableW = assoc_query(ASSOCSTR_EXECUTABLE, extensionW, openW); + executableW = assoc_query(ASSOCSTR_EXECUTABLE, winTypeW, openW); if (executableW) openWithIconA = extract_icon(executableW, 0, NULL, FALSE);
- friendlyAppNameW = assoc_query(ASSOCSTR_FRIENDLYAPPNAME, extensionW, openW); + friendlyAppNameW = assoc_query(ASSOCSTR_FRIENDLYAPPNAME, winTypeW, openW); if (friendlyAppNameW) { friendlyAppNameA = wchars_to_utf8_chars(friendlyAppNameW); @@ -2719,59 +2778,26 @@ static BOOL generate_associations(const char *xdg_data_home, const char *package } }
- progIdW = reg_get_valW(HKEY_CLASSES_ROOT, extensionW, NULL); - if (progIdW) - { - progIdA = escape(progIdW); - if (progIdA == NULL) - { - WINE_ERR("out of memory\n"); - goto end; - } - } - else - goto end; /* no progID => not a file type association */ - - /* Do not allow duplicate ProgIDs for a MIME type, it causes unnecessary duplication in Open dialogs */ - mimeProgId = heap_printf("%s=>%s", mimeTypeA, progIdA); - if (mimeProgId) - { - struct rb_string_entry *entry; - if (wine_rb_get(&mimeProgidTree, mimeProgId)) - { - HeapFree(GetProcessHeap(), 0, mimeProgId); - goto end; - } - entry = HeapAlloc(GetProcessHeap(), 0, sizeof(struct rb_string_entry)); - if (!entry) - { - WINE_ERR("out of memory allocating rb_string_entry\n"); - goto end; - } - entry->string = mimeProgId; - if (wine_rb_put(&mimeProgidTree, mimeProgId, &entry->entry)) - { - WINE_ERR("error updating rb tree\n"); - goto end; - } - } - - if (has_association_changed(extensionW, mimeTypeA, progIdW, friendlyAppNameA, openWithIconA)) + if (has_association_changed(winTypeW, mimeTypeA, progIdW, friendlyAppNameA, openWithIconA)) { - char *desktopPath = heap_printf("%s/wine-extension-%s.desktop", applications_dir, &extensionA[1]); + char *desktopPath; + if (is_protocol_type) + desktopPath = heap_printf("%s/wine-protocol-%s.desktop", applications_dir, winTypeA); + else + desktopPath = heap_printf("%s/wine-extension-%s.desktop", applications_dir, winTypeA+1); if (desktopPath) { - if (write_freedesktop_association_entry(desktopPath, extensionA, friendlyAppNameA, mimeTypeA, progIdA, openWithIconA)) + if (write_freedesktop_association_entry(desktopPath, winTypeA, friendlyAppNameA, mimeTypeA, progIdA, openWithIconA)) { hasChanged = TRUE; - update_association(extensionW, mimeTypeA, progIdW, friendlyAppNameA, desktopPath, openWithIconA); + update_association(winTypeW, mimeTypeA, progIdW, friendlyAppNameA, desktopPath, openWithIconA); } HeapFree(GetProcessHeap(), 0, desktopPath); } }
end: - HeapFree(GetProcessHeap(), 0, extensionA); + HeapFree(GetProcessHeap(), 0, winTypeA); HeapFree(GetProcessHeap(), 0, commandW); HeapFree(GetProcessHeap(), 0, executableW); HeapFree(GetProcessHeap(), 0, openWithIconA); @@ -2786,7 +2812,7 @@ static BOOL generate_associations(const char *xdg_data_home, const char *package HeapFree(GetProcessHeap(), 0, progIdW); HeapFree(GetProcessHeap(), 0, progIdA); } - HeapFree(GetProcessHeap(), 0, extensionW); + HeapFree(GetProcessHeap(), 0, winTypeW); if (ret != ERROR_SUCCESS) break; }
On Wed, 24 Jun 2020, Alex Henrie wrote:
The big change here is rewriting the patches to avoid the term "blacklist", which I have replaced with "naughty list".
In this context it's not clear what naughty means. What in a file extension is "badly behaved, disobedient or mildly rude or indecent"?
I want for proof that you have to explain what it means in the code:
if (on_naughty_list(extensionW, commandW))
/* command is on naughty list => desktop integration is not desirable */
Also, this being a key name, is "List" even needed? After all the "Classes" key is not called "ClassesList".
So I think something like "FileOpenIgnore" would be clearer, although a wording more explicitly related to desktop integration may be even better. "FileOpenInWineOnly", "NotExportedExtensions" or "WineOnlyExtensions"?
+HKCU,Software\Wine\FileOpenInWineOnly.gif,"iexplore",,"""%16422%\Internet Explorer\iexplore.exe"" -nohome" +HKCU,Software\Wine\FileOpenInWineOnly.jpe,"iexplore",,"""%16422%\Internet Explorer\iexplore.exe"" -nohome"
On Thu, Jun 25, 2020 at 3:29 AM Francois Gouget fgouget@free.fr wrote:
On Wed, 24 Jun 2020, Alex Henrie wrote:
The big change here is rewriting the patches to avoid the term "blacklist", which I have replaced with "naughty list".
In this context it's not clear what naughty means. What in a file extension is "badly behaved, disobedient or mildly rude or indecent"?
Several built-in Wine programs are badly behaved in the sense that they associate themselves with file types that native desktop programs are better suited to open.
I want for proof that you have to explain what it means in the code:
if (on_naughty_list(extensionW, commandW))
/* command is on naughty list => desktop integration is not desirable */
Also, this being a key name, is "List" even needed? After all the "Classes" key is not called "ClassesList".
So I think something like "FileOpenIgnore" would be clearer, although a wording more explicitly related to desktop integration may be even better. "FileOpenInWineOnly", "NotExportedExtensions" or "WineOnlyExtensions"?
The word "extension" is problematic because the naughty list includes both extensions (which start with a dot) and protocols (which do not). How about "FileOpenNoIntegration"?
-Alex
On Mon, Jun 29, 2020 at 10:45 PM Alex Henrie alexhenrie24@gmail.com wrote:
On Thu, Jun 25, 2020 at 3:29 AM Francois Gouget fgouget@free.fr wrote:
On Wed, 24 Jun 2020, Alex Henrie wrote:
The big change here is rewriting the patches to avoid the term "blacklist", which I have replaced with "naughty list".
In this context it's not clear what naughty means. What in a file extension is "badly behaved, disobedient or mildly rude or indecent"?
Several built-in Wine programs are badly behaved in the sense that they associate themselves with file types that native desktop programs are better suited to open.
Would it be a problem to remove such integration completely? I can't think of a good scenario when it would be useful.
I want for proof that you have to explain what it means in the code:
if (on_naughty_list(extensionW, commandW))
/* command is on naughty list => desktop integration
is not desirable */
Also, this being a key name, is "List" even needed? After all the "Classes" key is not called "ClassesList".
So I think something like "FileOpenIgnore" would be clearer, although a wording more explicitly related to desktop integration may be even better. "FileOpenInWineOnly", "NotExportedExtensions" or "WineOnlyExtensions"?
The word "extension" is problematic because the naughty list includes both extensions (which start with a dot) and protocols (which do not). How about "FileOpenNoIntegration"?
-Alex
On Mon, Jun 29, 2020 at 1:49 PM Nikolay Sivov bunglehead@gmail.com wrote:
On Mon, Jun 29, 2020 at 10:45 PM Alex Henrie alexhenrie24@gmail.com wrote:
On Thu, Jun 25, 2020 at 3:29 AM Francois Gouget fgouget@free.fr wrote:
On Wed, 24 Jun 2020, Alex Henrie wrote:
The big change here is rewriting the patches to avoid the term "blacklist", which I have replaced with "naughty list".
In this context it's not clear what naughty means. What in a file extension is "badly behaved, disobedient or mildly rude or indecent"?
Several built-in Wine programs are badly behaved in the sense that they associate themselves with file types that native desktop programs are better suited to open.
Would it be a problem to remove such integration completely? I can't think of a good scenario when it would be useful.
The associations have to be in Wine for programs that call `start.exe <file>` to open a file.
-Alex
On Mon, Jun 29, 2020 at 10:54 PM Alex Henrie alexhenrie24@gmail.com wrote:
On Mon, Jun 29, 2020 at 1:49 PM Nikolay Sivov bunglehead@gmail.com wrote:
On Mon, Jun 29, 2020 at 10:45 PM Alex Henrie alexhenrie24@gmail.com
wrote:
On Thu, Jun 25, 2020 at 3:29 AM Francois Gouget fgouget@free.fr
wrote:
On Wed, 24 Jun 2020, Alex Henrie wrote:
The big change here is rewriting the patches to avoid the term "blacklist", which I have replaced with "naughty list".
In this context it's not clear what naughty means. What in a file extension is "badly behaved, disobedient or mildly rude or indecent"?
Several built-in Wine programs are badly behaved in the sense that they associate themselves with file types that native desktop programs are better suited to open.
Would it be a problem to remove such integration completely? I can't
think of a good scenario when it would be useful.
The associations have to be in Wine for programs that call `start.exe <file>` to open a file.
This has to be a prefix configuration, not affecting opening/strating things through DE. E.g. 'wine start test.txt' supposedly expected to open notepad, that doesn't have to be configured for DE associations. Maybe you're talking about something else, I meant this part:
Several built-in Wine programs are badly behaved in the sense that they associate themselves with file types that native desktop programs are better suited to open.
Builtin programs or installed programs only need shell extensions stuff in registry to open via 'wine start', they don't have to touch system configuration.
Is that a different issue?
-Alex
On Mon, Jun 29, 2020 at 2:05 PM Nikolay Sivov bunglehead@gmail.com wrote:
On Mon, Jun 29, 2020 at 10:54 PM Alex Henrie alexhenrie24@gmail.com wrote:
On Mon, Jun 29, 2020 at 1:49 PM Nikolay Sivov bunglehead@gmail.com wrote:
On Mon, Jun 29, 2020 at 10:45 PM Alex Henrie alexhenrie24@gmail.com wrote:
On Thu, Jun 25, 2020 at 3:29 AM Francois Gouget fgouget@free.fr wrote:
On Wed, 24 Jun 2020, Alex Henrie wrote:
The big change here is rewriting the patches to avoid the term "blacklist", which I have replaced with "naughty list".
In this context it's not clear what naughty means. What in a file extension is "badly behaved, disobedient or mildly rude or indecent"?
Several built-in Wine programs are badly behaved in the sense that they associate themselves with file types that native desktop programs are better suited to open.
Would it be a problem to remove such integration completely? I can't think of a good scenario when it would be useful.
The associations have to be in Wine for programs that call `start.exe <file>` to open a file.
This has to be a prefix configuration, not affecting opening/strating things through DE. E.g. 'wine start test.txt' supposedly expected to open notepad, that doesn't have to be configured for DE associations. Maybe you're talking about something else, I meant this part:
Several built-in Wine programs are badly behaved in the sense that they associate themselves with file types that native desktop programs are better suited to open.
Builtin programs or installed programs only need shell extensions stuff in registry to open via 'wine start', they don't have to touch system configuration.
Is that a different issue?
If I understand you correctly now, you're proposing to get rid of desktop integration for associations altogether. I imagine that would be very undesirable for people who use MS Office on Linux through Wine. I'd also like to be able to install Steam games in the Windows client by browsing https://store.steampowered.com/ in the native browser and then clicking steamapp:// links that open in Wine.
-Alex
On Mon, Jun 29, 2020 at 11:22 PM Alex Henrie alexhenrie24@gmail.com wrote:
On Mon, Jun 29, 2020 at 2:05 PM Nikolay Sivov bunglehead@gmail.com wrote:
On Mon, Jun 29, 2020 at 10:54 PM Alex Henrie alexhenrie24@gmail.com
wrote:
On Mon, Jun 29, 2020 at 1:49 PM Nikolay Sivov bunglehead@gmail.com
wrote:
On Mon, Jun 29, 2020 at 10:45 PM Alex Henrie alexhenrie24@gmail.com
wrote:
On Thu, Jun 25, 2020 at 3:29 AM Francois Gouget fgouget@free.fr
wrote:
On Wed, 24 Jun 2020, Alex Henrie wrote:
> The big change here is rewriting the patches to avoid the term > "blacklist", which I have replaced with "naughty list".
In this context it's not clear what naughty means. What in a file extension is "badly behaved, disobedient or mildly rude or
indecent"?
Several built-in Wine programs are badly behaved in the sense that they associate themselves with file types that native desktop
programs
are better suited to open.
Would it be a problem to remove such integration completely? I can't
think of a good scenario when it would be useful.
The associations have to be in Wine for programs that call `start.exe <file>` to open a file.
This has to be a prefix configuration, not affecting opening/strating
things through DE. E.g. 'wine start test.txt' supposedly expected to open notepad,
that doesn't have to be configured for DE associations. Maybe you're
talking about something else, I meant this part:
Several built-in Wine programs are badly behaved in the sense that they associate themselves with file types that native desktop programs are better suited to open.
Builtin programs or installed programs only need shell extensions stuff
in registry to open via 'wine start',
they don't have to touch system configuration.
Is that a different issue?
If I understand you correctly now, you're proposing to get rid of desktop integration for associations altogether. I imagine that would be very undesirable for people who use MS Office on Linux through Wine. I'd also like to be able to install Steam games in the Windows client by browsing https://store.steampowered.com/ in the native browser and then clicking steamapp:// links that open in Wine.
That becomes unusable once you have more than one prefix (I believe desktop integration does not specify WINEPREFIX for launch commands). Do they get updated if you move prefix with Office somewhere, or if you remove it? Steam example is even more artificial.
Maybe disabling it by default, and keeping that checkbox in winecfg, would be good for now, I don't know.
-Alex
On 6/29/20 3:27 PM, Nikolay Sivov wrote:
On Mon, Jun 29, 2020 at 11:22 PM Alex Henrie <alexhenrie24@gmail.com mailto:alexhenrie24@gmail.com> wrote:
On Mon, Jun 29, 2020 at 2:05 PM Nikolay Sivov <bunglehead@gmail.com <mailto:bunglehead@gmail.com>> wrote: > > > > On Mon, Jun 29, 2020 at 10:54 PM Alex Henrie <alexhenrie24@gmail.com <mailto:alexhenrie24@gmail.com>> wrote: >> >> On Mon, Jun 29, 2020 at 1:49 PM Nikolay Sivov <bunglehead@gmail.com <mailto:bunglehead@gmail.com>> wrote: >> > >> > >> > >> > On Mon, Jun 29, 2020 at 10:45 PM Alex Henrie <alexhenrie24@gmail.com <mailto:alexhenrie24@gmail.com>> wrote: >> >> >> >> On Thu, Jun 25, 2020 at 3:29 AM Francois Gouget <fgouget@free.fr <mailto:fgouget@free.fr>> wrote: >> >> > >> >> > On Wed, 24 Jun 2020, Alex Henrie wrote: >> >> > >> >> > > The big change here is rewriting the patches to avoid the term >> >> > > "blacklist", which I have replaced with "naughty list". >> >> > >> >> > In this context it's not clear what naughty means. What in a file >> >> > extension is "badly behaved, disobedient or mildly rude or indecent"? >> >> >> >> Several built-in Wine programs are badly behaved in the sense that >> >> they associate themselves with file types that native desktop programs >> >> are better suited to open. >> > >> > >> > Would it be a problem to remove such integration completely? I can't think of a good scenario when it would be useful. >> >> The associations have to be in Wine for programs that call `start.exe >> <file>` to open a file. > > > This has to be a prefix configuration, not affecting opening/strating things through DE. E.g. 'wine start test.txt' supposedly expected to open notepad, > that doesn't have to be configured for DE associations. Maybe you're talking about something else, I meant this part: > > >> Several built-in Wine programs are badly behaved in the sense that > >> they associate themselves with file types that native desktop programs > >> are better suited to open. > > Builtin programs or installed programs only need shell extensions stuff in registry to open via 'wine start', > they don't have to touch system configuration. > > Is that a different issue? If I understand you correctly now, you're proposing to get rid of desktop integration for associations altogether. I imagine that would be very undesirable for people who use MS Office on Linux through Wine. I'd also like to be able to install Steam games in the Windows client by browsing https://store.steampowered.com/ in the native browser and then clicking steamapp:// links that open in Wine.
That becomes unusable once you have more than one prefix (I believe desktop integration does not specify WINEPREFIX for launch commands).
In fact it does; see write_freedesktop_association_entry() in winemenubuilder.c.
Do they get updated if you move prefix with Office somewhere, or if you remove it?
winemenubuilder automatically updates associations on prefix update, or when manually run with the -a argument.
Of course associations never get removed, which is a problem, but it's hard to solve. It's not obvious to me that it's worth throwing out the whole of winemenubuilder just because of that, though.
Not to mention that moving prefixes is probably not a common operation anyway.
Steam example is even more artificial.
Why? Running Steam from within Wine is very common, even now after Proton has been introduced.
Nor is Steam the only program with an idiosyncratic protocol or file extension.
Maybe disabling it by default, and keeping that checkbox in winecfg, would be good for now, I don't know.
On Mon, Jun 29, 2020 at 10:41 PM Zebediah Figura z.figura12@gmail.com wrote:
On 6/29/20 3:27 PM, Nikolay Sivov wrote:
On Mon, Jun 29, 2020 at 11:22 PM Alex Henrie <alexhenrie24@gmail.com mailto:alexhenrie24@gmail.com> wrote:
On Mon, Jun 29, 2020 at 2:05 PM Nikolay Sivov <bunglehead@gmail.com <mailto:bunglehead@gmail.com>> wrote: > > > > On Mon, Jun 29, 2020 at 10:54 PM Alex Henrie <alexhenrie24@gmail.com <mailto:alexhenrie24@gmail.com>> wrote: >> >> On Mon, Jun 29, 2020 at 1:49 PM Nikolay Sivov <bunglehead@gmail.com <mailto:bunglehead@gmail.com>> wrote: >> > >> > >> > >> > On Mon, Jun 29, 2020 at 10:45 PM Alex Henrie <alexhenrie24@gmail.com <mailto:alexhenrie24@gmail.com>> wrote: >> >> >> >> On Thu, Jun 25, 2020 at 3:29 AM Francois Gouget <fgouget@free.fr <mailto:fgouget@free.fr>> wrote: >> >> > >> >> > On Wed, 24 Jun 2020, Alex Henrie wrote: >> >> > >> >> > > The big change here is rewriting the patches to avoid the
term
>> >> > > "blacklist", which I have replaced with "naughty list". >> >> > >> >> > In this context it's not clear what naughty means. What in a file >> >> > extension is "badly behaved, disobedient or mildly rude or indecent"? >> >> >> >> Several built-in Wine programs are badly behaved in the sense
that
>> >> they associate themselves with file types that native desktop programs >> >> are better suited to open. >> > >> > >> > Would it be a problem to remove such integration completely? I can't think of a good scenario when it would be useful. >> >> The associations have to be in Wine for programs that call
`start.exe
>> <file>` to open a file. > > > This has to be a prefix configuration, not affecting opening/strating things through DE. E.g. 'wine start test.txt' supposedly expected to open notepad, > that doesn't have to be configured for DE associations. Maybe you're talking about something else, I meant this part: > > >> Several built-in Wine programs are badly behaved in the sense
that
> >> they associate themselves with file types that native desktop programs > >> are better suited to open. > > Builtin programs or installed programs only need shell extensions stuff in registry to open via 'wine start', > they don't have to touch system configuration. > > Is that a different issue? If I understand you correctly now, you're proposing to get rid of desktop integration for associations altogether. I imagine that would be very undesirable for people who use MS Office on Linux through Wine. I'd also like to be able to install Steam games in the Windows client by browsing https://store.steampowered.com/ in the native browser and then clicking steamapp:// links that open in Wine.
That becomes unusable once you have more than one prefix (I believe desktop integration does not specify WINEPREFIX for launch commands).
In fact it does; see write_freedesktop_association_entry() in winemenubuilder.c.
Do they get updated if you move prefix with Office somewhere, or if you remove it?
winemenubuilder automatically updates associations on prefix update, or when manually run with the -a argument.
Of course associations never get removed, which is a problem, but it's hard to solve. It's not obvious to me that it's worth throwing out the whole of winemenubuilder just because of that, though.
That's not true. Associations do get removed.
It was intended to behave the way users expect.
How do you remove an association from a native *nix application? You use a tool that ultimately deletes the fd.o file eg. ~/.local/share/applications/wine-extension-png.desktop. On the next winemenubuilder run, it will see the PNG associated was previously generated (from the registry) but the fd.o file is absent, and assume the user doesn't want it, and avoid regenerating the fd.o file.
If you uninstall the Windows application, the uninstaller deletes the association from the registry, and winemenubuilder then deletes it from fd.o.
Either way, the fd.o association gets deleted. That's how I remember designing and implementing it ~10 years ago. If it doesn't currently behave this way, it's a bug.
(Of course, applications that ship with Wine, like iexplore and notepad, never get deleted...)
Damjan
On 6/29/20 10:18 PM, Damjan Jovanovic wrote:
On Mon, Jun 29, 2020 at 10:41 PM Zebediah Figura <z.figura12@gmail.com mailto:z.figura12@gmail.com> wrote:
On 6/29/20 3:27 PM, Nikolay Sivov wrote: > > > On Mon, Jun 29, 2020 at 11:22 PM Alex Henrie <alexhenrie24@gmail.com <mailto:alexhenrie24@gmail.com> > <mailto:alexhenrie24@gmail.com <mailto:alexhenrie24@gmail.com>>> wrote: > > On Mon, Jun 29, 2020 at 2:05 PM Nikolay Sivov <bunglehead@gmail.com <mailto:bunglehead@gmail.com> > <mailto:bunglehead@gmail.com <mailto:bunglehead@gmail.com>>> wrote: > > > > > > > > On Mon, Jun 29, 2020 at 10:54 PM Alex Henrie > <alexhenrie24@gmail.com <mailto:alexhenrie24@gmail.com> <mailto:alexhenrie24@gmail.com <mailto:alexhenrie24@gmail.com>>> wrote: > >> > >> On Mon, Jun 29, 2020 at 1:49 PM Nikolay Sivov > <bunglehead@gmail.com <mailto:bunglehead@gmail.com> <mailto:bunglehead@gmail.com <mailto:bunglehead@gmail.com>>> wrote: > >> > > >> > > >> > > >> > On Mon, Jun 29, 2020 at 10:45 PM Alex Henrie > <alexhenrie24@gmail.com <mailto:alexhenrie24@gmail.com> <mailto:alexhenrie24@gmail.com <mailto:alexhenrie24@gmail.com>>> wrote: > >> >> > >> >> On Thu, Jun 25, 2020 at 3:29 AM Francois Gouget > <fgouget@free.fr <mailto:fgouget@free.fr> <mailto:fgouget@free.fr <mailto:fgouget@free.fr>>> wrote: > >> >> > > >> >> > On Wed, 24 Jun 2020, Alex Henrie wrote: > >> >> > > >> >> > > The big change here is rewriting the patches to avoid the term > >> >> > > "blacklist", which I have replaced with "naughty list". > >> >> > > >> >> > In this context it's not clear what naughty means. What in a > file > >> >> > extension is "badly behaved, disobedient or mildly rude or > indecent"? > >> >> > >> >> Several built-in Wine programs are badly behaved in the sense that > >> >> they associate themselves with file types that native desktop > programs > >> >> are better suited to open. > >> > > >> > > >> > Would it be a problem to remove such integration completely? I > can't think of a good scenario when it would be useful. > >> > >> The associations have to be in Wine for programs that call `start.exe > >> <file>` to open a file. > > > > > > This has to be a prefix configuration, not affecting > opening/strating things through DE. E.g. 'wine start test.txt' > supposedly expected to open notepad, > > that doesn't have to be configured for DE associations. Maybe > you're talking about something else, I meant this part: > > > > >> Several built-in Wine programs are badly behaved in the sense that > > >> they associate themselves with file types that native desktop > programs > > >> are better suited to open. > > > > Builtin programs or installed programs only need shell extensions > stuff in registry to open via 'wine start', > > they don't have to touch system configuration. > > > > Is that a different issue? > > If I understand you correctly now, you're proposing to get rid of > desktop integration for associations altogether. I imagine that would > be very undesirable for people who use MS Office on Linux through > Wine. I'd also like to be able to install Steam games in the Windows > client by browsing https://store.steampowered.com/ in the native > browser and then clicking steamapp:// links that open in Wine. > > > That becomes unusable once you have more than one prefix (I believe > desktop integration does not specify WINEPREFIX for launch commands). In fact it does; see write_freedesktop_association_entry() in winemenubuilder.c. > Do they get updated if you move prefix with Office somewhere, or if you > remove it? winemenubuilder automatically updates associations on prefix update, or when manually run with the -a argument. Of course associations never get removed, which is a problem, but it's hard to solve. It's not obvious to me that it's worth throwing out the whole of winemenubuilder just because of that, though.
That's not true. Associations do get removed.
It was intended to behave the way users expect.
How do you remove an association from a native *nix application? You use a tool that ultimately deletes the fd.o file eg. ~/.local/share/applications/wine-extension-png.desktop. On the next winemenubuilder run, it will see the PNG associated was previously generated (from the registry) but the fd.o file is absent, and assume the user doesn't want it, and avoid regenerating the fd.o file.
If you uninstall the Windows application, the uninstaller deletes the association from the registry, and winemenubuilder then deletes it from fd.o.
Either way, the fd.o association gets deleted. That's how I remember designing and implementing it ~10 years ago. If it doesn't currently behave this way, it's a bug.
(Of course, applications that ship with Wine, like iexplore and notepad, never get deleted...)
Right, I guess I should be more specific; associations from deleted or moved prefixes will never be removed.
Damjan
On Mon, Jun 29, 2020 at 2:27 PM Nikolay Sivov bunglehead@gmail.com wrote:
On Mon, Jun 29, 2020 at 11:22 PM Alex Henrie alexhenrie24@gmail.com wrote:
On Mon, Jun 29, 2020 at 2:05 PM Nikolay Sivov bunglehead@gmail.com wrote:
On Mon, Jun 29, 2020 at 10:54 PM Alex Henrie alexhenrie24@gmail.com wrote:
On Mon, Jun 29, 2020 at 1:49 PM Nikolay Sivov bunglehead@gmail.com wrote:
On Mon, Jun 29, 2020 at 10:45 PM Alex Henrie alexhenrie24@gmail.com wrote:
On Thu, Jun 25, 2020 at 3:29 AM Francois Gouget fgouget@free.fr wrote: > > On Wed, 24 Jun 2020, Alex Henrie wrote: > > > The big change here is rewriting the patches to avoid the term > > "blacklist", which I have replaced with "naughty list". > > In this context it's not clear what naughty means. What in a file > extension is "badly behaved, disobedient or mildly rude or indecent"?
Several built-in Wine programs are badly behaved in the sense that they associate themselves with file types that native desktop programs are better suited to open.
Would it be a problem to remove such integration completely? I can't think of a good scenario when it would be useful.
The associations have to be in Wine for programs that call `start.exe <file>` to open a file.
This has to be a prefix configuration, not affecting opening/strating things through DE. E.g. 'wine start test.txt' supposedly expected to open notepad, that doesn't have to be configured for DE associations. Maybe you're talking about something else, I meant this part:
Several built-in Wine programs are badly behaved in the sense that they associate themselves with file types that native desktop programs are better suited to open.
Builtin programs or installed programs only need shell extensions stuff in registry to open via 'wine start', they don't have to touch system configuration.
Is that a different issue?
If I understand you correctly now, you're proposing to get rid of desktop integration for associations altogether. I imagine that would be very undesirable for people who use MS Office on Linux through Wine. I'd also like to be able to install Steam games in the Windows client by browsing https://store.steampowered.com/ in the native browser and then clicking steamapp:// links that open in Wine.
That becomes unusable once you have more than one prefix (I believe desktop integration does not specify WINEPREFIX for launch commands). Do they get updated if you move prefix with Office somewhere, or if you remove it? Steam example is even more artificial.
Maybe disabling it by default, and keeping that checkbox in winecfg, would be good for now, I don't know.
I'd really like desktop integration to "just work" for novice Wine users who only have one prefix. Maybe we should disable all desktop integration by default on prefixes other than $HOME/.wine, but in the general case desktop integration for programs that the user installs is a desirable thing.
-Alex
On Mon, 29 Jun 2020, Alex Henrie wrote: [...]
Also, this being a key name, is "List" even needed? After all the "Classes" key is not called "ClassesList".
So I think something like "FileOpenIgnore" would be clearer, although a wording more explicitly related to desktop integration may be even better. "FileOpenInWineOnly", "NotExportedExtensions" or "WineOnlyExtensions"?
The word "extension" is problematic because the naughty list includes both extensions (which start with a dot) and protocols (which do not). How about "FileOpenNoIntegration"?
Yes. I think that's better.