aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS.WinForms/OobeStory.cs
diff options
context:
space:
mode:
authorRogueAI42 <[email protected]>2017-06-16 23:20:10 +1000
committerRogueAI42 <[email protected]>2017-06-16 23:20:10 +1000
commit50bd1ab402918ede7e4e365ca91b2300ebc20741 (patch)
tree8d9c328ec8bda1685f8717c7c6490916bc35bd25 /ShiftOS.WinForms/OobeStory.cs
parent9df7aa2110dc037a6922c5d6e4c0534fcf18b6ef (diff)
downloadshiftos_thereturn-50bd1ab402918ede7e4e365ca91b2300ebc20741.tar.gz
shiftos_thereturn-50bd1ab402918ede7e4e365ca91b2300ebc20741.tar.bz2
shiftos_thereturn-50bd1ab402918ede7e4e365ca91b2300ebc20741.zip
Fix Intro on Linux
MORE LUNIX, MORE FUN also replaced drive type with drive format
Diffstat (limited to 'ShiftOS.WinForms/OobeStory.cs')
-rw-r--r--ShiftOS.WinForms/OobeStory.cs56
1 files changed, 34 insertions, 22 deletions
diff --git a/ShiftOS.WinForms/OobeStory.cs b/ShiftOS.WinForms/OobeStory.cs
index f2a4930..cab1ec8 100644
--- a/ShiftOS.WinForms/OobeStory.cs
+++ b/ShiftOS.WinForms/OobeStory.cs
@@ -85,28 +85,40 @@ namespace ShiftOS.WinForms
ConsoleEx.ForegroundColor = ConsoleColor.White;
Console.WriteLine(@"We'll now begin formatting your drive. Please be patient.");
Console.WriteLine();
- var dinf = new DriveInfo("C:\\");
- decimal bytesFree = ((dinf.AvailableFreeSpace / 1024) / 1024) / 1024;
- decimal totalBytes = ((dinf.TotalSize / 1024) / 1024) / 1024;
- string type = dinf.DriveType.ToString();
- string name = dinf.Name;
- ConsoleEx.Bold = true;
- Console.Write("Drive name: ");
- ConsoleEx.Bold = false;
- Console.WriteLine(name);
- ConsoleEx.Bold = true;
- Console.Write("Drive type: ");
- ConsoleEx.Bold = false;
- Console.WriteLine(type);
- ConsoleEx.Bold = true;
- Console.Write("Total space: ");
- ConsoleEx.Bold = false;
- Console.WriteLine(totalBytes.ToString() + " GB");
- ConsoleEx.Bold = true;
- Console.Write("Free space: ");
- Console.WriteLine(bytesFree.ToString() + " GB");
- Console.WriteLine();
-
+ double bytesFree, totalBytes;
+ string type, name;
+ dynamic dinf;
+ try
+ {
+ if (Lunix.InWine)
+ dinf = new Lunix.DFDriveInfo("/");
+ else
+ dinf = new DriveInfo("C:\\");
+ bytesFree = dinf.AvailableFreeSpace / 1073741824.0;
+ totalBytes = dinf.TotalSize / 1073741824.0;
+ type = dinf.DriveFormat.ToString();
+ name = dinf.Name;
+ ConsoleEx.Bold = true;
+ Console.Write("Drive name: ");
+ ConsoleEx.Bold = false;
+ Console.WriteLine(name);
+ ConsoleEx.Bold = true;
+ Console.Write("Drive type: ");
+ ConsoleEx.Bold = false;
+ Console.WriteLine(type);
+ ConsoleEx.Bold = true;
+ Console.Write("Total space: ");
+ ConsoleEx.Bold = false;
+ Console.WriteLine(String.Format("{0:F1}", totalBytes) + " GB");
+ ConsoleEx.Bold = true;
+ Console.Write("Free space: ");
+ Console.WriteLine(String.Format("{0:F1}", bytesFree) + " GB");
+ Console.WriteLine();
+ }
+ catch (Exception ex)
+ {
+ Console.WriteLine(ex.ToString());
+ }
ConsoleEx.Bold = false;
ConsoleEx.BackgroundColor = ConsoleColor.Black;