Skip to content

Commit

Permalink
Rebrand stuff to CPBack, start using electron-builder
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel11420 committed Jan 19, 2020
1 parent 0bd85f6 commit 32d7d33
Show file tree
Hide file tree
Showing 5 changed files with 1,924 additions and 191 deletions.
34 changes: 2 additions & 32 deletions main.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,5 @@
const {app, BrowserWindow, dialog} = require('electron');
const isDev = require('electron-is-dev');
if (isDev) { } else {
const {autoUpdater} = require('electron');
const server = "https://hazel-pi-flame.now.sh/";
const feed = `${server}/update/${process.platform}/${app.getVersion()}`;
autoUpdater.setFeedURL(feed);

autoUpdater.on('update-downloaded', (event, releaseNotes, releaseName) => {
const dialogOpts = {
type: 'info',
buttons: ['Restart', 'Later'],
title: 'Application Update',
message: process.platform === 'win32' ? releaseNotes : releaseName,
detail: 'A new version has been downloaded. Restart the application to apply the updates.'
}

dialog.showMessageBox(dialogOpts).then((returnValue) => {
if (returnValue.response === 0) autoUpdater.quitAndInstall();
});
});

autoUpdater.on('error', message => {
console.error('There was a problem updating the application');
console.error(message);
});
}

//const {app, BrowserWindow} = require('electron');
const path = require('path');
Expand Down Expand Up @@ -55,7 +30,7 @@ function createWindow () {
mainWindow = new BrowserWindow({
width: 1280,
height: 720,
title: "Club Penguin Back is loading...",
title: "CPBack is loading...",
icon: __dirname + '/favicon.ico',
webPreferences: {
preload: path.join(__dirname, 'preload.js'),
Expand Down Expand Up @@ -89,9 +64,4 @@ app.on('activate', function () {
});


setInterval(clearCache, 1000*60*5);
//if (isDev === false) {
// setInterval(() => {
// autoUpdater.checkForUpdates()
// }, 60000);
//}
setInterval(clearCache, 1000*60*5);
Loading

0 comments on commit 32d7d33

Please sign in to comment.