Check for IDE update at startup (#797)

* Remove check for updates on startup setting

* Remove useless exported function

* Update template-package.json used to package IDE

* Add function to get channel file during packaging step

* Add updates check

* move ide updater on backend

* configure updater options

* add auto update preferences

* TMP check updates on start and download

* index on check-update-startup: fcb8f6e TMP check updates on start and download

* set version to skip on local storage

* add IDE setting to toggle update check on start-up

* comment out check for updates on startup and auto update settings

* Update Theia to 1.22.1

* updated CI

* download changelog and show it in IDE updater dialog

* remove useless file

* remove useless code

* add i18n to updater dialog

* fix i18n

* refactor UpdateInfo typing

* add macos zip to artifacts

* Simply use `--ignore-engines`

* Use correct --ignore-engines

* Fix semver#valid call

* Use C++17

* updated documentation

* add update channel preference

* update updater url

* updated documentation

* Fix the C++ version

* Build flag for cpp

* add disclaimer with correct node version

* Update `electron-builder`

* Fix `Electron.Menu` issue

* Skip electron rebuild

* Rebuild native dependencies beforehand

* Use resolutions section

* Update template-package.json as well

* move ide-updater to electron application

* refactor ide-updater service

* update yarn.lock

* update i18n

* Revert "Add gRPC user agent (#834)"

This reverts commit 5ab3a747a6.

* fix ide download url

* update latest file in CI

* fix i18n check

Co-authored-by: Silvano Cerza <silvanocerza@gmail.com>
Co-authored-by: Francesco Stasi <f.stasi@me.com>
Co-authored-by: Mark Sujew <msujew@yahoo.de>
This commit is contained in:
Alberto Iannaccone
2022-02-15 18:01:19 +01:00
committed by GitHub
parent 9ecff86bbe
commit f660058c75
30 changed files with 1915 additions and 346 deletions

View File

@@ -0,0 +1,71 @@
import {
Command,
CommandContribution,
CommandRegistry,
MessageService,
} from '@theia/core';
import { injectable, inject } from 'inversify';
import { IDEUpdater, UpdateInfo } from '../../common/protocol/ide-updater';
@injectable()
export class IDEUpdaterCommands implements CommandContribution {
constructor(
@inject(IDEUpdater)
private readonly updater: IDEUpdater,
@inject(MessageService)
protected readonly messageService: MessageService
) {}
registerCommands(registry: CommandRegistry): void {
registry.registerCommand(IDEUpdaterCommands.CHECK_FOR_UPDATES, {
execute: this.checkForUpdates.bind(this),
});
registry.registerCommand(IDEUpdaterCommands.DOWNLOAD_UPDATE, {
execute: this.downloadUpdate.bind(this),
});
registry.registerCommand(IDEUpdaterCommands.STOP_DOWNLOAD, {
execute: this.stopDownload.bind(this),
});
registry.registerCommand(IDEUpdaterCommands.INSTALL_UPDATE, {
execute: this.quitAndInstall.bind(this),
});
}
async checkForUpdates(): Promise<UpdateInfo | void> {
return await this.updater.checkForUpdates();
}
async downloadUpdate(): Promise<void> {
await this.updater.downloadUpdate();
}
async stopDownload(): Promise<void> {
await this.updater.stopDownload();
}
quitAndInstall(): void {
this.updater.quitAndInstall();
}
}
export namespace IDEUpdaterCommands {
export const CHECK_FOR_UPDATES: Command = {
id: 'arduino-ide-check-for-updates',
category: 'Arduino',
label: 'Check for Arduino IDE updates',
};
export const DOWNLOAD_UPDATE: Command = {
id: 'arduino-ide-download-update',
category: 'Arduino',
label: 'Download Arduino IDE updates',
};
export const STOP_DOWNLOAD: Command = {
id: 'arduino-ide-stop-download',
category: 'Arduino',
label: 'Stop download of Arduino IDE updates',
};
export const INSTALL_UPDATE: Command = {
id: 'arduino-ide-install-update',
category: 'Arduino',
label: 'Install Arduino IDE updates',
};
}