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

Allow (opt-in?) writing to XDG_STATE_DIR instead of requiring cwd to be writable #364

Open
x10an14 opened this issue Feb 4, 2024 · 6 comments
Labels
Severity: Low Status: Feedback Issue is unclear and needs further discussion. Type: Enhancement

Comments

@x10an14
Copy link

x10an14 commented Feb 4, 2024

Description

  • Currently, the installation says that the program requires the folder it resides in to be writable by the user running the program.

Suggest a solution

Would make things easier for those of us who like to install programs into immutable filesystems for a plethora reasons (including security ones).

@x10an14 x10an14 added Status: Review Verify bug or check feasibility of a new feature. Type: Enhancement labels Feb 4, 2024
@RevZero RevZero added Status: Feedback Issue is unclear and needs further discussion. Severity: Low and removed Status: Review Verify bug or check feasibility of a new feature. labels Nov 14, 2024
@RevZero
Copy link
Member

RevZero commented Nov 14, 2024

I get your point, however

  • The steam_appid.txt has to reside in the same folder where the steam_api64.dll is located. AML creates this file on first start (depending on game type selection) and thus, requires write access to the binary folder.
  • AML is supposed to be "portable". But using a special folder could be optional of course.

PS : I don't see the benefit of XDG here. I would leverage Environment.SpecialFolder instead.

@x10an14
Copy link
Author

x10an14 commented Nov 14, 2024

"and thus, requires write access to the binary folder"

Ref:

The steam_appid.txt has to reside in the same folder where the steam_api64.dll is located. AML creates this file on first start (depending on game type selection) and thus, requires write access to the binary folder.

Some clarifications/confirmations, it's these folders you refer to inside the Steam folder containing your game libraries?

Location(s) of **steam_appid.txt** inside Steam folder
-> $ find . -type f -name steam_appid.txt
./common/Risk of Rain 2/steam_appid.txt
./common/The Two of Us/steam_appid.txt
./common/Valheim/steam_appid.txt
./common/Door Kickers - Action Squad/steam_appid.txt
./common/Counter-Strike Global Offensive/steam_appid.txt
./common/Tabletop Simulator/steam_appid.txt
./common/ProjectZomboid/projectzomboid/steam_appid.txt
./common/Deadlock/game/bin/win64/steam_appid.txt
Location(s) of **steam_api64.dll** inside Steam folder
-> $ find . -type f -name steam_api64.dll | grep Rain
./common/Risk of Rain 2/steam_api64.dll

Yeah, I get why AML needs write access here, but is this the only folder it requires write access to?
Ref. the cwd (current working directory, AKA path you start AML from) mention in issue title?


XDG

Ref

PS : I don't see the benefit of XDG here. I would leverage Environment.SpecialFolder instead.

Well, it'll open up the opportunity for AML to be used (at own risk and etc of course) on other operating systems (like SteamDeck OS).
Not just windows.

A benefit of XDG I didn't see you address, is that even if the XDG standard was developed for linux derived OSs, plenty of programming languages and 3rd party dependencies use and rely on it now to standardize across MacOS, Windows, and not just Linux OSs.

@RevZero
Copy link
Member

RevZero commented Nov 14, 2024

I am not sure I follow. What I meant is, that the steam_api64.dll is located in the AML-folder because it is a dependency for the Steamworks.NET.dll library. From Steams API perspective, AML is a game, which is why steam_appid.txt is required to identify the game id. By choosing between XCOM2 and Chimera, AML creates the file with the respective game id accordingly.

The SpecialFolder stuff from .NET has multi-platform support (Windows, Linux and MacOS IIRC). So I would imagine this would suffice.

@x10an14
Copy link
Author

x10an14 commented Nov 14, 2024

The SpecialFolder stuff from .NET has multi-platform support (Windows, Linux and MacOS IIRC). So I would imagine this would suffice.

Apologies for my ignorance/incompetence.
I know lots if .NET is cross platform, but from your link I can see no mention of a) where these folders/locations equivalenta would be on other systems, and b) nor how it can be overwitten/steered with e.g. environment variables (XDG_STATE_HOME being an example of how this is purposefully designed into the XDG protocol/standard).

Would you be able to give some directions to find the answers to a and b?

@x10an14
Copy link
Author

x10an14 commented Nov 15, 2024

Found the answer to a) in a private blog post from 2015: https://jimrich.sk/environment-specialfolder-on-windows-linux-and-os-x/

@RevZero
Copy link
Member

RevZero commented Nov 16, 2024

Sorry for the lack of a response. I was busy and forgot about it.
The MS documentation is indeed lacking some information with respect to special folders and other platforms. The blog post is 9 years old, IIRC there were some changes to those folders since then, so I would not rely on those examples. There are some stack overflow posts with more recent information.

But regardless, there is still the problem that AML needs write access to the application folder, as described above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Severity: Low Status: Feedback Issue is unclear and needs further discussion. Type: Enhancement
Projects
None yet
Development

No branches or pull requests

2 participants