Wrong working directory when MuseScore is launched via a file association under Windows

• Mar 31, 2020 - 23:01
Reported version
3.4
Type
Functional
Frequency
Once
Severity
S4 - Minor
Reproducibility
Always
Status
closed
Regression
No
Workaround
Yes
Project

Under Windows, when MuseScore is launched via a file association (e.g., when the user double-clicks a score in File Explorer), MuseScore starts up with the working directory set to that of the opened score instead of the MuseScore application directory.

This has the unfortunate consequence of keeping the directory locked, preventing the user from deleting or renaming it. Because MuseScore never changes the working directory during a session (even if the user closes the score and/or opens a score in a different directory), the only way to delete or rename the directory is to close MuseScore.

When MuseScore is launched normally, it starts up with the working directory set to the application directory. It should always start up that way, no matter how it is launched.

This problem was originally reported here.


Comments

Status PR created fixed

Fixed in branch master, commit 1f590b2b0c

_Fix #303194: Wrong working directory when MuseScore is launched via a file association under Windows

Worked around a problem that caused MuseScore to start up with the working directory set to the score directory instead of the application directory when launched via a file association under Windows (e.g., when the user double-clicks a score in File Explorer).

This problem made it impossible to delete or rename the score directory without closing MuseScore._

Fixed in branch master, commit 6929ecf7bd

_Merge pull request #5891 from Spire42/303194-wrong-working-directory-when-launched-via-file-association-under-Windows

Fix #303194: Wrong working directory when MuseScore is launched via a file association under Windows_

Fix version
3.5.0