Skip to content

Commit

Permalink
update autoupdate things readme
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanmajh committed Dec 8, 2021
1 parent 5d58319 commit 0acd9dd
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 421 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ git clone https://github.com/jonathanmajh/iko_mro_items.git
# Go into the repository
cd iko_mro_items
# Install dependencies
Note: Better-sqlite3 does not include prebuilt binaries for windows, this will have to be complied see [Better-Sqlite](https://github.com/JoshuaWise/better-sqlite3/blob/master/docs/troubleshooting.md) and [Working with Electron](https://github.com/JoshuaWise/better-sqlite3/issues/126)
npm install
# Run the app
npm start
```
Note: Better-sqlite3 does not include prebuilt binaries for windows, this will have to be complied see [Better-Sqlite](https://github.com/JoshuaWise/better-sqlite3/blob/master/docs/troubleshooting.md) and [Working with Electron](https://github.com/JoshuaWise/better-sqlite3/issues/126)

Using
```
Expand All @@ -27,4 +27,7 @@ electron v11.1.0
better-sqlite3 v7.1.2
electron-squirrel-startup v1.0.0
xlsx v0.16.9
```
```

Auto updating using Nuts
https://github.com/GitbookIO/nuts
16 changes: 14 additions & 2 deletions assets/autoupdater.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const {app, autoUpdater, dialog} = require('electron');
const version = app.getVersion();
const platform = os.platform() + '_' + os.arch(); // usually returns darwin_64

const updaterFeedURL = 'https://electron0autoupdate.herokuapp.com/update/' + platform + '/' + version;
const updaterFeedURL = 'https://jonathanmajh-iko-tool.herokuapp.com/update/' + platform + '/' + version;
// replace updaterFeedURL with http://yourappname.herokuapp.com

function appUpdater() {
Expand All @@ -14,7 +14,19 @@ function appUpdater() {
You could alsoe use nslog or other logging to see what's happening */
autoUpdater.on('error', err => console.log(err));
autoUpdater.on('checking-for-update', () => console.log('checking-for-update'));
autoUpdater.on('update-available', () => console.log('update-available'));
autoUpdater.on('update-available', () => {
dialog.showMessageBox({
type: 'question',
buttons: ['OK1', 'OK2'],
defaultId: 0,
message: 'A new version of ' + app.getName() + ' is available and currently being downloaded',
detail: message
}, response => {
if (response === 0) {
console.log('selected 0')
}
});
});
autoUpdater.on('update-not-available', () => console.log('update-not-available'));

// Ask the user if update is available
Expand Down
Loading

0 comments on commit 0acd9dd

Please sign in to comment.