Does Lutris accept sudo commands for pre-launch scripts?

Hello there, I have to copy a dll file to a location for Age of Empires II: Definitive Edition online to work. Anytime the game updates steam changes that dll file so I decided to create a pre-launch script such as this: cd ~/Downloads/vcredist/ && sudo cp ucrtbase.dll ~/.local/share/Steam/steamapps/compatdata/813780/pfx/drive_c/windows/system32/. As you can see I need to use sudo for that command but I don’t know if Lutris does it or not. I don’t start Lutris sudo so I thought this may not work. Is there a way around it?

But it seems like this is just limited to your user profile on Linux. How come you need sudo for this?

This part; “~/” implies that you strictly copying from a sub directory of your home folder to another sub directory. So I don’t see why you need sudo at all here as this is going on in your home folder. So you should have the privileges to do this without using sudo.

Is there a folder in your home directory that is owned by root?

I checked the permissions on the folder, it says it’s owned by user and not root but when I try to do cp it gives me this error: cp: cannot create regular file '/home/user/.local/share/Steam/steamapps/compatdata/813780/pfx/drive_c/windows/system32/ucrtbase.dll': Permission denied

So I got to that location and checked the dll, it said it’s a symlink to /home/user/.local/share/Steam/steamapps/common/Proton - Experimental/files/lib64/wine/x86_64-windows/ucrtbase.dll So I checked the permissions of that file. It’s owned by user however the owner was restricted to read only, I changed that to read and write and now the cp command works as intended. However I don’t know if it will stay that way after an update so I still need a workaround.

It’s owned by user however the owner was restricted to read only, I changed that to read and write and now the cp command works as intended. However I don’t know if it will stay that way after an update so I still need a workaround.

Well, you may have to make a shortcut to set the attribute each time. That will be the only way to remedy this issue. But if you don’t need sudo for that, you could just another line to your script that’s used for copying; before the cp command.

Like so: chmod 755 /home/user/.local/share/Steam/steamapps/compatdata/813780/pfx/drive_c/windows/system32/

That should set the default permissions.

That’s a great idea. Thank you!

1 Like