go-astilectron-bootstrap
go-astilectron-bootstrap copied to clipboard
Add an auto-update functionality
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).
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
Curious. Would some of the code provided by itch.io's installer help with this task?
https://github.com/itchio/itch-setup
I think it would help indeed!