Bug
In mergeIcons (bin/helpers/merge.ts), the custom system tray icon handling has two defects:
await fsExtra.pathExists(options.systemTrayIcon); // result discarded (dead)
const iconExt = path.extname(options.systemTrayIcon).toLowerCase();
if (iconExt === '.png' || iconExt === '.ico') {
const trayIcoPath = path.join(npmDirectory, `src-tauri/png/${safeAppName}${iconExt}`);
trayIconPath = `png/${safeAppName}${iconExt}`; // assigned BEFORE the copy
await fsExtra.copy(options.systemTrayIcon, trayIcoPath);
}
...
} catch (err) {
logger.warn(`✼ ...`);
logger.warn(`✼ Default system tray icon will remain unchanged.`); // but it already changed
}
- Dead check —
await fsExtra.pathExists(...) is awaited but its boolean result is never used.
- Premature assignment —
trayIconPath (which becomes system_tray_path in the config) is set before fsExtra.copy. If the source is missing or the copy throws, the catch warns that the default "will remain unchanged", but the config already points at png/<name>.<ext> — a file that was never written. The app then references a non-existent tray icon.
Fix
Use the existence check to keep the default (with a clear "not found" message), and assign trayIconPath only after a successful copy. PR attached.
Bug
In
mergeIcons(bin/helpers/merge.ts), the custom system tray icon handling has two defects:await fsExtra.pathExists(...)is awaited but its boolean result is never used.trayIconPath(which becomessystem_tray_pathin the config) is set beforefsExtra.copy. If the source is missing or the copy throws, thecatchwarns that the default "will remain unchanged", but the config already points atpng/<name>.<ext>— a file that was never written. The app then references a non-existent tray icon.Fix
Use the existence check to keep the default (with a clear "not found" message), and assign
trayIconPathonly after a successful copy. PR attached.