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

Option to download proton and wine versions to a universal folder and add to clients via symlinks #286

Open
Killrmemz opened this issue Sep 1, 2023 · 6 comments
Labels
enhancement New feature or request

Comments

@Killrmemz
Copy link

Having separate copies of Proton/Wine for Bottles, Lutris, Heroic, and Steam can be rather space inefficient.
Having to download the same versions multiple times is network inefficient and takes longer.
So I propose, downloading to a single folder, and registering symlinks to relevant applications.
Of course, for the Flatpaks among the clients, it would need to be a location where each of them has permission to read, but that can be dealt with either by storing them in a default location they all share, or by adding explicit read permissions to the folder with a button.
When installing a new Proton or Wine version to a client, versions that already exist can have [Installed] listed next to their names in the list.

@Killrmemz Killrmemz added the enhancement New feature or request label Sep 1, 2023
@sonic2kk
Copy link
Contributor

sonic2kk commented Sep 1, 2023

Related: #162

A custom download directory may solve this. Using the same custom directory for multiple launchers would probably resolve this, though I didn't test.

You can choose the custom download directory by pressing the three dots button beside the launcher drop-down.

It should also be noted that for Proton, while it is not designed for use outside of Steam despite other launchers providing support, many of those will pick up Proton versions in compatibilitytools.d (and elsewhere for Valve Proton releases). So when you install a Proton version for Steam, Lutris and Heroic at least should pick it up.

Of course, this doesn't apply to Wine-GE and such with Lutris, so you still end up with the space-inefficiency you mentioned when dealing with Wine builds. This can be especially annoying with Tkg builds which can exceed 1gb.

@Killrmemz
Copy link
Author

Killrmemz commented Sep 1, 2023

In that case, and since Heroic and Lutris using Steam's own Proton versions didn't cross my mind, I can revise my idea just a little:
If a Proton version is installed to Steam, it will show up in Heroic and Lutris, but greyed out with a steam icon next to it.
However, they will still be installed to a universal folder, and the Steam install should still be a symlink, so that Bottles can be symlinked into the proton versions as well, since it does not support running bottles out of compatibilitytools.d prefixes. This can allow Lutris and Heroic to still have independent proton versions, but give a visual indicator that they can see and utilize what's installed to Steam.
Wine versions remain unchanged, and still symlink to everything that supports them.

@DavidoTek
Copy link
Owner

As sonic2kk pointed out, for now you can use the custom install folder option (... button) and add the symlinks manually.

In theory we could add modify the logic to install compatibility tools to some ProtonUp-Qt related directory and then simlink the tool to either all launchers or let the user choose which launcher should receive that tool.

I found this comment in # 162. Do symlinks to Proton actually work? #162 (comment)

@sonic2kk
Copy link
Contributor

sonic2kk commented Sep 4, 2023

I'll test that out now (GE-Proton, Proton-tkg, and a regular Valve Proton release).

Though at least in terms of launching a symlink script (Steam launches Proton games via a Python script), the SteamTinkerLaunch script is symlinked from its install directory to ~/.local/share/Steam/compatibilitytools.d/SteamTinkerLaunch/steamtinkerlaunch. Though the folder itself isn't a symlink, the script it. I guess the question becomes then, is Steam able to read symlinked compatibility tool directories.

@sonic2kk
Copy link
Contributor

sonic2kk commented Sep 4, 2023

I realised midway through testing that Valve Proton is not really applicable here, as Proton can be installed anywhere. However the tl;dr is that things work fine with Steam and mostly fine with Lutris and Heroic 🥳

  • Steam worked (tested with Steam Client Beta on Linux Desktop)
  • Lutris worked, (tested Lutris Git) though it did not display Proton-tkg for some reason, and it warned that GE-Proton8-14 did not support fsync, this issue did not occur when GE-Proton8-14 was not symlinked (this could be a bug with lutris-git)
  • Heroic worked (tested Flatpak) and displayed GE-Proton8-14 and Proton-tkg.

The games I tested with Proton-tkg had some compatibility issues, but that is probably not related to the symlinking.

For testing, I moved them to my downloads folder on my boot drive with Steam, as well as onto a folder on a separate internal drive. I symlinked them to ~/.local/share/Steam/compatibilitytools.d/, which is where Heroic and Lutris were picking them up from.

image

It seems like symlinking is supported!

@DavidoTek
Copy link
Owner

DavidoTek commented Sep 12, 2023

It seems like symlinking is supported!

Great!

Adding something like this and according GUI functionality should do the trick:

# GE-Proton CtInstaller:
    def is_update_available(self, install_dir: str):
        """
        Determines whether a new release is available.

        Returns: bool
            Returns True if an update is available, False otherwise
        """
        latest = self.fetch_releases(count=1)[0]
        ls_installed = os.listdir(install_dir)

        return (latest not in ls_installed)

    def install_update(self, install_dir: str) -> int:
        """
        Install the latest version of the ctmod and symlink it

        Returns: int
            -1: error
             0: sucess
             1: already latest
        """
        latest = self.fetch_releases(count=1)[0]
        ls_installed = os.listdir(install_dir)
        symlink_name = CT_NAME + '-Latest'

        if latest in ls_installed:
            return 1

        self.get_tool(version=latest, install_dir=install_dir, temp_dir=TEMP_DIR)

        symlink_dir = os.path.join(install_dir, symlink_name)
        latest_dir = os.path.join(install_dir, latest)

        if os.path.exists(symlink_dir):
            os.remove(symlink_dir)
        os.symlink(latest_dir, symlink_dir)

        return 0

TODOs:

  • Add GUI functionality
  • Implement is_update_available and install_update for ct mods and run install_update when following conditions apply:
    1) Old symlink exists (user enable auto updates)
    2) is_update_available() = True
  • Implement "get number of used games" for the symlink

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants