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

NXM downloads don't work with Flatpaks #317

Open
GamzeeRakoon opened this issue Mar 22, 2022 · 26 comments
Open

NXM downloads don't work with Flatpaks #317

GamzeeRakoon opened this issue Mar 22, 2022 · 26 comments
Labels
discussion Conversation about the project or related subjects

Comments

@GamzeeRakoon
Copy link
Contributor

When trying to download mods via NXM links on nexus MO2 will give me the error "failed to start download".
i have tested this on a fresh install of SkyrimSE/AE.

@otikscypi
Copy link

otikscypi commented Apr 9, 2022

It is not MO2 that gives you the error but modorganizer2-linux-installer (kind of). If you are running flatpak version of protontricks, try switching to pipx version. It helped me.

I had same problem (or rather symptom) as you. In my case it was caused by "modorganizer2-nxm-broker.sh" script calling protontricks-launch, which is not a part of flatpak version and therefore was not on my system. I tried to rewrite the script myself to get it working with flatpak version of protontricks, but I was defeated by flatpak's handling of encapsulation.

I recognized my failure, installed protontricks via pipx and let my hatred towards flatpaks/snaps grow stronger.

@astorioth
Copy link

Your fix worked like a charm, thanks man. I was at my wit's end.

@kylecarow
Copy link

kylecarow commented Apr 17, 2022

Uninstalling the protontricks flatpak, removing the alias line from my .bashrc, and installing via pipx worked perfectly.

@Osced86
Copy link

Osced86 commented May 29, 2022

I seem to get similar problem after I updated protontricks, however it works if you hit the download button when MO2 is not running, then it starts up and the download is working, but if I try to download something more I i'm getting an en error, have tried to re-install MO2, but hasn't helped.

@Morstis
Copy link

Morstis commented Jun 4, 2022

Probably related:
Matoking/protontricks#146

Installing protontricks-git fixed the issue for me

@andersmmg
Copy link

Same issue, installing protontricks-git from AUR fixed it for me too

@rockerbacon
Copy link
Owner

I'll improve the readme to include better instructions for Flatpak users as soon as I can.

Perhaps the system requirement checks can also be improved to warn users of potential incompatibilities.

@rockerbacon rockerbacon added the enhancement New feature or request label Oct 27, 2022
@StellarHarbour
Copy link

StellarHarbour commented Apr 16, 2023

pipx works for me too, but I have same problem as @Osced86 , I can't download with MO2 from Nexus if it's open already, unlucky Linux still such mess

@StellarHarbour
Copy link

@kylecarow
What's alias line from .bashrc?

@rockerbacon rockerbacon changed the title NXM downloads dont work NXM downloads don't work with Flatpaks Jul 17, 2023
@rockerbacon
Copy link
Owner

Just to give a quick update on this issue: there is no way to fully utilize the NXM links functionality when Flatpaks are involved. As far as I can tell, there is no way to make the necessary inter-process communication work because of the Flatpak security design.

If that feature is important for you, don't use Flatpaks.

@rockerbacon rockerbacon added discussion Conversation about the project or related subjects and removed enhancement New feature or request labels Jul 17, 2023
@StellarHarbour
Copy link

So is there a way to have adequate Linux setup for gaming? For example Fallout: New Vegas and MO2 with working links all the time, can we have setup with auto updates or it's cringe for Linux devs to create something that fully working?

@Martan404
Copy link

Just to give a quick update on this issue: there is no way to fully utilize the NXM links functionality when Flatpaks are involved. As far as I can tell, there is no way to make the necessary inter-process communication work because of the Flatpak security design.

If that feature is important for you, don't use Flatpaks.

As I mentioned here, by editing the modorganizer2-nxm-handler.desktop file to look like this

[Desktop Entry]
Type=Application
Categories=Game;

Exec=bash -c 'env "STEAM_COMPAT_CLIENT_INSTALL_PATH=$HOME/.steam/steam" "STEAM_COMPAT_DATA_PATH=$HOME/.steam/steam/steamapps/compatdata/489830" "$HOME/.local/share/Steam/steamapps/common/Proton 6.3/proton" run "$HOME/Games/mod-organizer-2-skyrimspecialedition/modorganizer2/nxmhandler.exe" "%u"'

Name=Mod Organizer 2 NXM Handler
MimeType=x-scheme-handler/nxm;

is it possible to use the NXM Handler with flatpaks

@metalbass
Copy link

This works perfectly for New Vegas as well.
Leaving some note for any users that want to use @Martan404's solution with New Vegas (or any other supported game):

  1. You'll need to know where you installed ModOrganizer for the current game, and replace that in the .desktop file. I installed mine in: $HOME/Games/mod-organizer-2-newvegas/.
  2. Now replace "$HOME/Games/mod-organizer-2-skyrimspecialedition/modorganizer2/nxmhandler.exe" with your folder. e.g. "$HOME/Games/mod-organizer-2-newvegas/modorganizer2/nxmhandler.exe"
  3. You can find the steam app id of the game in $HOME/Games/mod-organizer-2-newvegas/appid.txt. New Vegas is 22380
  4. You need to replace "STEAM_COMPAT_DATA_PATH=$HOME/.steam/steam/steamapps/compatdata/489830" with the id of the previous step. e.g.: "STEAM_COMPAT_DATA_PATH=$HOME/.steam/steam/steamapps/compatdata/22380"

As a question for proton-knowledgable users. Isn't MO2 using proton 8.0 now? @Martan404's .desktop file is using 6.3.

@aki-hp
Copy link

aki-hp commented Feb 9, 2024

Hi, I made a makeshift solution for Flatpak users. It's a bit more involved, but if one decided to use Linux, editing .sh files and taking API keys shouldn't be beyond them. For Steam Deck buyers, sorry, you signed up for this, like it or not.

https://gist.github.com/aki-hp/27dbcd38f55b68e21d2edd5b5a46ebc5

Replace ~/.local/share/modorganizer2/modorganizer2-nxm-broker.sh with this one, and put your Personal Nexus API Key in nexus_apikey, on line 4. At the very least, it should provide you with seamless NXM download for multiple games. @Martan404 and @metalbass 's solution was actually very nice, but sadly I couldn't make it work for multiple games.
My broker edit used built-in core tools to emulate the feeling of downloading directly to the MO2 Downloads folder for any supported games. Supposedly it will work on a Steam Deck because I edited it with Steam Deck in mind, but I haven't gotten time to test it yet. It works on Ubuntu 20.04 and Steam Deck now.

Limitations as of now:

  1. No feedback provided for the user. If the download's done, you should be able to see it in the MO2 Downloads folder. Maybe I'll add it once I have more time and have learned more.
  2. No .meta file created. This is treated as manual download by MO2. You gotta right click the downloaded file and use Query Info for that. Maybe I could try to create .meta file later on, but that's beyond what I'm willing (and am having time) to do now.

Limitation always:

  1. Provide your personal Nexus API Key manually. I guess this fits here.

I hope this helps someone.

EDIT : Tested with Steam Deck, and added "progress bar". In its current state it's not working properly yet (the progress bar is not moving, but the pop-up will stay until the download is finished), but I might be able to throw a fix in a near future.

@ubeogesh
Copy link

ubeogesh commented Apr 15, 2024

Just to give a quick update on this issue: there is no way to fully utilize the NXM links functionality when Flatpaks are involved. As far as I can tell, there is no way to make the necessary inter-process communication work because of the Flatpak security design.
If that feature is important for you, don't use Flatpaks.

As I mentioned here, by editing the modorganizer2-nxm-handler.desktop file to look like this

[Desktop Entry]
Type=Application
Categories=Game;

Exec=bash -c 'env "STEAM_COMPAT_CLIENT_INSTALL_PATH=$HOME/.steam/steam" "STEAM_COMPAT_DATA_PATH=$HOME/.steam/steam/steamapps/compatdata/489830" "$HOME/.local/share/Steam/steamapps/common/Proton 6.3/proton" run "$HOME/Games/mod-organizer-2-skyrimspecialedition/modorganizer2/nxmhandler.exe" "%u"'

Name=Mod Organizer 2 NXM Handler
MimeType=x-scheme-handler/nxm;

is it possible to use the NXM Handler with flatpaks

This is very nice and works. Thank you very much. I have only had to change the proton path to 8.0 there, because that's what I use for Skyrim.

Now if someone could please explain to me, how do I install "protontricks-git" "from AUR"? or whatever protontricks that is not a flatpack? Google leads me to here: https://aur.archlinux.org/packages/protontricks-git, but how do I install that?

I tried sudo pacman -S protontricks-git but that didn't work: error: target not found: protontricks-git

(Just in case it's not clear, I'm on Steam Deck)

@Martan404
Copy link

Martan404 commented Apr 19, 2024

Just to give a quick update on this issue: there is no way to fully utilize the NXM links functionality when Flatpaks are involved. As far as I can tell, there is no way to make the necessary inter-process communication work because of the Flatpak security design.
If that feature is important for you, don't use Flatpaks.

As I mentioned here, by editing the modorganizer2-nxm-handler.desktop file to look like this

[Desktop Entry]
Type=Application
Categories=Game;

Exec=bash -c 'env "STEAM_COMPAT_CLIENT_INSTALL_PATH=$HOME/.steam/steam" "STEAM_COMPAT_DATA_PATH=$HOME/.steam/steam/steamapps/compatdata/489830" "$HOME/.local/share/Steam/steamapps/common/Proton 6.3/proton" run "$HOME/Games/mod-organizer-2-skyrimspecialedition/modorganizer2/nxmhandler.exe" "%u"'

Name=Mod Organizer 2 NXM Handler
MimeType=x-scheme-handler/nxm;

is it possible to use the NXM Handler with flatpaks

This is very nice and works. Thank you very much. I have only had to change the proton path to 8.0 there, because that's what I use for Skyrim.

Now if someone could please explain to me, how do I install "protontricks-git" "from AUR"? or whatever protontricks that is not a flatpack? Google leads me to here: https://aur.archlinux.org/packages/protontricks-git, but how do I install that?

I tried sudo pacman -S protontricks-git but that didn't work: error: target not found: protontricks-git

(Just in case it's not clear, I'm on Steam Deck)

Unfortunately there is no easy and reliable way to install AUR packages on to the Steam Deck. If you want to install system packages you need to enter the command steamos-readonly disable. This will allow you to install pacman packages. ( I do not recommend doing this as it will reset after every SteamOS update).
Once that is done you need to install YAY or PARU to handle AUR packages. After installing YAY or PARU then you can then install protontricks using yay -S protontricks-git or paru -S protontricks-git

But why can you not use the flatpak version of Protontricks? If the flatpak is not working then try to exit the Steam client fully before opening Protontricks

Edit: On my desktop Arch system I prefer to use paru and this is how I install it

pacman -S git rust cmake 
git clone https://aur.archlinux.org/paru-bin.git
cd paru-bin
makepkg -si

@StellarHarbour
Copy link

Desktop entry helped to resolve the issue, it raises the question why the system didn't generate it in that format from the beginning...

@andersmmg
Copy link

andersmmg commented Apr 20, 2024

@StellarHarbour The way it usually sets it up allows for managing multiple games automatically. I don't think that version can, it's set to a single game.

@StellarHarbour
Copy link

@andersmmg Are you saying it can't be improved to work with every game?

@Allexio
Copy link

Allexio commented May 2, 2024

Hi, I made a makeshift solution for Flatpak users. It's a bit more involved, but if one decided to use Linux, editing .sh files and taking API keys shouldn't be beyond them. For Steam Deck buyers, sorry, you signed up for this, like it or not.

https://gist.github.com/aki-hp/27dbcd38f55b68e21d2edd5b5a46ebc5

Replace ~/.local/share/modorganizer2/modorganizer2-nxm-broker.sh with this one, and put your Personal Nexus API Key in nexus_apikey, on line 4. At the very least, it should provide you with seamless NXM download for multiple games. @Martan404 and @metalbass 's solution was actually very nice, but sadly I couldn't make it work for multiple games. My broker edit used built-in core tools to emulate the feeling of downloading directly to the MO2 Downloads folder for any supported games. Supposedly it will work on a Steam Deck because I edited it with Steam Deck in mind, but I haven't gotten time to test it yet. It works on Ubuntu 20.04 and Steam Deck now.

Limitations as of now:

  1. No feedback provided for the user. If the download's done, you should be able to see it in the MO2 Downloads folder. Maybe I'll add it once I have more time and have learned more.
  2. No .meta file created. This is treated as manual download by MO2. You gotta right click the downloaded file and use Query Info for that. Maybe I could try to create .meta file later on, but that's beyond what I'm willing (and am having time) to do now.

Limitation always:

  1. Provide your personal Nexus API Key manually. I guess this fits here.

I hope this helps someone.

EDIT : Tested with Steam Deck, and added "progress bar". In its current state it's not working properly yet (the progress bar is not moving, but the pop-up will stay until the download is finished), but I might be able to throw a fix in a near future.

Hey there, First of all thanks for trying to help all of us :)
Unfortunately, I tried this solution and could not get it to work. I am on Fedora 40 if that helps.
As mentioned by other people, the first download (before MO2 is launched) works, but then all further downloads are just ignored.

@aki-hp
Copy link

aki-hp commented May 6, 2024

Hi, I made a makeshift solution for Flatpak users. It's a bit more involved, but if one decided to use Linux, editing .sh files and taking API keys shouldn't be beyond them. For Steam Deck buyers, sorry, you signed up for this, like it or not.
https://gist.github.com/aki-hp/27dbcd38f55b68e21d2edd5b5a46ebc5
Replace ~/.local/share/modorganizer2/modorganizer2-nxm-broker.sh with this one, and put your Personal Nexus API Key in nexus_apikey, on line 4. At the very least, it should provide you with seamless NXM download for multiple games. @Martan404 and @metalbass 's solution was actually very nice, but sadly I couldn't make it work for multiple games. My broker edit used built-in core tools to emulate the feeling of downloading directly to the MO2 Downloads folder for any supported games. Supposedly it will work on a Steam Deck because I edited it with Steam Deck in mind, but I haven't gotten time to test it yet. It works on Ubuntu 20.04 and Steam Deck now.
Limitations as of now:

  1. No feedback provided for the user. If the download's done, you should be able to see it in the MO2 Downloads folder. Maybe I'll add it once I have more time and have learned more.
  2. No .meta file created. This is treated as manual download by MO2. You gotta right click the downloaded file and use Query Info for that. Maybe I could try to create .meta file later on, but that's beyond what I'm willing (and am having time) to do now.

Limitation always:

  1. Provide your personal Nexus API Key manually. I guess this fits here.

I hope this helps someone.
EDIT : Tested with Steam Deck, and added "progress bar". In its current state it's not working properly yet (the progress bar is not moving, but the pop-up will stay until the download is finished), but I might be able to throw a fix in a near future.

Hey there, First of all thanks for trying to help all of us :) Unfortunately, I tried this solution and could not get it to work. I am on Fedora 40 if that helps. As mentioned by other people, the first download (before MO2 is launched) works, but then all further downloads are just ignored.

Sorry, I just got the time to reply. Was there any error pop-up, or was it a silent error? I found an error caused by executing MO2 directly instead of using the forwarder, so I wanted to make sure about your execution condition.

@Allexio
Copy link

Allexio commented May 6, 2024

Sorry, I just got the time to reply. Was there any error pop-up, or was it a silent error? I found an error caused by executing MO2 directly instead of using the forwarder, so I wanted to make sure about your execution condition.

Hi and thanks for the reply, it is a fully silent error. I tried launching it through steam, and also by using a nexus mod link (Which launches it and does the first download but not others)

@Zackey
Copy link

Zackey commented May 9, 2024

Just to give a quick update on this issue: there is no way to fully utilize the NXM links functionality when Flatpaks are involved. As far as I can tell, there is no way to make the necessary inter-process communication work because of the Flatpak security design.
If that feature is important for you, don't use Flatpaks.

As I mentioned here, by editing the modorganizer2-nxm-handler.desktop file to look like this

[Desktop Entry]
Type=Application
Categories=Game;

Exec=bash -c 'env "STEAM_COMPAT_CLIENT_INSTALL_PATH=$HOME/.steam/steam" "STEAM_COMPAT_DATA_PATH=$HOME/.steam/steam/steamapps/compatdata/489830" "$HOME/.local/share/Steam/steamapps/common/Proton 6.3/proton" run "$HOME/Games/mod-organizer-2-skyrimspecialedition/modorganizer2/nxmhandler.exe" "%u"'

Name=Mod Organizer 2 NXM Handler
MimeType=x-scheme-handler/nxm;

is it possible to use the NXM Handler with flatpaks

This works great, it seems the issue is mostly one of paths included in this .desktop file.

Mine is as follows for fallout 4, for future google travelers:

[Desktop Entry]
Type=Application
Categories=Game;

Exec=bash -c 'env "STEAM_COMPAT_CLIENT_INSTALL_PATH=/home/SR/.var/app/com.valvesoftware.Steam/.local/share/Steam" "STEAM_COMPAT_DATA_PATH=/blaze/SteamLibrary/steamapps/compatdata/377160" "/home/SR/.var/app/com.valvesoftware.Steam/data/Steam/compatibilitytools.d/GE-Proton8-32/proton" run "/home/SR/Games/mod-organizer-2-fallout4/modorganizer2/nxmhandler.exe" "%u"'

Name=Mod Organizer 2 NXM Handler
MimeType=x-scheme-handler/nxm;

@rockerbacon rockerbacon pinned this issue May 10, 2024
@gbdrbob
Copy link

gbdrbob commented Jun 16, 2024

EDIT: While the below approach worked for me, you're probably better off using nix to install protontricks instead. I didn't know about nix until recently.

Unfortunately there is no easy and reliable way to install AUR packages on to the Steam Deck. If you want to install system packages you need to enter the command steamos-readonly disable. This will allow you to install pacman packages. ( I do not recommend doing this as it will reset after every SteamOS update).

@Martan404 This isn't entirely correct, I modified the steps @TaPO4eg3D suggested in #425 and got the standard nxm handler working using rwfus to allow installation of protontricks-git from AUR without disabling read-only mode

Beware rwfus can brick your system if you try to do a general update of all packages using pacman, read the warnings on the rwfus github page . However I believe it is safer than turning off read-only mode and it should survive an OS update. I may be pushing it installing base-devel. While I think it should be fine, I haven't had a steamOS update yet, so do the below at your own risk:

  • Install modorganizer2-linux-installer according to the README and ensure you have removed any alias set up for the flatpak version of protontricks if it is installed.

  • Note the commands below install rwfus for steamOS 3.5 or later. Update your deck first if you’re still in an earlier version.

  • Execute the following console commands in your deck's home directory (you'll need to have set a password for the deck user)

cd ~
sed -i '/NoDisplay/d' "/home/deck/.local/share/applications/modorganizer2-nxm-handler.desktop"
git clone https://github.com/ValShaped/rwfus.git
cd rwfus/
./rwfus --install
./rwfus --enable
mkdir ~/builds
cd ~/builds
sudo pacman -S base-devel
git clone https://aur.archlinux.org/protontricks-git.git
cd protontricks-git/
makepkg -si

@Jahfry
Copy link

Jahfry commented Jun 30, 2024

Adding what worked for me, combining a couple of the above snippets, to get MO2 launching on a Steam Deck to manage Fallout 4 using the flatpak Protontricks. There's nothing truly new here, but the comment that mentioned Fallout 4 had some odd pathing.

[Desktop Entry]
Type=Application
Categories=Game;

Exec=bash -c 'env "STEAM_COMPAT_CLIENT_INSTALL_PATH=$HOME/.steam/steam" "STEAM_COMPAT_DATA_PATH=$HOME/.steam/steam/steamapps/compatdata/377160" "$HOME/.local/share/Steam/steamapps/common/Proton 9.0 (Beta)/proton" run "$HOME/Games/mod-organizer-2-fallout4/modorganizer2/nxmhandler.exe" "%u"'

Name=Mod Organizer 2 NXM Handler
MimeType=x-scheme-handler/nxm;

NOTES:

  • Be upgraded to SteamOS 3.5.x+
  • Install Mod Organizer 2 as per this github
  • Make a backup copy of the .desktop file /home/deck/.local/share/applications/modorganizer2-nxm-handler.desktop just in case
  • Change the .desktop file to match the code block above with generic system paths
  • Protontricks was installed via flatpack using the "Discover" software center.
  • This sets FO4 to use Proton 9 (Beta), so you may want to change that as needed (look in the .desktop contents for "$HOME/.local/share/Steam/steamapps/common/Proton 9.0 (Beta)/proton", change the path to the Proton you want to use)
  • If you need help figuring out how to run F4SE from MO2, see this video (not mine)
  • Once you have your mods set up the way you want, and no longer want to see MO2 every time you "Play" in steam, see this to modify the shortcut.

@Rain-Gayming
Copy link

Just to give a quick update on this issue: there is no way to fully utilize the NXM links functionality when Flatpaks are involved. As far as I can tell, there is no way to make the necessary inter-process communication work because of the Flatpak security design.
If that feature is important for you, don't use Flatpaks.

As I mentioned here, by editing the modorganizer2-nxm-handler.desktop file to look like this

[Desktop Entry]
Type=Application
Categories=Game;

Exec=bash -c 'env "STEAM_COMPAT_CLIENT_INSTALL_PATH=$HOME/.steam/steam" "STEAM_COMPAT_DATA_PATH=$HOME/.steam/steam/steamapps/compatdata/489830" "$HOME/.local/share/Steam/steamapps/common/Proton 6.3/proton" run "$HOME/Games/mod-organizer-2-skyrimspecialedition/modorganizer2/nxmhandler.exe" "%u"'

Name=Mod Organizer 2 NXM Handler
MimeType=x-scheme-handler/nxm;

is it possible to use the NXM Handler with flatpaks

This works great, it seems the issue is mostly one of paths included in this .desktop file.

Mine is as follows for fallout 4, for future google travelers:

[Desktop Entry] Type=Application Categories=Game;

Exec=bash -c 'env "STEAM_COMPAT_CLIENT_INSTALL_PATH=/home/SR/.var/app/com.valvesoftware.Steam/.local/share/Steam" "STEAM_COMPAT_DATA_PATH=/blaze/SteamLibrary/steamapps/compatdata/377160" "/home/SR/.var/app/com.valvesoftware.Steam/data/Steam/compatibilitytools.d/GE-Proton8-32/proton" run "/home/SR/Games/mod-organizer-2-fallout4/modorganizer2/nxmhandler.exe" "%u"'

Name=Mod Organizer 2 NXM Handler MimeType=x-scheme-handler/nxm;

I tried this on Mint and it didnt work :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Conversation about the project or related subjects
Projects
None yet
Development

No branches or pull requests