protonscr

Bug : Proton prefix not complete at first launch but second launch

protonclosed
ValveSoftware/Proton#4565 · opened 2021-01-22 by class101 · updated 2021-02-26 · 1 comments · github
Cclass101 2021-01-22 github

It seems the first time I run Proton on any app, the initial prefix is created without a config_info file, and without the builtin libraries. This is to the second launch that the config_info file is created and that the builtin libraries are deployed.

Bug: config_info and builtin libraries deployed the second time proton is started rather than the first time
Expected: Proton to deploy config_info and builtin libraries at the first launch (when pfx does not exists)
Tested: Issue observed on 5.13-5
Steps to reproduce:

  • Add a non-Steam game *.exe file with latest proton 5.13-5 in the compatibility tab
  • Run the Game
  • Notice config_info file is missing from prefix and update_builtin_libs has not been called
  • Run the Game again
  • Notice config_info file is created and update_builtin_libs has been called

I think I trace back this to this piece of code that is ignored when old_ver is None (when no prefix exists)

if old_ver == CURRENT_PREFIX_VERSION:
    # check whether any prefix config has changed
    try:
        with open(self.config_info_file, "r") as f:
            old_prefix_info = f.read()
    except IOError:
        old_prefix_info = ""

    if old_prefix_info != prefix_info:
        # update builtin dll symlinks or copies
        self.update_builtin_libs(builtin_dll_copy)

        with open(self.config_info_file, "w") as f:
            f.write(prefix_info)

When I change the condition to allow old_ver at None, I finally get the config info written and the built in libraries deployed at first proton launch

if old_ver == CURRENT_PREFIX_VERSION or old_ver is None:

To note that this might not be the perfect solution, maybe another one would be to move the writing of config_info_file outside the condition. Well at least this works.

Cclass101 2021-02-26 github

closing because nobody reads

Proton versions