|
| 1 | +declare const __BUILD_COMMIT__: string | undefined; |
| 2 | +declare const __BUILD_DATE__: string | undefined; |
| 3 | + |
1 | 4 | import dns from "node:dns"; |
2 | 5 | import { mkdirSync } from "node:fs"; |
| 6 | +import os from "node:os"; |
3 | 7 | import path from "node:path"; |
4 | 8 | import { fileURLToPath } from "node:url"; |
5 | 9 | import { |
6 | 10 | app, |
7 | 11 | BrowserWindow, |
| 12 | + clipboard, |
| 13 | + dialog, |
8 | 14 | ipcMain, |
9 | 15 | Menu, |
10 | 16 | type MenuItemConstructorOptions, |
@@ -116,7 +122,38 @@ function createWindow(): void { |
116 | 122 | { |
117 | 123 | label: "Array", |
118 | 124 | submenu: [ |
119 | | - { role: "about" }, |
| 125 | + { |
| 126 | + label: "About Array", |
| 127 | + click: () => { |
| 128 | + const commit = __BUILD_COMMIT__ ?? "dev"; |
| 129 | + const buildDate = __BUILD_DATE__ ?? "dev"; |
| 130 | + const info = [ |
| 131 | + `Version: ${app.getVersion()}`, |
| 132 | + `Commit: ${commit}`, |
| 133 | + `Date: ${buildDate}`, |
| 134 | + `Electron: ${process.versions.electron}`, |
| 135 | + `Chromium: ${process.versions.chrome}`, |
| 136 | + `Node.js: ${process.versions.node}`, |
| 137 | + `V8: ${process.versions.v8}`, |
| 138 | + `OS: ${process.platform} ${process.arch} ${os.release()}`, |
| 139 | + ].join("\n"); |
| 140 | + |
| 141 | + dialog |
| 142 | + .showMessageBox({ |
| 143 | + type: "info", |
| 144 | + title: "About Array", |
| 145 | + message: "Array", |
| 146 | + detail: info, |
| 147 | + buttons: ["Copy", "OK"], |
| 148 | + defaultId: 1, |
| 149 | + }) |
| 150 | + .then((result) => { |
| 151 | + if (result.response === 0) { |
| 152 | + clipboard.writeText(info); |
| 153 | + } |
| 154 | + }); |
| 155 | + }, |
| 156 | + }, |
120 | 157 | { type: "separator" }, |
121 | 158 | { |
122 | 159 | label: "Check for Updates...", |
|
0 commit comments