Merge pull request #589 from silentrald/bugfix/broken-app-icon

[bugfix] show bsm icon properly
This commit is contained in:
MathieuG-P
2024-09-28 12:22:53 +02:00
committed by GitHub
2 changed files with 13 additions and 2 deletions
+10 -1
View File
@@ -8,7 +8,12 @@ import log from "electron-log";
export class UtilsService {
private static instance: UtilsService;
private assetsPath: string = app.isPackaged ? path.join(process.resourcesPath, "assets") : path.join(__dirname, "../../assets");
private assetsPath: string = app.isPackaged
? path.join(process.resourcesPath, "assets")
: path.join(path.dirname(path.dirname(__dirname)), "assets");
private readonly buildPath: string = app.isPackaged
? path.join(process.resourcesPath, "build")
: path.join(path.dirname(path.dirname(__dirname)), "build");
private constructor() {}
@@ -36,6 +41,10 @@ export class UtilsService {
return path.join(app.getPath("temp"), app.getName());
}
public getBuildPath(filepath: string): string {
return path.join(this.buildPath, filepath);
}
public ipcSend<T = unknown>(channel: string, response: IpcResponse<T>): void {
try {
BrowserWindow.getAllWindows().forEach(window => window?.webContents?.send(channel, response));
+3 -1
View File
@@ -25,7 +25,9 @@ export class WindowManagerService {
private readonly baseWindowOption: BrowserWindowConstructorOptions = {
title: APP_NAME,
icon: this.utilsService.getAssetsPath("favicon.ico"),
icon: process.platform === "linux"
? this.utilsService.getBuildPath(path.join("icons", "png", "256x256.png"))
: this.utilsService.getBuildPath(path.join("icons", "win", "favicon.ico")),
show: false,
frame: false,
titleBarOverlay: false,