CodingGarden / entropychat.app

A discord clone made by the Coding Garden Community.
https://entropychat.app
103 stars 37 forks source link

Electron | Automatic updates implemented for each release and pre-configured application for windows #19

Open ChrisMichaelPerezSantiago opened 4 years ago

ChrisMichaelPerezSantiago commented 4 years ago

Automatic update for each release has been integrated, with pre-configuration for windows. It can also be configured for other platforms

vue.config.js

Predefined settings for windows, but can be configured for other platforms.

In the publish section you should change:

and make value changes in the properties appId, and productName.

to see available options, check out Electron Builder Configuration Options

GH_TOKEN

You should assign an environment variable called GH_TOKEN with the token that github provides you. This is mandatory as it will help to apply automatic updates. For more information visit the Auto Update section for more details.

How to release the application to github?

Before generating the icons you should go to the package.json and change the --input path where the icon is located

"electron:generate-icons": "electron-icon-builder --input=./public/favicon-32x32.png --output=build --flatten",

then ...

yarn electron:generate-icons
yarn gh-publish GH_TOKEN

It will perform the build of the application and the release as draf. Now you should go to the repository and you will see that a release draf has created for you.

This is very useful because now the user should not go to the release section to download the new release of the application. It would only be enough to enter the application, and if there is a new version windows will show a notification to perform the update.

But yes, the user the first time should download the release from github. To see more releases the user will receive a notification to their computer to download the new version, without the need to go to github and download the release.

The documentation comes from a template that I had implemented with vue + electron, at the following URL

ChrisMichaelPerezSantiago commented 4 years ago

Hi @w3cj ,

Sorry for the delay. I had to open a new pull request, I think now you should have no problem merging the changes.