Cleared the cacge
This commit is contained in:
@@ -44,14 +44,22 @@
|
|||||||
"appId": "com.lambdabanking.rmtpocketwatcher",
|
"appId": "com.lambdabanking.rmtpocketwatcher",
|
||||||
"productName": "rmtPocketWatcher",
|
"productName": "rmtPocketWatcher",
|
||||||
"directories": {
|
"directories": {
|
||||||
"output": "release"
|
"output": "release",
|
||||||
|
"buildResources": "resources"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"dist/**/*",
|
"dist/**/*",
|
||||||
"package.json"
|
"package.json"
|
||||||
],
|
],
|
||||||
|
"extraResources": [
|
||||||
|
{
|
||||||
|
"from": "resources/icons",
|
||||||
|
"to": "icons"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
|
||||||
"win": {
|
"win": {
|
||||||
|
"icon": "resources/icons/icon.ico",
|
||||||
"target": [
|
"target": [
|
||||||
"portable"
|
"portable"
|
||||||
]
|
]
|
||||||
|
|||||||
BIN
electron-app/resources/icons/icon.ico
Normal file
BIN
electron-app/resources/icons/icon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 116 KiB |
BIN
electron-app/resources/icons/logo.png
Normal file
BIN
electron-app/resources/icons/logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.5 KiB |
@@ -18,13 +18,22 @@ console.log('API_URL:', process.env.API_URL);
|
|||||||
|
|
||||||
let mainWindow: BrowserWindow | null = null;
|
let mainWindow: BrowserWindow | null = null;
|
||||||
let tray: Tray | null = null;
|
let tray: Tray | null = null;
|
||||||
|
const isDev = process.env.NODE_ENV === 'development';
|
||||||
|
|
||||||
|
function getIconPath(): string {
|
||||||
|
if (isDev) {
|
||||||
|
return process.platform === 'win32'
|
||||||
|
? path.join(__dirname, '../../resources/icons/icon.ico')
|
||||||
|
: path.join(__dirname, '../../resources/icons/logo.png');
|
||||||
|
}
|
||||||
|
|
||||||
|
return process.platform === 'win32'
|
||||||
|
? path.join(process.resourcesPath, 'icons', 'icon.ico')
|
||||||
|
: path.join(process.resourcesPath, 'icons', 'logo.png');
|
||||||
|
}
|
||||||
|
|
||||||
function createWindow(): void {
|
function createWindow(): void {
|
||||||
// In dev: __dirname = dist/main, logo is at root
|
const iconPath = getIconPath();
|
||||||
// In prod: __dirname = resources/app.asar/dist/main
|
|
||||||
const iconPath = process.env.NODE_ENV === 'development'
|
|
||||||
? path.join(__dirname, '../../logo.png')
|
|
||||||
: path.join(__dirname, '../assets/logo.png');
|
|
||||||
|
|
||||||
console.log('Window icon path:', iconPath);
|
console.log('Window icon path:', iconPath);
|
||||||
|
|
||||||
@@ -65,13 +74,14 @@ function createWindow(): void {
|
|||||||
function createTray(): void {
|
function createTray(): void {
|
||||||
// In dev: __dirname = dist/main, logo is at root
|
// In dev: __dirname = dist/main, logo is at root
|
||||||
// In prod: __dirname = resources/app.asar/dist/main
|
// In prod: __dirname = resources/app.asar/dist/main
|
||||||
const iconPath = process.env.NODE_ENV === 'development'
|
const iconPath = getIconPath();
|
||||||
? path.join(__dirname, '../../logo.png')
|
|
||||||
: path.join(__dirname, '../assets/logo.png');
|
|
||||||
|
|
||||||
console.log('Tray icon path:', iconPath);
|
console.log('Tray icon path:', iconPath);
|
||||||
|
|
||||||
const icon = nativeImage.createFromPath(iconPath).resize({ width: 16, height: 16 });
|
let icon = nativeImage.createFromPath(iconPath);
|
||||||
|
if (process.platform !== 'win32') {
|
||||||
|
icon = icon.resize({ width: 16, height: 16 });
|
||||||
|
}
|
||||||
|
|
||||||
tray = new Tray(icon);
|
tray = new Tray(icon);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user