Skip to content

Commit

Permalink
winemono: replace -f globs with for loop
Browse files Browse the repository at this point in the history
  • Loading branch information
WheezyE committed Jun 10, 2024
1 parent 490558f commit 6f3acdf
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/winetricks
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 6f3acdf

Please sign in to comment.