Skip to content

[guide] Running Wrye Bash on WINE (Arch Linux)

Infernio edited this page Jun 11, 2021 · 3 revisions

Table of Contents

  1. Utumno's Turn
  2. Ganda's Turn
  3. Infernio's Turn

Utumno's Turn

Commits after this merge run on WINE and I post this to detail my experience.

DISCLAIMER: I am a complete WINE newbie and the info below is copy pasted from a wonky terminal.

Install WINE

Uninstall

Because I had to redo the process I also needed to cleanly uninstall. WINE leaves a lot of cruft behind when uninstalled but their FAQ has a dedicated section. The tricky part is the rm -f $HOME/.local/share/icons/????_*.{xpm,png} cause you can't find them with find / -type d \( -path /path/to/ignore \) -prune -o -iname "*wine*". A file not mentioned in their wiki I found this way was /usr/share/bash-completion/completions/wine - and also a wine prefix (virtual wine windows install) in my /root/ dir - probably cause I run wine as root (never do this). Restart to make sure menus etc are gone - after issuing (see the arch wine wiki):

$ rm ~/.local/share/applications/mimeinfo.cache
$ update-desktop-database ~/.local/share/applications/

Install

Install WINE from the official repositories.

[root@mrsd-arch utumno]# pacman -S wine
#......
Packages (8) glu-9.0.0-3  lib32-gettext-0.19.5-1  lib32-glu-9.0.0-2
             lib32-libnl-3.2.26-1  lib32-libpcap-1.7.4-1  lib32-libusb-1.0.19-1
             lib32-libxdamage-1.1.4-2  wine-1.7.51-1
#......
[root@mrsd-arch utumno]# exit # do it !

You have to enable multilib if on x64, see the Arch wiki on wine. Running from a x32 wine prefix did not make any difference in the comtype issues below.

You may want to disable WINE's bad habit of messing with your file associations - do it from the beginning

Install Pyhton prerequisites

While Bash's installer runs fine under WINE the recommended way to run bash on WINE is by the python source. One reason is that installing python via the installer will work but uninstalling it did not for me - so when I wanted a clean reinstall of python I had a hard time doing it. Another reason is this way you will be able to edit the files as described below to workaround the comtypes issues. So:

  1. Download the Python prerequisites listed in our frontpage: https://github.com/wrye-bash/wrye-bash
  2. Wine install them in this order:
$ WINEDLLOVERRIDES="winemenubuilder.exe=d"
$ echo $WINEDLLOVERRIDES
winemenubuilder.exe=d
$ cd ~/Downloads/wrye-bash-prerequisites # do this, don't run from another dir
# msiexec python-2.7.10.msi, wine start python-2.7.10.msi won't work
$ wine msiexec /i  python-2.7.10.msi
$ wine wxPython2.8-win32-unicode-2.8.12.1-py27.exe
$ wine pywin32-218.win32-py2.7.exe
$ wine comtypes-0.6.2.win32.exe
$ cd ~/.wine/drive_c/_/Python27/
$ wine python.exe
Python 2.7.10 (default, May 23 2015, 09:40:32) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import wx
>>> wx.version()
'2.8.12.1 (msw-unicode)'
>>> ^D

Run Bash

Make sure you are running from https://github.com/wrye-bash/wrye-bash/commit/124f314100e32a18cb3c339a17f6c434e48295f8 onwards. Commits before https://github.com/wrye-bash/wrye-bash/commit/1a7f12bb2ff1b6aa846593fed592d69c205e2251 would not run on WINE while commit https://github.com/wrye-bash/wrye-bash/commit/e10ca695076e24e306511fa0dd3b697e0eea0146 fixes some problems I run across on first run.

  • First hiccup was in liblo - not present in Bash anymore so you should upgrade to 307 (beta 3 at the time of writing)!

  • Second hiccup (no fix yet) - comtypes on first run cause a stack overflow in import wx.iewin:

utumno@mrsd-arch ~/.wine/drive_c/_/Python27 $ wine python.exe /mnt//win/Users/MrD/Desktop/ZZZ/wrye-bash/Mopy/Wrye\ Bash\ Launcher.pyw -o /mnt/win/GAMES/TESIV/Oblivion
wine: ....
testing UAC
fixme:shell: ....
[2015-09-23 02:12:50.450257] [0x90000000] [trace]   Getting path to %LOCALAPPDATA%.
# Generating comtypes.gen._99AB80C4_5E19_4FD5_B3CA_5EF62FC3F765_0_1_0
# Generating comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0
# Generating comtypes.gen.stdole
# Generating comtypes.gen.myole4ax
# Generating comtypes.gen._EAB22AC0_30C1_11CF_A7EB_0000C05BAE0B_0_1_1
fail bash\basher\frames.py
fail bash\basher\app_buttons.py
fail bash\basher\links.py
fail bash\basher.py
Traceback (most recent call last):
  File "/mnt//win/Users/MrD/Desktop/ZZZ/wrye-bash/Mopy/Wrye Bash Launcher.pyw", line 88, in <module>
    bash.main()
  File "Z:\mnt\win\Users\MrD\Desktop\ZZZ\wrye-bash\Mopy\bash\bash.py", line 380, in main
    import basher
  File "/mnt//win/Users/MrD/Desktop/ZZZ/wrye-bash/Mopy/Wrye Bash Launcher.pyw", line 76, in load_module
    exec compile(code, initfile, 'exec') in mod.__dict__
  File "bash\basher\__init__.py", line 4534, in <module>
    from .links import InitLinks
  File "/mnt//win/Users/MrD/Desktop/ZZZ/wrye-bash/Mopy/Wrye Bash Launcher.pyw", line 63, in load_module
    mod = imp.load_source(fullname,filename+ext,fp)
  File "bash\basher\links.py", line 40, in <module>
    from .app_buttons import *
  File "/mnt//win/Users/MrD/Desktop/ZZZ/wrye-bash/Mopy/Wrye Bash Launcher.pyw", line 63, in load_module
    mod = imp.load_source(fullname,filename+ext,fp)
  File "bash\basher\app_buttons.py", line 28, in <module>
    from .frames import ModChecker, DocBrowser
  File "/mnt//win/Users/MrD/Desktop/ZZZ/wrye-bash/Mopy/Wrye Bash Launcher.pyw", line 63, in load_module
    mod = imp.load_source(fullname,filename+ext,fp)
  File "bash\basher\frames.py", line 38, in <module>
    import wx.lib.iewin
  File "C:\_\Python27\lib\site-packages\wx-2.8-msw-unicode\wx\lib\iewin.py", line 20, in <module>
    cc.GetModule('shdocvw.dll')  # IWebBrowser2 and etc.
  File "C:\_\Python27\lib\site-packages\comtypes\client\_generate.py", line 112, in GetModule
    mod = _CreateWrapper(tlib, pathname)
  File "C:\_\Python27\lib\site-packages\comtypes\client\_generate.py", line 176, in _CreateWrapper
    generate_module(tlib, ofi, pathname)
  File "C:\_\Python27\lib\site-packages\comtypes\tools\tlbparser.py", line 708, in generate_module
    items = p.parse()
  File "C:\_\Python27\lib\site-packages\comtypes\tools\tlbparser.py", line 600, in parse
    self.parse_typeinfo(tinfo)
  File "C:\_\Python27\lib\site-packages\comtypes\tools\tlbparser.py", line 578, in parse_typeinfo
    return self.ParseAlias(tinfo, ta)
  File "C:\_\Python27\lib\site-packages\comtypes\tools\tlbparser.py", line 482, in ParseAlias
    typ = self.make_type(ta.tdescAlias, tinfo)
  File "C:\_\Python27\lib\site-packages\comtypes\tools\tlbparser.py", line 123, in make_type
    result = self.parse_typeinfo(ti)
  File "C:\_\Python27\lib\site-packages\comtypes\tools\tlbparser.py", line 578, in parse_typeinfo
######################################################################## SO
  File "C:\_\Python27\lib\site-packages\comtypes\tools\tlbparser.py", line 578, in parse_typeinfo
    return self.ParseAlias(tinfo, ta)
  File "C:\_\Python27\lib\site-packages\comtypes\tools\tlbparser.py", line 482, in ParseAlias
    typ = self.make_type(ta.tdescAlias, tinfo)
  File "C:\_\Python27\lib\site-packages\comtypes\tools\tlbparser.py", line 123, in make_type
    result = self.parse_typeinfo(ti)
  File "C:\_\Python27\lib\site-packages\comtypes\tools\tlbparser.py", line 533, in parse_typeinfo
    modname = self._typelib_module()
  File "C:\_\Python27\lib\site-packages\comtypes\tools\tlbparser.py", line 518, in _typelib_module
    return str(tlib.GetLibAttr())
  File "C:\_\Python27\lib\site-packages\comtypes\typeinfo.py", line 537, in __repr__
    (self.guid, self.wMajorVerNum, self.wMinorVerNum, self.lcid, self.wLibFlags)
  File "C:\_\Python27\lib\site-packages\comtypes\GUID.py", line 42, in __unicode__
    _StringFromCLSID(byref(self), byref(p))
  File "_ctypes/callproc.c", line 945, in GetResult
ImportError: caused by ImportError(u'caused by ImportError(u\'caused by ImportError(u"caused by RuntimeError(\\\'maximum recursion depth exceeded while calling a Python object\\\',)",)\',)',)
  • Well third's the charm:
$ wine python.exe /mnt//win/Users/MrD/Desktop/ZZZ/wrye-bash/Mopy/Wrye\ Bash\ Launcher.pyw -o /mnt/win/GAMES/TESIV/Oblivion
wine: cannot find L"C:\\windows\\system32\\winemenubuilder.exe"
err:wineboot:ProcessRunKeys Error running cmd L"C:\\windows\\system32\\winemenubuilder.exe -a -r" (2)
Wine cannot find the ncurses library (libncursesw.so.5).
fixme:ole:RemUnknown_QueryInterface No interface for iid {00000019-0000-0000-c000-000000000046}
err:winediag:schan_imp_init Failed to load libgnutls, secure connections will not be available.
err:winediag:SECUR32_initNTLMSP ntlm_auth was not found or is outdated. Make sure that ntlm_auth >= 3.0.25 is in your path. Usually, you can find it in the winbind package of your distribution.
testing UAC
fixme:shell:check_flags Unsupported flags: 0024
fixme:shell:check_flags Unsupported flags: 0038
[2015-09-24 00:18:16.698580] [0x90000000] [trace]   Getting path to %LOCALAPPDATA%.
fixme:msvcrt:MSVCRT__wsopen_s : pmode 0x01ff ignored
fixme:ole:RemUnknown_QueryInterface No interface for iid {00000019-0000-0000-c000-000000000046}
fixme:commctrl:TaskDialogIndirect 0x2f352f8, 0x2eabf08, 0x2eabf58, 0x2eabfa8
fixme:commctrl:TaskDialogIndirect dwCommonButtons=1 uType=0 ret=1
fixme:msvcrt:__clean_type_info_names_internal (0xcb39b58) stub
...

Broken

  • Maybe because comtypes fell on its face askContinue dialogs in Bash are broken:

    broken-dialogs

  • To fix this one edit balt.py:

@@ -666,3 +666,3 @@ def askNumber(parent,message,prompt=u'',title=u'',value=0,min=0,max=10000):
 import windows
-canVista = windows.TASK_DIALOG_AVAILABLE
+canVista = False
  • Other things that depend on comtypes do not work - see #240. Preferably add a patch in your report.

Run Bash from the Standalone

Running Bash from the standalone is certainly possible but you lose the ability to edit the code - below i run it in a wine x32 prefix which did not help solving the broken stuff

$ WINEPREFIX=~/.wine32/ wine Wrye\ Bash.exe -o /mnt/win/GAMES/TESIV/Oblivion
Wine cannot find the ncurses library (libncursesw.so.5).
fixme:ole:RemUnknown_QueryInterface No interface for iid {00000019-0000-0000-c000-000000000046}
4:16:02 AM: Debug: src/helpers.cpp(140): 'CreateActCtx' failed with error 0x00000103 (no more data available.).
fixme:shell:check_flags Unsupported flags: 0024
fixme:shell:check_flags Unsupported flags: 0038
[2015-09-24 04:16:03.055115] [0x90000000] [trace]   Getting path to %LOCALAPPDATA%.
fixme:msvcrt:MSVCRT__wsopen_s : pmode 0x01ff ignored
fixme:ole:RemUnknown_QueryInterface No interface for iid {00000019-0000-0000-c000-000000000046}
fixme:commctrl:TaskDialogIndirect 0x2187470, 0x213a508, 0x213a558, 0x213a5a8
fixme:commctrl:TaskDialogIndirect dwCommonButtons=1 uType=0 ret=1

Appendix: fix wine warnings

In my first iterations I tried to fix some wine warnings but those do not seem to be necessary to run bash. After a fair amount of googling (for instance 1, 2 and most difficult of all was the libgnutls):

[root@mrsd-arch utumno]# pacman -S lib32-ncurses
Packages (1) lib32-ncurses-5.9-3
.....
utumno@mrsd-arch ~ $ wine /home/utumno/Desktop/ZZZ/wrye-wine/Mopy/Wrye\ Bash.exe -o /mnt/win/GAMES/TESIV/Oblivion/
fixme:ole:RemUnknown_QueryInterface No interface for iid {00000019-0000-0000-c000-000000000046}
err:module:load_builtin_dll failed to load .so lib for builtin L"winemp3.acm": libmpg123.so.0: cannot open shared object file: No such file or directory
9:55:03 PM: Debug: src/helpers.cpp(140): 'CreateActCtx' failed with error 0x00000103 (no more data available.).
err:winediag:schan_imp_init Failed to load libgnutls, secure connections will not be available.
err:winediag:SECUR32_initNTLMSP ntlm_auth was not found or is outdated. Make sure that ntlm_auth >= 3.0.25 is in your path. Usually, you can find it in the winbind package of your distribution.
fixme:shell:check_flags Unsupported flags: 0024
fixme:shell:check_flags Unsupported flags: 0038

[root@mrsd-arch utumno]# pacman -S lib32-mpg123
Packages (2) lib32-libltdl-2.4.6-3  lib32-mpg123-1.22.3-1
 lib32-libltdl-2.4.6-3...    16.9 KiB   112K/s 00:00 [############################] 100%
 lib32-mpg123-1.22.3-1...   119.0 KiB   330K/s 00:00 [############################] 100%
utumno@mrsd-arch ~ $ wine /home/utumno/Desktop/ZZZ/wrye-wine/Mopy/Wrye\ Bash.exe -o /mnt/win/GAMES/TESIV/Oblivion/
fixme:ole:RemUnknown_QueryInterface No interface for iid {00000019-0000-0000-c000-000000000046}
10:09:31 PM: Debug: src/helpers.cpp(140): 'CreateActCtx' failed with error 0x00000103 (no more data available.).
err:winediag:schan_imp_init Failed to load libgnutls, secure connections will not be available.
err:winediag:SECUR32_initNTLMSP ntlm_auth was not found or is outdated. Make sure that ntlm_auth >= 3.0.25 is in your path. Usually, you can find it in the winbind package of your distribution.
fixme:shell:check_flags Unsupported flags: 0024
fixme:shell:check_flags Unsupported flags: 0038

Really not sure about this one (EDIT: samba not required for Bash to run just squelches the err:winediag:SECUR32_initNTLMSP ntlm_auth was not found or is outdated, lib32-gnutls not needed either just squelches err:winediag:schan_imp_init Failed to load libgnutls):

[root@mrsd-arch utumno]# pacman -S samba
Packages (3) gamin-0.1.10-8  iniparser-4.0-2  samba-4.3.0-2
...
 samba-4.3.0-2-x86_64       4.7 MiB   637K/s 00:08 [######################] 100%
....
[root@mrsd-arch utumno]# pacman -S lib32-gnutls
Packages (5) lib32-gmp-6.0.0-1  lib32-libtasn1-4.5-1  lib32-nettle-3.1.1-1
             lib32-p11-kit-0.23.1-2  lib32-gnutls-3.4.4.1-1

I am not sure I got it right but still this is a WIP.

TODO: properly rewrite/cleanup this. See page history for my initial attempt

Ganda's Turn

Which surprisingly, is quite short (so far). Running on wine 3.13.

Install

Enable multilib first (ArchWiki), then install WINE from the official repositories.

$ pacman -Syu wine

If you're new to wine, READ THE WIKI PAGE. Seriously, it will save a lot of headaches later.

Install Python prerequisites

Here you'll install all the necessary python packages and such to run wrye bash. Another warning, ALL OF IT NEEDS TO BE 32BIT, doesn't matter if your system is 64bit, if your wine install is 64bit, get the 32bit version FOR EVERYTHING. You will not believe the amount of times I needed to redo this because I got distracted or forgot and got one of the packages in 64bit and then nothing worked.

All the packages are in the readme: https://github.com/wrye-bash/wrye-bash

In my example I download everything to a specific folder and then install. It's just simpler this way but shouldn't make a difference. Shouldn't.

You should see something like this:

$ cd ~/wbreqs
$ wine msiexec /i python-2.7.15.msi
$ wine wxPython2.8-win32-unicode-2.8.12.1-py27.exe
$ wine pywin32-223.win32-py2.7.exe
$ wine comtypes-0.6.2.win32.exe
$ cd ~/.wine/drive_c/Python27/
$ wine python.exe
Python 2.7.15 (v2.7.15:ca079a3ea3, Apr 30 2018, 16:22:17) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import wx
>>> wx.version()
'2.8.12.1 (msw-unicode)'

The important part is at the end, if running python, import wx and checking its version is like above, then you did it right.

Install Steam and the Game[s]

If you have the Game[s] installed on a windows partition then that should work, so you can skip this. For the purists, go get steam here, make sure to download the windows installer and:

$ wine SteamSetup.exe

This will be just like if you were on windows, so install steam, go to the Game[s] store page, start downloading/installing that and relax for a bit.

Once that is done you should be all set!

Running Wrye Bash

Unlike Utumno, Bash runs just fine for me (so far).

$ cd ~/.wine/drive_c/Python27/
$ wine python.exe ~/git/wrye-bash/Mopy/Wrye\ Bash\ Launcher.pyw -o ../Program\ Files\ \(x86\)/Steam/steamapps/common/$GAME  #$GAME is obviously, the Game

Infernio's Turn

Third time's a charm :P

  • Distro: Arch Linux
  • Wine used: Staging 4.0-rc7
    • Note: I've also tried regular 4.0-rc7, but that doesn't seem to affect anything.
  • Wrye Bash used: Python version, commit SHA: c34fcab61837e34a7c76fa582fa3f00f3436aac3

Wine Setup

Make a new 32-bit prefix:

export WINEARCH=win32 # I have this in my /etc/profile, so all my prefixes are automatically 32-bit
WINEPREFIX=~/.wine-bash winecfg

If you're curios, the upside of using new prefixes for stuff like this is that:

  1. To uninstall (and reinstall) stuff, you can just rm -rf a prefix.
  2. Some programs actually break when you install certain DLLs into a prefix, while others need those DLLs.
  3. You can have both 32-bit and 64-bit prefixes, allowing you to use 32-bit only when necessary.

Anyways, you should now have winecfg open. On the Libaries tab, add an entry for winemenubuilder.exe and set it to disabled: This stops Wine from messing with your file associations.

Note: According to the Wine FAQ, the 'Manage file associations' toggle in the Desktop Integration tab also suffices.

WB Installation

First, clone the Wrye Bash repo somewhere (that place will be referred to as $BASH_LOC for the rest of this section), and follow the steps in [dev] Set up Pycharm for wrye bash.

Basically, download Python and install it through wine, then use pip to install our requirements. Note that you will have to specify the new WINEPREFIX each time - unless you export it, of course.

In the interest of making this reproducible, a log of the exact commands I used follows:

export WINEPREFIX=~/.wine-bash
mkdir /tmp/bash_downloads
cd /tmp/bash_downloads
# long curl command here
wine msiexec /i python-2.7.16.msi
wine python -m pip install -U pip # not necessary, but hey
cd $BASH_LOC
wine python -m pip install -r requirements.txt
# note: on nightly, you will have to run this instead (without the #'s, obviously):
# wine python -m pip install pipenv
# wine python -m pipenv sync --dev

Final Steps

Install Steam:

WINEPREFIX=~/.wine-bash winetricks steam

Now, install a game to use (I used Skyrim for testing) and wait until it's downloaded. The location where you installed it (I used the default, C:\Program Files\Steam) will be referred to as $GAME_LOC for the rest of this section.

Finally, run Wrye Bash:

WINEPREFIX=~/.wine-bash wine python $BASH_LOC/Mopy/Wrye\ Bash\ Launcher.pyw -o $GAME_LOC

For me, most things work. No canVista changes were necessary (so far). A list of the things that don't follows (will update as I encounter more issues):

  • Dragging and dropping a mod in the Mods tab crashes (Crash Dump, BashBugDump is completely empty since this crashes outside Bash code).
    • May need to report this to the Wine devs?
Clone this wiki locally