File tree 4 files changed +14
-7
lines changed
arduino-ide-extension/src
electron-main/ide-updater
4 files changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -280,7 +280,8 @@ export class ArduinoFrontendContribution
280
280
}
281
281
282
282
this . updaterService . init (
283
- this . arduinoPreferences . get ( 'arduino.ide.updateChannel' )
283
+ this . arduinoPreferences . get ( 'arduino.ide.updateChannel' ) ,
284
+ this . arduinoPreferences . get ( 'arduino.ide.updateBaseUrl' )
284
285
) ;
285
286
this . updater . checkForUpdates ( true ) . then ( async ( updateInfo ) => {
286
287
if ( ! updateInfo ) return ;
Original file line number Diff line number Diff line change @@ -78,6 +78,14 @@ export const ArduinoConfigSchema: PreferenceSchema = {
78
78
"Release channel to get updated from. 'stable' is the stable release, 'nightly' is the latest development build."
79
79
) ,
80
80
} ,
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
+ } ,
81
89
'arduino.board.certificates' : {
82
90
type : 'string' ,
83
91
description : nls . localize (
@@ -178,6 +186,7 @@ export interface ArduinoConfiguration {
178
186
'arduino.window.autoScale' : boolean ;
179
187
'arduino.window.zoomLevel' : number ;
180
188
'arduino.ide.updateChannel' : UpdateChannel ;
189
+ 'arduino.ide.updateBaseUrl' : string ;
181
190
'arduino.board.certificates' : string ;
182
191
'arduino.sketchbook.showAllFiles' : boolean ;
183
192
'arduino.cloud.enabled' : boolean ;
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ export interface ProgressInfo {
46
46
export const IDEUpdaterPath = '/services/ide-updater' ;
47
47
export const IDEUpdater = Symbol ( 'IDEUpdater' ) ;
48
48
export interface IDEUpdater extends JsonRpcServer < IDEUpdaterClient > {
49
- init ( channel : UpdateChannel ) : void ;
49
+ init ( channel : UpdateChannel , baseUrl : string ) : void ;
50
50
checkForUpdates ( initialCheck ?: boolean ) : Promise < UpdateInfo | void > ;
51
51
downloadUpdate ( ) : Promise < void > ;
52
52
quitAndInstall ( ) : void ;
Original file line number Diff line number Diff line change 8
8
} from '../../common/protocol/ide-updater' ;
9
9
10
10
const CHANGELOG_BASE_URL = 'https://downloads.arduino.cc/arduino-ide/changelog' ;
11
- const IDE_DOWNLOAD_BASE_URL = 'https://downloads.arduino.cc/arduino-ide' ;
12
11
13
12
@injectable ( )
14
13
export class IDEUpdaterImpl implements IDEUpdater {
@@ -18,14 +17,12 @@ export class IDEUpdaterImpl implements IDEUpdater {
18
17
protected theiaFEClient ?: IDEUpdaterClient ;
19
18
protected clients : Array < IDEUpdaterClient > = [ ] ;
20
19
21
- init ( channel : UpdateChannel ) : void {
20
+ init ( channel : UpdateChannel , baseUrl : string ) : void {
22
21
this . updater . autoDownload = false ;
23
22
this . updater . channel = channel ;
24
23
this . updater . setFeedURL ( {
25
24
provider : 'generic' ,
26
- url : `${ IDE_DOWNLOAD_BASE_URL } /${
27
- channel === UpdateChannel . Nightly ? 'nightly' : ''
28
- } `,
25
+ url : `${ baseUrl } /${ channel === UpdateChannel . Nightly ? 'nightly' : '' } ` ,
29
26
channel,
30
27
} ) ;
31
28
You can’t perform that action at this time.
0 commit comments