-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix app can not restart after an unexpected exit during the apply releases #1862
Conversation
…eases Use a temp directory to apply the releases and then rename the temp directory to the final release directory
Instead of doing this, write a Also, don't quit your application while updates are running - instead of exiting, hide the window, await the update, then close once it finishes |
Use the .not-finished file to indicate whether the installation of the new version was successful and make stubs ignore those folders which have the .not-finished file
Agreed, I have submitted another commit, plz help review it, thanks. About
and
Yes, during the upgrade process, we don't recommend users to exit the app. But we can't guarantee whether the app will be exited due to other reasons, such as crash or system shutdown. So we need this part logic to make sure users won't be able to launch the app due to the uncompleted upgrade. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few small things but this looks good
Hi @anaisbetts , plz review it again, thx |
Not sure if I missed something here, but I don't think this covers the |
@caesay In fact, when launching the app through "Update.exe --processStart," it initiates the latest version recorded in the local RELEASES file. However, if the last upgrade attempt failed, the RELEASES file remains unchanged, and as a result, it won't launch the broken directory. |
Problem Description: During the use of Squirrel's automatic upgrade feature, if the app is quit or unexpectedly exits while installing the new version, it may result in unable to restart the app. Upon reviewing the source code, it was found that the stubExe would find the latest version and create the path to launch it. However, due to missing files in the latest app-xxx directory, the app fails to start.
Solution: To address this issue, during the application of releases, the new version is first extracted to a temp-app-xxxx directory. After the extraction is complete, it is then renamed to the final app-xxxx directory. This approach ensures that even if the app unexpectedly exits during the installation process and leaves the temp directory, it will not affect the next app launch.