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

New guide for implementing updates #10251

Merged
merged 21 commits into from Aug 21, 2017

Conversation

Projects
None yet
5 participants
@leo
Member

leo commented Aug 11, 2017

As discusssed with @zeke on Slack, we concluded that:

  • The API docs for autoUpdater should really only be API docs, not contain a guide
  • There needs to be a guide on how to implement updates

Both of these issues are resolved with this PR.

leo added some commits Aug 11, 2017

@leo leo added the needs-review label Aug 11, 2017

@leo leo requested a review from zeke Aug 11, 2017

leo added some commits Aug 11, 2017

Depending on your needs, you can choose from one of these:
- [Hazel](https://github.com/zeit/hazel) – Pulls new releases from [GitHub Releases](https://help.github.com/articles/creating-releases/) and is **perfect for getting started**
- [Nuts](https://github.com/GitbookIO/nuts) – Also uses [GitHub Releases](https://help.github.com/articles/creating-releases/), but caches app updates on disk

This comment has been minimized.

@MarshallOfSound

MarshallOfSound Aug 12, 2017

Member

but caches app updates on disk, therefore allowing use of private GitHub repositories

This comment has been minimized.

@leo
As the final step, tell [autoUpdater](../api/auto-updater.md) where to ask for updates:
```js
autoUpdater.setFeedURL(feed)

This comment has been minimized.

@MarshallOfSound

MarshallOfSound Aug 12, 2017

Member

Maybe add autoUpdater.checkForUpdates() here as well or people might think it does the checking automagically

This comment has been minimized.

@leo

leo Aug 12, 2017

Member

Great idea as well! 👍 235ae09

@zeke zeke self-assigned this Aug 14, 2017

@zeke

This comment has been minimized.

Member

zeke commented Aug 14, 2017

@leo I made a few changes based on the styleguide, but overall I think this is a great start.

I think the last section should be fleshed out a bit more. It would be great to show some example code that illustrates what you mean by "this can be achieved using events".

@@ -50,15 +41,6 @@ The installer generated with Squirrel will create a shortcut icon with an
same ID for your app with `app.setAppUserModelId` API, otherwise Windows will
not be able to pin your app properly in task bar.
Unlike Squirrel.Mac, Windows can host updates on S3 or any other static file host.

This comment has been minimized.

@zeke

zeke Aug 15, 2017

Member

@leo why did this section on Windows and Linux get removed?

This comment has been minimized.

@leo

leo Aug 15, 2017

Member

I thought it wasn't necessary, but now - after thinking about it a bit more - I brought it back just to be sure that we're all on the same page: 3405596 and 78f11df

leo added some commits Aug 15, 2017

@leo

This comment has been minimized.

Member

leo commented Aug 15, 2017

@zeke Great idea! 4ba4fe4

for logging them to `stderr`:
```js
autoUpdater.on('error', console.error)

This comment has been minimized.

@zeke

zeke Aug 15, 2017

Member

Are you sure this will work? Normally you have to do console.error.bind(console) to get this kind of trick to work. Maybe this would be more clear:

autoUpdater.on('error', (error) => {
  console.error('There was a problem updating the application')
  console.error(error)
})

This comment has been minimized.

@leo

leo Aug 15, 2017

Member

Well, it almost always works. Except for when the caller accesses this inside - but I personally haven't experienced that case yet. Fixed anyways!

leo and others added some commits Aug 15, 2017

@zeke zeke requested a review from joshaber Aug 15, 2017

@zeke

This comment has been minimized.

Member

zeke commented Aug 15, 2017

Added SquirrelMaster @joshaber as a reviewer.

zeke added some commits Aug 15, 2017

@joshaber

Is it worth talking about Squirrel.Windows' events?

Once your application is [packaged](../tutorial/application-distribution.md),
it will receive an update for each new
[GitHub Release](https://help.github.com/articles/creating-releases/) that you

This comment has been minimized.

@joshaber

joshaber Aug 15, 2017

Contributor

It seems like this is specific to Hazel?

I guess more generally, it's not clear to me if this is meant to be a guide to using Hazel or a general guide for updates?

This comment has been minimized.

@leo

leo Aug 15, 2017

Member

Depending on which update server you choose, not only the way to creating a release, but also the code inside the client differs. In turn, we need to pick one as an example (Hazel is the easiest of them all) and indicate that (I did that here - first paragraph).

@zeke agreed on highlighting it, since it's currently the best for beginners.

This comment has been minimized.

@zeke

zeke Aug 15, 2017

Member

I don't have a stance on what the "best" option is, but I think it's useful to get a guide to updating apps off the ground that goes beyond our current API docs for autoUpdater, which leave much to be desired.

Eventually I think it would be great for this document to have a section for each of the update server thingies we want to recommend (nuts, etc), and I'm comfortable using Hazel as the prototype for that.

This comment has been minimized.

@leo

leo Aug 16, 2017

Member

Yep 👍

buttons: ['Restart', 'Later'],
title: 'Application Update',
message: 'A new version has been downloaded. Restart the application to apply the updates.',
detail: releaseName + '\n\n' + releaseNotes

This comment has been minimized.

@joshaber

joshaber Aug 15, 2017

Contributor

Is it worth nothing that releaseNotes won't exist on Windows?

This comment has been minimized.

@leo

leo Aug 15, 2017

Member

Fixed! 78c87d4

leo and others added some commits Aug 15, 2017

@zeke zeke merged commit b101176 into master Aug 21, 2017

0 of 6 checks passed

continuous-integration/appveyor/pr Waiting for AppVeyor build to complete
Details
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
electron-linux-arm Build #7717245 queued
Details
electron-linux-arm64 Build #7717246 queued
Details
electron-linux-ia32 Build #7717247 queued
Details
electron-linux-x64 Build #7717248 queued
Details

@zeke zeke deleted the new-update-docs branch Aug 21, 2017

@zeke

This comment has been minimized.

Member

zeke commented Aug 21, 2017

Thanks, @leo. This will end up on the website the next time we cut a (stable) release. 👍

@myfrndjk

This comment has been minimized.

myfrndjk commented Sep 2, 2017

I explained something about auto update feature with minimal code sample.
Adding the link here since it is related to auto update.
https://discuss.atom.io/t/deploy-app-on-users-machine-with-autoupdate/40385/2

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