diff --git a/src/winetricks b/src/winetricks index e1774793f..6666f376b 100755 --- a/src/winetricks +++ b/src/winetricks @@ -14078,12 +14078,16 @@ w_metadata winemono dlls \ load_winemono() { - # Look for registry keys + # Look for registry keys and cached .msi files ${WINE} reg query "HKLM\\Software\\Microsoft\\.NETFramework\\Policy" 1>/dev/null # check for wine-mono/dotnet48- regkeys (dotnet5+/dotnetcore don't store regkeys here) - regquery_dnbelow5=$? # 0 = found regkeys; 1 = no regkeys (or wine crashed while searching) + regquery_dnbelow5=$? # 0 = found regkeys; 1 = no regkeys (or wine crashed while searching). ${WINE} reg query "HKCU\\Software\\Wine\\Mono" 1>/dev/null # check if a user created a custom wine-mono installation. This is not a default regkey when wine-mono is installed regquery_customwinemono=$? # 0 = found regkeys; 1 = no regkeys (or wine crashed while searching) - # Note: Can't use winetricks w_try here since we are counting on an error code being returned. + for winemono_msicaches in "${HOME}/.cache/wine/" "/usr/share/wine/mono/" "/opt/wine/mono/"; do + if winemono_cachedmsi=$(find ${winemono_msicaches} -iname 'wine-mono*.msi'); then + break + fi + done # Cancel installation if .NET or wine-mono are already installed if [ -d "${W_WINDIR_UNIX}/mono/mono-2.0" ] || [ -d "${WINEPREFIX}/share/wine/mono/wine-mono-5.0.0" ] || [ -d "/usr/local/share/wine/mono/wine-mono-5.0.0" ] || [ -d "/usr/share/wine/mono/wine-mono-5.0.0" ] || [ -d "/opt/wine/mono/wine-mono-5.0.0" ] || [ ${regquery_customwinemono} -eq 0 ]; then @@ -14094,7 +14098,7 @@ load_winemono() fi # Auto-install any cached wine-mono*.msi files silenty, or use AHK to silently press "Wine Mono Installer" install button, or run "Wine Mono Installer" for user - if [ -e "${HOME}"/.cache/wine/wine-mono*.msi ] || [ -e /usr/share/wine/mono/wine-mono*.msi ] || [ -e /opt/wine/mono/wine-mono*.msi ]; then + if [ ${winemono_cachedmsi} ]; then w_try "${WINE}" control.exe appwiz.cpl install_mono # launch Wine Mono Installer # Note: Wine Mono Installer will auto-install a cached wine-mono*.msi if it is in any of these directories (ignores .tar.gz / .tar.xz files). elif [ ${W_OPT_UNATTENDED} ]; then