How to use the electron-updater.autoUpdater.checkForUpdates function in electron-updater

To help you get started, we’ve selected a few electron-updater examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github olymp / olymp / packages / electron / main.es6 View on Github external
function createWindow() {
  log.info('Starting');
  if (template.length) {
    const menu = Menu.buildFromTemplate(template);
    Menu.setApplicationMenu(menu);
  }

  if (process.env.NODE_ENV === 'production') {
    log.info('Starting updater..');

    autoUpdater
      .checkForUpdates()
      .then(() => {
        log.info('Promise fulfilled');
      })
      .catch(reason => {
        log.info(`Handle rejected promise (${reason.stack || reason}) here.`);
      });
  }
  log.info('Creating browser window');
  // Create the browser window.
  // mainWindow = new BrowserWindow({ width: 800, height: 600, frame: true, titleBarStyle: 'hidden' });
  mainWindow = new BrowserWindow({
    width: 1000,
    height: 750,
    minWidth: 600,
    minHeight: 450,
github BuildingXwithJS / building-electron-apps-with-js / index.js View on Github external
})
  );

  // Open the DevTools.
  mainWindow.webContents.openDevTools();

  // 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;
  });

  // trigger autoupdate check
  autoUpdater.checkForUpdates();
}
github Mokkapps / scrum-daily-standup-picker / main.ts View on Github external
pathname: path.join(__dirname, 'dist/index.html'),
        protocol: 'file:',
        slashes: true
      })
    );
  }

  // Open the DevTools.
  if (serve) {
    win.webContents.openDevTools();
  }

  // Standup picker only works with .deb on Linux but auto-updater
  // does not work for .deb and only for AppImage and Snap
  if (!isDev && !isLinux) {
    autoUpdater.checkForUpdates();
  }

  // Emitted when the window is closed.
  win.on('closed', () => {
    // Dereference the window object, usually you would store window
    // in an array if your app supports multi windows, this is the time
    // when you should delete the corresponding element.
    win = null;
  });
}
github hql287 / Manta / main / updater.js View on Github external
function checkForUpdate() {
  // Only check for update in Production
  if (!isDev) {
    autoUpdater.checkForUpdates();
  }
}
github gauthamzz / Passerine / index.js View on Github external
// -const tray = require('./tray');

require('electron-debug')({enabled: true});
require('electron-dl')();
require('electron-context-menu')();

const domain = 'producthunt.com';
const {app, ipcMain} = electron;

app.setAppUserModelId('com.gauthamzz.legacy');
app.disableHardwareAcceleration();

if (!isDev) {
	autoUpdater.logger = log;
	autoUpdater.logger.transports.file.level = 'info';
	autoUpdater.checkForUpdates();
}

let mainWindow;
let isQuitting = false;
let prevMessageCount = 0;
let dockMenu;

const isAlreadyRunning = app.makeSingleInstance(() => {
	if (mainWindow) {
		if (mainWindow.isMinimized()) {
			mainWindow.restore();
		}

		mainWindow.show();
	}
});
github cern-phone-apps / desktop-phone-app / public / updater.js View on Github external
storage.get('update_channel', (error, data) => {
    const channel = data.channel || 'latest';
    if (channel === 'latest') {
      autoUpdater.allowPrerelease = false;
    } else {
      autoUpdater.allowPrerelease = true;
    }
    console.log(`Setting allowPrerelease to ${autoUpdater.allowPrerelease}`);

    if (error) {
      console.log(`Error found checking updates: ${error}`);
    }
    console.log(`Auto Updater is set to ${autoUpdater.channel}`);
    console.log(`Current version of the app is ${autoUpdater.currentVersion}`);
    autoUpdater.checkForUpdates();
  });
}
github LN-Zap / zap-desktop / electron / updater.js View on Github external
        task: () => autoUpdater.checkForUpdates(),
        baseDelay: this.settings.interval,
github jie17 / v2ray-electron / src / main / index.ts View on Github external
      (): Promise => autoUpdater.checkForUpdates(),
      3600000
github yjlintw / comic-reader / main.js View on Github external
ipc.on('check-for-update', function(event) {
  autoUpdater.checkForUpdates();
  manualupdate = true;
});