Skip to content

Commit

Permalink
Implement auto update
Browse files Browse the repository at this point in the history
  • Loading branch information
StarLederer committed Apr 24, 2021
1 parent 165fc5f commit 9f8db2a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 6 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "metashine",
"version": "1.1.0",
"version": "1.0.0",
"description": "Music meta tag editor",
"repository": "github:HermanLederer/mp3-tag-assistant",
"repository": "github:HermanLederer/metashine",
"license": "MIT",
"author": {
"name": "Herman Lederer",
Expand Down
25 changes: 21 additions & 4 deletions src/main/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { app, BrowserWindow, ipcMain, IpcMainEvent } from 'electron';
import { autoUpdater } from 'electron-updater';
import fs from 'fs';
import * as path from 'path';
import path from 'path';
import { format as formatUrl } from 'url';

import { app, BrowserWindow, ipcMain, IpcMainEvent } from 'electron';
import { autoUpdater } from 'electron-updater';

import * as mm from 'music-metadata';
import * as NodeID3 from 'node-id3';

Expand All @@ -27,6 +29,7 @@ function createMainWindow() {
icon: './src/assets/app-icon.png',
webPreferences: {
nodeIntegration: true,
contextIsolation: false,
},
});

Expand All @@ -46,6 +49,21 @@ function createMainWindow() {
);
}

if (!isDevelopment) {
// window.webContents.send('c', 'starting');
// autoUpdater.on('checking-for-update', () =>
// window.webContents.send('c', 'checking')
// );
// autoUpdater.on('update-available', () =>
// window.webContents.send('c', 'available')
// );
// autoUpdater.on('update-not-available', () =>
// window.webContents.send('c', 'not available')
// );
autoUpdater.allowPrerelease = true;
autoUpdater.checkForUpdatesAndNotify();
}

// window.on('closed', () => {
// mainWindow = null;
// });
Expand Down Expand Up @@ -78,7 +96,6 @@ app.on('activate', () => {
// create main BrowserWindow when electron is ready
app.on('ready', () => {
mainWindow = createMainWindow();
autoUpdater.checkForUpdatesAndNotify();
});

//
Expand Down

0 comments on commit 9f8db2a

Please sign in to comment.