包裹后我得到了这个错误"错误:EACCES:权限被拒绝,打开"

时间:2017-10-30 19:59:14

标签: electron electronics electron-builder tray electron-packager

如何解决此问题。我想它关于托盘或其他东西。我尝试了很多东西。我也看了一眼:https://github.com/electron/electron/issues/7657但我找不到解决方案

enter image description here

我跟你说我的电子代码



'use strict'
// ELECTRON SIDE 
const electron = require('electron');
// Interprocess communication so that React can communicate with Electron.
const ipcMain = require("electron").ipcMain;
// Module to control application life.
const app = electron.app;
const dialog = electron.dialog;
// Module to control application tray and menu.
const Tray = electron.Tray;
const Menu = electron.Menu;
// Module to create native browser window.
const BrowserWindow = electron.BrowserWindow;
const {nativeImage} = require('electron');
const path = require('path');
const fs = require('fs');
let mainWindow;

let createWindow = () => {
  // Create the browser window.
  mainWindow = new BrowserWindow({
    minWidth: 300,
    minHeight: 700,
    width: 400,
    height: 750,
    transparent: true,
    frame: false
  })


  mainWindow.loadURL(path.join('file://', __dirname, '/index.html'))

  mainWindow.on('closed', () => {

    mainWindow = null
  })

  // System tray.
  var tray = new Tray('./app/assets/assignment.png');

  var contextMenu = Menu.buildFromTemplate([
    { label: 'open', click: () => {mainWindow.restore(); mainWindow.show();} },
    { label: 'minimize', click: () => {mainWindow.minimize();} },
    { label: 'close', click: 
      function handleClicked () {
        app.quit();
      }
    }
  ]);

  tray.on('click', function handleClicked () {
    mainWindow.restore();
    mainWindow.show();
  });
  tray.setToolTip('Material Account App');
  tray.setContextMenu(contextMenu);
}
...




0 个答案:

没有答案