go-astilectron-bootstrap icon indicating copy to clipboard operation
go-astilectron-bootstrap copied to clipboard

Add an auto-update functionality

Open asticode opened this issue 7 years ago • 4 comments

asticode avatar Nov 08 '17 18:11 asticode

Were you looking at using a particular framework or method? This is on my list of P1 features for my own app which is using this bootstrapper, I'd be more than happy to integrate it and push it upstream if it's a negligible amount of added work (since I already need to do it).

craigsc avatar Jun 08 '18 23:06 craigsc

I didn't want to use any framework as I wanted to keep things as simple as possible.

What I had in mind is the following:

  • the bootstrap has a Versioner option which is an interface along the lines of :
type Versioner interface {
  LastVersion() (Version, error)
}

type Version struct {
  Name string // Example: v1.2.3
  URL string // Example: http://mysite.com/path/to/file
}
  • in the Run method, the bootstrap would check if this interface != nil, and if so would get the last version
  • it would check whether the last version is different from the current version (which means the current version would need to be added as an ldflags in the bundler)
  • if a newer version was available, it would download the files, replace the current files and display a message to the user saying that a newer version is available and he/she needs to restart the app

That being said, the Versioner interface would have to be set with something that exists : that's where the deployer project comes in. I started it a month ago to try things out and here is what I had in mind:

  • this project has a private server only available to the developer where he/she can add projects and for each project upload binaries/files for specific OSes with specific version names on a nice UI in the browser
  • this project also has a public server which can provide the last version available for a specific project that is to say implementing the Versioner interface

Does that make sense

asticode avatar Jun 09 '18 06:06 asticode

Curious. Would some of the code provided by itch.io's installer help with this task?

https://github.com/itchio/itch-setup

Happy-Ferret avatar Sep 03 '19 09:09 Happy-Ferret

I think it would help indeed!

asticode avatar Sep 04 '19 07:09 asticode