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

Select target directory for game files on first run #40

Open
narcisgarcia opened this issue Jul 22, 2023 · 12 comments
Open

Select target directory for game files on first run #40

narcisgarcia opened this issue Jul 22, 2023 · 12 comments
Labels
AppImage enhancement New feature or request Linux

Comments

@narcisgarcia
Copy link

narcisgarcia commented Jul 22, 2023

AppImage installs, updates and downloads studd to user's "Documents" directory.
Sometimes user has another disk volume with appropiate space, or even faster for games.
And sometimes "Documents" directory is a network drive, inconvenient for software or rapid i/o.

AppImage should ask where to install files on first run.

@p2004a
Copy link
Collaborator

p2004a commented Sep 17, 2023

Since last release, $XDG_STATE_HOME is used following XDG specification. Before then, it was Documents as you point out, and if launcher detects files there, it uses that location to not break existing installs.

So, it's following the standard behavior of Linux applications.

@p2004a p2004a closed this as completed Sep 17, 2023
@narcisgarcia
Copy link
Author

Thank you for attending this issue, but:
No answer for the request: Be able (user) to select target directory.

@p2004a
Copy link
Collaborator

p2004a commented Sep 18, 2023

  1. You can set the directory be setting $XDG_STATE_HOME environment variable to what you want for application
  2. You can also set the directory also by specifying --write-path argument to the application.

So there are already 2 separate options how you can set it.

EDIT: And of course you can also just use symlinks.

@narcisgarcia
Copy link
Author

  1. Download Beyond-All-Reason-1.2470.0.AppImage
  2. Open file "properties" and enable executable checkbox
  3. Double-click on AppImage file

How to say it something about XDG_STATE_HOME or write-path ?

Note symlinks don't work on network folders and some other filesystems.

@p2004a
Copy link
Collaborator

p2004a commented Sep 18, 2023

There are many options

  • Use the menu editing program in your distribution (or something like https://flathub.org/apps/page.codeberg.libre_menu_editor.LibreMenuEditor if your distro doesn't ship one) to add entry with correct invocation

  • Create a .desktop file with correct invocation following some instruction from internet, e.g. https://www.baeldung.com/linux/desktop-entry-files

  • Run from command line

    ./Beyond-All-Reason-1.2470.0.AppImage --write-path /some/path
    # or
    XDG_STATE_HOME=/some/path ./Beyond-All-Reason-1.2470.0.AppImage
  • Create wrapper script that does it for you, e.g. run_bar.sh

    #!/bin/sh
    ./Beyond-All-Reason-1.2470.0.AppImage --write-path /some/path
    

Note symlinks don't work on network folders and some other filesystems.

I strongly recommend not putting your home user directory on filesystem that doesn't support basic features like that, or overall putting it on networked filesystem. Putting BAR on networked file system is also pretty bad idea as it will very significantly slow down game load times (10k files to read)

@p2004a p2004a transferred this issue from beyond-all-reason/Beyond-All-Reason Sep 18, 2023
@narcisgarcia
Copy link
Author

narcisgarcia commented Sep 18, 2023

It's not a rare practice to mount ~/Documents folder on a network resource.
But yes it's a rare practice to make an app installer to deploy its stuff at ~/Documents , which is intended for another use, fully controlled by user.

About launcher creation and registration with an additional shell script, I believed BAR app was targeted to unexperienced users.

@p2004a
Copy link
Collaborator

p2004a commented Sep 18, 2023

But yes it's a rare practice to make an app installer to deploy its stuff at ~/Documents , which is intended for another use, fully controlled by user.

As I noted already, this was resolved, and launcher is now following the freedesktop XDG specification and not installing files in Documents.

About launcher creation and registration with an additional shell script, I believed BAR app was targeted to unexperienced users.

I've listed multiple options. Changing the installation directory, unlike on Windows, is uncommon for Linux software, and I consider it an advanced configuration option. BAR is not targeting any specific category of users, but we try to make it streamlined for all users. Changing directory is possible and I consider advanced configuration that doesn't have to be easy.


If somebody external will be willing to write some nice smooth prompts and GUI for picking up directory on the first run, handle properly different cases and it wouldn't add a lot of complexity to launcher, I would accept such PR. So, I will reopen this, but it needs external contributor to resolve.

@p2004a p2004a reopened this Sep 18, 2023
@p2004a p2004a changed the title FR: Ask for target directory on first setup [Linux] Select target directory for game files on first setup Sep 18, 2023
@p2004a p2004a changed the title [Linux] Select target directory for game files on first setup [Linux] Select target directory for game files on first run Sep 18, 2023
@p2004a p2004a added enhancement New feature or request Linux AppImage labels Sep 18, 2023
@p2004a p2004a changed the title [Linux] Select target directory for game files on first run Select target directory for game files on first run Sep 18, 2023
@narcisgarcia
Copy link
Author

Sorry, I didn't understand well the XDG implementation now implies to not install files in concrete ~/Documents

About uncommon selection of install directory on GNU/Linux, this is because GNU/Linux distributions have already defined FHS destinations for all software, and this structure is armonized with package managing (Dpkg, RPM, etc).

Any installation process out of package manager integration, and even more in unprivileged context (no root permissions), should ask user for things like program files directory and/or data files directory.

@p2004a
Copy link
Collaborator

p2004a commented Sep 19, 2023

this is because GNU/Linux distributions have already defined FHS destinations for all software (...) Any installation process out of package manager integration, and even more in unprivileged context (no root permissions), should ask user for things like program files directory and/or data files directory.

No. Please read what XDG Specification is about. Also read full commit message of change that added implementation to launcher: b08cb88.

@narcisgarcia
Copy link
Author

XDG specifications are focused on GUI-specific behaviour, while FHS is focused on a wider scope: Unix-like including GNU/Linux.

And sure we are converging to same point, coming from each one's perspective.

@p2004a
Copy link
Collaborator

p2004a commented Sep 19, 2023

XDG specifications are focused on GUI-specific behaviour

There is nothing in the spec that differeciates between GUI or non-GUI applications. It's generic and applicable to all types of applications that store user specific data.

I'm also not sure how that comment relates to what is discussed in this issue, which is: whatever setting where to save game data is advanced configuration that needs to be exposed on the first run.

@narcisgarcia
Copy link
Author

XDG = X Desktop Group.
I mention this to compare with operating system FHS and supported package managers.

But yes, thread's focus is: Whatever setting where to save game data as configuration that needs to be offered on the first run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AppImage enhancement New feature or request Linux
Projects
None yet
Development

No branches or pull requests

2 participants