-
Notifications
You must be signed in to change notification settings - Fork 39
Use a 'current' directory instead of 'app-{version}' for the latest app version #24
Comments
When you fix this, is it possible to make it work when updating from a previous version where the latest is not in a current directory? |
While I am breaking a lot of things about how Squirrel.Windows works, I strive to make all of my changes backwards compatible for installed apps. It should always be possible to upgrade from any recent-ish version of Squirrel.Windows, or any version of Clowd.Squirrel to the latest version of Clowd.Squirrel. This is also the reason that the command line interface for |
Hi caesay, |
Regular shortcuts (created by Squirrel) now point to the stub executable, and do not need to be updated. Pinned shortcuts still point to the actual application exe in the version directory, so they need to be fixed during every update. There is a routine in Squirrel (same in this fork and the original) which scans the pinned shortcuts and attempts to fix the shortcut target during updates. That code is here. |
Closes ppy#17965. Note that this will cause a second osu! icon to appear after running the application (after any update). As per the inline comment, this will eventually be resolved via clowd/Clowd.Squirrel#24. I do think having context menus working is more important than duplicate icons. Note that for anyone who already has a pinned taskbar icon, it will need to be manually unpinned and repinned after a future update to actually fix this issue. Thanks to @caesay for help with investigation.
This has been completed in develop branch, it will be released in the 3.0.0 previews soon. |
@caesay is there an ETA when this will be released? |
@hutterm This is implemented in 3.0.0 along with macOS support (currently being worked on in #73). I think the implementation is close to done, but due to how large the change is I need to do a fair bit of testing before I feel comfortable publishing a release. Without promising anything, I am thinking a first pre-release should drop around the end of May. However I won't be releasing another stable until 3.0.0 is tested a bit in the real world. |
Problem
Currently an application will be running from a directory like
app-1.0.1
. The application binaries moving around in each version has several disadvantages:A workaround for taskbar-pinned shortcuts exists, and StubExecutable's were created in an attempt to fix some of the other issues, but from the above, it only helps with shortcuts and associations/protocols that require a static exe location.
Tray icons and firewall rules are based on the currently executing process path - so these things remain broken.
Additionally, StubExecutable's create additional issues
WINDOWS_GUI_SUBSYSTEM
, meaning they do not attach a console, and will fail to run a console app properly. (this could be fixed by patching stub's with the same subsystem as their target exe, but it is a significant unnecessary effort)Proposal
%localappdata%\MyApp\current\MyApp.exe
Update.exe:ProcessStart
,UpdateManager.RestartApp
which will update thecurrent
junction to point to the latest app version.Even though the real binary location will still change in each version, as long as it's always executed via the junction, windows will see the binary path as
%localappdata%\MyApp\current\MyApp.exe
and all the aforementioned issues should work. This needs to be tested with firewall rules and tray icons beforehand.Side note: If we are extracting the nuspec to each app dir and using it for metadata storage, perhaps we could automatically add a
<squirrelFramework>...</>
tag when creating releases, and verify that the required dependencies are installed before updating the junction (eg. for #9)The text was updated successfully, but these errors were encountered: