Skip to content
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

electron-updater does not update app, ERR_CONNECTION_REFUSED error #2289

Closed
naheller opened this issue Nov 9, 2017 · 14 comments
Closed

electron-updater does not update app, ERR_CONNECTION_REFUSED error #2289

naheller opened this issue Nov 9, 2017 · 14 comments

Comments

@naheller
Copy link

naheller commented Nov 9, 2017

  • electron-builder version: 19.45.2
  • electron-updater version: 2.16.1
  • target: ["zip", "dmg"]

I am trying to use electron-updater for a Mac app release. I've built on top of basic-electron-react-boilerplate and added in electron-builder and electron-updater.

My workflow looks like this:

  1. Make changes to code
  2. Push code to repository
  3. Run npm run build which is short for webpack --config webpack.build.config.js
  4. Run npm run publish which is short for build -p always, which spits out my dmg, zip, latest-mac files, etc and publishes them to a GitHub Release.
  5. Download and install dmg (an initial release v0.0.1, so no updates available yet)
  6. Repeat steps 1-4, and when my first update v0.0.2 is uploaded as GitHub Release, reopen v0.0.1 and expect it to update to v0.0.2, which it does not.

my main.js:
screen shot 2017-11-08 at 5 19 02 pm

and my error message:
screen shot 2017-11-08 at 5 21 24 pm

Any advice would be greatly appreciated! Let me know if you'd like any additional details, like my package.json or otherwise.

@tylerlong
Copy link

Where did you publish your app to? Is the latest-mac.json file publicly accessible?

@naheller
Copy link
Author

naheller commented Nov 9, 2017

@tylerlong Thanks for your reply! The npm run publish command publishes latest-mac.json to my GitHub Release, along with many other files, as shown below:

screen shot 2017-11-09 at 9 46 28 am

@naheller
Copy link
Author

naheller commented Nov 9, 2017

I should also add that this is a private repository, but I do have my GH_TOKEN set as an env variable. Do I need to add any additional permissions for the updater to look into a private repo?

@develar
Copy link
Member

develar commented Nov 9, 2017

macOS apps has own set of env. terminal env are not available for apps. Please use https://github.com/sindresorhus/shell-env

And I hope that you understand what do you do using private repo for updates. Separate user must be used and private option is set in the GitHub publish options.

@naheller
Copy link
Author

naheller commented Nov 9, 2017

Thanks @develar

What do you mean by "I hope you understand what do you do using private repo for updates"? What else do I need to do for private repos besides setting the GH_TOKEN env variable?

Will this address the error I shared above?

@develar
Copy link
Member

develar commented Nov 9, 2017

What do you mean

API Token allows to do everything. So, you must create special user and limit user access.

Will this address the error I shared above?

shell-env will.

@develar
Copy link
Member

develar commented Nov 9, 2017

@naheller Have your read https://www.electron.build/auto-update#private-github-update-repo?

(yes, I am going to add note about shell-env to docs).

@naheller
Copy link
Author

naheller commented Nov 9, 2017

@develar By "special user", do you mean GitHub user? Many people who will use my app don't have GitHub accounts. This is my first time using auto-update, so I'm not sure about special user access.

I am looking at the page you linked. Is the private option set as follows?

screen shot 2017-11-09 at 10 08 29 am

Thanks for your help!

@develar
Copy link
Member

develar commented Nov 9, 2017

@naheller It seems you don't understand that auto-updater requires token on a user machine to work.

Only for very special cases — not intended and not suitable for all users.

See https://www.electron.build/auto-update#private-github-update-repo

So, just use Digital Ocean Spaces or Amazon S3.

@naheller
Copy link
Author

naheller commented Nov 9, 2017

@develar Ah... I see. GitHub Releases would have been perfect, but I will try those other solutions. electron-release-server might be a good option in the meantime for testing.

Thanks for your help

@develar
Copy link
Member

develar commented Nov 9, 2017

https://github.com/ArekSredzki/electron-release-server is not definitely an option because it requires non static server. Electron updater supports any http server, nothing else is required.

@develar
Copy link
Member

develar commented Nov 9, 2017

Well, you can just create an empty public repo and use it to release artifacts;)

@naheller
Copy link
Author

naheller commented Nov 9, 2017

I could do that with an empty repo? Don't releases need to be tied to a certain branch?

screen shot 2017-11-09 at 10 49 38 am

@develar
Copy link
Member

develar commented Nov 9, 2017

@naheller It will looks a little bit crazy, but works. https://github.com/electron-userland/electron-builder-binaries/releases is an example of such repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants