-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Autoupdate downloads new update, but does not successfully update the app on quit. #2317
Comments
Got exactly the same issue. Not sure about several updates, but my app is not updating itself after successfully downloading from server and restarting on |
Thank God this issue, I thought I'm going insane 😄 I have the exact same issue. My goal was to get to learn how to do publishing by forking one of the example projects and following the documentation. You can see my releases from yesterday on github, I got that part working. However, my ultimate goal is to get auto update staged rollouts integrated as part of my production aws codepipeline, which is going to be publishing to S3. So this is my setup
I noticed 2 things while getting publishing to work. The first is to do with the publishing process itself. As you can see in the log below I have permission denied error. Even though this error, I get a successfully published artifacts. This is something that always happens and I don't know what is trying to do and how to fix it.
The second observation I had is that some of the events for auto update may not be triggering. Case in point is autoUpdater.on('download-progress', (progressObj) => {}). You can see what I mean if you download v0.9.7. The app is going to correctly pick up that there is an update (displaying a message "Update available"). Then On a side note: I love electron and I believe that it is the future of developing desktop software. I'm new-ish to electron, I've been using it for the past 4 months, and now I want to become more proficient and use electron-builder in production. However, I felt the last few days a bit under supported even with the great efforts you guys have put in the documentation. So I think I can help you by documenting my experience and passing it on to you as a detailed tutorial, for people that have the same setup as me. Let me know if you are interested. |
I might have a hint on what might happen, I believe it might be a race condition, but I don't have enough experience with nodejs to proof that.
This might be due to Then I found another (clear) bug: When we run files with a version number in their name (e.g. Changing that argument to |
@siebertm Vielen Dank. Du hast absolut recht. |
This issue about macOS, not about Linux. @mobitar Sorry, I haven't yet investigated the issue. It works for me, but yeach, maybe something strange in the Squirrel.Mac. To be investigated later or will be obsolete when DMG update will be implemented. |
This was working for me before but suddenly seems to have stopped working. The autoupdater downloads the update file and even opens the installer but then everything shuts down almost as if the quit() command quits ALL windows related to my app including the installer. I see a console flash up and then it disappears and the installer quits. Not sure why this happens. Any help would be much appreciated. *** Just noticed that the console that flashes is taskkill.exe. Any idea why this would be the case? Is it a permissions issue? Am completely at a loss... I am using the following: "devDependencies": { |
I found the reason for this error and it has nothing to do with the autoupdater. I introduced code where I had a .on('close') function for a window. This was causing the issue. Removing this piece of code enabled the updater to work as before. Hope this helps anyone else having similar issues. |
What I see in your code:
But problem is that Note: If application quit was initiated by autoUpdater.quitAndInstall() then before-quit is emitted after emitting close event on all windows and closing them. So, Please try to rework this code. I guess you should listen |
Does this still apply if I'm not using quitAndInstall? I'm seeing this issue on Mac when I quit the app completely via the dock, by right clicking the icon, then clicking Quit. The docs say:
|
Please try to add some logging to trace events. |
Thanks, doing that now. But still unclear on what I should be looking for. Basically, you're saying |
You can also comment out your close handler to test — if issue still actual :) |
Sorry, still a little confused here. On Mac, when the user hits X or Cmd + W, I need the window to hide, but not be destroyed, so that when they re-click the icon in the dock, the same window reappears with the same state. Is this behavior inconsistent with how autoUpdater works? The only way to do that as far as I know is e.preventDefault() in the |
Ok, looks like it might indeed have something to do with window closing. I'm testing a new install of my app version 2.1.26 with an upgrade pending of 2.1.27. "Quit" means right click icon on Mac and click Quit. If I launch the app and:
Investigating.. |
I noticed in my case that after running quitAndInstall(), the app quits and ShipIt process starts in the background that actually copies the update file. Depending on the size of your app, some of them can be pretty big, and it can take at least 30 seconds to finish. If you try running app right away before that process is over, you get the old version, if you run after ShipIt is done, you'll get the new version. I'm not sure how it's supposed to work 🤷♂️ Edit: I'm running this on a Mac. |
same issue here: #3067 is it enough to have
? I asked because according to the documentation |
Any update on this? I getting exactly this issue with the latest Electron Builder version - 20.35.x
Testing with simple node http-server to serve the request
The ZIP downloaded,
|
I was having this issue and fixed it by running |
Is there any other solution? Since normal users wont have access to sudo as @jknoxville's one. |
Using electron 1.8.8, electron-updater: 3.0.1, electron-builder: 20.22.0. After server is closed I can finally update without problems ('Proxy server for native Squirrel.Mac is closed'.) |
i got a same problem before, than i find some of my file can't be executed, so i just run the |
It consistently stopped happening to us anymore after I've implemented 2 things:
I'm not sure if that is a universal solution, but it worked great for us. |
Friends, I found the problem. In my electron-builder configuration, I did not have "appId" when I was facing the same problem. Then I checked it, and I notice that it is com.electron.blabla. After adding "appId" to my build configuration, rebuilding and creating the next release, I noticed that it started working. I hope this information will be useful for people who are facing the same problem. |
Hello everyone. After spending many hours trying to debug the issue I went through the autoUpdate error logs (at The error was It was just a matter of disabling the plugin cache option to stop that file from being created, and now the update works flawlessly, no strange hacks required. In conclusion if you're also stuck trying to get the autoupdate to work I suggest you first check that log file to see if it is due to a permission error, in which case it's easy to debug because you should have the exact location of the problematic file in the logs. Get rid of those files and it should work! |
I'm facing precisely the same behavior but on Windows (if user opens the application too quickly - which is quite common as the silent install takes some seconds to finish and doesn't show any feedback - it just gets in this loop of saying it has a new version 'ready to install upon quit').. |
Well at first I thought It wasn't working, but it turns out I'm manually opening the application after it closes but before it automatically re-starts after calling |
Hi @Arama2014, |
Hello @avner-hoffmann.
Credit for location of those logs goes to @nicmosc from a few posts up:
Specifically: |
@Arama2014 I’m not sure actually, like I said in my answer I was getting a Permission denied, so not sure what your issue could be. I’ll see if I have those old logs and take a look as well |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
If I download my Mac app as a zip, the time it takes to decompress into .app is roughly equivalent to the amount of time I must wait (via setTimeout) before I allow the user to try to install an update. This IO issue could certainly be handled at a lower level... |
Hi All - In my case (on a Mac), this issue was caused by the 'update' certificate not matching the previous certificate used to sign my app. For me, the behavior was not intermittent, it would occur during every update attempt:
In my application log, I would see the following message:
I believe this error is thrown if:
In my case, the certificate used to sign the app was owned by another team member and it had expired. I ended up creating a DMG signed with a new certificate, and had my users update manually. Once the new certificate was in place, subsequent app updates worked normally as before. This obviously isn't ideal if you have a huge install base. I don't know if there is a setting to loosen app signing restrictions i.e. where are the 'code signing requirements' specified in the error log? Check your logs and certificates! Hope this helps somebody. |
How does anyone get these |
@stevenroussey-privicy Don't know if you found them or not, but just to clarify for future readers, the ShipIt logs seem to be under |
Seeing the same problem on windows with nsis installer. |
Windows NSIS same issue Dev Dependencies: "electron": "^4.2.9", Any resolutions? |
I have the problem on window NSIS too. I'm using electron-builder 21.2.0. The issue seems to be in this commit: 39e6783 I'm not a windows person, so I'm not exactly sure why that commit breaks the auto-update, but I suspect/speculate that it has something to do either with the change to the uninstaller name (removing the '.') or the change to the taskkill invocation (adding the '/t' arg). In any case, I created a fork of electron-builder (from tag 'v21.2.0') and reverted that particular commit, then built my project with the forked version and auto-update worked again. |
@kaitlynbrown @cyphercodes96 Might be better to open new issue as this one is old and was about Mac, not Windows. |
@transparentech I am dealing with this since 10 days ago on NSIS, after I had to upgrade electron-builder because of the How can I apply your solution? I didn't understand. |
anyone found a solution yet? |
@iJosephY for me the problem was that I had |
Thanks for your comment @kaitlynbrown and there was some other solutions there .. the issue appear to be with electron 7 and electron-builder 22 |
@damianobarbati My fork is here (branch=sme): https://github.com/transparentech/electron-builder It works with Electron 7, hand has the commit mentioned about reverted. |
Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward? This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
@develar - Did anyone from the electron-builder maintainers had a look on all of the above? |
(This is a follow up on #2006 (comment))
Unfortunately I am still seeing this issue with electron-builder 19.45.5 and electron 1.7.9.
I'm not sure if the underlying cause is the same, but on the surface, here's what happens:
update-downloaded
event.Result:
update-downloaded
is received again. Repeat steps 1-3, same results.After repeating many times, it will eventually update.
Any ideas as what could be causing this? Does user have to wait X seconds after quitting app before re-opening?
My index.js: https://github.com/standardnotes/desktop/blob/master/app/index.js#L29
You can test this issue for yourself by downloading an older version of Standard Notes and waiting for the update message to appear in the lower right corner of the app: https://github.com/standardnotes/desktop/releases
The text was updated successfully, but these errors were encountered: