DoubleYouC/Bethini-Pie-Performance-INI-Editor

Unhandled exception detecting "Starfield" on Linux

Opened this issue · 11 comments

Previous version worked well, no issues running it through wine.
I am able to select the game "Starfield" afterwards it gives Unhandled Expection window. Setting Game Path and INI Path is possible but I am not able to set or view values.

Clicking "Ok" on the unhandled exception exits the program.

The window should state the exception, and the log file has more information. As is, I can't tell what is happening from the description.

Leaving a screenshot maybe it helps:

image

4.8 works fine, don't experience any issue

Found more info on log.log:

2023-10-22 17:45:34,267 - INFO - 2023 10-Oct 22 Sun - 17.44.55 will be kept.
2023-10-22 17:45:34,267 - INFO - 2023 10-Oct 22 Sun - 17.45.34 will be kept.
2023-10-22 17:45:34,377 - INFO - Force choose game/application at startup.
2023-10-22 17:45:34,403 - INFO - Choose game/application.
2023-10-22 17:45:38,661 - INFO - Change of game/application
2023-10-22 17:45:38,682 - INFO - Application/game is Starfield
2023-10-22 17:45:38,688 - INFO - No image for tab.

couldn't open "icons\Setup.png": no such file or directory
2023-10-22 17:45:38,695 - INFO - Starfield Documents\My Games folder is Starfield.
2023-10-22 17:45:38,696 - INFO - User documents location: C:\users\steamuser\Documents
2023-10-22 17:45:38,722 - INFO - Starfield Documents\My Games folder is Starfield.
2023-10-22 17:45:38,723 - INFO - User documents location: C:\users\steamuser\Documents
2023-10-22 17:45:38,724 - INFO - No image for tab.

couldn't open "icons\Preferences.png": no such file or directory
2023-10-22 17:45:38,753 - INFO - An unhandled exception occurred.

Can confirm the same exact issue with Fallout 4. Rolling back to 4.8 and everything works normally.

For reference, this is with BethINI running under WINE. I haven't tried running the program natively, though I imagine it's possible given that it's built with Python.

I had this issue too.

For short term, adjust the instructions to use a tool such as proton tricks to launch the tool under proton.

As of long term I think the best way for it to handle it is to add a launcher script for Linux users that will set it up to launch under the proton environment of the appropriate game. You can find the core of such a linux script in the ProtonTricks project. This script can also setup any needed runtimes that are absent from proton. Chances are the Winetricks script ProtonTricks uses has installers for said runtimes available.

You may also want to donate a tool script to Protontricks and/or the WineTricks tool to install and run Bethini Pie. This would be the ideal solution.

Still, I would like to note, this should NOT be a fatal error. If anything goes wrong finding the directory structure, it should simply prompt the user for the appropriate directories to use.

Still, I would like to note, this should NOT be a fatal error. If anything goes wrong finding the directory structure, it should simply prompt the user for the appropriate directories to use.

I agree greatly with this sentiment. Graceful failure is always better than a hard crash. Communication to the user that something has gone wrong is more than enough. Crashing and burning over a missing file or directory is typically not good.

Edit: Upon investigation this seems like it might be related to registries for the games not being present. Relevant snippet follows:

2023-12-22 16:20:18,145 - DEBUG - Did not find game folder in the registry (no WOW6432Node location).
Traceback (most recent call last):
File "lib\customFunctions.py", line 211, in getBethesdaGameFolder
FileNotFoundError: [WinError 2] File not found
2023-12-22 16:20:18,147 - INFO - Fallout 4 Documents\My Games folder is Fallout4.
2023-12-22 16:20:18,147 - INFO - User documents location: C:\users\dusty\Documents
2023-12-22 16:20:18,166 - INFO - Fallout 4 Documents\My Games folder is Fallout4.
2023-12-22 16:20:18,167 - INFO - User documents location: C:\users\dusty\Documents
2023-12-22 16:20:18,175 - INFO - An unhandled exception occurred.

For short term, adjust the instructions to use a tool such as proton tricks to launch the tool under proton.

I'm seeing this issue with Skyrim SE when Bethini is launched from MO2 which replaced the Steam Skyrim SE launcher, so I'm pretty sure it's already running under Proton.

Hello everyone,

I've been trying to setup FO4 in a macMini M1 (Sonoma) with CrossOver 24.0.3, and got the same "Unhandled exception" error after the game selection screen. After a lot of debugging and searching, I managed to solve it. Not sure if it will solve the scenarios reported above (Linux, Starfield, etc), but I guess it's worth a try. Here it goes:

  • Install Python 12 and download the latest repo code
  • Install dependencies with pip. Here's what I have currently installed:
# pip list
Package                   Version
------------------------- --------
altgraph                  0.17.4
colorama                  0.4.6
debuglater                1.4.4
packaging                 24.1
pefile                    2023.2.7
pillow                    10.3.0
pip                       24.0
pyinstaller               6.8.0
pyinstaller-hooks-contrib 2024.7
pywin32-ctypes            0.2.2
setuptools                70.1.0
simpleeval                0.9.13
ttkbootstrap              1.10.1
  • Edit file "Bethini.pyw", from line 807 onwards, changing from:
self.tab_dictionary[each_tab]["LabelFrames"][the_label_frame]["SettingFrames"][on_frame][the_setting][id_] = 
ttk.Checkbutton(self.tab_dictionary[each_tab]["LabelFrames"][the_label_frame]["SettingFrames"][on_frame][the_setting]["TkFinalSettingFrame"],
                                                                                                                              text=each_setting, variable=self.tab_dictionary[each_tab]["LabelFrames"][the_label_frame]["SettingFrames"][on_frame][the_setting]["tk_var"],
                                                                                                                              onvalue=on_value, offvalue=off_value)

to:

self.tab_dictionary[each_tab]["LabelFrames"][the_label_frame]["SettingFrames"][on_frame][the_setting][id_] = 
ttk.Checkbutton(self.tab_dictionary[each_tab]["LabelFrames"][the_label_frame]["SettingFrames"][on_frame][the_setting]["TkFinalSettingFrame"],
                                                                                                                              bootstyle="round-toggle",
                                                                                                                              text=each_setting, variable=self.tab_dictionary[each_tab]["LabelFrames"][the_label_frame]["SettingFrames"][on_frame][the_setting]["tk_var"],
                                                                                                                              onvalue=on_value, offvalue=off_value)

i.e. just add bootstyle="round-toggle", to the parameter list

  • start a regular "cmd" session
  • start the app with the following command: "python Bethini.pyw"

It will change the style of the checkboxes (or Checkbuttons, as the ttk framework calls it), but I guess it's just cosmetics.

Regarding the font issue: I've installed manually the font Segoe UI to my Crossover Bottle. I'll try later to run the fix above without the font installed.

For reference, the solution was posted in the following issue:
israel-dryer/ttkbootstrap#506

Please let me know if it works. I'm quite rusty with Python programming, but maybe next week I can take some time to create a PR, or a clone with the new binaries.

Cheers!

I have already solved this issue with the help of another tester, but I haven't posted the fix yet.

This bug affects all supported titles on Steam Deck, and seemingly other Linux platforms as well. I'm looking forward to using the fixed version!

Tried 4.11 started from Vortex

couldn't open "icons\Setup.png": no such file or directory
2024-07-29 18:38:27,321 - INFO - Starfield Documents\My Games folder is Starfield.
2024-07-29 18:38:27,322 - INFO - User documents location: C:\users\eric\Documents
2024-07-29 18:38:27,373 - INFO - Starfield Documents\My Games folder is Starfield.
2024-07-29 18:38:27,374 - INFO - User documents location: C:\users\eric\Documents
2024-07-29 18:38:27,376 - INFO - No image for tab.

couldn't open "icons\Preferences.png": no such file or directory
2024-07-29 18:38:27,416 - INFO - An unhandled exception occurred.

Both image files are not part of the icons folder, will try 4.8 as recommended here

For anyone still having this issue, the easy way to solve it is to install the Segoe UI font into the game prefix. Go to the repository bellow and drop all fonts from the font folder into the "/home/deck/.local/share/Steam/steamapps/compatdata/489830/pfx/drive_c/windows/Fonts" folder (I've tried other font files but it seems that it just works with a specific file name with small caps, like the ones from this repository.

https://github.com/mrbvrz/segoe-ui-linux/tree/master