Commit 43ba28c0 authored by Alex Brazier's avatar Alex Brazier

Improvements to auto updater

parent 6c19f856
......@@ -27,5 +27,7 @@
!macroend
!macro customUnInstall
Delete "$SMSTARTUP\Rocket.Chat+.lnk"
${IfNot} ${Silent}
Delete "$SMSTARTUP\Rocket.Chat+.lnk"
${endif}
!macroend
......@@ -159,22 +159,23 @@ export function afterMainWindow (mainWindow) {
width: 600,
height: 350,
show : false,
skipTaskbar: true,
center: true,
resizable: false,
maximizable: false,
minimizable: false
});
window.loadURL('file://'+__dirname+'/public/update.html');
window.setMenuBarVisibility(false);
window.webContents.on('did-finish-load', () => {
window.webContents.send('newVersion', version);
window.webContents.send('new-version', version);
window.show();
});
ipcMain.once('update', () => {
dialog.showMessageBox({
title: 'Downloading update',
title: 'Downloading Update',
message: 'You will be notified when the update is ready to be installed'
}, () => window.close());
autoUpdater.downloadUpdate();
......@@ -193,18 +194,18 @@ export function afterMainWindow (mainWindow) {
autoUpdater.on('update-downloaded', () => {
dialog.showMessageBox({
title: 'Update ready to install',
title: 'Update Ready to Install',
message: 'Update has been downloaded',
buttons: [
'Install Later',
'Quit and Install'
'Install Now'
],
defaultId: 1
}, (response) => {
if (response === 0) {
dialog.showMessageBox({
title: 'Install later',
message: 'Update will be installed when you quit'
title: 'Installing Later',
message: 'Update will be installed when you exit the app'
});
} else {
autoUpdater.quitAndInstall();
......
......@@ -19,16 +19,6 @@
margin-bottom: 10px;
}
.app-name {
font-size: 14px;
font-weight: bold;
}
.app-version {
margin-top: 20px;
font-size: 11px;
}
.update {
font-size: 15px;
font-weight: bold;
......@@ -73,17 +63,17 @@
<div style="text-align:center;">
<img src="images/icon.png"/>
<p>A new version of the Rocket.Chat Desktop App is available!</p>
<p>From: <span class="old"></span> To: <span class="new"></span></p>
<p>Current Version: <span class="old"></span> New Version: <span class="new"></span></p>
</div>
<hr />
<p class="controls">
<a class="skip" href="/">Skip This Version</a>
<a class="remind" href="/">Remind me later</a>
<a class="remind" href="/">Remind Me Later</a>
<button class="update">Install Update</button>
</p>
<script>
var remote = require('electron').remote;
require('electron').ipcRenderer.on('newVersion', function(e, version) {
require('electron').ipcRenderer.on('new-version', function(e, version) {
document.querySelector('.old').innerHTML = remote.app.getVersion();
document.querySelector('.new').innerHTML = version;
});
......
......@@ -12,11 +12,13 @@ const appTemplate = [
height: 200,
resizable: false,
show: false,
center: true,
maximizable: false,
minimizable: false,
title: 'About Rocket.Chat'
});
win.loadURL('file://' + __dirname + '/about.html');
win.setMenuBarVisibility(false);
win.show();
}
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment