@@ -974,6 +974,11 @@ public static void DownloadAndInstallTool(ExternalTool tool, ExternalTools_Versi
974974 string step = "" ;
975975 try
976976 {
977+ if ( tool == null || version == null )
978+ {
979+ return ;
980+ }
981+
977982 ShowStatusPanel ( $ "Downloading { tool . Name } version { version . Version } ...") ;
978983
979984 // Download path
@@ -1106,22 +1111,34 @@ exit 1
11061111 bash = bash . Replace ( "{tempFile}" , tempFile ) . Replace ( "{installationPath}" , installationPath ) ;
11071112 File . WriteAllText ( bashFile , bash ) ;
11081113
1109- // Set execute attr in Linux/Mac
11101114 if ( CurrentOperatingSystem != OperatingSystems . Windows )
11111115 {
1112- var process = new Process ( ) ;
1113- process . StartInfo . FileName = "chmod" ;
1114- process . StartInfo . ArgumentList . Add ( "+x" ) ;
1115- process . StartInfo . ArgumentList . Add ( bashFile ) ;
1116- process . StartInfo . RedirectStandardOutput = true ;
1117- process . StartInfo . RedirectStandardError = true ;
1118- process . StartInfo . UseShellExecute = false ;
1119- process . Start ( ) ;
1120- process . WaitForExit ( ) ;
1116+ // Set execute attr in Linux/Mac
1117+ {
1118+ var process = new Process ( ) ;
1119+ process . StartInfo . FileName = "chmod" ;
1120+ process . StartInfo . ArgumentList . Add ( "+x" ) ;
1121+ process . StartInfo . ArgumentList . Add ( bashFile ) ;
1122+ process . StartInfo . RedirectStandardOutput = true ;
1123+ process . StartInfo . RedirectStandardError = true ;
1124+ process . StartInfo . UseShellExecute = false ;
1125+ process . Start ( ) ;
1126+ process . WaitForExit ( ) ;
1127+ }
1128+ // Launch .sh file
1129+ ProcessStartInfo psi = new ProcessStartInfo
1130+ {
1131+ FileName = "bash" ,
1132+ Arguments = bashFile ,
1133+ WorkingDirectory = Path . Combine ( GeneralConfig . BasePath , "downloads" ) ,
1134+ UseShellExecute = true ,
1135+ } ;
1136+ var p = new Process { StartInfo = psi } ;
1137+ p . Start ( ) ;
11211138 }
1122-
1123- // Run batch/bash file
1139+ else
11241140 {
1141+ // Launch .bat file
11251142 ProcessStartInfo psi = new ProcessStartInfo
11261143 {
11271144 FileName = bashFile ,
@@ -1132,6 +1149,7 @@ exit 1
11321149 p . Start ( ) ;
11331150 }
11341151
1152+
11351153 // Exit app
11361154 ExitApp ( ) ;
11371155 }
0 commit comments