Skip to content

Commit

Permalink
Merge pull request #9 from brendancboyle/dev
Browse files Browse the repository at this point in the history
1.0.3
  • Loading branch information
bcbee authored Feb 12, 2018
2 parents 5dd7f0d + 59b1c7b commit d856ef0
Show file tree
Hide file tree
Showing 13 changed files with 54 additions and 49 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ flow-typed/npm/*
!flow-typed/npm/module_vx.x.x.js

# App packaged
release/win-unpacked
release
app/main.prod.js
app/main.prod.js.map
app/renderer.prod.js
Expand Down
28 changes: 22 additions & 6 deletions app/main.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
* @flow
*/
import { app, BrowserWindow } from 'electron';
import { app, BrowserWindow, dialog } from 'electron';
import IsDev from 'electron-is-dev';
import { autoUpdater } from 'electron-updater';
import ElectronLog from 'electron-log';
Expand Down Expand Up @@ -87,14 +87,30 @@ app.on('ready', async () => {
const menuBuilder = new MenuBuilder(mainWindow);
menuBuilder.buildMenu();

ElectronLog.transports.file.level = 'debug';
if (IsDev) {
ElectronLog.transports.file.level = 'debug';
} else {
ElectronLog.transports.file.level = 'error';
}

ElectronLog.info('App Started!');

autoUpdater.logger = ElectronLog;
autoUpdater.on('error', (error) => {
dialog.showErrorBox('Error: ', error == null ? 'unknown' : (error.stack || error).toString());
});

autoUpdater.on('update-downloaded', () => {
dialog.showMessageBox({
title: 'Install Updates',
message: 'A newer version of UPR is available. UPR will restart and come back better than ever!'
}, () => {
setImmediate(() => autoUpdater.quitAndInstall());
});
});

if (!IsDev) {
autoUpdater.logger = ElectronLog;
autoUpdater.checkForUpdatesAndNotify();
setInterval(() => {
autoUpdater.checkForUpdatesAndNotify();
}, 60000);
ElectronLog.info('Checking for updates...');
}
});
23 changes: 21 additions & 2 deletions app/menu.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// @flow
import { app, Menu, shell, BrowserWindow } from 'electron';
import { app, Menu, shell, BrowserWindow, dialog } from 'electron';
import { autoUpdater } from 'electron-updater';
import ElectronLog from 'electron-log';

export default class MenuBuilder {
mainWindow: BrowserWindow;
Expand Down Expand Up @@ -97,7 +99,8 @@ export default class MenuBuilder {
label: 'Help',
submenu: [
{ label: 'Learn More', click() { shell.openExternal('https://universalpresenterremote.com'); } },
{ label: 'Support', click() { shell.openExternal('mailto:[email protected]'); } }
{ label: 'Support', click() { shell.openExternal('mailto:[email protected]'); } },
{ label: 'Check For Updates', click: () => { MenuBuilder.checkForUpdates(); } }
]
};

Expand Down Expand Up @@ -163,9 +166,25 @@ export default class MenuBuilder {
click() {
shell.openExternal('mailto:[email protected]');
}
}, {
label: 'Check For Updates',
click: () => {
MenuBuilder.checkForUpdates();
}
}]
}];

return templateDefault;
}

static checkForUpdates() {
ElectronLog.info('Checking for updates...');
autoUpdater.on('update-not-available', () => {
dialog.showMessageBox({
title: 'No Updates',
message: 'Current version is up-to-date.'
});
});
autoUpdater.checkForUpdates();
}
}
2 changes: 1 addition & 1 deletion app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "upr-desktop",
"productName": "upr-desktop",
"productName": "Universal Presenter Remote",
"version": "1.0.2",
"description": "Control your presentations from any platform.",
"main": "./main.prod.js",
Expand Down
10 changes: 9 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@
"main.prod.js.map",
"package.json"
],
"mac": {
"type": "distribution",
"artifactName": "upr-desktop-${version}-mac.${ext}"
},
"dmg": {
"contents": [
{
Expand All @@ -54,7 +58,11 @@
"type": "link",
"path": "/Applications"
}
]
],
"artifactName": "upr-desktop-${version}-mac.${ext}"
},
"nsis": {
"artifactName": "upr-desktop-${version}-setup.${ext}"
},
"win": {
"target": [
Expand Down
Binary file removed release/Universal Presenter Remote Setup 1.0.0.exe
Binary file not shown.
Binary file not shown.
Binary file removed release/Universal Presenter Remote Setup 1.0.1.exe
Binary file not shown.
Binary file not shown.
Binary file removed release/Universal Presenter Remote Setup 1.0.2.exe
Binary file not shown.
Binary file not shown.
29 changes: 0 additions & 29 deletions release/electron-builder.yaml

This file was deleted.

9 changes: 0 additions & 9 deletions release/latest.yml

This file was deleted.

0 comments on commit d856ef0

Please sign in to comment.