const { nativeImage } = require('electron') const icon = path.join(__dirname, '路径') // __dirname为主进程执行的同级目录 let tray = new Tray(nativeImage.createFromPath(icon))