ZeroK-RTS / Zero-K-Infrastructure

Website, lobby launcher and server, steam deployment, .NET based tools and other vital parts of Zero-K infrastructure
GNU General Public License v3.0
49 stars 51 forks source link

Compliance with permission models on Linux installs #2971

Open alexpyattaev opened 10 months ago

alexpyattaev commented 10 months ago

Would it be possible to make Zero-K.exe to use the standard linux directories? This would imply the following changes:

This would make packaging Zero-K for linux distros a whole lot easier to accomplish, as well as to achieve compliance with distro requirements for package behavior. This would, in turn, help with ZK popularity on linux desktops quite a bit.

I am quite sure that a good way to detect if this behavior should be triggered is to check if the directory where Zero-K.exe is located is writable. There is already a check for it in the code, so the modifications would be truly minimal.

Once this is done I can make packages for at least a few popular distros.

Licho1 commented 10 months ago

I believe it is currently configurable. If certain env vars contain writeable directory it should use that instead of current one. In general this logic is used:

image

This is used if the current folder is not writeable. So for example if you put launcher into some non writeable dir, it will auto use HOME/.spring

We could change the logic even more but i guess it needs more thinking also because of steam compatibility. Steam on linux is a preferable distribution method and there all is in one folder

alexpyattaev commented 10 months ago

Ok when I run it from a non-writable directory it just says in a small popup window that I should run from a writable location instead. No attempt to use .spring is made, sadly.

Could you explain/link what the specific requirements for Steam are? Maybe I can try to hack something together which would work in both steam and normal Linux installs. Or have separate releases? What is your preference?

ma 11. syysk. 2023 klo 11.51 Licho @.***> kirjoitti:

I believe it is currently configurable. If certain env vars contain writeable directory it should use that instead of current one. In general this logic is used:

[image: image] https://user-images.githubusercontent.com/3185783/266963093-7ad61550-4a34-4907-8738-ab1f1fd26b1f.png

This is used if the current folder is not writeable. So for example if you put launcher into some non writeable dir, it will auto use HOME/.spring

We could change the logic even more but i guess it needs more thinking also because of steam compatibility. Steam on linux is a preferable distribution method and there all is in one folder

— Reply to this email directly, view it on GitHub https://github.com/ZeroK-RTS/Zero-K-Infrastructure/issues/2971, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABNIL3X5EDDRKKWYO2LK33TXZ3GK5ANCNFSM6AAAAAA4S2ZRPE . You are receiving this because you authored the thread.Message ID: @.***>

Licho1 commented 7 months ago

I think the steam mode all you need to do is to make folder writeable + create a text file called steam_folder.txt then it should work but it might not download updated to certain components like engine