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

mtg_arena: new verb #1347

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions src/winetricks
Original file line number Diff line number Diff line change
Expand Up @@ -17969,6 +17969,68 @@ load_hordesoforcs2_demo()

#----------------------------------------------------------------

# https://appdb.winehq.org/objectManager.php?sClass=version&iId=37229

w_metadata mtg_arena games \
title="Magic: The Gathering arena" \
publisher="Wizards of the Coast" \
year="2019" \
media="download" \
installed_exe1="$W_PROGRAMS_X86_WIN/Wizards of the Coast/MTGA/MTGA.exe"

load_mtg_arena()
{
# https://bugs.winehq.org/show_bug.cgi?id=45937#c13
if w_workaround_wine_bug 45937; then
w_call 'usetakefocus=disabled'
fi

# https://bugs.winehq.org/show_bug.cgi?id=47820
if w_workaround_wine_bug 47820; then
# Credit: ZeroPointEnergy (https://appdb.winehq.org/objectManager.php?sClass=version&iId=37229)
w_warn "This may take a while to load"
w_download "https://mtgarena.downloads.wizards.com/Live/Windows32/versions/1790.733462/MTGAInstaller_0.1.1790.733462.msi"
export file1="MTGAInstaller_0.1.1790.733462.msi"
w_warn "Installer is going to complain about permssions set on windows, these doesn't seem to be related to WINE and doesn't affect the runtime of game"
elif ! w_workaround_wine_bug 47820; then
w_download "https://mtgarena.downloads.wizards.com/Live/Windows32/MTGAInstaller.exe"
export file1="MTGAInstaller.msi"
fi

# https://bugs.winehq.org/show_bug.cgi?id=45898
if w_workaround_wine_bug 45898; then
w_warn "Affected by https://bugs.winehq.org/show_bug.cgi?id=45898"
fi

# https://bugs.winehq.org/show_bug.cgi?id=45546
if w_workaround_wine_bug 45546; then
if [ -n "$WINETRICKS_BUILD_WINE" ]; then
w_warn "We are about to build a wine from source and package it in AppImage"
wineappimagebuilder_patches() {
w_download "https://bugs.winehq.org/attachment.cgi?id=62956" '' "$W_CACHE/$W_PACKAGE/62956.diff"

if ! grep -qF "for (i = 0; i < 2000; i++)" "$wineappimagebuilder_workdir/wine-4.17/dlls/ntdll/thread.c"; then
patch "$wineappimagebuilder_workdir/wine-4.17/dlls/ntdll/thread.c" "$W_CACHE/$W_PACKAGE/62956.diff" || w_die "Failed to apply patch in '$wineappimagebuilder_workdir/wine-4.17/dlls/ntdll/thread.c'"
elif grep -qF "for (i = 0; i < 2000; i++)" "$wineappimagebuilder_workdir/wine-4.17/dlls/ntdll/thread.c"; then
w_debug "Patch for 45546 is already applied"
else w_die "Unexpected output in wineappimagebuilder_patches function"
fi
}
load_wineappimagebuilder
elif [ -z "$WINETRICKS_BUILD_WINE" ]; then
w_download "https://github.com/Kreyren/kreytricks/releases/download/7f230d2/MTGA.AppImage"
fi

# Sanitycheck for applied patches
[ "$WINE" != "$W_CACHE/$W_PACKAGE/MTGA.AppImage" ] && [ "$WINE" != "$W_CACHE/$W_PACKAGE/$W_PACKAGE.AppImage" ] && w_die "This installer requires patched wine named MTGA.AppImage' or '$W_PACKAGE.AppImage' from '$W_CACHE/$W_PACKAGE/' provide this path to the WINE variable and execute the script again. (You can also blacklist winebug 45546)"
fi

w_warn "It may take few seconds for installer to launch (max 50sec)"
(WINEDEBUG="fixme-all" w_try "$WINE" msiexec /i "$W_CACHE/$W_PACKAGE/$file1")
}

#----------------------------------------------------------------

w_metadata mfsxde games \
title="Microsoft Flight Simulator X: Deluxe Edition" \
publisher="Microsoft" \
Expand Down