-
-
Notifications
You must be signed in to change notification settings - Fork 409
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for installing Mono via winetricks? #1236
Comments
Wine automatically installs Mono, the Wiki even lists the search paths. |
Because, as it says, it doesn't find a Mono package. Put the right msi installer in the right folder, and it'll install automatically. For the path, see the wiki. |
I think the OP was referring to that already, that he/she doesn't want to use that "manual" method of copying the msi to a folder, and instead would like to do something like |
Any updates on this? I'm interested in doing the same thing. |
No updates. The main problem is that I can't see an easy way to figure out what version of mono a given wine version needs without hard coding it (i.e., the value isn't in the registry/plain text anywhere, just embedded in mscoree.dll/appwiz.cpl). And given that wine automatically gets mono on first boot/has an automated option already, it's a lower priority. |
On my system, when updating a prefix, wine displays two pop-up windows asking if I want to download Mono and asking if I want to download Gecko. This might not seem like a big deal for one wine prefix, but when managing many prefixes, it's very boring to click OK hundreds of times... There has got to be a way to install Mono and Gecko unattended. |
There is: TL;DR: put the .msi files for gecko/mono in |
Would it be possible to place those files in a universal location, rather than in one user's home directory? |
Look closer at the wiki: (or if you have wine in /usr, then make that directory and put the msi files there). |
I figured it out. Turns out you had to download the .msi files to /opt/wine/gecko and /opt/wine/mono, and retain the original filenames! |
I don't think this is likely to be implemented, without changes upstream (see #1236 (comment)) |
I understand this ticket is closed, but for future implementation in winetricks, or for others who end up here... The script below works reasonably well on Ubuntu 22.04 with Wine 7.22 ( |
A neat idea, but unfortunately, not portable.
|
Yeah, quite true, it is a GNU extension. So... less pretty (and slightly more error prone), but portable:
yields:
|
That grep doesn't work on BSD grep for me:
|
fwiw, I'm also interested in winetricks verbs for I did some sleuthing and found a way to trigger the wine-mono or wine-gecko install window prompts: But I don't yet know how to run them silently. Using the wine-gecko is required for the winetricks This might be a bit messy, but one could manually install AHK into tmp and run an AHK script to press the Install button. It wouldn't work for a headless install without xserver, but otherwise a winetricks verb could be written with a silent option that way. Some Sleuthing Debug Setup:
Some interesting lines from the console output: Using Running Downloading and unzipping wine-9.9 sourcecode and using notepad++ to set folder as workspace and search all files finds install_gecko mentioned in wine9.9source\dlls\appwiz.cpl\appwiz.c & wine9.9source\dlls\mshtml\nsembed.c From here, I can't find a way to launch silently (and no helpful strings related to 'help' 'silent' or 'quiet'), but these are relevant methods static LONG start_params(const WCHAR *params)
{
if(!params)
return FALSE;
if(!wcscmp(params, L"install_gecko")) {
install_addon(ADDON_GECKO);
return TRUE;
}
if(!wcscmp(params, L"install_mono")) {
install_addon(ADDON_MONO);
return TRUE;
} In nsembed.c static BOOL install_wine_gecko(void)
{
PROCESS_INFORMATION pi;
STARTUPINFOW si;
WCHAR app[MAX_PATH];
WCHAR *args;
LONG len;
BOOL ret;
static const WCHAR controlW[] = L"\\control.exe";
static const WCHAR argsW[] = L" appwiz.cpl install_gecko";
len = GetSystemDirectoryW(app, MAX_PATH-ARRAY_SIZE(controlW));
memcpy(app+len, controlW, sizeof(controlW));
args = malloc(len * sizeof(WCHAR) + sizeof(controlW) + sizeof(argsW));
if(!args)
return FALSE;
memcpy(args, app, len*sizeof(WCHAR) + sizeof(controlW));
memcpy(args + len + ARRAY_SIZE(controlW)-1, argsW, sizeof(argsW));
TRACE("starting %s\n", debugstr_w(args));
memset(&si, 0, sizeof(si));
si.cb = sizeof(si);
ret = CreateProcessW(app, args, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);
free(args);
if (ret) {
CloseHandle(pi.hThread);
WaitForSingleObject(pi.hProcess, INFINITE);
CloseHandle(pi.hProcess);
}else {
WARN("installation failed\n");
}
return ret;
} In control.c extern void WINAPI Control_RunDLLW(HWND hWnd, HINSTANCE hInst, LPCWSTR cmd, DWORD nCmdShow);
static void launch(LPCWSTR what)
{
Control_RunDLLW(GetDesktopWindow(), 0, what, SW_SHOW);
ExitProcess(0);
}
int WINAPI wWinMain(HINSTANCE hInst, HINSTANCE hPrev, LPWSTR lpszCmdLine, INT nCmdShow)
{
InitCommonControls();
/* no parameters - pop up whole "Control Panel" by default */
if (!*lpszCmdLine) {
launch(lpszCmdLine);
}
/* check for optional parameter */
if (!lstrcmpiW(lpszCmdLine, L"COLOR"))
launch(L"desk.cpl,,2");
if (!lstrcmpiW(lpszCmdLine, L"DATE/TIME"))
launch(L"timedate.cpl");
if (!lstrcmpiW(lpszCmdLine, L"DESKTOP"))
launch(L"desk.cpl");
if (!lstrcmpiW(lpszCmdLine, L"INTERNATIONAL"))
launch(L"intl.cpl");
if (!lstrcmpiW(lpszCmdLine, L"KEYBOARD"))
launch(L"main.cpl @1");
if (!lstrcmpiW(lpszCmdLine, L"MOUSE"))
launch(L"main.cpl");
if (!lstrcmpiW(lpszCmdLine, L"PORTS"))
launch(L"sysdm.cpl,,1");
if (!lstrcmpiW(lpszCmdLine, L"PRINTERS"))
launch(L"main.cpl @2");
/* try to launch if a .cpl file is given directly */
launch(lpszCmdLine);
return 0;
} For those who want to automate wine-mono and Gecko installs, more interesting info I learned from trial-and-error: # If a wine-mono .msi is already present in a cached area, then wine will install it silently by default.
w_try "${WINE}" control.exe appwiz.cpl install_mono
# wine-mono Installer only pays attention to .msi files (ignores .tar.gz / .tar.xz files). Version does not matter.
#
# wine-mono Installer will install a wine-mono*.msi if it is in any of these directories.
# $HOME/.cache/wine/
# /usr/share/wine/mono/
# /opt/wine/mono/
#
# wine-mono Installer will ignore a wine-mono*.msi if it is in any of these directories.
# /usr/local/share/wine/mono/
# $HOME/.wine/share/wine/mono/
# $HOME/.wine/drive_c/windows/system32/mono/
# $HOME/.wine/drive_c/windows/sysWoW64/mono/
# $HOME/.wine/drive_c/windows/syswow64/mono/ # If a wine*gecko*.msi of the correct version for wine is already present in a cached area, then wine will install it silently by default.
w_try "${WINE}" control.exe appwiz.cpl install_gecko
# Wine Gecko Installer only pays attention to .msi files (ignores .tar.bz2 / .cab files) of the correct version for Wine.
#
# Wine Gecko Installer will install a proper wine-gecko*.msi if it is in any of these directories.
# $HOME/.cache/wine/
# /usr/share/wine/gecko/
# /opt/wine/gecko/
#
# Wine Gecko Installer will ignore a proper wine*gecko*.msi if it is in any of these directories.
# /usr/local/share/wine/gecko/
# $HOME/.wine/share/wine/gecko/
# $HOME/.wine/drive_c/windows/system32/gecko/
# $HOME/.wine/drive_c/windows/sysWoW64/gecko/
# $HOME/.wine/drive_c/windows/syswow64/gecko/ edits: Sorry to spam anybody's email inbox, just want to report this info properly |
Can Winetricks install Mono MSI instead of installing it manually as per Wiki?
I'm aware it can
remove_mono
, but I can't see option to install it. I can see the Mono popup asking to install it when runningwineboot -u
, or by overridingWINEDLLOVERRIDES
, e.g.WINEDLLOVERRIDES=fixme+all winetricks -v
, but I'm looking for non-interactive way with minimum hassle (likewinetricks mono
).Is there any reason why Mono is not on the list of libraries to install? I think in the past Mono was supported. Was there some reason to remove it?
The text was updated successfully, but these errors were encountered: