Browse Source

fix(.net 3.5): final touches (ejecting ISO, etc)

master
he3als 4 months ago
parent
commit
e986cde90b
Signed by: he3als GPG Key ID: A0FC52EA5368ECF4
2 changed files with 13 additions and 10 deletions
  1. +10
    -7
      src/Actions/.NET.cs
  2. +3
    -3
      src/Program.cs

+ 10
- 7
src/Actions/.NET.cs View File

@ -52,18 +52,21 @@ namespace amecs.Actions
{
string letter;
var choice = new ChoicePrompt() { Text = "A Windows Setup ISO must be provided to install .NET 3.5.\r\nDo you have a Win USB/folder instead of an ISO? (Y/N): " }.Start();
var choice = new ChoicePrompt() { Text = "To install .NET 3.5, Windows installation media is needed.\r\nDo you have a Windows USB instead of an ISO? (Y/N): " }.Start();
if (choice == null) return false;
var usingFolder = choice == 0;
if (usingFolder)
{
var dlg = new FolderPicker();
dlg.InputPath = Globals.UserFolder;
if (dlg.ShowDialog(default, false) == false) return false;
if (!dlg.ShowDialog(IntPtr.Zero, false).GetValueOrDefault())
{
Console.WriteLine();
ConsoleTUI.OpenFrame.Close("\r\nYou must select a folder or drive.", new ChoicePrompt() {AnyKey = true, Text = "Press any key to return to the Menu: "});
return true;
}
if (CheckFileViolation(dlg.ResultPath)) return false;
letter = dlg.ResultPath;
Console.WriteLine(letter);
Console.ReadLine();
}
else
{
@ -74,7 +77,6 @@ namespace amecs.Actions
NativeWindow window = new NativeWindow();
window.AssignHandle(Process.GetCurrentProcess().MainWindowHandle);
Console.WriteLine("a");
if (dialog.ShowDialog(window) == DialogResult.OK)
{
if (CheckFileViolation(dialog.FileName)) return false;
@ -156,7 +158,7 @@ namespace amecs.Actions
}
DismApi.Shutdown();
if (usingFolder) DismountImage();
if (!usingFolder) DismountImage();
}
} catch (Exception e)
{
@ -165,7 +167,7 @@ namespace amecs.Actions
Thread.Sleep(50);
}
if (usingFolder)
if (!usingFolder)
{
try
{
@ -188,6 +190,7 @@ namespace amecs.Actions
Console.WriteLine();
Console.WriteLine();
if (!usingFolder)
ConsoleTUI.OpenFrame.Close(".NET 3.5 installed successfully", ConsoleColor.Green, Console.BackgroundColor, new ChoicePrompt()
{
AnyKey = true,


+ 3
- 3
src/Program.cs View File

@ -40,9 +40,9 @@ namespace amecs
private const string Ver = "2.1";
public static ConsoleTUI.Frame Frame;
public static async Task Main(string[] args)
[STAThread]
public static void Main(string[] args)
{
ConsoleTUI.Initialize("Central AME Script");


Loading…
Cancel
Save