Fix manual update check failing after launching through a file extension#37199
Fix manual update check failing after launching through a file extension#37199austin19moore wants to merge 5 commits intoppy:masterfrom
Conversation
…aunched through a file association
| if (args.Length > 0 && !args[0].StartsWith("--velo", StringComparison.Ordinal)) | ||
| { | ||
| Logger.Log("Handling arguments, skipping full velopack setup."); | ||
| return; | ||
| } |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
… should be setup.
Resolves #37103
Error from clicking "Check for Updates" after opening Osu through a file extension:
When launching through a file extension (beatmap / skin import),
osu.Desktop\Program.cs::setupVelopackdoes not callVelopackApp.Build(). This seems to make sense for theIsPackageManagedcheck, 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 beforeapp.Run().