Skip to content
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

Fix remove_mono breaks dotnet40 on subsequent dotnet* installs #2101

Merged
merged 3 commits into from
Dec 15, 2023

Conversation

deriamis
Copy link
Contributor

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

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 Winetricks#2072
@skryvel
Copy link

skryvel commented Aug 5, 2023

Hi. I have the following suggestion, leaving it outside of the if.

    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

I arrived at this because I think I witnessed it still being removed while trying to debug things, but I can't say right now if it's really a thing or not. In any case, this should make it idempotent in a way.

@deriamis
Copy link
Contributor Author

Hi. I have the following suggestion, leaving it outside of the if.

    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

I arrived at this because I think I witnessed it still being removed while trying to debug things, but I can't say right now if it's really a thing or not. In any case, this should make it idempotent in a way.

I agree that this is better. I'll update the PR when I get off work. Thanks!

@austin987
Copy link
Contributor

Please fix the quoting errors that shellcheck pointed out; the current code will break for prefixes that contain special characters.

@deriamis
Copy link
Contributor Author

deriamis commented Sep 9, 2023

@austin987 I've addressed the shellcheck issues. Sorry about that!

@qwertychouskie
Copy link
Contributor

@austin987 Any chance of getting this merged?

@austin987 austin987 merged commit 1f7d8b7 into Winetricks:master Dec 15, 2023
@austin987
Copy link
Contributor

Yes, sorry for the delay, and thanks @deriamis for the patch!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

remove_mono breaks dotnet40 on subsequent dotnet* installs
4 participants