How to use the electron-updater.autoUpdater.allowPrerelease 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 z------------- / CPod / main.js View on Github external
app.on("window-all-closed", () => {
  if (process.platform !== "darwin") {
    app.quit()
  }
})

app.on("activate", () => {
  if (win === null) {
    createWindow()
  }
})

/* auto-update */

if (settings.autoUpdaterAllowPrerelease) {
  autoUpdater.allowPrerelease = true
}

// autoUpdater.fullChangelog = true
autoUpdater.autoDownload = false

var currentVersion

autoUpdater.checkForUpdates()
.then((updateCheckResult) => {
  let info = updateCheckResult.updateInfo
  console.log(info, info.releaseNotes)

  var isNewer = false;
  currentVersion = package.version
  let cvs = currentVersion.split(".").map(s => Number(s))
  let uvs = info.version.split(".").map(s => Number(s))
github crowbartools / Firebot / lib / autoUpdateManager.js View on Github external
'use strict';

const {ipcMain} = require('electron');
const {settings} = require('./common/settings-access');
const {autoUpdater} = require('electron-updater');
const backupManager = require("./backupManager");
const logger = require('./logwrapper');

autoUpdater.autoDownload = false;
autoUpdater.allowPrerelease = settings.getAutoUpdateLevel() === 4;

let initialized = false;

function startDownload() {
    autoUpdater.checkForUpdates();
    autoUpdater.downloadUpdate();
}

function init() {

    if (initialized) return;
    initialized = true;
    logger.info("Auto Updater running...");

    // Run Updater
    ipcMain.on('downloadUpdate', () => {
github yjlintw / comic-reader / main.js View on Github external
const path = require('path');
const url = require('url');
const settings = require('electron-settings');
const log = require('electron-log');
const {autoUpdater} = require("electron-updater");
const EA = require("electron-analytics");
const ipc = electron.ipcMain;
EA.init("Bkles-YA1-");

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

// Logging
autoUpdater.logger = log;
autoUpdater.logger.transports.file.level = "info";
// autoUpdater.autoDownload = false;
autoUpdater.allowPrerelease = false;
log.info('App Starting');

let manualupdate = false;

// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is garbage collected.
require('electron-context-menu')();

let win;

function sendStatusToWindow(text) {
  log.info('', text);
  // win.webContents.send('message', text);
}

function createWindow () {
github beakerbrowser / beaker / app / bg / browser.js View on Github external
export function checkForUpdates (opts = {}) {
  // dont overlap
  if (updaterState != UPDATER_STATUS_IDLE) { return }

  // update global state
  logger.info('[AUTO-UPDATE] Checking for a new version.')
  updaterError = false
  setUpdaterState(UPDATER_STATUS_CHECKING)
  if (opts.prerelease) {
    logger.info('[AUTO-UPDATE] Jumping to pre-releases.')
    autoUpdater.allowPrerelease = true
  }
  autoUpdater.checkForUpdates()

  // just return a resolve; results will be emitted
  return Promise.resolve()
}
github IndomaximTechID / storaji-ui / src / electron / setupFrame.js View on Github external
function Frame() {
  // Logging
  autoUpdater.logger = log;
  autoUpdater.logger.transports.file.level = 'info';
  autoUpdater.autoDownload = false;
  autoUpdater.allowDowngrade = true;
  autoUpdater.allowPrerelease = true;
  log.info('App starting...');

  win = null;
  showNoUpdate = false;
  tray = null;
  quitting = false;
}
github gielcobben / caption / main / updater.js View on Github external
cancellationToken,
    onStartup: false,
  };
};

// IPC Events
ipcMain.on("cancelUpdate", event => {
  cancelUpdater();
});

ipcMain.on("installUpdate", event => {
  autoUpdater.quitAndInstall();
});

// UPDATER
autoUpdater.allowPrerelease = isDev;
autoUpdater.autoDownload = false;

autoUpdater.on("checking-for-update", () => {
  const { onStartup } = global.updater;
  if (!onStartup) {
    showCheckWindow();
  }
});

autoUpdater.on("update-available", info => {
  const { cancellationToken } = global.updater;
  closeCheckWindow();
  showProgressWindow();
  autoUpdater.downloadUpdate(cancellationToken);
});
github Automattic / wp-desktop / desktop / app-handlers / updater / auto-updater / index.js View on Github external
constructor( options = {} ) {
		super( options );

		autoUpdater.on( 'error', this.onError.bind( this ) );
		autoUpdater.on( 'update-available', this.onAvailable.bind( this ) );
		autoUpdater.on( 'update-not-available', this.onNotAvailable.bind( this ) );
		autoUpdater.on( 'update-downloaded', this.onDownloaded.bind( this ) );

		autoUpdater.autoInstallOnAppQuit = false;

		if ( this.beta ) {
			autoUpdater.allowPrerelease = true;
		}
	}
github szymonkaliski / Neutron / src / auto-updater.js View on Github external
const { autoUpdater } = require('electron-updater');
const { dialog } = require('electron');

autoUpdater.allowPrerelease = true;
autoUpdater.autoDownload = true;

module.exports = () => {
  autoUpdater.on('update-downloaded', () => {
    dialog.showMessageBox(
      {
        type: 'question',
        buttons: ['Install and Relaunch', 'Later'],
        defaultId: 0,
        message: 'A new version of Neutron has been downloaded',
        detail: 'It will be installed the next time you restart the application'
      },
      response => {
        if (response === 0) {
          autoUpdater.quitAndInstall();
        }
github padloc / padloc / main.js View on Github external
function checkForUpdates(manual) {
    autoUpdater.autoDownload = settings.get("autoDownloadUpdates");
    autoUpdater.allowPrerelease = settings.get("allowPrerelease");

    const check = autoUpdater.checkForUpdates();
    check &&
        check.then(result => {
            if (autoUpdater.updateAvailable) {
                updateAvailable(result.versionInfo);
            } else if (manual) {
                dialog.showMessageBox(
                    {
                        type: "info",
                        message: "No Updates Available",
                        detail: "Your version of Padlock is up to date.",
                        checkboxLabel: "Automatically download and install updates in the future (recommended)",
                        checkboxChecked: settings.get("autoDownloadUpdates")
                    },
                    (buttonIndex, checkboxChecked) => {
github padloc / padloc / main.js View on Github external
"use strict";

const { app, shell, BrowserWindow, Menu, dialog, ipcMain } = require("electron");
const { autoUpdater } = require("electron-updater");
const path = require("path");
const url = require("url");
const os = require("os");
const uuid = require("uuid/v4");
const { debug, test } = require("yargs").argv;
const ElectronStore = require("electron-store");

const settings = global.settings = new ElectronStore({
    name: "settings",
    defaults: {
        autoDownloadUpdates: false,
        allowPrerelease: autoUpdater.allowPrerelease,
        windowBounds: {
            width: 900,
            height: 600
        },
        fullscreen: false
    }
});

if (!settings.get("uuid")) {
    settings.set("uuid", uuid());
}

let win;
let updateOnQuit = false;

if (debug || test) {