function createWindow() {
  // Check if there is a newer version
  autoUpdater.checkForUpdatesAndNotify();

  // Verifies if Guppy is already in the Applications folder
  // and prompts the user to move it if it isn't
  manageApplicationLocation();

  // Create the browser window.
  mainWindow = new BrowserWindow({
    width: 1120,
    height: 768,
    minWidth: 777,
    titleBarStyle: 'hidden',
    icon: path.join(__dirname, icon256Path),
  });

  // set up some chrome extensions
  if (process.env.NODE_ENV === 'development') {
    const {
      default: installExtension,
      REACT_DEVELOPER_TOOLS,
      REACT_PERF,
    } = require('electron-devtools-installer');

    require('electron-debug')({ showDevTools: true });

    const ChromeLens = {
      // ID of the extension (https://chrome.google.com/webstore/detail/chromelens/idikgljglpfilbhaboonnpnnincjhjkd)
      id: 'idikgljglpfilbhaboonnpnnincjhjkd',
      electron: '>=1.2.1',
    };

    const extensions = [REACT_DEVELOPER_TOOLS, REACT_PERF, ChromeLens];

    for (const extension of extensions) {
      try {
        installExtension(extension);
      } catch (e) {
        console.error(chalk.red(`[ELECTRON] Extension installation failed`), e);
      }
    }
  }

  // and load the index.html of the app.
  const startUrl =
    process.env.ELECTRON_START_URL ||
    url.format({
      pathname: path.join(__dirname, '/../build/index.html'),
      protocol: 'file:',
      slashes: true,
    });
  mainWindow.loadURL(startUrl);

  mainWindow.on('close', e => {
    if (emitAppWillClose) {
      emitAppWillClose = false;
      mainWindow.webContents.send('app-will-close');
      e.preventDefault();
    }
  });

  // Emitted when the window is closed.
  mainWindow.on('closed', function() {
    // Dereference the window object, usually you would store windows
    // in an array if your app supports multi windows, this is the time
    // when you should delete the corresponding element.
    mainWindow = null;
  });

  attachIpcMainListeners(ipcMain);
}
This is our main Electron process.
It handles opening our app window, and quitting the application.