Skip to content

Commit 43548d5

Browse files
committed
modified: main.js
modified: package-lock.json modified: package.json
1 parent 9caf6d3 commit 43548d5

File tree

3 files changed

+38
-14
lines changed

3 files changed

+38
-14
lines changed

main.js

+23-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
1-
const { app, BrowserWindow, Menu } = require('electron');
1+
const { app, BrowserWindow, Menu, dialog } = require('electron');
22
const path = require('path');
33
const template = require('./menubar');
44
const dns = require('dns');
55
const { autoUpdater } = require('electron-updater');
6+
const log = require('electron-log');
67

78
let mainWindow;
89

910
const menu = Menu.buildFromTemplate(template)
1011
Menu.setApplicationMenu(menu)
1112

13+
autoUpdater.logger = log;
14+
autoUpdater.logger.transports.file.level = 'info';
15+
1216
function createWindow() {
1317
mainWindow = new BrowserWindow({
1418
width: 1280,
@@ -17,7 +21,7 @@ function createWindow() {
1721
frame: true,
1822
autoHideMenuBar: true, // Automatically hide the menu bar
1923
webPreferences: {
20-
nodeIntegration: false,
24+
nodeIntegration: true,
2125
}
2226
});
2327

@@ -45,25 +49,40 @@ app.whenReady().then(() => {
4549
createWindow();
4650
}
4751
});
48-
49-
// Check for updates
52+
5053
autoUpdater.checkForUpdatesAndNotify();
5154
});
5255

5356
autoUpdater.on('update-available', () => {
5457
console.log('Update available!');
58+
dialog.showMessageBox({
59+
type: 'info',
60+
title: 'Update Available',
61+
message: 'An update is available and is being downloaded.',
62+
});
5563
});
5664

5765
autoUpdater.on('update-not-available', () => {
5866
console.log('No updates available.');
67+
dialog.showMessageBox({
68+
type: 'info',
69+
title: 'No Updates',
70+
message: 'Your application is up-to-date.',
71+
});
5972
});
6073

6174
autoUpdater.on('error', (err) => {
6275
console.error('Error checking for updates:', err);
76+
dialog.showErrorBox('Update Error', 'An error occurred while checking for updates. Please check the logs for more details.');
6377
});
6478

6579
autoUpdater.on('update-downloaded', () => {
6680
console.log('Update downloaded. It will be installed on restart.');
81+
dialog.showMessageBox({
82+
type: 'info',
83+
title: 'Update Ready',
84+
message: 'Update downloaded. It will be installed on restart.',
85+
});
6786
});
6887

6988
app.on('window-all-closed', () => {

package-lock.json

+12-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+3-8
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,12 @@
11
{
22
"name": "chess.com",
3-
"version": "1.1.1",
3+
"version": "1.1.2",
44
"main": "main.js",
55
"build": {
66
"appId": "com.biboucorp.chesscomapp",
77
"productName": "ChessCom App",
8-
"copyright": "© 2025 BibouCorp",
98
"win": {
10-
"target": "nsis",
11-
"icon": "assets/icon.ico"
12-
},
13-
"nsis": {
14-
"oneClick": false,
15-
"allowToChangeInstallationDirectory": true
9+
"icon": "Images/icon.ico"
1610
},
1711
"publish": {
1812
"provider": "github",
@@ -30,6 +24,7 @@
3024
"license": "ISC",
3125
"description": "This is my Chess.com app, since chess.com doesn't have a desktop app, I made my own.",
3226
"dependencies": {
27+
"electron-log": "^5.3.3",
3328
"electron-squirrel-startup": "^1.0.1",
3429
"electron-updater": "^6.6.2"
3530
},

0 commit comments

Comments
 (0)