mirror of
https://github.com/stake-house/wagyu-key-gen.git
synced 2026-01-08 20:27:57 -05:00
Correctly set the app icon during window creation and AppImage target
This commit is contained in:
@@ -58,13 +58,15 @@
|
||||
],
|
||||
"extraFiles": [
|
||||
"build/bin/*",
|
||||
"build/word_lists/*"
|
||||
"build/word_lists/*",
|
||||
"static/icon.png"
|
||||
],
|
||||
"mac": {
|
||||
"category": "public.app-category.utilities"
|
||||
},
|
||||
"linux": {
|
||||
"target": "deb"
|
||||
"target": "AppImage",
|
||||
"icon": "static/icon.png"
|
||||
},
|
||||
"win": {
|
||||
"target": "portable",
|
||||
|
||||
@@ -1,11 +1,30 @@
|
||||
import { BrowserWindow, app, globalShortcut, ipcMain } from "electron";
|
||||
import { cwd } from 'process';
|
||||
import path from "path";
|
||||
|
||||
import { accessSync, constants } from "fs";
|
||||
|
||||
const doesFileExist = (filename: string): boolean => {
|
||||
try {
|
||||
accessSync(filename, constants.F_OK);
|
||||
return true;
|
||||
} catch (err) {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
app.on("ready", () => {
|
||||
// once electron has started up, create a window.
|
||||
var iconPath = path.join("static", "icon.png");
|
||||
const bundledIconPath = path.join(process.resourcesPath, "..", "static", "icon.png");
|
||||
if (doesFileExist(bundledIconPath)) {
|
||||
iconPath = bundledIconPath;
|
||||
}
|
||||
|
||||
const window = new BrowserWindow({
|
||||
width: 900,
|
||||
height: 720,
|
||||
icon: 'src/images/ethstaker_icon_1.png',
|
||||
icon: iconPath,
|
||||
|
||||
webPreferences: {
|
||||
nodeIntegration: true,
|
||||
|
||||
BIN
static/icon.png
Normal file
BIN
static/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 13 KiB |
Reference in New Issue
Block a user