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

Conversation

Kreyren
Copy link
Contributor

@Kreyren Kreyren commented Sep 28, 2019

DO NOT MERGE - Game was updated and this no longer works.

Adds Magic: The Gathering Arena verb

Referencing: PhoenicisOrg/scripts#934

game using non-visualstuio installer works with output that doesn't seem to be relevant to WINE:

Executing wine msiexec /I /home/kreyren/.cache/winetricks/mtg_arena/MTGAInstaller_0.1.1790.733462.msi

Z:\home\kreyren>chcp 65001
Can't recognize 'chcp 65001 ' as an internal or external command, or batch script.

Z:\home\kreyren>del "C:\users\kreyren\Temp\{CE5264CC-7EDF-492E-84F6-B9E7A53A606A}.bat" /Q /F
Can't recognize 'C:\users\kreyren\Temp\{CE5264CC-7EDF-492E-84F6-B9E7A53A606A}.bat' as an internal or external command, or batch script.

Official uses visualstudio installer

Uses: #1348

Signed-off-by: Jacob Hrbek kreyren@rixotstudio.cz

@Kreyren
Copy link
Contributor Author

Kreyren commented Sep 28, 2019

Results in:
image

which is fatal

Update: affected by https://bugs.winehq.org/show_bug.cgi?id=45546

Update: Patched using #1348 using WINEHACK

Adds Magic: The Gathering Arena verb

Referencing: PhoenicisOrg/scripts#934

game using non-visualstuio installer works with output that doesn't seem to be relevant to WINE:
```
Executing wine msiexec /I /home/kreyren/.cache/winetricks/mtg_arena/MTGAInstaller_0.1.1790.733462.msi

Z:\home\kreyren>chcp 65001
Can't recognize 'chcp 65001 ' as an internal or external command, or batch script.

Z:\home\kreyren>del "C:\users\kreyren\Temp\{CE5264CC-7EDF-492E-84F6-B9E7A53A606A}.bat" /Q /F
Can't recognize 'C:\users\kreyren\Temp\{CE5264CC-7EDF-492E-84F6-B9E7A53A606A}.bat' as an internal or external command, or batch script.
```

Official uses visualstudio installer
- returns `0070:err:msi:custom_get_thread_return Invalid Return Code 1627` for https://mtgarena.downloads.wizards.com/Live/Windows32/MTGAInstaller.exe
- winebug https://bugs.winehq.org/show_bug.cgi?id=47820, logic adapted

This installer uses wine binary stacked in AppImage using Winetricks#1348

Signed-off-by: Jacob Hrbek <kreyren@rixotstudio.cz>
@Kreyren Kreyren marked this pull request as ready for review September 28, 2019 18:46
@Kreyren
Copy link
Contributor Author

Kreyren commented Sep 28, 2019

Lutris installer

Source of lutris installer which is written based on this commit
https://lutris.net/games/install/15855/view

custom-name: Magic The Gathering Arena - AppImage
files:
- setup: https://mtgarena.downloads.wizards.com/Live/Windows32/versions/1790.733462/MTGAInstaller_0.1.1790.733462.msi
- appimage_ci: https://github.com/Kreyren/kreytricks/releases/download/7f230d2/MTGA.AppImage
game:
  args: wine "$GAMEDIR/drive_c/Program Files (x86)/Wizards of the Coast/MTGA/MTGA.exe"
  exe: $GAMEDIR/MTGA.AppImage
installer:
- move:
    dst: $GAMEDIR
    src: appimage_ci
- execute:
    args: wine wineboot
    description: Setting up wine prefix
    env:
      WINEARCH: win64
      WINEPREFIX: $GAMEDIR
    file: $GAMEDIR/MTGA.AppImage
- execute:
    args: wine setup
    description: Installing MTGA
    env:
      WINEDLLOVERRIDES: winemenubuilder.exe=d
      WINEPREFIX: $GAMEDIR
    file: $GAMEDIR/MTGA.AppImage
require-binaries: wine
system:
  env:
    WINEARCH: win64
    WINEDEBUG: -all
    WINEDLLOVERRIDES: winemenubuilder.exe=d
    WINEPREFIX: $GAMEDIR

@Kreyren
Copy link
Contributor Author

Kreyren commented Sep 29, 2019

Game outputs Wine error if Change payment method in shop is pressed. This doesn't affect gameplay, but it should be investigated.

@Kreyren
Copy link
Contributor Author

Kreyren commented Sep 30, 2019

do not merge the patch path is wrong

Update: resolved

@Kreyren
Copy link
Contributor Author

Kreyren commented Sep 30, 2019

Some ways wineprefix feature has not been taken fully advantage of.
I still think ntdll is sitll a ntdll.dll.so file.
So with platform stuff.
If it is a PE file things do come different.

Might be alternative solution for ntdll.dll fix instead of using wineappimagebuilder

Relevant: https://www.winehq.org/news/2019070501 (this year feature)

So the older documentation and work around would not have considered that route because it really was not an option.
The old option was basically a Microsoft provide dll or wine internal dll.so we have a third option a wine made pe dll with a patch being used instead of the Microsoft dll
Windows executatable format is PE (Portable Executables)
dll.so that wine has historically used is a elf pe hibrid that could use host platform elf .so files .... This does mean dll.so are not that portable. Also means if a windows applicaiton looked at a dll.so file and sees ELF at the start it can go what in hell I was expecting PE

Also the PE ends in just dll no .so

You have to watch out for anther trap.
Wine generates what is called fake dlls as well.
Inside the wine prefix you can be look at what are fake dlls that are basically enough of a PE file that application looks at it and the applications goes dll exists but when it attempt to use it what is really given is the builtin .dll.so/.dll in the built in directory.
wine is complex little beast with fake dlls, builtin dll and native dll

he built in provide dll will be in like /usr/lib64/wine ie outside the wine prefix with fakes generated in the wineprefix.
native windows libraries/override libraries will be placed in wineprefix than used dlloverride setting to make the built wine dll be ingnored.

kreyren> Are all builtin dlls in /usr/lib64/wine PE libs?
No
some are elf/pe hybrids some are PE these days.

01> being new stuff there is no good documentation on this process either.
<kreyren> > kreytricks_test/wine-4.17/dlls/ntdll/ntdll.dll.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=8858036a6746067f0e3f5f93dc56e17da147d43d, not stripped
<kreyren> -> not PE?
<kreyren> or 
<kreyren> > kreytricks_test/wine-4.17/dlls/ntdll/ntdll.dll.fake: PE32+ executable (DLL) x86-64, for MS Windows
<kreyren> this should be patched using provided winehack -> just preloading for WINE should be enough ?
<01> ending in fake I would say that was the fake one built to be placed in the wine directory
<01> I would suspect you have a ntdll.dll.so so that is still a elf/pe hybrid.
<01> kreyren: yes you have a dll.so so that has not been migrated to PE only solution yet.
<01> kreyren: but this is something you need to keep eye on with changed with wine versions as this may or may not change.
<kreyren> might be worth trying though
<kreyren> WINETRICKS_BLACKLIST="45546" LD_PRELOAD="/home/kreyren/kreytricks_test/wine-4.17/dlls/ntdll/ntdll.dll.so" kreytricks prefix=mtga mtg_arena
<kreyren> > /bin/sh: error while loading shared libraries: libwine.so.1: cannot open shared object file: No such file or directory

kreyren: I don't know if you will get this but you cannot use preload with wine elf/pe stuff wine has its own loader that stacks on top of the normal loader. So this is stuff that need to be done by WINEDLLOVERRIDES and WINEDLLPATH yes WINEDLLPATH making the first PATH in list have the replacement ntdll.dll.so and next path point to host will work to replace ntdll.dll.so.

Conclusion: investigate

@Kreyren
Copy link
Contributor Author

Kreyren commented Sep 30, 2019

In src/winetricks line 18044:

        if ! grep -qF "for (i = 0; i < 2000; i++)" "$wineappimagebuilder_workdir/wine-4.17/dlls/ntdll/thread.c"; then

                                                    ^-- SC2154: wineappimagebuilder_workdir is referenced but not assigned.

Will be assigned once #1348 is merged

Kreyren pushed a commit to Kreytricks/kreytricks that referenced this pull request Oct 3, 2019
As refferenced on Winetricks#1344 making a new wineprefix is creating conflicts for installers that are using custom WINE, this resolves it and seems to fix Winetricks#599 as well.

Adding `winetricks_set_wineprefix` to some verbs might be required, so far no conflicts on WINE 4.17 packaged by Debian.

Fixes: Winetricks#1344
Fixes: Winetricks#1335
Fixes: Winetricks#1347
Allows adaptation using: Winetricks#1348

Signed-off-by: Jacob Hrbek <kreyren@rixotstudio.cz>
Kreyren pushed a commit to Kreytricks/kreytricks that referenced this pull request Oct 3, 2019
As refferenced on Winetricks#1344 
making a new wineprefix is creating conflicts for installers that are 
using custom WINE, this resolves it and seems to fix 
Winetricks#599 as well.

Adding `winetricks_set_wineprefix` to some verbs might be required, so 
far no conflicts on WINE 4.17 packaged by Debian.

Fixes: Winetricks#1344
Fixes: Winetricks#1335
Fixes: Winetricks#1347
Allows adaptation using: 
Winetricks#1348

Signed-off-by: Jacob Hrbek <kreyren@rixotstudio.cz>
@Kreyren
Copy link
Contributor Author

Kreyren commented Oct 20, 2019

Game got updated and the workaround is no longer working -> Update required

@Kreyren
Copy link
Contributor Author

Kreyren commented Oct 20, 2019

New update requires powershell apparently (#1391)

@Kreyren
Copy link
Contributor Author

Kreyren commented Nov 15, 2019

Transfered in Kreytricks#40 since game needs debugging

@Kreyren Kreyren closed this Nov 15, 2019
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.

None yet

1 participant