Show osu!(lazer) in windows "default apps" menus #31438
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Implementation
Very simple, just sets the registry keys as defined in https://learn.microsoft.com/en-us/windows/win32/shell/default-programs. You can read the commits for more details. The specific keys/concepts used are:
RegisteredApplications
,Capabilities
,ApplicationDescription
,FileAssociations
andUrlAssociations
.Previously, the default URI handler and file type handlers were set to osu!(lazer) when it was installed. This has now been removed. We trust that the windows explorer / shell will provide a sane default (works as expected from my testing).
End goal for the UX
Important: this doesn't work yet with this PR, changes to osu!(stable) are needed to get this working. Lazer will continue to steal association from stable at the moment.
osu! and osu!(lazer) appear in the "Open with" context menu
The user can choose default apps for each file type / URI in the Settings app
The user is presented with the "Select an app..." after installing osu!(lazer)
In this example, osu!(stable) was first installed, an
.osk
file was opened in stable, and then osu!(lazer) was installed and the.osk
file double-clicked.Same applies when opening an
osu://
URI.If the user never opened a file type in osu!(stable), both options are presented equally when lazer is installed.