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

[DESKTOP] Desktop app auto update #1177

Closed
sfroment opened this issue Apr 11, 2019 · 0 comments
Closed

[DESKTOP] Desktop app auto update #1177

sfroment opened this issue Apr 11, 2019 · 0 comments
Milestone

Comments

@sfroment
Copy link
Member

sfroment commented Apr 11, 2019

After trying to use AutoUpdater through astilectron I've been stuck by the squirrel.mac signature verification of the .zip
Using autoUpdater from electron should be great but it's a waste of time for the moment here are the reasons why:

     case consts.eventNames.autoUpdaterCheckForUpdates:
        autoUpdater.checkForUpdates()
        client.write('1', consts.eventNames.autoUpdaterCheckForUpdates, {})
        break
      case consts.eventNames.autoUpdaterGetFeedURL:
        client.write('1', consts.eventNames.autoUpdaterGetFeedURL, { url: autoUpdater.getFeedURL() })
        break
      case consts.eventNames.autoUpdaterSetFeedURL:
        autoUpdater.setFeedURL({ url: json.url })
        client.write('1', consts.eventNames.autoUpdaterSetFeedURL, { url: json.url })
        break

You'll also need to listen to the event send by electron to send them to the go https://electronjs.org/docs/api/auto-updater#events
Lastly you need in add a type AutoUpdater in go-astilectron it could look like something like:

package astilectron

type AutoUpdater struct {
	*object
}

func (au *AutoUpdater) GetFeedURL() (string, err error) {
	o, err := synchronousEvent(au.c, au, au.w, Event{Name: "auto.updater.get.feed.url"}, "auto.updater.get.feed.url")
	return nil, err
}

func (au *AutoUpdater) SetFeedURL(url string) (err error) {
	_, err = synchronousEvent(au.c, au, au.w, Event{Name: "auto.updater.set.feed.url", URL: url}, "auto.updater.set.feed.url")
	return
}

func (au *AutoUpdater) checkForUpdates() (bool, err error) {
	_, err = synchronousEvent(au.c, au, au.w, Event{Name: "auto.updater.check.for.updates"}, "auto.updater.check.for.updates")
	return
}

func (au *AutoUpdater) QuitAndInstall() (err error) {
	_, err = synchronousEvent(au.c, au, au.w, Event{Name: "auto.updater.quit.and.install"}, "auto.updater.quit.and.install")
	return
}

I think it will be great to use AutoUpdater once we're open source and we make release based on github releases

#1176

@sfroment sfroment added this to the w19.15 👾 milestone Apr 11, 2019
@sfroment sfroment self-assigned this Apr 11, 2019
@glouvigny glouvigny mentioned this issue Apr 11, 2019
44 tasks
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

1 participant