diff --git a/ViewModels/MainWindowViewModel.cs b/ViewModels/MainWindowViewModel.cs index 0c6a22b..9d80bb6 100644 --- a/ViewModels/MainWindowViewModel.cs +++ b/ViewModels/MainWindowViewModel.cs @@ -322,6 +322,13 @@ private async Task DownloadPreReqs() client.DownloadProgressChanged += Client_DownloadProgressChanged; await client.DownloadFileTaskAsync(new Uri(dep.Link), $@"./{dep.FileName}"); } + } + else + { + if (!Directory.Exists($@".\{dep.Name}") && dep.FileName.Contains(".zip")) + { + ZipFile.ExtractToDirectory($@"./{dep.FileName}", $@"./{dep.Name}"); + } } } Status = $"Gitting {SelectedConfig.DisplayName}"; @@ -339,13 +346,15 @@ private async Task DownloadPreReqs() private void GetPlatformIO() { Status = "Getting Platform IO"; + ProcessStartInfo start = new ProcessStartInfo(); + start.Verb = "runas"; start.FileName = $@"{Directory.GetCurrentDirectory()}\python\python.exe"; - start.Arguments = string.Format("\"{0}\" \"{1}\"", $@"{ Directory.GetCurrentDirectory()}\get-platformio.py", null); + start.Arguments = string.Format("\"{0}\" \"{1}\"", "-I", $@"{ Directory.GetCurrentDirectory()}\get-platformio.py"); start.UseShellExecute = false;// Do not use OS shell - //start.CreateNoWindow = true; // We don't need new window - //start.RedirectStandardOutput = true;// Any output, generated by application will be redirected back - //start.RedirectStandardError = true; // Any error in standard output will be redirected back (for example exceptions) + start.CreateNoWindow = true; // We don't need new window + start.RedirectStandardOutput = true;// Any output, generated by application will be redirected back + start.RedirectStandardError = true; // Any error in standard output will be redirected back (for example exceptions) using (Process process = Process.Start(start)) { using (StreamReader reader = process.StandardOutput) @@ -357,6 +366,7 @@ private void GetPlatformIO() } } + private void CompileSketch() { Status = "Compiling Base Station Classic Sketch";