From f7021d53888bc935f255ae1da8457850ecc22f23 Mon Sep 17 00:00:00 2001 From: Ryan Egesdahl Date: Wed, 19 Jul 2023 19:47:44 -0700 Subject: [PATCH 1/3] Fix remove_mono breaks dotnet40 on subsequent dotnet* installs We should not be removing mscoree.dll in all dotnet* installs because it could have been placed by the dotnet40 verb, which would cause subsequent dotnet* verbs to break dotnet40. The deletion should instead only happen when the native dotnet is detected. We continue to remove the registry keys in any case, though, since they are only relevant to the native DLL. Closes #2072 --- src/winetricks | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/winetricks b/src/winetricks index c9829c050..4ddcc09bc 100755 --- a/src/winetricks +++ b/src/winetricks @@ -18758,18 +18758,15 @@ load_remove_mono() for uuid in ${mono_uuid}; do "${WINE_ARCH}" uninstaller --remove "${uuid}" done + "${WINE_ARCH}" reg delete "HKLM\\Software\\Microsoft\\NET Framework Setup\\NDP\\v3.5" /f || true + "${WINE_ARCH}" reg delete "HKLM\\Software\\Microsoft\\NET Framework Setup\\NDP\\v4" /f || true + + w_try rm -f "${W_WINDIR_UNIX}/system32/mscoree.dll" + if [ "${W_ARCH}" = "win64" ]; then + w_try rm -f "${W_WINDIR_UNIX}/syswow64/mscoree.dll" + fi elif [ -z "$1" ] || [ "$1" != "internal" ]; then - # Bail out if mono isn't installed, so we don't break .Net setups w_warn "Mono does not appear to be installed." - return - fi - - "${WINE_ARCH}" reg delete "HKLM\\Software\\Microsoft\\NET Framework Setup\\NDP\\v3.5" /f || true - "${WINE_ARCH}" reg delete "HKLM\\Software\\Microsoft\\NET Framework Setup\\NDP\\v4" /f || true - - w_try rm -f "${W_WINDIR_UNIX}/system32/mscoree.dll" - if [ "${W_ARCH}" = "win64" ]; then - w_try rm -f "${W_WINDIR_UNIX}/syswow64/mscoree.dll" fi } From 4afa2c74408e67b5be6b3cac9fb2eeeadb6e5bd0 Mon Sep 17 00:00:00 2001 From: Ryan Egesdahl Date: Mon, 21 Aug 2023 15:09:14 -0700 Subject: [PATCH 2/3] Make dll removal conditioned on mono override in use --- src/winetricks | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/winetricks b/src/winetricks index 4ddcc09bc..3727d2128 100755 --- a/src/winetricks +++ b/src/winetricks @@ -18761,8 +18761,10 @@ load_remove_mono() "${WINE_ARCH}" reg delete "HKLM\\Software\\Microsoft\\NET Framework Setup\\NDP\\v3.5" /f || true "${WINE_ARCH}" reg delete "HKLM\\Software\\Microsoft\\NET Framework Setup\\NDP\\v4" /f || true - w_try rm -f "${W_WINDIR_UNIX}/system32/mscoree.dll" - if [ "${W_ARCH}" = "win64" ]; then + if grep --quiet --text "WINE_MONO_OVERRIDES" ${W_WINDIR_UNIX}/system32/mscoree.dll; then + w_try rm -f "${W_WINDIR_UNIX}/system32/mscoree.dll" + fi + if grep --quiet --text "WINE_MONO_OVERRIDES" ${W_WINDIR_UNIX}/syswow64/mscoree.dll; then w_try rm -f "${W_WINDIR_UNIX}/syswow64/mscoree.dll" fi elif [ -z "$1" ] || [ "$1" != "internal" ]; then From e0b4d67e39bab1fd7173d646f49e7fc09bc5edfb Mon Sep 17 00:00:00 2001 From: Ryan Egesdahl Date: Fri, 8 Sep 2023 22:07:38 -0700 Subject: [PATCH 3/3] Resolve shellcheck issues --- src/winetricks | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/winetricks b/src/winetricks index 3727d2128..f224721db 100755 --- a/src/winetricks +++ b/src/winetricks @@ -18761,10 +18761,10 @@ load_remove_mono() "${WINE_ARCH}" reg delete "HKLM\\Software\\Microsoft\\NET Framework Setup\\NDP\\v3.5" /f || true "${WINE_ARCH}" reg delete "HKLM\\Software\\Microsoft\\NET Framework Setup\\NDP\\v4" /f || true - if grep --quiet --text "WINE_MONO_OVERRIDES" ${W_WINDIR_UNIX}/system32/mscoree.dll; then + if grep --quiet --text "WINE_MONO_OVERRIDES" "${W_WINDIR_UNIX}/system32/mscoree.dll"; then w_try rm -f "${W_WINDIR_UNIX}/system32/mscoree.dll" fi - if grep --quiet --text "WINE_MONO_OVERRIDES" ${W_WINDIR_UNIX}/syswow64/mscoree.dll; then + if grep --quiet --text "WINE_MONO_OVERRIDES" "${W_WINDIR_UNIX}/syswow64/mscoree.dll"; then w_try rm -f "${W_WINDIR_UNIX}/syswow64/mscoree.dll" fi elif [ -z "$1" ] || [ "$1" != "internal" ]; then