musescore / MuseScore

MuseScore is an open source and free music notation software. For support, contribution, bug reports, visit MuseScore.org. Fork and make pull requests!
https://musescore.org
Other
12.21k stars 2.64k forks source link

Ability to override config file path via command line or environment variables #24137

Open wizofaus opened 2 months ago

wizofaus commented 2 months ago

Your idea

As per MS3, have the ability to run two different (stable) versions of MuseScore on the same user profile that use different config file paths.

Problem to be solved

I installed the "MuseScore 4 Testing" 4.4 beta and found it was sharing preferences with 4.3, which I definitely don't want (for a start, files saved with 4.4 can't be opened in 4.3 by default, but I want them to use different colour schemes etc. so I know when I'm doing "work" vs "testing"). If I were able to specify an alternative config path location via a command-line parameter (as per MS 3.6) this would be solved.

Prior art

MS 3.6 supported this.

Additional context

In the code it's just

ifdef MUSE_APP_UNSTABLE

QCoreApplication::setApplicationName("MuseScore4Development");

else

QCoreApplication::setApplicationName("MuseScore4");

endif

And Qt then resolves the config file path via the standard OS-specific way of determining the "AppData" area (in Windows, this is C:\Users\\AppData\Local) and appends the Organization name (hardcoded to MuseScore) and the ApplicationName as above to form the path. There appears to be no way to override via command line parameter or environment variable.

In fact my preference would be the ability to place an .ini file in the same directory as the exe to override this, so even if I launched the exe directly from the bin directory it would still use the expected location.

For now I'm just testing the 4.4 nightlies, which are Development builds, and use the MuseScore/MuseScore4Development config path.

Checklist

cbjeukendrup commented 1 month ago

I'm not sure whether we really need the ability to specify the folder name manually. I can imagine some benefits of it, but it doesn't strike me as very essential.

But I assume your main reason for raising this request is that you were negatively surprised by the fact that MuseScore 4.4 beta/rc used the same config folder as MuseScore 4.3. I agree that this should be changed. Apparently it has always been that way, with all betas of all previous MuseScore versions, contrary to my expectations. Fortunately it's easy to fix.

I'm still doubting a bit whether we should make one folder for every 'release channel', i.e. dev nightly testing stable, or that we simply stick with "MuseScore4Development" vs "MuseScore4" and make beta/rc builds use MuseScore4Development.

wizofaus commented 1 month ago

I'm fine if the beta uses MuseScore4Development, but it still seems beneficial to be able to override the configuration path, and like I noted, it was supported in v3.6.

wizofaus commented 1 month ago

And yes it's an easy fix if you're happy for "unstable" to appear in the about dialog etc