File tree Expand file tree Collapse file tree 4 files changed +14
-7
lines changed
arduino-ide-extension/src
electron-main/ide-updater Expand file tree Collapse file tree 4 files changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -280,7 +280,8 @@ export class ArduinoFrontendContribution
280280 }
281281
282282 this . updaterService . init (
283- this . arduinoPreferences . get ( 'arduino.ide.updateChannel' )
283+ this . arduinoPreferences . get ( 'arduino.ide.updateChannel' ) ,
284+ this . arduinoPreferences . get ( 'arduino.ide.updateBaseUrl' )
284285 ) ;
285286 this . updater . checkForUpdates ( true ) . then ( async ( updateInfo ) => {
286287 if ( ! updateInfo ) return ;
Original file line number Diff line number Diff line change @@ -78,6 +78,14 @@ export const ArduinoConfigSchema: PreferenceSchema = {
7878 "Release channel to get updated from. 'stable' is the stable release, 'nightly' is the latest development build."
7979 ) ,
8080 } ,
81+ 'arduino.ide.updateBaseUrl' : {
82+ type : 'string' ,
83+ default : 'https://downloads.arduino.cc/arduino-ide' ,
84+ description : nls . localize (
85+ 'arduino/preferences/ide.updateBaseUrl' ,
86+ `The base URL where to download updates from. Defaults to 'https://downloads.arduino.cc/arduino-ide'`
87+ ) ,
88+ } ,
8189 'arduino.board.certificates' : {
8290 type : 'string' ,
8391 description : nls . localize (
@@ -178,6 +186,7 @@ export interface ArduinoConfiguration {
178186 'arduino.window.autoScale' : boolean ;
179187 'arduino.window.zoomLevel' : number ;
180188 'arduino.ide.updateChannel' : UpdateChannel ;
189+ 'arduino.ide.updateBaseUrl' : string ;
181190 'arduino.board.certificates' : string ;
182191 'arduino.sketchbook.showAllFiles' : boolean ;
183192 'arduino.cloud.enabled' : boolean ;
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ export interface ProgressInfo {
4646export const IDEUpdaterPath = '/services/ide-updater' ;
4747export const IDEUpdater = Symbol ( 'IDEUpdater' ) ;
4848export interface IDEUpdater extends JsonRpcServer < IDEUpdaterClient > {
49- init ( channel : UpdateChannel ) : void ;
49+ init ( channel : UpdateChannel , baseUrl : string ) : void ;
5050 checkForUpdates ( initialCheck ?: boolean ) : Promise < UpdateInfo | void > ;
5151 downloadUpdate ( ) : Promise < void > ;
5252 quitAndInstall ( ) : void ;
Original file line number Diff line number Diff line change 88} from '../../common/protocol/ide-updater' ;
99
1010const CHANGELOG_BASE_URL = 'https://downloads.arduino.cc/arduino-ide/changelog' ;
11- const IDE_DOWNLOAD_BASE_URL = 'https://downloads.arduino.cc/arduino-ide' ;
1211
1312@injectable ( )
1413export class IDEUpdaterImpl implements IDEUpdater {
@@ -18,14 +17,12 @@ export class IDEUpdaterImpl implements IDEUpdater {
1817 protected theiaFEClient ?: IDEUpdaterClient ;
1918 protected clients : Array < IDEUpdaterClient > = [ ] ;
2019
21- init ( channel : UpdateChannel ) : void {
20+ init ( channel : UpdateChannel , baseUrl : string ) : void {
2221 this . updater . autoDownload = false ;
2322 this . updater . channel = channel ;
2423 this . updater . setFeedURL ( {
2524 provider : 'generic' ,
26- url : `${ IDE_DOWNLOAD_BASE_URL } /${
27- channel === UpdateChannel . Nightly ? 'nightly' : ''
28- } `,
25+ url : `${ baseUrl } /${ channel === UpdateChannel . Nightly ? 'nightly' : '' } ` ,
2926 channel,
3027 } ) ;
3128
You can’t perform that action at this time.
0 commit comments