On Fri May 5 02:25:59 2023 +0000, Loïc Rebmeister wrote:
This is the changes I would suggest:
- Adding a `is_protocol_banned` function and adding the `file` protocol
to the blacklist. 2. Adding a registry key to disable this new behavior (`winecfg` support?) This is the code to detect if associations are enabled:
static BOOL associations_enabled(void) { BOOL ret = TRUE; HKEY hkey; BYTE buf[32]; DWORD len; if ((hkey = open_associations_reg_key())) { len = sizeof(buf); if (!RegQueryValueExA(hkey, "Enable", NULL, NULL, buf, &len)) ret = IS_OPTION_TRUE(buf[0]); RegCloseKey( hkey ); } return ret; }
Maybe making a copy of it called `protocol_scheme_enabled` and using `ProtocolSheme`/`ProtocolShemeEnabled` as registry key. (Pick your favorite) Also I saw that all registry keys related to `winemenubuilder` are missing in the official doc: https://wiki.winehq.org/Useful_Registry_Keys
Hi Loïc, thanks for the feedback. You raise some good points.
I agree that Wine shouldn't advertise `file:` URI handlers to the desktop environment, because Windows programs can't use Unix file paths. I just pushed a new patch that adds the `file` "protocol" to the blacklist.
I'm not convinced that we need another registry option to disable desktop integration for protocols. We already have `HKCU\Software\Wine\FileOpenAssociations\Exclude` to disable associations for a particular program and `HKCU\Software\Wine\FileOpenAssociations\Enable` to disable associations altogether. I don't see a benefit to treating protocol associations differently than file associations. Not many Windows programs use protocol associations in the first place. However, we could add such an exclusion feature later if there turns out to be a lot of demand for it. For clarity, I did just add a second commit to this merge request that changes the "Manage file associations" checkbox in winecfg to say "Manage file and protocol associations" instead.
https://wiki.winehq.org/ is a wiki. When you see something missing, please add it!