How to use the electron-updater.autoUpdater.allowDowngrade 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 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 SelfKeyFoundation / Identity-Wallet / src / main / auto-update / auto-update-service.js View on Github external
constructor({ app }) {
		super();
		this.app = app;
		autoUpdater.logger = log;
		autoUpdater.channel = 'beta';
		autoUpdater.allowDowngrade = false;
		autoUpdater.autoDownload = false;

		autoUpdater.on('update-available', info => this.emit('update-available', info));
		autoUpdater.on('download-progress', progress => this.emit('download-progress', progress));
		autoUpdater.on('update-downloaded', info => this.emit('update-downloaded', info));
	}
github LN-Zap / zap-desktop / app / lib / zap / updater.js View on Github external
import { dialog } from 'electron'
import { autoUpdater } from 'electron-updater'
import isDev from 'electron-is-dev'
import { updaterLog } from '../utils/log'

autoUpdater.logger = updaterLog

/**
 * Update Channel
 * supported channels are 'alpha', 'beta' and 'latest'
 * Refer electron-builder docs
 */
autoUpdater.channel = process.env.AUTOUPDATE_CHANNEL || 'beta'
autoUpdater.allowDowngrade = false

/**
 * @class ZapController
 *
 * The ZapUpdater class manages the electron auto update process.
 */
class ZapUpdater {
  /**
   * Create a new ZapUpdater instance.
   * @param  {BrowserWindow} mainWindow BrowserWindow instance to interact with
   */
  constructor(mainWindow) {
    this.mainWindow = mainWindow
  }

  init() {
github luminati-io / luminati-proxy / index.js View on Github external
let upgrade = ver=>etask(function*(){
    if (!can_upgrade)
    {
        let res = yield show_message({type: 'info', title: 'Luminati update',
            message: (ver ? `Luminati version ${ver}` : 'Luminati update')
            +' will be installed on exit',
            buttons: ['Install on exit', 'Install now']});
        if (!res)
            return void console.log('Update postponed until exit');
    }
    console.log('Starting upgrade');
    auto_updater.quitAndInstall();
});

auto_updater.allowDowngrade = true;
auto_updater.autoDownload = false;
auto_updater.on('error', ()=>{});

auto_updater.on('update-available', e=>etask(function*(){
    const changelog_url = 'https://github.com/luminati-io/luminati-proxy/blob/'
    +'master/CHANGELOG.md';
    console.log(`Update version ${e.version} is available. Full list of
        changes is available here: ${changelog_url}`);
    if (!can_upgrade)
    {
        let res = yield show_message({type: 'info',
            title: `Luminati update ${e.version} is available`,
            message: 'Luminati version '+e.version
            +' is available, would you like to download it?',
            buttons: ['No', 'Yes']});
        if (!res)
github FantasticFiasco / searchlight / src / main / application-updates / updaters / default-updater.ts View on Github external
private onUpdateNotAvailable(version: UpdateInfo) {
        log.info('DefaultUpdater', `update not available (latest version: ${version.version}, downgrade is ${autoUpdater.allowDowngrade ? 'allowed' : 'disallowed'})`);

        this.state = State.Idle;
        this.send(ApplicationUpdatesChannelName.CheckResponse, new NoUpdatesAvailableEvent());
    }
github FantasticFiasco / searchlight / src / main / application-updates / updaters / mac-os-updater.ts View on Github external
private onUpdateNotAvailable(version: UpdateInfo) {
        log.info('MacOSUpdater', `update not available (latest version: ${version.version}, downgrade is ${autoUpdater.allowDowngrade ? 'allowed' : 'disallowed'})`);

        this.state = State.Idle;
        this.send(ApplicationUpdatesChannelName.CheckResponse, new NoUpdatesAvailableEvent());
    }
github luminati-io / luminati-proxy / bin / lum_electron.js View on Github external
if (!can_upgrade)
    {
        let res = yield show_message({type: 'info', title: 'Luminati update',
            message: (ver ? `Luminati version ${ver}` : 'Luminati update')
            +' will be installed on exit',
            buttons: ['Install on exit', 'Install now']});
        if (!res)
            return void logger.notice('Update postponed until exit');
    }
    logger.notice('Starting upgrade');
    is_upgrading = true;
    zerr.perr('upgrade_start');
    auto_updater.quitAndInstall();
});

auto_updater.allowDowngrade = true;
auto_updater.autoDownload = false;
auto_updater.on('error', e=>zerr.perr('upgrade_error', {error: e}));
auto_updater.on('before-quit', ()=>{
    if (is_upgrading)
        zerr.perr('upgrade_finish');
});

auto_updater.on('update-available', e=>etask(function*(){
    if (semver.lt(e.version, pkg.version))
    {
        if (!config.is_lum)
        {
            zerr.perr('upgrade_invalid_version',
                {upgrade_v: e.version, current_v: pkg.version});
        }
        return;
github FantasticFiasco / searchlight / src / main / updates.ts View on Github external
autoUpdater.on('update-not-available', (versionInfo: VersionInfo) => {
            log.info(`Updates', 'update not available (latest version: ${versionInfo.version}, downgrade is ${autoUpdater.allowDowngrade ? 'allowed' : 'disallowed'})`);
        });