Skip to content

Commit 00f0ee0

Browse files
committed
about content coming from package.json
1 parent 1449fcc commit 00f0ee0

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

main.js

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -220,14 +220,18 @@ const template = [
220220
},
221221
{
222222
label: 'About',
223-
click: () => {
224-
dialog.showMessageBox(mainWindow, {
225-
type: 'info',
226-
title: 'Rapid Power Estimator',
227-
message: 'Rapid Power Estimator\nVersion: 0.0.1\nAuthor: © 2024 Rapid Silicon Inc. \nType: Engineering',
228-
buttons: ['OK'],
229-
});
230-
},
223+
click: () => {
224+
const packagePath = path.join(__dirname, 'package.json');
225+
const packageData = JSON.parse(fs.readFileSync(packagePath, 'utf8'));
226+
227+
const message = `${packageData.name}\nVersion: ${packageData.version}\nAuthor: © ${packageData.author}\nType: Engineering`;
228+
229+
dialog.showMessageBox(mainWindow, {
230+
type: 'info',
231+
title: packageData.name,
232+
message: message
233+
});
234+
}
231235
},
232236
],
233237
},

0 commit comments

Comments
 (0)