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

docs about servers side support for auto updating a windows build #3525

Closed
plrthink opened this issue Nov 20, 2015 · 24 comments
Closed

docs about servers side support for auto updating a windows build #3525

plrthink opened this issue Nov 20, 2015 · 24 comments

Comments

@plrthink
Copy link

The doc about 'auto-updater' module says

The server-side setup is also different from OS X. You can read the documents of Squirrel.Windows to get more details.'

But I can't find that at Squirrel.Windows' documents.

Where I can find the info about that?

@enahum
Copy link

enahum commented Nov 20, 2015

Does anyone have an example for a server side implementation for Squirrel.Windows? I cannot seem to find it, I managed to get the RELEASES file to establish that there is an update available, but thats all, no way to download nor install the update.

Any help here will be appreciated.

@ghost
Copy link

ghost commented Nov 20, 2015

It would be useful to read/visit docs and Getting Started Guide

@enahum
Copy link

enahum commented Nov 20, 2015

@dkfiresky, already read it. couldn't find any info about a server side implementation for hosting the updates, as @plrthink says no docs in that link about how it works.

I found out that when checking for updates it makes a request to the updater.setFeedURL and appends a RELEASES?id=APPNAME&localVersion=1.0.2&arch=amd64 at the end.

If there's no update the update-not-available event is fired, but when there is an update the download is not triggered as in Squirrel.Mac

@ghost
Copy link

ghost commented Nov 20, 2015

The update is only fired when you reply with 200 OK and following json:

{
   "url": "http://mycompany.com/myapp/releases/myrelease",
   "name": "My Release Name",
   "notes": "Theses are some release notes innit",
   "pub_date": "2013-09-18T12:29:53+01:00",
}

Ref: https://github.com/Squirrel/Squirrel.Mac#update-json-format

I assume it's the same with Squirrel.Windows.

@plrthink
Copy link
Author

@dkfiresky So, does it means the server side setup for auto update windows builds is same as that for OS X except that we are supposed to add a config file as this says?

There is no pc available to me right now, so I would try that tomorrow. But I think the doc is so misunderstanding if it's true...

@enahum

@enahum
Copy link

enahum commented Nov 20, 2015

I really don't think so, cause the only way it detects that theres is an update available is by downloading the RELEASES file.

My Squirrel.Mac implementation works flawless but this one I cannot seem to understand.

@enahum
Copy link

enahum commented Nov 20, 2015

Ok folks, got it working!!!!

This is the way it works at least for me:

  • use grunt-electron-installer to generate the installer
  • In your electron app set the updater URL with setFeedURL (it has to be a valid URL with SSL)

I have suppor for both mac & windows updates.. my URL is https://mycompany.com/update/:app/:platform/:version then in the server I have two routes for this

  1. /update/:app/:platform/:version -> This one is for Mac updates and returns 204 or 200 status code with the Squirrel.Mac json update format
  2. /update/:app/:platform/:version/releases -> This one is for Windows updates and downloads the latest RELEASES file (be aware that the RELEASES file have to have only one line per version one for the full and one for the delta)

After that the URL for the Mac downloads is set in the json update format in the url property, but the Squirrel.Windows way of doing it is by making a GET Request to the same URL as in the setFeedURL of the updater meaning that is something like this /update/:app/:platform/:version/filename.nupkg.

Serve the file in that URL and you're set.

@plrthink
Copy link
Author

@enahum nice! It would be great if you can show a example here or create a gist.

@plrthink
Copy link
Author

@enahum A few questiones here:

1.For windows builds, does electron (or Squirrel.Windows) automatically decide whether there is a update available based on the latest RELEASES file? Since unlike that on mac, which you can decide if there is a update or not by making different response, on windows it just download the latest RELEASES file.

2.Also for windows builds, does electron (or Squirrel.Windows) automatically request the update (the .nupkg) file or you should manually request that?

@enahum
Copy link

enahum commented Nov 20, 2015

@plrthink

  1. For windows build, Squirrel.Windows will decide automatically if there is an update based on the RELEASES file it downloads, it will make a comparison with the RELEASES file that you already have with the installed app. That means that when checking for updates you have to send the RELEASES file to the electron app.
  2. When the RELEASES file have a newer version than that installed by the user it will automatically request the newest .nupkg found in the RELEASES file (it could be the full version or the delta version).

Hope it helps

@plrthink
Copy link
Author

@enahum Yeah, that make sense for me. An additional question. How to generate a delta .nupkg file?

@enahum
Copy link

enahum commented Nov 20, 2015

the grunt-electron-installer creates it all by itself if you don't delete your previous builds of the installer.

Cheers!!

@plrthink
Copy link
Author

Oh, got it, thank for answering questions.

@plrthink
Copy link
Author

@enahum @dkfiresky After digging Squirrel.Windows, I find this:

  1. At this line, Squirrel.Windows fetch a remote RELEASES file.
  2. And this file is response for downloads .nupkg files.

@enahum
Copy link

enahum commented Nov 20, 2015

I haven't been able to run the app with the squirrel events getting triggered, I even modified the rcedit project to include SquirrelAwareApp=1.

Anyone have had successfully made this work?

@plrthink
Copy link
Author

@enahum Did you say it work?

@plrthink plrthink reopened this Nov 21, 2015
@plrthink
Copy link
Author

Could anyone of electron team update the docs about this section and explain how it works? May be it's easy for a windows developer to understand but it's not for a js developer without any existing knowledge about windows development.

@zcbenz
Copy link
Contributor

zcbenz commented Nov 23, 2015

I suggest bringing this up in issues list of Squirrel.Windows, you should be able to get much better answers there, and the documents on auto-updater in Electron just links to there.

@evgenyzinoviev
Copy link

Hey guys, can I use auto-updater on windows without using grunt-electron-installer (I want to use Inno Setup for creating the installer)?

@enahum
Copy link

enahum commented Dec 6, 2015

@evgenyzinoviev I haven´t tried but it shouldn't be a Problem, and if you include the binaries from Squirrel.Windows you should have support for the auto-updater feature, Its only a wild guess. Give it a try and let us know if it works.

Cheers.

@anaisbetts
Copy link
Contributor

Could anyone of electron team update the docs about this section and explain how it works? May be it's easy for a windows developer to understand but it's not for a js developer without any existing knowledge about windows development.

Squirrel.Windows dev here, I totally agree with this sentiment, it's been on my TODO list to make this much easier / less confusing. Sorry that right now it's kind of Black Magic.

(I want to use Inno Setup for creating the installer)?

auto-updater specifically works with Squirrel.Windows, if you use Inno Setup you're on your own

@evgenyzinoviev
Copy link

okay then, I ported osx auto-updater to windows and it seems to work: https://github.com/evgenyzinoviev/electron-windows-updater

@plrthink
Copy link
Author

plrthink commented Dec 7, 2015

@paulcbetts 👍

@mzmousa
Copy link

mzmousa commented May 13, 2016

@paulcbetts any news on updated docs?

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

No branches or pull requests

6 participants