Nexus-Mods / NexusMods.App

Home of the development of the Nexus Mods App
https://nexus-mods.github.io/NexusMods.App/
GNU General Public License v3.0
1.07k stars 49 forks source link

Flatpak Installs of Protontricks currently don't work. #2094

Open Sewer56 opened 1 month ago

Sewer56 commented 1 month ago

Bug Report

Summary

Reportedly installations of protontricks via Flatpak don't work well with the App.

[!NOTE]
Very notably Steam Deck uses an immutable distro (SteamOS). People can't install packages like normal, instead they have to rely on tech like FlatPak to sideload applications. Therefore this is rather high priority.

Steps to reproduce

  1. Install Protontricks on a Steam Deck via the Discover App
  2. Try to run Cyberpunk 2077 REDmod deployment.

What is the expected behaviour?

Things should 'just work', they are however very far from that.

Other information

Normally more advanced users working with Flatpak would set an alias like:

echo "alias protontricks='flatpak run com.github.Matoking.protontricks'" >> ~/.bashrc
echo "alias protontricks-launch='flatpak run --command=protontricks-launch com.github.Matoking.protontricks'" >> ~/.bashrc

This allows them to use protontricks and protontricks-launch from the terminal, as if it was a normal installation. However, this is a shell alias.

I believe we don't currently start processes via the shell, therefore even if the user does this, these aliases are not inherited.

In general there are two problems:

Granting Protontricks Access to Steam Libraries

You need to use a program such as flatseal to give the Flatpak install of protontricks permissions to see additional directories, such as installs of games on SDCard.

Since we should be striving to 'make modding easy'; we really should be looking into whether it's possible to automate what flatseal does here for this very specific common case (Steam Deck == Big Audience).

Executing the Flatpak Version of protontricks

Because we should not rely on users having to perform manual installation steps, we should ideally be detecting if protontricks is installed via Flatpak. We should avoid having to ask users to set an alias. If a user has it installed via flatpak, we should instead invoke that binary.

Other Notes

The strategy of what we do here will probably warrant some discussion.

erri120 commented 1 month ago

We can use flatpak list to check for the presence of com.github.Matoking.protontricks.

We can extend our runtime dependency system to automatically check for this.

erri120 commented 1 month ago

We can check for the required permissions using

flatpak override --show --user <id>

If the result doesn't contain the user's steam library, we can notify them and prompt them with an autofix:

flatpak override --user --filesystem=<path> <id>