text: import { app, BrowserWindow, nativeTheme, ipcMain } from 'electron'
  // 注意这个autoUpdater不是electron中的autoUpdater
  import {autoUpdater} from "electron-updater"
  
  try {
    if (process.platform === 'win32' && nativeTheme.shouldUseDarkColors === true) {
      require('fs').unlinkSync(require('path').join(app.getPath('userData'), 'DevTools Extensions'))
    }
  } catch (_) { }
  
  /**
   * Set `__statics` path to static files in production;
   * The reason we are setting it here is that the path needs to be evaluated at runtime
   */
  // if (process.env.PROD) {
  //   global.__statics = __dirname
  // }
  
  if (process.env.NODE_ENV !== 'development') {
    global.__static = require('path').join(__dirname, '/static').replace(/\\/g, '\\\\');
  }
  
  
  
  let mainWindow
  
  function createWindow () {
    /**
     * Initial window options
     */
    mainWindow = new BrowserWindow({
      width: 1000,
      height: 600,
      useContentSize: true,
      webPreferences: {
        // Change from /quasar.conf.js > electron > nodeIntegration;
        // More info: https://quasar.dev/quasar-cli/developing-electron-apps/node-integration
        nodeIntegration: process.env.QUASAR_NODE_INTEGRATION,
        nodeIntegrationInWorker: process.env.QUASAR_NODE_INTEGRATION,
  
        // More info: /quasar-cli/developing-electron-apps/electron-preload-script
        // preload: path.resolve(__dirname, 'electron-preload.js')
      }
    })
  
    mainWindow.loadURL(process.env.APP_URL)
  
    mainWindow.on('closed', () => {
      mainWindow = null
    })
  }
  
  app.on('ready', () => {
    createWindow();
    //执行自动更新检查
    autoUpdater.checkForUpdatesAndNotify();
  });
  
  
  app.on('window-all-closed', () => {
    if (process.platform !== 'darwin') {
      app.quit()
    }
  })
  
  app.on('activate', () => {
    if (mainWindow === null) {
      createWindow()
    }
  })
  