The pop-up dialog requesting installation of Mono can be an inconvenience when automating processes involving Wine. In some cases it's also helpful to be able to install a clean Wine prefix without having Mono auto-installed as part of the prefix initialisation. This MR adds environment variables allowing the user to prevent installation of the Mono and Gecko.
-- v2: appwiz.cpl: Allow installation of add-ons to be skipped.
From: Owen Rudge orudge@codeweavers.com
--- dlls/appwiz.cpl/addons.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/dlls/appwiz.cpl/addons.c b/dlls/appwiz.cpl/addons.c index a5fdda3e81f..e324e46d2d6 100644 --- a/dlls/appwiz.cpl/addons.c +++ b/dlls/appwiz.cpl/addons.c @@ -77,6 +77,7 @@ typedef struct { const char *url_config_key; const char *dir_config_key; LPCWSTR dialog_template; + const char *env_var; } addon_info_t;
/* Download addon files over HTTP because Wine depends on an external library @@ -90,7 +91,8 @@ static const addon_info_t addons_info[] = { GECKO_SHA, "http://source.winehq.org/winegecko.php", "MSHTML", "GeckoUrl", "GeckoCabDir", - MAKEINTRESOURCEW(ID_DWL_GECKO_DIALOG) + MAKEINTRESOURCEW(ID_DWL_GECKO_DIALOG), + "WINE_SKIP_GECKO_INSTALL" }, { MONO_VERSION, @@ -99,7 +101,8 @@ static const addon_info_t addons_info[] = { MONO_SHA, "http://source.winehq.org/winemono.php", "Dotnet", "MonoUrl", "MonoCabDir", - MAKEINTRESOURCEW(ID_DWL_MONO_DIALOG) + MAKEINTRESOURCEW(ID_DWL_MONO_DIALOG), + "WINE_SKIP_MONO_INSTALL" } };
@@ -752,6 +755,10 @@ BOOL install_addon(addon_t addon_type)
addon = addons_info+addon_type;
+ /* Don't install the add-on if the user has asked not to */ + if (getenv(addon->env_var)) + return FALSE; + p_wine_get_dos_file_name = (void *)GetProcAddress(GetModuleHandleW(L"kernel32.dll"), "wine_get_dos_file_name");
/*
The test failure in the rebased pipeline run appears to be completely unrelated to this.
Is there anything I can do to improve the likelihood of this patch being accepted? There are certain automation scenarios where this would be very helpful.
On Wed Feb 8 12:00:52 2023 +0000, Owen Rudge wrote:
The test failure in the rebased pipeline run appears to be completely unrelated to this. Is there anything I can do to improve the likelihood of this patch being accepted? There are certain automation scenarios where this would be very helpful.
I think it's reasonable to have a way to skip installing addons, but isn't disabling appwiz.cpl during prefix creation enough already? (Still, your patch allows selecting addons, so it's a bit more flexible.)
On Wed Feb 8 12:00:52 2023 +0000, Jacek Caban wrote:
I think it's reasonable to have a way to skip installing addons, but isn't disabling appwiz.cpl during prefix creation enough already? (Still, your patch allows selecting addons, so it's a bit more flexible.)
Ah yes, I guess something like `WINEDLLOVERRIDES=mscoree=d` may be sufficient to achieve what I need (as I would still need Gecko installed). My patch may make things clearer, but if there's an alternative solution that works well enough then that should be OK for me.
This merge request was closed by Owen Rudge.