Hyper: Better updates system

Created on 4 Jul 2016  路  13Comments  路  Source: vercel/hyper

screen shot 2016-07-03 at 4 29 20 pm

Goals and improvements over the ugly hack we have:

  • Downloads and installs on the background, only prompts the user to restart
  • Single-click restart
  • Dismissable
  • Green instead of red

Assets:

  • Icon icon.svg.zip
  • Background color: #7ED321
  • Dismiss link color: #528D11

Thanks to @matiastucci for bringing this electron API to my attention.

help wanted

Most helpful comment

Something like this would be great as well (if people want to get their hands on an update before the local auto updater even knows that a new version is out):

All 13 comments

This might also require updates to hyperterm-website.

@rauchg looking at this tonight.

@numeraltwo excellent!

hey @numeraltwo, I deployed a server here https://nuts-serve-nxchetcjig.now.sh/update/osx/${CURRENT_VERSION} to check if there is an update or not. It's using GitHub releases to check that.

I started this the other day but the autoUpdater events didn't fire. For example: autoUpdater.once('checking-for-update', () => { /.../ }); I don't know why. Maybe you'll have more luck. When I have more free time I'll try again

@matiastucci awesome! I'll set up a Slack in case you guys want to work together on this one

Ok, sure @rauchg. That would be great.

Ok, this morning I spend some time on this. Here is my fork: https://github.com/matiastucci/hyperterm

I wrote a quick autoUpdater module, and is detecting when there is a new update. But after downloading it Squirrel is throwing this error: Code signature at URL file:///Users/Mati/Library/Caches/co.zeit.hyperterm.ShipIt/update.zH0J7it/HyperTerm.app/ did not pass validation: code failed to satisfy specified code requirement(s)

I'm pretty sure that error is because I'm signing the app with my User ID. I think the only way to test this is signing the app the same way as the releases. Any ideas?

Ok, is definitely that. Before I was signing the app with my identity and getting the update from GitHub releases (signed it with some other identity). Now, I signed 2 versions (3.0.1 and 3.0.2) both with my identity. I uploaded the 3.0.2 to the server, ran the 3.0.1 and now it works.

ezgif-2544192603

A couple of things:

  1. If you run npm start is going to throw an error saying that the app is not signed. This is because I'm importing autoUpdater and Squirrel requires the app to be signed. So, to test it I'm doing ./package.sh everytime. Of course this sucks, and it has to be some way to sign the running app but I don't know how yet.
  2. For this to actually work with GitHub releases the app is going to need to be signed with the same identity.
  3. I'm not sure how to fix this without pushing the identity to GitHub 馃

@matiastucci amazing

Something like this would be great as well (if people want to get their hands on an update before the local auto updater even knows that a new version is out):

Btw, the current update server is not working:

2017-01-11 07:55:10> FileDownloader: Downloading url: https://hyper-updates.now.sh/update/win32/1.0.1/releases?id=hyper&localversion=1.0.1&arch=amd64
2017-01-11 07:55:11> IEnableLogger: Failed to download url: https://hyper-updates.now.sh/update/win32/1.0.1/releases?id=hyper&localversion=1.0.1&arch=amd64: System.Net.WebException: The remote server returned an error: (500) Internal Server Error.
   at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
   at System.Net.WebClient.GetWebResponse(WebRequest request, IAsyncResult result)
   at System.Net.WebClient.DownloadBitsResponseCallback(IAsyncResult result)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Squirrel.Utility.<LogIfThrows>d__35`1.MoveNext()
2017-01-11 07:55:11> CheckForUpdateImpl: Download resulted in WebException (returning blank release list): System.Net.WebException: The remote server returned an error: (500) Internal Server Error.
   at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
   at System.Net.WebClient.GetWebResponse(WebRequest request, IAsyncResult result)
   at System.Net.WebClient.DownloadBitsResponseCallback(IAsyncResult result)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Squirrel.Utility.<LogIfThrows>d__35`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Squirrel.FileDownloader.<DownloadUrl>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at Squirrel.UpdateManager.CheckForUpdateImpl.<CheckForUpdate>d__2.MoveNext()
2017-01-11 07:55:11> Unhandled exception: System.AggregateException: One or more errors occurred. ---> System.Net.WebException: The remote server returned an error: (500) Internal Server Error.
   at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
   at System.Net.WebClient.GetWebResponse(WebRequest request, IAsyncResult result)
   at System.Net.WebClient.DownloadBitsResponseCallback(IAsyncResult result)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Squirrel.Utility.<LogIfThrows>d__35`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Squirrel.FileDownloader.<DownloadUrl>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at Squirrel.UpdateManager.CheckForUpdateImpl.<CheckForUpdate>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Squirrel.UpdateManager.<CheckForUpdate>d__7.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Squirrel.Update.Program.<Download>d__7.MoveNext()
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   at System.Threading.Tasks.Task`1.get_Result()
   at Squirrel.Update.Program.executeCommandLine(String[] args)
   at Squirrel.Update.Program.main(String[] args)
---> (Inner Exception #0) System.Net.WebException: The remote server returned an error: (500) Internal Server Error.
   at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
   at System.Net.WebClient.GetWebResponse(WebRequest request, IAsyncResult result)
   at System.Net.WebClient.DownloadBitsResponseCallback(IAsyncResult result)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Squirrel.Utility.<LogIfThrows>d__35`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Squirrel.FileDownloader.<DownloadUrl>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at Squirrel.UpdateManager.CheckForUpdateImpl.<CheckForUpdate>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Squirrel.UpdateManager.<CheckForUpdate>d__7.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Squirrel.Update.Program.<Download>d__7.MoveNext()<---


This issue can be closed as it has been implemented.

Closing 馃憣

Was this page helpful?
0 / 5 - 0 ratings

Related issues

laur1s picture laur1s  路  3Comments

anthonyettinger picture anthonyettinger  路  3Comments

daenuprobst picture daenuprobst  路  3Comments

cooperpellaton picture cooperpellaton  路  3Comments

stan-stripe picture stan-stripe  路  3Comments