You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
autoUpdater does not work when have authenticated proxy #5020
The autoUpdater module in electron does not appear to be attempting to update all my users on windows from 3.0.1 to 3.1.0. It took a clean reinstall of the application on a few computers that I am aware of before it decided there was an update too download.
Upon sniffing out the traffic I could see that an update check request was being sent to fetch the RELEASES file and then didn't attempt to download the obviously available update.
I don't see how it can work for around 80% of users (that number is a guestimate) and not work for the rest.
I'll grab them as soon as I can make it do this again. Completely uninstalling and reinstalling to replicate is time consuming when there is only a small chance it fails 😄
@paulcbetts Is there any way around this? Or any way for me to detect that proxy from within electron and tell the user they won't be able to get updates?
Is there any way around this? Or any way for me to detect that proxy from within electron and tell the user they won't be able to get updates?
@MarshallOfSound There are several NPM packages that let you detect a proxy. Or you could write your own solution in Node.js to detect a proxy. Could you do that without needing changes in Squirrel for Windows? Because there would be cases where someone would want to update via a proxy.
Ideally I would skip all the above together and either check to see if the file could be reached and notify the user if not or attempt to download the file and notify the user if the download fails. This is how most updaters handle this.
If none of the above works for you I guess I don't completely understand your case.
So, the problem at the end of the day is, if you have an authenticated proxy on Windows, you need to pop UI to prompt for username/passwords at the time of request (i.e. not just in a system settings dialog). This is deeply stupid, but it is what it is.
To mitigate this, you could download RELEASES and the latest NuPkg file yourself with Chromium (as well as implement the login callback to actually show UI in-app), then point your updater URL to that temp folder. This is deeply obnoxious, but so are proxy servers.
@paulcbetts Out of interest do you know how / if atom handles this problem? Downloading the RELEASES and nupkg files through electron seems a bit silly to me but it seems like I need to somehow bypass a network connection all together so I'm not sure.... 😢
hi all, everything seems to be working fine for me on this except that it never seems to trigger the autoUpdate.on('update-downloaded') event? Anyone experienced this?
Reacted by Samuel Grant, Abhishek kandari and Jie Xu
Fingers crossed someone sees this! I was using this successfully and now it appears to not recognize the feedURL or at least autoUpdater.checkForUpdates() does not trigger anymore. Has anything changed in the AutoUpdater for electron?
Fingers crossed someone sees this! I was using this successfully and now it appears to not recognize the feedURL or at least autoUpdater.checkForUpdates() does not trigger anymore. Has anything changed in the AutoUpdater for electron?
Are you using the built-in updater the npm module?
Unfortunately, I don't believe the built-in updater has supported this for quite some time, which is why I posted the in-app HTTP proxy method above. The updater runs outside the JavaScript context, so unless they add support for this, I don't think it's going to work. Someone please correct me if I'm wrong.
I created electron-github-autoupdater to solve this problem. It's a custom autoUpdater that works pretty much the same, but accepts a config object including a GH user token. More information in the readme.
I've tested this on the latest versions of electron-forge, but I believe forge is electron 14, so it may not be compatible on v16+. Also, I have only tested on windows, I would very much appreciate a Mac user giving it a go.
But I get this error: Error: Could not locate update bundle for com.github.Electron within file:///Users/X/Library/Caches/com.github.Electron.ShipIt/update.SrmZwAy/ that looks nothing like the "url" that I passed...
I'm very stuck on this, some help would be very appreciated.
But I get this error: Error: Could not locate update bundle for com.github.Electron within file:///Users/X/Library/Caches/com.github.Electron.ShipIt/update.SrmZwAy/ that looks nothing like the "url" that I passed...
I'm very stuck on this, some help would be very appreciated.
@qiqetes@emalei Did you figure out a way to solve this? Looks like autoUpdater creates Users/X/Library/Caches/*/update. before downloading. Since we are skipping that part and doing it ourselves, this file/dir seems to be missing.
I'm trying to Manually handle updates.
I download the update from s3 bucket whenever there's an available update. And then I create a feed.json file with the format:
But I get this error: Error: Could not locate update bundle for com.github.Electron within file:///Users/X/Library/Caches/com.github.Electron.ShipIt/update.SrmZwAy/ that looks nothing like the "url" that I passed...
I'm very stuck on this, some help would be very appreciated.
@qiqetes@emalei Did you figure out a way to solve this? Looks like autoUpdater creates Users/X/Library/Caches/*/update. before downloading. Since we are skipping that part and doing it ourselves, this file/dir seems to be missing.
consttempPath=path.join(app.getPath("temp"),"updateVersion");constsetAutoUpdaterMac=()=>{// We need to manually create a feed.json file with a `url` key that points to our local `.zip` update file.constjson={url: url.pathToFileURL(path.join(tempPath,"update.zip")).href,};fs.writeFileSync(tempPath+"/feed.json",JSON.stringify(json));console.log("file://"+tempPath+"/feed.json");autoUpdater.setFeedURL({url: url.pathToFileURL(path.join(tempPath,"feed.json")).href,});autoUpdater.checkForUpdates();};
I don't remember it too much, what I have now and it's working is that piece of code.
@qiqetes Thank you. The issue's resolved now. The reason is – I am downloading a .dmg and feeding that to the autoUpdater when instead I should be feeding a zip file of .app
One other thing that I would like to bring up is, I am being prompted with a message saying "Application is downloaded from the internet. Are you sure you want to open it?" This is happening every time an update is downloaded and installed. Any idea why this happens?
Activity
kevinsawicki commentedon Apr 4, 2016
What version of squirrel on windows is your installer using?
MarshallOfSound commentedon Apr 4, 2016
Whichever version is packaged with
grunt-electron-installerversion1.2.3I can see that that repository received a major version bump recently to
2.0.0, is that bump at all related to this issue?kevinsawicki commentedon Apr 4, 2016
No, that major bump was for a new underlying library that was used.
MarshallOfSound commentedon Apr 4, 2016
Bit of a long shot hope 😆
I'm trying to find a way to accurately replicate this issue but it appears to be completely random 😢
kevinsawicki commentedon Apr 4, 2016
Are you able to get the squirrel logs off any of the machines that are experiencing the issue?
MarshallOfSound commentedon Apr 4, 2016
I'll grab them as soon as I can make it do this again. Completely uninstalling and reinstalling to replicate is time consuming when there is only a small chance it fails 😄
MarshallOfSound commentedon Apr 4, 2016
@kevinsawicki It appears as though there is some release notes parsing error https://gist.github.com/MarshallOfSound/7c6616b032a2499afd56de71186ef451 but then it still (eventually) starts building the full package and my app receives an update notification.
Still trying to make it not update 😞
I just pinged all the issues related to this asking for them to upload their squirrel log. I'll ping here if / when I get one
MarshallOfSound commentedon Apr 5, 2016
@kevinsawicki I managed to get a log from someone else's PC experiencing this issue.
https://gist.github.com/rickwastaken/c659c5a9fe75ecb3db274222bf6c288c
From what I can see they are having really strange DNS issues, which used to happen a lot (as an example MarshallOfSound/Google-Play-Music-Desktop-Player-UNOFFICIAL-#301)
However when the user accesses
update.googleplaymusicdesktopplayer.comin there browser. It resolves the address fine (as seen hereAny reason why C#'s WebClient wouldn't resolve the name but a browser would?
kevinsawicki commentedon Apr 5, 2016
No idea, not sure if @paulcbetts might know 🔦
anaisbetts commentedon Apr 5, 2016
If it's using an authenticated proxy
MarshallOfSound commentedon Apr 5, 2016
@paulcbetts Is there any way around this? Or any way for me to detect that proxy from within electron and tell the user they won't be able to get updates?
MarshallOfSound commentedon Apr 5, 2016
@paulcbetts Or maybe implementing this https://msdn.microsoft.com/en-us/library/system.net.webrequest.defaultwebproxy.aspx in Squirrel.Windows
baconbrad commentedon Apr 5, 2016
@MarshallOfSound There are several NPM packages that let you detect a proxy. Or you could write your own solution in Node.js to detect a proxy. Could you do that without needing changes in Squirrel for Windows? Because there would be cases where someone would want to update via a proxy.
Ideally I would skip all the above together and either check to see if the file could be reached and notify the user if not or attempt to download the file and notify the user if the download fails. This is how most updaters handle this.
If none of the above works for you I guess I don't completely understand your case.
anaisbetts commentedon Apr 7, 2016
So, the problem at the end of the day is, if you have an authenticated proxy on Windows, you need to pop UI to prompt for username/passwords at the time of request (i.e. not just in a system settings dialog). This is deeply stupid, but it is what it is.
To mitigate this, you could download RELEASES and the latest NuPkg file yourself with Chromium (as well as implement the login callback to actually show UI in-app), then point your updater URL to that temp folder. This is deeply obnoxious, but so are proxy servers.
MarshallOfSound commentedon Apr 7, 2016
@paulcbetts Out of interest do you know how / if atom handles this problem? Downloading the RELEASES and
nupkgfiles through electron seems a bit silly to me but it seems like I need to somehow bypass a network connection all together so I'm not sure.... 😢44 remaining items
FCF-Releases commentedon May 21, 2021
hi all, everything seems to be working fine for me on this except that it never seems to trigger the autoUpdate.on('update-downloaded') event? Anyone experienced this?
FCF-Releases commentedon Feb 5, 2022
Fingers crossed someone sees this! I was using this successfully and now it appears to not recognize the feedURL or at least autoUpdater.checkForUpdates() does not trigger anymore. Has anything changed in the AutoUpdater for electron?
sploders101 commentedon Feb 5, 2022
Are you using the built-in updater the npm module?
Unfortunately, I don't believe the built-in updater has supported this for quite some time, which is why I posted the in-app HTTP proxy method above. The updater runs outside the JavaScript context, so unless they add support for this, I don't think it's going to work. Someone please correct me if I'm wrong.
christianblandford commentedon Feb 16, 2022
I created electron-github-autoupdater to solve this problem. It's a custom autoUpdater that works pretty much the same, but accepts a config object including a GH user token. More information in the readme.
I've tested this on the latest versions of electron-forge, but I believe forge is electron 14, so it may not be compatible on v16+. Also, I have only tested on windows, I would very much appreciate a Mac user giving it a go.
qiqetes commentedon Jun 28, 2022
I'm trying to Manually handle updates.
I download the update from s3 bucket whenever there's an available update. And then I create a
feed.jsonfile with the format:Then I set the
But I get this error:
Error: Could not locate update bundle for com.github.Electron within file:///Users/X/Library/Caches/com.github.Electron.ShipIt/update.SrmZwAy/that looks nothing like the "url" that I passed...I'm very stuck on this, some help would be very appreciated.
zschreur commentedon Jun 28, 2022
@qiqetes Using the
urlpackage could help ensure the URL is properly formatted.qiqetes commentedon Jun 28, 2022
Thanks for the reply. Seems like the urls are fine. (tried with your method, same error is thrown).

emalei commentedon Oct 17, 2022
Have you solved this problem
saibhavateja1 commentedon Jan 13, 2023
@qiqetes @emalei Did you figure out a way to solve this? Looks like autoUpdater creates Users/X/Library/Caches/*/update. before downloading. Since we are skipping that part and doing it ourselves, this file/dir seems to be missing.
@joshuapinter How did you get this to work?
qiqetes commentedon Jan 13, 2023
I don't remember it too much, what I have now and it's working is that piece of code.
saibhavateja1 commentedon Jan 13, 2023
@qiqetes Thank you for the snippet. Do you mind sharing which version of electron you are using today?
Also is the autoUpdater from electron module?
qiqetes commentedon Jan 13, 2023
Latest version, and yes, autoUpdater comes from the electron module;
saibhavateja1 commentedon Jan 18, 2023
@qiqetes Thank you. The issue's resolved now. The reason is – I am downloading a .dmg and feeding that to the autoUpdater when instead I should be feeding a zip file of .app
One other thing that I would like to bring up is, I am being prompted with a message saying "Application is downloaded from the internet. Are you sure you want to open it?" This is happening every time an update is downloaded and installed. Any idea why this happens?
0xvgd commentedon Jan 28, 2023
Is nupkg file still required for auto update on Windows?
I found squirrel.windows, which is used for generating nupkg file, is deprecated and can't see the latest update from its repository.
On the other hand, I found squirrel.windows is still a solution to auto update an electron app on Windows.
https://www.electronjs.org/docs/latest/api/auto-updater#windows
What is the best way to implement auto update on windows?
@joshuapinter @scottrippey
lockiechen commentedon Oct 27, 2023
how can i add query token when download the windows pkg