diff --git a/main/utils/privilige.ts b/main/utils/privilige.ts index 896456ec..51817465 100644 --- a/main/utils/privilige.ts +++ b/main/utils/privilige.ts @@ -1,12 +1,14 @@ +import * as path from 'path' import { app } from 'electron' import * as sudo from 'sudo-prompt' -import { resources } from '../utils/directory' const sudoExeca = (command: string) => { return new Promise((resolve, reject) => { sudo.exec(command, { name: app.name, - icns: resources.file('images/icon.icns'), + icns: process.platform === 'darwin' + ? path.join(app.getPath('exe'), '../../Resources/electron.icns') + : undefined, }, (err, stdout, stderr) => { if (err) reject(Object.assign(err, { stdout, stderr })) else resolve({ stdout, stderr })