Skip to content
This repository has been archived by the owner on Sep 11, 2023. It is now read-only.

Commit

Permalink
Null fixes again, More attempts for platformio
Browse files Browse the repository at this point in the history
  • Loading branch information
dexslab committed Mar 12, 2020
1 parent 4e3d538 commit 1bb4fcf
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions ViewModels/MainWindowViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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}";
Expand All @@ -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)
Expand All @@ -357,6 +366,7 @@ private void GetPlatformIO()
}
}


private void CompileSketch()
{
Status = "Compiling Base Station Classic Sketch";
Expand Down

0 comments on commit 1bb4fcf

Please sign in to comment.