qol: formatting

This commit is contained in:
Gary Sharp
2025-07-20 13:47:56 +10:00
parent 49da389c2c
commit 5792771ea1
158 changed files with 693 additions and 679 deletions
+10 -10
View File
@@ -1,11 +1,11 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading;
using System.Net;
using System.IO;
using System.Diagnostics;
namespace Disco.ClientBootstrapper
{
@@ -20,13 +20,13 @@ namespace Disco.ClientBootstrapper
private StringBuilder errorMessage;
private Process clientProcess;
//#if DEBUG
// public const string DiscoServerName = "WS-GSHARP";
// public const int DiscoServerPort = 57252;
//#else
//#if DEBUG
// public const string DiscoServerName = "WS-GSHARP";
// public const int DiscoServerPort = 57252;
//#else
public const string DiscoServerName = "DISCO";
public const int DiscoServerPort = 9292;
//#endif
//#endif
public BootstrapperLoop(IStatus StatusUI, LoopCompleteCallback Callback)
{
@@ -128,8 +128,8 @@ namespace Disco.ClientBootstrapper
break;
}
}
}
}
if (!Interop.NetworkInterop.PingDiscoIct(DiscoServerName))
{
// Client Failed
@@ -1,9 +1,9 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Security.Cryptography.X509Certificates;
using System.Text.RegularExpressions;
using System.IO;
namespace Disco.ClientBootstrapper.Interop
{
@@ -66,7 +66,7 @@ namespace Disco.ClientBootstrapper.Interop
foreach (var file in Directory.EnumerateFiles(SourceLocation))
{
var fileName = Path.GetFileName(file);
// Only Copy Certain Files
// Copy Wireless Certificates
@@ -79,7 +79,7 @@ namespace Disco.ClientBootstrapper.Interop
if (fileName.StartsWith("WLAN_Profile_", StringComparison.OrdinalIgnoreCase) &&
fileName.EndsWith(".xml", StringComparison.OrdinalIgnoreCase))
File.Copy(file, Path.Combine(InstallLocation, fileName));
}
#endregion
@@ -340,7 +340,7 @@ namespace Disco.ClientBootstrapper.Interop
var progress = eventArgs.WideParameter.ToInt32();
Program.Status.UpdateStatus(null, null, $"Time remaining: {timeRemainingMessage}", true, progress);
break;
default:
break;
@@ -40,14 +40,16 @@ namespace Disco.ClientBootstrapper.Interop
{
var wirelessConnectionStatus = WirelessConnectionStatus;
}
catch (Exception) {
catch (Exception)
{
IsWireless = false;
};
}
}
public int WirelessConnectionStatus
{
get {
get
{
if (IsWireless)
{
IntPtr handle = IntPtr.Zero;
@@ -1,8 +1,8 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.NetworkInformation;
using System.Management;
using System.Net.NetworkInformation;
using System.Runtime.InteropServices;
using System.Xml;
@@ -30,7 +30,7 @@ namespace Disco.ClientBootstrapper.Interop
private static extern int LookupPrivilegeValue(string lpsystemname, string lpname, [MarshalAs(UnmanagedType.Struct)] ref LUID lpLuid);
[DllImport("advapi32.dll", CharSet = CharSet.Auto)]
private static extern int AdjustTokenPrivileges(int tokenhandle, int disableprivs, [MarshalAs(UnmanagedType.Struct)]ref TOKEN_PRIVILEGES Newstate, int bufferlength, int PreivousState, int Returnlength);
private static extern int AdjustTokenPrivileges(int tokenhandle, int disableprivs, [MarshalAs(UnmanagedType.Struct)] ref TOKEN_PRIVILEGES Newstate, int bufferlength, int PreivousState, int Returnlength);
[DllImport("advapi32.dll", CharSet = CharSet.Auto, SetLastError = true)]
private static extern int RegLoadKey(uint hKey, string lpSubKey, string lpFile);
@@ -649,7 +649,8 @@ namespace Disco.ClientBootstrapper.Interop.WIMInterop
///Private null constructor
///</summary>
private
NativeMethods() { }
NativeMethods()
{ }
[DllImport("Wimgapi.dll", ExactSpelling = true,
EntryPoint = "WIMCreateFile",
@@ -1435,7 +1436,7 @@ namespace Disco.ClientBootstrapper.Interop.WIMInterop
///Abort.
///</summary>
Abort = NativeMethods.WIMMessage.WIM_MSG_ABORT_IMAGE,
MountCleanupProgress = NativeMethods.WIMMessage.WIM_MSG_MOUNT_CLEANUP_PROGRESS
}
+10 -11
View File
@@ -118,18 +118,17 @@ namespace Disco.ClientBootstrapper
SleepThread(4000, true);
Interop.ShutdownInterop.Shutdown();
}
else if (PostBootstrapperActions.Contains("Reboot"))
{
Status.UpdateStatus("System Preparation (Bootstrapper)", "Rebooting; Finished...", string.Empty, false, 0);
SleepThread(4000, true);
Interop.ShutdownInterop.Reboot();
}
else
if (PostBootstrapperActions.Contains("Reboot"))
{
Status.UpdateStatus("System Preparation (Bootstrapper)", "Rebooting; Finished...", string.Empty, false, 0);
SleepThread(4000, true);
Interop.ShutdownInterop.Reboot();
}
else
{
Status.UpdateStatus("System Preparation (Bootstrapper)", "Starting System; Finished...", string.Empty, false, 0);
SleepThread(2000, true);
}
{
Status.UpdateStatus("System Preparation (Bootstrapper)", "Starting System; Finished...", string.Empty, false, 0);
SleepThread(2000, true);
}
}
else
{