@@ -6516,13 +6516,22 @@ export class ProjectExplorer implements CustomConfigurationProvider {
65166516 let needReload = false ;
65176517 if ( tarFlasher . resources [ osType ( ) ] ) {
65186518
6519- if ( cancel . isCancellationRequested ) return ;
6519+ if ( cancel . isCancellationRequested )
6520+ return ;
65206521
65216522 const res = tarFlasher . resources [ osType ( ) ] ;
6522- let installDir = res . locationType == 'global' ? new File ( resManager . getEideToolsInstallDir ( ) ) : project . getRootDir ( ) ;
6523- if ( res . locationType == 'workspace' ) installDir = File . fromArray ( [ project . getRootDir ( ) . path , res . location ] ) ;
65246523
6525- if ( res . zipType != 'none' ) {
6524+ let installDir : File ;
6525+ let isFirstInstall : boolean = false ;
6526+
6527+ if ( res . locationType == 'workspace' )
6528+ installDir = File . fromArray ( [ project . getRootDir ( ) . path , res . location ] ) ;
6529+ else // global
6530+ installDir = File . fromArray ( [ resManager . getEideToolsInstallDir ( ) , res . location ] ) ;
6531+
6532+ // if have a resource and not install, download it
6533+ if ( res . zipType != 'none' && installDir . IsDir ( ) == false ) {
6534+
65266535 reporter . report ( { message : 'downloading resources' } ) ;
65276536 const buf = await downloadFile ( redirectHost ( res . url ) ) ;
65286537 if ( ! ( buf instanceof Buffer ) ) throw buf || new Error ( 'Cannot download resource' ) ;
@@ -6534,6 +6543,8 @@ export class ProjectExplorer implements CustomConfigurationProvider {
65346543 const szip = new SevenZipper ( ) ;
65356544 const r = szip . UnzipSync ( new File ( tmpPath ) , installDir ) ;
65366545 GlobalEvent . emit ( 'globalLog' , newMessage ( 'Info' , r ) ) ;
6546+
6547+ isFirstInstall = true ;
65376548 }
65386549
65396550 if ( res . setupCommand ) {
@@ -6549,7 +6560,7 @@ export class ProjectExplorer implements CustomConfigurationProvider {
65496560 }
65506561 }
65516562
6552- needReload = res . locationType == 'global' ;
6563+ needReload = isFirstInstall && res . locationType == 'global' ;
65536564 }
65546565
65556566 if ( cancel . isCancellationRequested ) {
0 commit comments