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 local settings and relative SongDir paths for portable USP installations #502

Open
JakobStaudt opened this issue Nov 8, 2024 · 3 comments
Assignees

Comments

@JakobStaudt
Copy link

Issue type: Feature request

Actual behaviour

Ultrastar Play on Windows uses the AppData directory to store its config data (Settings.json etc.).

Expected behaviour

For some applications (mainly a portable USP installation on an external drive that should be usable on multiple computers), it would be useful to have the settings located close to the USP files. This would allow the settings to be persistent across computers, if the external drive is connected to other computers. It would also be necessary to allow relative paths for the SongDirs, so mounting the external drive (containing USP and songs) as a different Drive Letter doesn't break the SongDir settings.

Implementation hints

On Startup, USP should check if the USP directory (or its parent?) contains a settings dir as it would normally be found in AppData. If a settings dir is found, it should be used, and no directory in AppData should be created. Only if no local settings are found, the AppData folder should be used/created.
The SongDirs Setting should be able to use relative paths. Ideally, the paths specified should be interpreted as relative to the settings file (or its parent?), so the location from which USP is started doesn't affect the behaviour.

@AnsisMalins AnsisMalins self-assigned this Nov 12, 2024
@achimmihca
Copy link
Collaborator

You can already specify a custom settings file via command line argument --settingsPath.
See https://github.com/UltraStar-Deluxe/Play/wiki/Command-Line-Parameters

@1337cookie
Copy link

1337cookie commented Jan 12, 2025

If you put the program on a flash drive or portable device you will have issues setting this up.

  1. Windows shortcuts can't use relative paths without a bit of a hack. So creating a shortcut to the exe with additional parameter --settingsPath will often fail.
  2. Shell scripts like .bat and .ps1 will have issues if you run them from a different folder than the game exe is. They often also require being run with right click, sometimes with privlege escalation and have their own set of edge cases.

I think the best way to deal with this would be a check on launch for a "settings.json" in the same directory as the exe and if it exists use that.

@achimmihca
Copy link
Collaborator

I think the best way to deal with this would be a check on launch for a "settings.json" in the same directory as the exe and if it exists use that.

I think this would be a fitting solution for this specific issue.

A more general solution could be to integrate a library for configuration management. It should support

  • different sources (e.g. JSON files, command line args, environment variables)
  • hierarchy (e.g. overwrite specific settings via command line, or with different configuration file locations)

Example libraries:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants