Skip to content

Fix manual update check failing after launching through a file extension#37199

Open
austin19moore wants to merge 5 commits intoppy:masterfrom
austin19moore:37103
Open

Fix manual update check failing after launching through a file extension#37199
austin19moore wants to merge 5 commits intoppy:masterfrom
austin19moore:37103

Conversation

@austin19moore
Copy link
Copy Markdown
Contributor

@austin19moore austin19moore commented Apr 4, 2026

Resolves #37103

Error from clicking "Check for Updates" after opening Osu through a file extension:

2026-03-25 17:33:25 [verbose]: VelopackUpdateManager: Update check failed with error (No VelopackLocator has been set. Either call VelopackApp.Build() or provide IVelopackLocator as a method parameter.)

When launching through a file extension (beatmap / skin import), osu.Desktop\Program.cs::setupVelopack does not call VelopackApp.Build(). This seems to make sense for the IsPackageManaged check, but for launching through a file extension a user would still expect manually checking for updates using "Check for Updates" in settings to work.

This code was introduced in #34330 to avoid the game updating and stalling / restarting when importing, but to my understanding of velopack that should still be avoided here by only calling VelopackApp.Build() and then returning before app.Run().

Comment thread osu.Desktop/Program.cs Outdated
Comment on lines +195 to +199
if (args.Length > 0 && !args[0].StartsWith("--velo", StringComparison.Ordinal))
{
Logger.Log("Handling arguments, skipping full velopack setup.");
return;
}
Copy link
Copy Markdown
Collaborator

@bdach bdach Apr 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is suspect.

The issue thread you linked in the OP even suggests this if it is properly read start-to-end. The "skipping velopack setup" code path was really ever intended to run if a windows shell association is being handled when osu! is already open. On windows at least, when osu! is already open, shell associations are handled by spawning a new process of osu! with IsPrimaryInstance = false, which then passes off the path of the file to open via ipc to the actual primary instance of the game.

The case failing in #37103 is where the game isn't open yet and therefore association handling is spawning a primary - not secondary - instance of the game.

That is all to say that this proposed change is neither here or there. It should be:

  • Either the game was launched as a primary instance with an import path given as the argument, and therefore it should run full velopack setup and not terminate halfway like here, or
  • The game was launched as a secondary instance handling shell associations on windows and its only goal is to hand off the received path to the file to open to the primary instance, and in that case velopack should not run at all.

Unfortunately IsPrimaryInstance is not available at this point in time because it's a property of DesktopGameHost. I would not advise reordering calls because we've already seen it go wrong.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense, then would adding a check similar to what is occuring in osu.Framework\Platform\NamedPipeIpcProvider.cs::62-70 work? I pushed my changes on what that looks like.

Comment thread osu.Desktop/Program.cs Fixed
Comment thread osu.Desktop/Program.cs Fixed
Comment thread osu.Desktop/Program.cs Fixed
@austin19moore austin19moore requested a review from bdach April 9, 2026 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Launching osu! by importing a beatmap makes update check fail

3 participants