GIT: perform LF normalization
This commit is contained in:
@@ -1,252 +1,252 @@
|
||||
//#define Debug
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Net;
|
||||
using System.IO;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace Disco.ClientBootstrapper
|
||||
{
|
||||
class BootstrapperLoop
|
||||
{
|
||||
|
||||
public Thread LoopThread;
|
||||
public delegate void LoopCompleteCallback();
|
||||
private LoopCompleteCallback mLoopCompleteCallback;
|
||||
private IStatus statusUI;
|
||||
private string tempWorkingDirectory;
|
||||
private StringBuilder errorMessage;
|
||||
private Process clientProcess;
|
||||
|
||||
public BootstrapperLoop(IStatus StatusUI, LoopCompleteCallback Callback)
|
||||
{
|
||||
this.statusUI = StatusUI;
|
||||
this.mLoopCompleteCallback = Callback;
|
||||
this.errorMessage = new StringBuilder();
|
||||
}
|
||||
|
||||
public void Start()
|
||||
{
|
||||
this.LoopThread = new Thread(new ThreadStart(loopHost));
|
||||
this.LoopThread.Start();
|
||||
}
|
||||
|
||||
private void loopHost()
|
||||
{
|
||||
try
|
||||
{
|
||||
loop();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if (ex.GetType() == typeof(ThreadAbortException))
|
||||
return;
|
||||
if (ex.GetType() == typeof(ThreadInterruptedException))
|
||||
return;
|
||||
Program.WriteAppError(ex);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
private void loop()
|
||||
{
|
||||
|
||||
#if Debug
|
||||
statusUI.UpdateStatus("Waiting for Debugger", "Please wait...", true, -1);
|
||||
try
|
||||
{
|
||||
do
|
||||
{
|
||||
System.Threading.Thread.Sleep(10);
|
||||
} while (!System.Diagnostics.Debugger.IsAttached);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
statusUI.UpdateStatus("Error", ex.Message, true, -1);
|
||||
return;
|
||||
}
|
||||
#else
|
||||
statusUI.UpdateStatus("System Preparation (Bootstrapper)", "Starting", "Please wait...", true, -1);
|
||||
#endif
|
||||
|
||||
tempWorkingDirectory = Path.Combine(Path.GetPathRoot(Environment.SystemDirectory), "Disco\\Temp");
|
||||
if (!Directory.Exists(tempWorkingDirectory))
|
||||
Directory.CreateDirectory(tempWorkingDirectory);
|
||||
|
||||
// Check for Network Connectivity
|
||||
statusUI.UpdateStatus(null, "Detecting Network", "Checking network connectivity, Please wait...", true, -1);
|
||||
if (!Interop.NetworkInterop.PingDisco())
|
||||
{
|
||||
statusUI.UpdateStatus(null, "Detecting Network", "No network connectivity detected, Diagnosing...", true, -1);
|
||||
statusUI_WriteAdapterInfo();
|
||||
|
||||
if (!Interop.NetworkInterop.PingDisco())
|
||||
{
|
||||
// Check for Wireless
|
||||
var hasWireless = (Interop.NetworkInterop.NetworkAdapters.Count(na => na.IsWireless) > 0);
|
||||
if (hasWireless)
|
||||
{
|
||||
// True: Do wireless loop
|
||||
statusUI.UpdateStatus(null, "Configuring Wireless Network", "Wireless adapter detected, Configuring...", true, -1);
|
||||
Interop.NetworkInterop.ConfigureWireless();
|
||||
statusUI.UpdateStatus(null, "Waiting for Wireless Network", null, true, 0);
|
||||
for (int i = 0; i < 100; i++)
|
||||
{
|
||||
statusUI_WriteAdapterInfo();
|
||||
statusUI.UpdateStatus(null, null, null, true, i);
|
||||
Program.SleepThread(500, false);
|
||||
if (Interop.NetworkInterop.PingDisco())
|
||||
break;
|
||||
}
|
||||
if (!Interop.NetworkInterop.PingDisco())
|
||||
{
|
||||
statusUI.UpdateStatus(null, "Wireless Network Failed", "Unable to connect to the wireless network, please connect the network cable...", false);
|
||||
Program.SleepThread(3000, false);
|
||||
}
|
||||
}
|
||||
|
||||
if (!Interop.NetworkInterop.PingDisco())
|
||||
{
|
||||
// Instruct user to connect network cable
|
||||
statusUI.UpdateStatus(null, "Please connect the network cable", null);
|
||||
for (int i = 0; i < 100; i++)
|
||||
{
|
||||
statusUI_WriteAdapterInfo();
|
||||
statusUI.UpdateStatus(null, null, null, true, i);
|
||||
Program.SleepThread(500, false);
|
||||
if (Interop.NetworkInterop.PingDisco())
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!Interop.NetworkInterop.PingDisco())
|
||||
{
|
||||
// Client Failed
|
||||
if (this.mLoopCompleteCallback != null)
|
||||
{
|
||||
this.mLoopCompleteCallback.BeginInvoke(null, null);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Download Client
|
||||
statusUI.UpdateStatus(null, "Downloading", "Retrieving Preparation Client, Please wait...", true, -1);
|
||||
string clientSourceLocation = Path.Combine(tempWorkingDirectory, "PreparationClient.zip");
|
||||
using (var webClient = new WebClient())
|
||||
{
|
||||
webClient.DownloadFile("http://disco:9292/Services/Client/PreparationClient", clientSourceLocation);
|
||||
}
|
||||
|
||||
// Unzip Client
|
||||
statusUI.UpdateStatus(null, "Extracting", "Retrieving Preparation Client, Please wait...", true, -1);
|
||||
string clientLocation = Path.Combine(tempWorkingDirectory, "PreparationClient");
|
||||
if (!Directory.Exists(clientLocation))
|
||||
Directory.CreateDirectory(clientLocation);
|
||||
using (var clientSource = Ionic.Zip.ZipFile.Read(clientSourceLocation))
|
||||
{
|
||||
clientSource.ExtractAll(clientLocation, Ionic.Zip.ExtractExistingFileAction.OverwriteSilently);
|
||||
}
|
||||
|
||||
// Launch Client
|
||||
statusUI.UpdateStatus("System Preparation (Client)", "Running", "Launching Preparation Client, Please wait...", true, -1);
|
||||
ProcessStartInfo clientProcessStart = new ProcessStartInfo(Path.Combine(clientLocation, "Start.bat"))
|
||||
{
|
||||
WorkingDirectory = clientLocation,
|
||||
CreateNoWindow = true,
|
||||
RedirectStandardOutput = true,
|
||||
UseShellExecute = false,
|
||||
};
|
||||
using (clientProcess = Process.Start(clientProcessStart))
|
||||
{
|
||||
// Read StdOutput until End
|
||||
try
|
||||
{
|
||||
clientProcess.OutputDataReceived += new DataReceivedEventHandler(clientProcess_OutputDataReceived);
|
||||
clientProcess.BeginOutputReadLine();
|
||||
clientProcess.WaitForExit();
|
||||
}
|
||||
catch (Exception) { throw; }
|
||||
finally
|
||||
{
|
||||
try { clientProcess.CloseMainWindow(); }
|
||||
catch (Exception) { }
|
||||
}
|
||||
}
|
||||
clientProcess = null;
|
||||
|
||||
// Cleanup
|
||||
if (Directory.Exists(tempWorkingDirectory))
|
||||
Directory.Delete(tempWorkingDirectory, true);
|
||||
Interop.CertificateInterop.RemoveTempCerts();
|
||||
|
||||
// Pause if Error
|
||||
if (this.errorMessage.Length > 0)
|
||||
{
|
||||
Program.SleepThread(10000, true);
|
||||
}
|
||||
|
||||
// End Of Loop
|
||||
if (this.mLoopCompleteCallback != null)
|
||||
{
|
||||
this.mLoopCompleteCallback.BeginInvoke(null, null);
|
||||
}
|
||||
}
|
||||
|
||||
void statusUI_WriteAdapterInfo()
|
||||
{
|
||||
|
||||
var info = new StringBuilder();
|
||||
foreach (var na in Interop.NetworkInterop.NetworkAdapters)
|
||||
{
|
||||
if (na.IsWireless)
|
||||
{
|
||||
info.AppendLine(string.Format("{0}: {1}", na.NetConnectionID, na.WirelessConnectionStatusMeaning(na.WirelessConnectionStatus)));
|
||||
}
|
||||
else
|
||||
{
|
||||
info.AppendLine(string.Format("{0}: {1}", na.NetConnectionID, na.ConnectionStatusMeaning(na.ConnectionStatus)));
|
||||
}
|
||||
}
|
||||
statusUI.UpdateStatus(null, null, info.ToString());
|
||||
|
||||
}
|
||||
|
||||
void clientProcess_OutputDataReceived(object sender, DataReceivedEventArgs e)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(e.Data))
|
||||
{
|
||||
System.Diagnostics.Debug.WriteLine(string.Format("OUTPUT: {0}", e.Data));
|
||||
var data = e.Data.Substring(1).Split(new char[] { ',' });
|
||||
switch (e.Data[0])
|
||||
{
|
||||
case '#':
|
||||
if (data.Length == 4)
|
||||
{
|
||||
statusUI.UpdateStatus(null, data[0].Replace("{comma}", ","), data[1].Replace("{comma}", ",").Replace("{newline}", Environment.NewLine), bool.Parse(data[2]), int.Parse(data[3]));
|
||||
}
|
||||
break;
|
||||
case '!':
|
||||
Program.PostBootstrapperActions = new List<string>(data);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//void clientProcess_ErrorDataReceived(object sender, DataReceivedEventArgs e)
|
||||
//{
|
||||
// if (!string.IsNullOrEmpty(e.Data))
|
||||
// {
|
||||
// System.Diagnostics.Debug.WriteLine(string.Format("ERROR: {0}", e.Data));
|
||||
// this.errorMessage.AppendLine(e.Data);
|
||||
// statusUI.UpdateStatus(null, "An Error Occurred", this.errorMessage.ToString(), false);
|
||||
// }
|
||||
//}
|
||||
|
||||
}
|
||||
}
|
||||
//#define Debug
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Net;
|
||||
using System.IO;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace Disco.ClientBootstrapper
|
||||
{
|
||||
class BootstrapperLoop
|
||||
{
|
||||
|
||||
public Thread LoopThread;
|
||||
public delegate void LoopCompleteCallback();
|
||||
private LoopCompleteCallback mLoopCompleteCallback;
|
||||
private IStatus statusUI;
|
||||
private string tempWorkingDirectory;
|
||||
private StringBuilder errorMessage;
|
||||
private Process clientProcess;
|
||||
|
||||
public BootstrapperLoop(IStatus StatusUI, LoopCompleteCallback Callback)
|
||||
{
|
||||
this.statusUI = StatusUI;
|
||||
this.mLoopCompleteCallback = Callback;
|
||||
this.errorMessage = new StringBuilder();
|
||||
}
|
||||
|
||||
public void Start()
|
||||
{
|
||||
this.LoopThread = new Thread(new ThreadStart(loopHost));
|
||||
this.LoopThread.Start();
|
||||
}
|
||||
|
||||
private void loopHost()
|
||||
{
|
||||
try
|
||||
{
|
||||
loop();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if (ex.GetType() == typeof(ThreadAbortException))
|
||||
return;
|
||||
if (ex.GetType() == typeof(ThreadInterruptedException))
|
||||
return;
|
||||
Program.WriteAppError(ex);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
private void loop()
|
||||
{
|
||||
|
||||
#if Debug
|
||||
statusUI.UpdateStatus("Waiting for Debugger", "Please wait...", true, -1);
|
||||
try
|
||||
{
|
||||
do
|
||||
{
|
||||
System.Threading.Thread.Sleep(10);
|
||||
} while (!System.Diagnostics.Debugger.IsAttached);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
statusUI.UpdateStatus("Error", ex.Message, true, -1);
|
||||
return;
|
||||
}
|
||||
#else
|
||||
statusUI.UpdateStatus("System Preparation (Bootstrapper)", "Starting", "Please wait...", true, -1);
|
||||
#endif
|
||||
|
||||
tempWorkingDirectory = Path.Combine(Path.GetPathRoot(Environment.SystemDirectory), "Disco\\Temp");
|
||||
if (!Directory.Exists(tempWorkingDirectory))
|
||||
Directory.CreateDirectory(tempWorkingDirectory);
|
||||
|
||||
// Check for Network Connectivity
|
||||
statusUI.UpdateStatus(null, "Detecting Network", "Checking network connectivity, Please wait...", true, -1);
|
||||
if (!Interop.NetworkInterop.PingDisco())
|
||||
{
|
||||
statusUI.UpdateStatus(null, "Detecting Network", "No network connectivity detected, Diagnosing...", true, -1);
|
||||
statusUI_WriteAdapterInfo();
|
||||
|
||||
if (!Interop.NetworkInterop.PingDisco())
|
||||
{
|
||||
// Check for Wireless
|
||||
var hasWireless = (Interop.NetworkInterop.NetworkAdapters.Count(na => na.IsWireless) > 0);
|
||||
if (hasWireless)
|
||||
{
|
||||
// True: Do wireless loop
|
||||
statusUI.UpdateStatus(null, "Configuring Wireless Network", "Wireless adapter detected, Configuring...", true, -1);
|
||||
Interop.NetworkInterop.ConfigureWireless();
|
||||
statusUI.UpdateStatus(null, "Waiting for Wireless Network", null, true, 0);
|
||||
for (int i = 0; i < 100; i++)
|
||||
{
|
||||
statusUI_WriteAdapterInfo();
|
||||
statusUI.UpdateStatus(null, null, null, true, i);
|
||||
Program.SleepThread(500, false);
|
||||
if (Interop.NetworkInterop.PingDisco())
|
||||
break;
|
||||
}
|
||||
if (!Interop.NetworkInterop.PingDisco())
|
||||
{
|
||||
statusUI.UpdateStatus(null, "Wireless Network Failed", "Unable to connect to the wireless network, please connect the network cable...", false);
|
||||
Program.SleepThread(3000, false);
|
||||
}
|
||||
}
|
||||
|
||||
if (!Interop.NetworkInterop.PingDisco())
|
||||
{
|
||||
// Instruct user to connect network cable
|
||||
statusUI.UpdateStatus(null, "Please connect the network cable", null);
|
||||
for (int i = 0; i < 100; i++)
|
||||
{
|
||||
statusUI_WriteAdapterInfo();
|
||||
statusUI.UpdateStatus(null, null, null, true, i);
|
||||
Program.SleepThread(500, false);
|
||||
if (Interop.NetworkInterop.PingDisco())
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!Interop.NetworkInterop.PingDisco())
|
||||
{
|
||||
// Client Failed
|
||||
if (this.mLoopCompleteCallback != null)
|
||||
{
|
||||
this.mLoopCompleteCallback.BeginInvoke(null, null);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Download Client
|
||||
statusUI.UpdateStatus(null, "Downloading", "Retrieving Preparation Client, Please wait...", true, -1);
|
||||
string clientSourceLocation = Path.Combine(tempWorkingDirectory, "PreparationClient.zip");
|
||||
using (var webClient = new WebClient())
|
||||
{
|
||||
webClient.DownloadFile("http://disco:9292/Services/Client/PreparationClient", clientSourceLocation);
|
||||
}
|
||||
|
||||
// Unzip Client
|
||||
statusUI.UpdateStatus(null, "Extracting", "Retrieving Preparation Client, Please wait...", true, -1);
|
||||
string clientLocation = Path.Combine(tempWorkingDirectory, "PreparationClient");
|
||||
if (!Directory.Exists(clientLocation))
|
||||
Directory.CreateDirectory(clientLocation);
|
||||
using (var clientSource = Ionic.Zip.ZipFile.Read(clientSourceLocation))
|
||||
{
|
||||
clientSource.ExtractAll(clientLocation, Ionic.Zip.ExtractExistingFileAction.OverwriteSilently);
|
||||
}
|
||||
|
||||
// Launch Client
|
||||
statusUI.UpdateStatus("System Preparation (Client)", "Running", "Launching Preparation Client, Please wait...", true, -1);
|
||||
ProcessStartInfo clientProcessStart = new ProcessStartInfo(Path.Combine(clientLocation, "Start.bat"))
|
||||
{
|
||||
WorkingDirectory = clientLocation,
|
||||
CreateNoWindow = true,
|
||||
RedirectStandardOutput = true,
|
||||
UseShellExecute = false,
|
||||
};
|
||||
using (clientProcess = Process.Start(clientProcessStart))
|
||||
{
|
||||
// Read StdOutput until End
|
||||
try
|
||||
{
|
||||
clientProcess.OutputDataReceived += new DataReceivedEventHandler(clientProcess_OutputDataReceived);
|
||||
clientProcess.BeginOutputReadLine();
|
||||
clientProcess.WaitForExit();
|
||||
}
|
||||
catch (Exception) { throw; }
|
||||
finally
|
||||
{
|
||||
try { clientProcess.CloseMainWindow(); }
|
||||
catch (Exception) { }
|
||||
}
|
||||
}
|
||||
clientProcess = null;
|
||||
|
||||
// Cleanup
|
||||
if (Directory.Exists(tempWorkingDirectory))
|
||||
Directory.Delete(tempWorkingDirectory, true);
|
||||
Interop.CertificateInterop.RemoveTempCerts();
|
||||
|
||||
// Pause if Error
|
||||
if (this.errorMessage.Length > 0)
|
||||
{
|
||||
Program.SleepThread(10000, true);
|
||||
}
|
||||
|
||||
// End Of Loop
|
||||
if (this.mLoopCompleteCallback != null)
|
||||
{
|
||||
this.mLoopCompleteCallback.BeginInvoke(null, null);
|
||||
}
|
||||
}
|
||||
|
||||
void statusUI_WriteAdapterInfo()
|
||||
{
|
||||
|
||||
var info = new StringBuilder();
|
||||
foreach (var na in Interop.NetworkInterop.NetworkAdapters)
|
||||
{
|
||||
if (na.IsWireless)
|
||||
{
|
||||
info.AppendLine(string.Format("{0}: {1}", na.NetConnectionID, na.WirelessConnectionStatusMeaning(na.WirelessConnectionStatus)));
|
||||
}
|
||||
else
|
||||
{
|
||||
info.AppendLine(string.Format("{0}: {1}", na.NetConnectionID, na.ConnectionStatusMeaning(na.ConnectionStatus)));
|
||||
}
|
||||
}
|
||||
statusUI.UpdateStatus(null, null, info.ToString());
|
||||
|
||||
}
|
||||
|
||||
void clientProcess_OutputDataReceived(object sender, DataReceivedEventArgs e)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(e.Data))
|
||||
{
|
||||
System.Diagnostics.Debug.WriteLine(string.Format("OUTPUT: {0}", e.Data));
|
||||
var data = e.Data.Substring(1).Split(new char[] { ',' });
|
||||
switch (e.Data[0])
|
||||
{
|
||||
case '#':
|
||||
if (data.Length == 4)
|
||||
{
|
||||
statusUI.UpdateStatus(null, data[0].Replace("{comma}", ","), data[1].Replace("{comma}", ",").Replace("{newline}", Environment.NewLine), bool.Parse(data[2]), int.Parse(data[3]));
|
||||
}
|
||||
break;
|
||||
case '!':
|
||||
Program.PostBootstrapperActions = new List<string>(data);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//void clientProcess_ErrorDataReceived(object sender, DataReceivedEventArgs e)
|
||||
//{
|
||||
// if (!string.IsNullOrEmpty(e.Data))
|
||||
// {
|
||||
// System.Diagnostics.Debug.WriteLine(string.Format("ERROR: {0}", e.Data));
|
||||
// this.errorMessage.AppendLine(e.Data);
|
||||
// statusUI.UpdateStatus(null, "An Error Occurred", this.errorMessage.ToString(), false);
|
||||
// }
|
||||
//}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
Option Explicit
|
||||
|
||||
Dim objShell, BootstrapperLocation
|
||||
|
||||
Set objShell = CreateObject("WScript.Shell")
|
||||
|
||||
BootstrapperLocation = Mid(WScript.ScriptFullName, 1, InStrRev(WScript.ScriptFullName, "\")) & "\Disco.ClientBootstrapper.exe"
|
||||
|
||||
Call objShell.Run("""" & BootstrapperLocation & """ /Install", , True)
|
||||
|
||||
Option Explicit
|
||||
|
||||
Dim objShell, BootstrapperLocation
|
||||
|
||||
Set objShell = CreateObject("WScript.Shell")
|
||||
|
||||
BootstrapperLocation = Mid(WScript.ScriptFullName, 1, InStrRev(WScript.ScriptFullName, "\")) & "\Disco.ClientBootstrapper.exe"
|
||||
|
||||
Call objShell.Run("""" & BootstrapperLocation & """ /Install", , True)
|
||||
|
||||
WScript.Echo "Disco Client Bootstrapper Installed"
|
||||
@@ -1,335 +1,335 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
|
||||
<ProductVersion>8.0.30703</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{15BD9561-A3C7-4608-9F7E-F1A1CFB60055}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Disco.ClientBootstrapper</RootNamespace>
|
||||
<AssemblyName>Disco.ClientBootstrapper</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<PublishUrl>publish\</PublishUrl>
|
||||
<Install>true</Install>
|
||||
<InstallFrom>Disk</InstallFrom>
|
||||
<UpdateEnabled>false</UpdateEnabled>
|
||||
<UpdateMode>Foreground</UpdateMode>
|
||||
<UpdateInterval>7</UpdateInterval>
|
||||
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
|
||||
<UpdatePeriodically>false</UpdatePeriodically>
|
||||
<UpdateRequired>false</UpdateRequired>
|
||||
<MapFileExtensions>true</MapFileExtensions>
|
||||
<ApplicationRevision>0</ApplicationRevision>
|
||||
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
|
||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<ApplicationManifest>Properties\app.manifest</ApplicationManifest>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisIgnoreBuiltInRuleSets>true</CodeAnalysisIgnoreBuiltInRuleSets>
|
||||
<CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisIgnoreBuiltInRuleSets>true</CodeAnalysisIgnoreBuiltInRuleSets>
|
||||
<CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<ApplicationIcon>Icon.ico</ApplicationIcon>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Management" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Deployment" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\BZip2\BitWriter.cs">
|
||||
<Link>DotNetZip\BZip2\BitWriter.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\BZip2\BZip2Compressor.cs">
|
||||
<Link>DotNetZip\BZip2\BZip2Compressor.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\BZip2\BZip2InputStream.cs">
|
||||
<Link>DotNetZip\BZip2\BZip2InputStream.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\BZip2\BZip2OutputStream.cs">
|
||||
<Link>DotNetZip\BZip2\BZip2OutputStream.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\BZip2\ParallelBZip2OutputStream.cs">
|
||||
<Link>DotNetZip\BZip2\ParallelBZip2OutputStream.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\BZip2\Rand.cs">
|
||||
<Link>DotNetZip\BZip2\Rand.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\CommonSrc\CRC32.cs">
|
||||
<Link>DotNetZip\CRC32.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\Zip\ComHelper.cs">
|
||||
<Link>DotNetZip\Zip\ComHelper.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\Zip\EncryptionAlgorithm.cs">
|
||||
<Link>DotNetZip\Zip\EncryptionAlgorithm.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\Zip\Events.cs">
|
||||
<Link>DotNetZip\Zip\Events.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\Zip\Exceptions.cs">
|
||||
<Link>DotNetZip\Zip\Exceptions.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\Zip\ExtractExistingFileAction.cs">
|
||||
<Link>DotNetZip\Zip\ExtractExistingFileAction.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\Zip\FileSelector.cs">
|
||||
<Link>DotNetZip\Zip\FileSelector.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\Zip\OffsetStream.cs">
|
||||
<Link>DotNetZip\Zip\OffsetStream.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\Zip\Shared.cs">
|
||||
<Link>DotNetZip\Zip\Shared.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\Zip\WinZipAes.cs">
|
||||
<Link>DotNetZip\Zip\WinZipAes.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\Zip\ZipConstants.cs">
|
||||
<Link>DotNetZip\Zip\ZipConstants.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\Zip\ZipCrypto.cs">
|
||||
<Link>DotNetZip\Zip\ZipCrypto.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\Zip\ZipDirEntry.cs">
|
||||
<Link>DotNetZip\Zip\ZipDirEntry.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\Zip\ZipEntry.cs">
|
||||
<Link>DotNetZip\Zip\ZipEntry.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\Zip\ZipEntry.Extract.cs">
|
||||
<Link>DotNetZip\Zip\ZipEntry.Extract.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\Zip\ZipEntry.Read.cs">
|
||||
<Link>DotNetZip\Zip\ZipEntry.Read.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\Zip\ZipEntry.Write.cs">
|
||||
<Link>DotNetZip\Zip\ZipEntry.Write.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\Zip\ZipEntrySource.cs">
|
||||
<Link>DotNetZip\Zip\ZipEntrySource.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\Zip\ZipErrorAction.cs">
|
||||
<Link>DotNetZip\Zip\ZipErrorAction.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\Zip\ZipFile.AddUpdate.cs">
|
||||
<Link>DotNetZip\Zip\ZipFile.AddUpdate.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\Zip\ZipFile.Check.cs">
|
||||
<Link>DotNetZip\Zip\ZipFile.Check.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\Zip\ZipFile.cs">
|
||||
<Link>DotNetZip\Zip\ZipFile.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\Zip\ZipFile.Events.cs">
|
||||
<Link>DotNetZip\Zip\ZipFile.Events.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\Zip\ZipFile.Extract.cs">
|
||||
<Link>DotNetZip\Zip\ZipFile.Extract.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\Zip\ZipFile.Read.cs">
|
||||
<Link>DotNetZip\Zip\ZipFile.Read.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\Zip\ZipFile.Save.cs">
|
||||
<Link>DotNetZip\Zip\ZipFile.Save.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\Zip\ZipFile.SaveSelfExtractor.cs">
|
||||
<Link>DotNetZip\Zip\ZipFile.SaveSelfExtractor.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\Zip\ZipFile.Selector.cs">
|
||||
<Link>DotNetZip\Zip\ZipFile.Selector.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\Zip\ZipFile.x-IEnumerable.cs">
|
||||
<Link>DotNetZip\Zip\ZipFile.x-IEnumerable.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\Zip\ZipInputStream.cs">
|
||||
<Link>DotNetZip\Zip\ZipInputStream.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\Zip\ZipOutputStream.cs">
|
||||
<Link>DotNetZip\Zip\ZipOutputStream.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\Zip\ZipSegmentedStream.cs">
|
||||
<Link>DotNetZip\Zip\ZipSegmentedStream.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\Zlib\Deflate.cs">
|
||||
<Link>DotNetZip\Zlib\Deflate.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\Zlib\DeflateStream.cs">
|
||||
<Link>DotNetZip\Zlib\DeflateStream.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\Zlib\GZipStream.cs">
|
||||
<Link>DotNetZip\Zlib\GZipStream.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\Zlib\Inflate.cs">
|
||||
<Link>DotNetZip\Zlib\Inflate.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\Zlib\InfTree.cs">
|
||||
<Link>DotNetZip\Zlib\InfTree.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\Zlib\ParallelDeflateOutputStream.cs">
|
||||
<Link>DotNetZip\Zlib\ParallelDeflateOutputStream.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\Zlib\Tree.cs">
|
||||
<Link>DotNetZip\Zlib\Tree.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\Zlib\Zlib.cs">
|
||||
<Link>DotNetZip\Zlib\Zlib.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\Zlib\ZlibBaseStream.cs">
|
||||
<Link>DotNetZip\Zlib\ZlibBaseStream.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\Zlib\ZlibCodec.cs">
|
||||
<Link>DotNetZip\Zlib\ZlibCodec.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\Zlib\ZlibConstants.cs">
|
||||
<Link>DotNetZip\Zlib\ZlibConstants.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\Zlib\ZlibStream.cs">
|
||||
<Link>DotNetZip\Zlib\ZlibStream.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="BootstrapperLoop.cs" />
|
||||
<Compile Include="InstallLoop.cs" />
|
||||
<Compile Include="Interop\CertificateInterop.cs" />
|
||||
<Compile Include="FormStatus.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="FormStatus.Designer.cs">
|
||||
<DependentUpon>FormStatus.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Interop\NetworkAdapter.cs" />
|
||||
<Compile Include="Interop\NetworkInterop.cs" />
|
||||
<Compile Include="Interop\RegistryInterop.cs" />
|
||||
<Compile Include="Interop\ShutdownInterop.cs" />
|
||||
<Compile Include="Interop\InstallInterop.cs" />
|
||||
<Compile Include="Interop\WIMInterop.cs" />
|
||||
<Compile Include="IStatus.cs" />
|
||||
<Compile Include="NullStatus.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<EmbeddedResource Include="FormStatus.resx">
|
||||
<DependentUpon>FormStatus.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
<None Include="Properties\app.manifest" />
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Properties\Settings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BootstrapperPackage Include=".NETFramework,Version=v4.0,Profile=Client">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>Microsoft .NET Framework 4 Client Profile %28x86 and x64%29</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>Windows Installer 3.1</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="BootstrapperWorkstationInstall.vbs">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Icon.ico" />
|
||||
<Content Include="InstallBootstrapper.vbs" />
|
||||
<None Include="Resources\Background-BW.png" />
|
||||
<Content Include="UninstallBootstrapper.vbs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<ProjectExtensions>
|
||||
<VisualStudio>
|
||||
<UserProperties BuildVersion_StartDate="2001/1/1" BuildVersion_DetectChanges="False" BuildVersion_UpdateAssemblyVersion="False" BuildVersion_UpdateFileVersion="False" BuildVersion_UseGlobalSettings="True" BuildVersion_BuildAction="ReBuild" />
|
||||
</VisualStudio>
|
||||
</ProjectExtensions>
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>COPY "$(TargetPath)" "$(ProjectDir)..\Disco.Web\ClientBin"</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
|
||||
<ProductVersion>8.0.30703</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{15BD9561-A3C7-4608-9F7E-F1A1CFB60055}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Disco.ClientBootstrapper</RootNamespace>
|
||||
<AssemblyName>Disco.ClientBootstrapper</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<PublishUrl>publish\</PublishUrl>
|
||||
<Install>true</Install>
|
||||
<InstallFrom>Disk</InstallFrom>
|
||||
<UpdateEnabled>false</UpdateEnabled>
|
||||
<UpdateMode>Foreground</UpdateMode>
|
||||
<UpdateInterval>7</UpdateInterval>
|
||||
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
|
||||
<UpdatePeriodically>false</UpdatePeriodically>
|
||||
<UpdateRequired>false</UpdateRequired>
|
||||
<MapFileExtensions>true</MapFileExtensions>
|
||||
<ApplicationRevision>0</ApplicationRevision>
|
||||
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
|
||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<ApplicationManifest>Properties\app.manifest</ApplicationManifest>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisIgnoreBuiltInRuleSets>true</CodeAnalysisIgnoreBuiltInRuleSets>
|
||||
<CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisIgnoreBuiltInRuleSets>true</CodeAnalysisIgnoreBuiltInRuleSets>
|
||||
<CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<ApplicationIcon>Icon.ico</ApplicationIcon>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Management" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Deployment" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\BZip2\BitWriter.cs">
|
||||
<Link>DotNetZip\BZip2\BitWriter.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\BZip2\BZip2Compressor.cs">
|
||||
<Link>DotNetZip\BZip2\BZip2Compressor.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\BZip2\BZip2InputStream.cs">
|
||||
<Link>DotNetZip\BZip2\BZip2InputStream.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\BZip2\BZip2OutputStream.cs">
|
||||
<Link>DotNetZip\BZip2\BZip2OutputStream.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\BZip2\ParallelBZip2OutputStream.cs">
|
||||
<Link>DotNetZip\BZip2\ParallelBZip2OutputStream.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\BZip2\Rand.cs">
|
||||
<Link>DotNetZip\BZip2\Rand.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\CommonSrc\CRC32.cs">
|
||||
<Link>DotNetZip\CRC32.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\Zip\ComHelper.cs">
|
||||
<Link>DotNetZip\Zip\ComHelper.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\Zip\EncryptionAlgorithm.cs">
|
||||
<Link>DotNetZip\Zip\EncryptionAlgorithm.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\Zip\Events.cs">
|
||||
<Link>DotNetZip\Zip\Events.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\Zip\Exceptions.cs">
|
||||
<Link>DotNetZip\Zip\Exceptions.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\Zip\ExtractExistingFileAction.cs">
|
||||
<Link>DotNetZip\Zip\ExtractExistingFileAction.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\Zip\FileSelector.cs">
|
||||
<Link>DotNetZip\Zip\FileSelector.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\Zip\OffsetStream.cs">
|
||||
<Link>DotNetZip\Zip\OffsetStream.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\Zip\Shared.cs">
|
||||
<Link>DotNetZip\Zip\Shared.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\Zip\WinZipAes.cs">
|
||||
<Link>DotNetZip\Zip\WinZipAes.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\Zip\ZipConstants.cs">
|
||||
<Link>DotNetZip\Zip\ZipConstants.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\Zip\ZipCrypto.cs">
|
||||
<Link>DotNetZip\Zip\ZipCrypto.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\Zip\ZipDirEntry.cs">
|
||||
<Link>DotNetZip\Zip\ZipDirEntry.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\Zip\ZipEntry.cs">
|
||||
<Link>DotNetZip\Zip\ZipEntry.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\Zip\ZipEntry.Extract.cs">
|
||||
<Link>DotNetZip\Zip\ZipEntry.Extract.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\Zip\ZipEntry.Read.cs">
|
||||
<Link>DotNetZip\Zip\ZipEntry.Read.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\Zip\ZipEntry.Write.cs">
|
||||
<Link>DotNetZip\Zip\ZipEntry.Write.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\Zip\ZipEntrySource.cs">
|
||||
<Link>DotNetZip\Zip\ZipEntrySource.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\Zip\ZipErrorAction.cs">
|
||||
<Link>DotNetZip\Zip\ZipErrorAction.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\Zip\ZipFile.AddUpdate.cs">
|
||||
<Link>DotNetZip\Zip\ZipFile.AddUpdate.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\Zip\ZipFile.Check.cs">
|
||||
<Link>DotNetZip\Zip\ZipFile.Check.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\Zip\ZipFile.cs">
|
||||
<Link>DotNetZip\Zip\ZipFile.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\Zip\ZipFile.Events.cs">
|
||||
<Link>DotNetZip\Zip\ZipFile.Events.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\Zip\ZipFile.Extract.cs">
|
||||
<Link>DotNetZip\Zip\ZipFile.Extract.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\Zip\ZipFile.Read.cs">
|
||||
<Link>DotNetZip\Zip\ZipFile.Read.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\Zip\ZipFile.Save.cs">
|
||||
<Link>DotNetZip\Zip\ZipFile.Save.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\Zip\ZipFile.SaveSelfExtractor.cs">
|
||||
<Link>DotNetZip\Zip\ZipFile.SaveSelfExtractor.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\Zip\ZipFile.Selector.cs">
|
||||
<Link>DotNetZip\Zip\ZipFile.Selector.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\Zip\ZipFile.x-IEnumerable.cs">
|
||||
<Link>DotNetZip\Zip\ZipFile.x-IEnumerable.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\Zip\ZipInputStream.cs">
|
||||
<Link>DotNetZip\Zip\ZipInputStream.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\Zip\ZipOutputStream.cs">
|
||||
<Link>DotNetZip\Zip\ZipOutputStream.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\Zip\ZipSegmentedStream.cs">
|
||||
<Link>DotNetZip\Zip\ZipSegmentedStream.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\Zlib\Deflate.cs">
|
||||
<Link>DotNetZip\Zlib\Deflate.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\Zlib\DeflateStream.cs">
|
||||
<Link>DotNetZip\Zlib\DeflateStream.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\Zlib\GZipStream.cs">
|
||||
<Link>DotNetZip\Zlib\GZipStream.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\Zlib\Inflate.cs">
|
||||
<Link>DotNetZip\Zlib\Inflate.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\Zlib\InfTree.cs">
|
||||
<Link>DotNetZip\Zlib\InfTree.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\Zlib\ParallelDeflateOutputStream.cs">
|
||||
<Link>DotNetZip\Zlib\ParallelDeflateOutputStream.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\Zlib\Tree.cs">
|
||||
<Link>DotNetZip\Zlib\Tree.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\Zlib\Zlib.cs">
|
||||
<Link>DotNetZip\Zlib\Zlib.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\Zlib\ZlibBaseStream.cs">
|
||||
<Link>DotNetZip\Zlib\ZlibBaseStream.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\Zlib\ZlibCodec.cs">
|
||||
<Link>DotNetZip\Zlib\ZlibCodec.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\Zlib\ZlibConstants.cs">
|
||||
<Link>DotNetZip\Zlib\ZlibConstants.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Resources\Libraries\DotNetZip\Source\Zlib\ZlibStream.cs">
|
||||
<Link>DotNetZip\Zlib\ZlibStream.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="BootstrapperLoop.cs" />
|
||||
<Compile Include="InstallLoop.cs" />
|
||||
<Compile Include="Interop\CertificateInterop.cs" />
|
||||
<Compile Include="FormStatus.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="FormStatus.Designer.cs">
|
||||
<DependentUpon>FormStatus.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Interop\NetworkAdapter.cs" />
|
||||
<Compile Include="Interop\NetworkInterop.cs" />
|
||||
<Compile Include="Interop\RegistryInterop.cs" />
|
||||
<Compile Include="Interop\ShutdownInterop.cs" />
|
||||
<Compile Include="Interop\InstallInterop.cs" />
|
||||
<Compile Include="Interop\WIMInterop.cs" />
|
||||
<Compile Include="IStatus.cs" />
|
||||
<Compile Include="NullStatus.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<EmbeddedResource Include="FormStatus.resx">
|
||||
<DependentUpon>FormStatus.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
<None Include="Properties\app.manifest" />
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Properties\Settings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BootstrapperPackage Include=".NETFramework,Version=v4.0,Profile=Client">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>Microsoft .NET Framework 4 Client Profile %28x86 and x64%29</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>Windows Installer 3.1</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="BootstrapperWorkstationInstall.vbs">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Icon.ico" />
|
||||
<Content Include="InstallBootstrapper.vbs" />
|
||||
<None Include="Resources\Background-BW.png" />
|
||||
<Content Include="UninstallBootstrapper.vbs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<ProjectExtensions>
|
||||
<VisualStudio>
|
||||
<UserProperties BuildVersion_StartDate="2001/1/1" BuildVersion_DetectChanges="False" BuildVersion_UpdateAssemblyVersion="False" BuildVersion_UpdateFileVersion="False" BuildVersion_UseGlobalSettings="True" BuildVersion_BuildAction="ReBuild" />
|
||||
</VisualStudio>
|
||||
</ProjectExtensions>
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>COPY "$(TargetPath)" "$(ProjectDir)..\Disco.Web\ClientBin"</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
+125
-125
@@ -1,125 +1,125 @@
|
||||
namespace Disco.ClientBootstrapper
|
||||
{
|
||||
partial class FormStatus
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.labelHeading = new System.Windows.Forms.Label();
|
||||
this.progressBar = new System.Windows.Forms.ProgressBar();
|
||||
this.labelSubHeading = new System.Windows.Forms.Label();
|
||||
this.labelMessage = new System.Windows.Forms.Label();
|
||||
this.labelVersion = new System.Windows.Forms.Label();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// labelHeading
|
||||
//
|
||||
this.labelHeading.BackColor = System.Drawing.Color.Transparent;
|
||||
this.labelHeading.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.labelHeading.Location = new System.Drawing.Point(15, 15);
|
||||
this.labelHeading.Name = "labelHeading";
|
||||
this.labelHeading.Size = new System.Drawing.Size(270, 20);
|
||||
this.labelHeading.TabIndex = 0;
|
||||
this.labelHeading.Text = "System Preparation";
|
||||
//
|
||||
// progressBar
|
||||
//
|
||||
this.progressBar.BackColor = System.Drawing.Color.White;
|
||||
this.progressBar.Location = new System.Drawing.Point(15, 100);
|
||||
this.progressBar.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.progressBar.MarqueeAnimationSpeed = 50;
|
||||
this.progressBar.Name = "progressBar";
|
||||
this.progressBar.Size = new System.Drawing.Size(381, 15);
|
||||
this.progressBar.Style = System.Windows.Forms.ProgressBarStyle.Marquee;
|
||||
this.progressBar.TabIndex = 1;
|
||||
this.progressBar.Visible = false;
|
||||
//
|
||||
// labelSubHeading
|
||||
//
|
||||
this.labelSubHeading.BackColor = System.Drawing.Color.White;
|
||||
this.labelSubHeading.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.labelSubHeading.Location = new System.Drawing.Point(15, 35);
|
||||
this.labelSubHeading.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||
this.labelSubHeading.Name = "labelSubHeading";
|
||||
this.labelSubHeading.Size = new System.Drawing.Size(381, 20);
|
||||
this.labelSubHeading.TabIndex = 2;
|
||||
//
|
||||
// labelMessage
|
||||
//
|
||||
this.labelMessage.BackColor = System.Drawing.Color.White;
|
||||
this.labelMessage.Location = new System.Drawing.Point(15, 55);
|
||||
this.labelMessage.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||
this.labelMessage.Name = "labelMessage";
|
||||
this.labelMessage.Size = new System.Drawing.Size(381, 60);
|
||||
this.labelMessage.TabIndex = 3;
|
||||
//
|
||||
// labelVersion
|
||||
//
|
||||
this.labelVersion.BackColor = System.Drawing.Color.White;
|
||||
this.labelVersion.Font = new System.Drawing.Font("Microsoft Sans Serif", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.labelVersion.ForeColor = System.Drawing.Color.Gray;
|
||||
this.labelVersion.Location = new System.Drawing.Point(229, 15);
|
||||
this.labelVersion.Name = "labelVersion";
|
||||
this.labelVersion.Size = new System.Drawing.Size(167, 20);
|
||||
this.labelVersion.TabIndex = 0;
|
||||
this.labelVersion.Text = "Disco Bootstrapper v";
|
||||
this.labelVersion.TextAlign = System.Drawing.ContentAlignment.TopRight;
|
||||
//
|
||||
// FormStatus
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.BackgroundImage = global::Disco.ClientBootstrapper.Properties.Resources.Background_BW;
|
||||
this.ClientSize = new System.Drawing.Size(411, 130);
|
||||
this.Controls.Add(this.labelHeading);
|
||||
this.Controls.Add(this.labelSubHeading);
|
||||
this.Controls.Add(this.progressBar);
|
||||
this.Controls.Add(this.labelVersion);
|
||||
this.Controls.Add(this.labelMessage);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "FormStatus";
|
||||
this.ShowIcon = false;
|
||||
this.ShowInTaskbar = false;
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "Disco - Client Bootstrapper";
|
||||
this.TopMost = true;
|
||||
this.TransparencyKey = System.Drawing.Color.Magenta;
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Label labelHeading;
|
||||
private System.Windows.Forms.ProgressBar progressBar;
|
||||
private System.Windows.Forms.Label labelSubHeading;
|
||||
private System.Windows.Forms.Label labelMessage;
|
||||
private System.Windows.Forms.Label labelVersion;
|
||||
}
|
||||
}
|
||||
|
||||
namespace Disco.ClientBootstrapper
|
||||
{
|
||||
partial class FormStatus
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.labelHeading = new System.Windows.Forms.Label();
|
||||
this.progressBar = new System.Windows.Forms.ProgressBar();
|
||||
this.labelSubHeading = new System.Windows.Forms.Label();
|
||||
this.labelMessage = new System.Windows.Forms.Label();
|
||||
this.labelVersion = new System.Windows.Forms.Label();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// labelHeading
|
||||
//
|
||||
this.labelHeading.BackColor = System.Drawing.Color.Transparent;
|
||||
this.labelHeading.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.labelHeading.Location = new System.Drawing.Point(15, 15);
|
||||
this.labelHeading.Name = "labelHeading";
|
||||
this.labelHeading.Size = new System.Drawing.Size(270, 20);
|
||||
this.labelHeading.TabIndex = 0;
|
||||
this.labelHeading.Text = "System Preparation";
|
||||
//
|
||||
// progressBar
|
||||
//
|
||||
this.progressBar.BackColor = System.Drawing.Color.White;
|
||||
this.progressBar.Location = new System.Drawing.Point(15, 100);
|
||||
this.progressBar.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.progressBar.MarqueeAnimationSpeed = 50;
|
||||
this.progressBar.Name = "progressBar";
|
||||
this.progressBar.Size = new System.Drawing.Size(381, 15);
|
||||
this.progressBar.Style = System.Windows.Forms.ProgressBarStyle.Marquee;
|
||||
this.progressBar.TabIndex = 1;
|
||||
this.progressBar.Visible = false;
|
||||
//
|
||||
// labelSubHeading
|
||||
//
|
||||
this.labelSubHeading.BackColor = System.Drawing.Color.White;
|
||||
this.labelSubHeading.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.labelSubHeading.Location = new System.Drawing.Point(15, 35);
|
||||
this.labelSubHeading.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||
this.labelSubHeading.Name = "labelSubHeading";
|
||||
this.labelSubHeading.Size = new System.Drawing.Size(381, 20);
|
||||
this.labelSubHeading.TabIndex = 2;
|
||||
//
|
||||
// labelMessage
|
||||
//
|
||||
this.labelMessage.BackColor = System.Drawing.Color.White;
|
||||
this.labelMessage.Location = new System.Drawing.Point(15, 55);
|
||||
this.labelMessage.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||
this.labelMessage.Name = "labelMessage";
|
||||
this.labelMessage.Size = new System.Drawing.Size(381, 60);
|
||||
this.labelMessage.TabIndex = 3;
|
||||
//
|
||||
// labelVersion
|
||||
//
|
||||
this.labelVersion.BackColor = System.Drawing.Color.White;
|
||||
this.labelVersion.Font = new System.Drawing.Font("Microsoft Sans Serif", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.labelVersion.ForeColor = System.Drawing.Color.Gray;
|
||||
this.labelVersion.Location = new System.Drawing.Point(229, 15);
|
||||
this.labelVersion.Name = "labelVersion";
|
||||
this.labelVersion.Size = new System.Drawing.Size(167, 20);
|
||||
this.labelVersion.TabIndex = 0;
|
||||
this.labelVersion.Text = "Disco Bootstrapper v";
|
||||
this.labelVersion.TextAlign = System.Drawing.ContentAlignment.TopRight;
|
||||
//
|
||||
// FormStatus
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.BackgroundImage = global::Disco.ClientBootstrapper.Properties.Resources.Background_BW;
|
||||
this.ClientSize = new System.Drawing.Size(411, 130);
|
||||
this.Controls.Add(this.labelHeading);
|
||||
this.Controls.Add(this.labelSubHeading);
|
||||
this.Controls.Add(this.progressBar);
|
||||
this.Controls.Add(this.labelVersion);
|
||||
this.Controls.Add(this.labelMessage);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "FormStatus";
|
||||
this.ShowIcon = false;
|
||||
this.ShowInTaskbar = false;
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "Disco - Client Bootstrapper";
|
||||
this.TopMost = true;
|
||||
this.TransparencyKey = System.Drawing.Color.Magenta;
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Label labelHeading;
|
||||
private System.Windows.Forms.ProgressBar progressBar;
|
||||
private System.Windows.Forms.Label labelSubHeading;
|
||||
private System.Windows.Forms.Label labelMessage;
|
||||
private System.Windows.Forms.Label labelVersion;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,82 +1,82 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Disco.ClientBootstrapper
|
||||
{
|
||||
public partial class FormStatus : Form, IStatus
|
||||
{
|
||||
|
||||
private delegate void dUpdateStatus(string Heading, string SubHeading, string Message, Nullable<bool> ShowProgress, Nullable<int> Progress);
|
||||
private dUpdateStatus mUpdateStatus;
|
||||
|
||||
public FormStatus()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
var version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
|
||||
this.labelVersion.Text = string.Format("v{0}", version.ToString(3));
|
||||
|
||||
this.FormClosed += new FormClosedEventHandler(FormStatus_FormClosed);
|
||||
|
||||
mUpdateStatus = new dUpdateStatus(UpdateStatusDo);
|
||||
Cursor.Hide();
|
||||
}
|
||||
|
||||
void FormStatus_FormClosed(object sender, FormClosedEventArgs e)
|
||||
{
|
||||
Cursor.Show();
|
||||
Program.ExitApplication();
|
||||
}
|
||||
|
||||
public void UpdateStatus(string Heading, string SubHeading, string Message, Nullable<bool> ShowProgress = null, Nullable<int> Progress = null)
|
||||
{
|
||||
try
|
||||
{
|
||||
this.Invoke(mUpdateStatus, Heading, SubHeading, Message, ShowProgress, Progress);
|
||||
}
|
||||
catch (Exception) { }
|
||||
}
|
||||
private void UpdateStatusDo(string Heading, string SubHeading, string Message, Nullable<bool> ShowProgress, Nullable<int> Progress)
|
||||
{
|
||||
if (Heading != null)
|
||||
if (this.labelHeading.Text != Heading)
|
||||
this.labelHeading.Text = Heading;
|
||||
if (SubHeading != null)
|
||||
if (this.labelSubHeading.Text != SubHeading)
|
||||
this.labelSubHeading.Text = SubHeading;
|
||||
if (Message != null)
|
||||
if (this.labelMessage.Text != Message)
|
||||
this.labelMessage.Text = Message;
|
||||
|
||||
if (ShowProgress.HasValue)
|
||||
{
|
||||
if (ShowProgress.Value)
|
||||
{
|
||||
this.progressBar.Visible = true;
|
||||
if (Progress.HasValue)
|
||||
{
|
||||
if (Progress.Value > 0)
|
||||
{
|
||||
this.progressBar.Value = Math.Min(Progress.Value, 100);
|
||||
this.progressBar.Style = ProgressBarStyle.Continuous;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.progressBar.Style = ProgressBarStyle.Marquee;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.progressBar.Visible = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Disco.ClientBootstrapper
|
||||
{
|
||||
public partial class FormStatus : Form, IStatus
|
||||
{
|
||||
|
||||
private delegate void dUpdateStatus(string Heading, string SubHeading, string Message, Nullable<bool> ShowProgress, Nullable<int> Progress);
|
||||
private dUpdateStatus mUpdateStatus;
|
||||
|
||||
public FormStatus()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
var version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
|
||||
this.labelVersion.Text = string.Format("v{0}", version.ToString(3));
|
||||
|
||||
this.FormClosed += new FormClosedEventHandler(FormStatus_FormClosed);
|
||||
|
||||
mUpdateStatus = new dUpdateStatus(UpdateStatusDo);
|
||||
Cursor.Hide();
|
||||
}
|
||||
|
||||
void FormStatus_FormClosed(object sender, FormClosedEventArgs e)
|
||||
{
|
||||
Cursor.Show();
|
||||
Program.ExitApplication();
|
||||
}
|
||||
|
||||
public void UpdateStatus(string Heading, string SubHeading, string Message, Nullable<bool> ShowProgress = null, Nullable<int> Progress = null)
|
||||
{
|
||||
try
|
||||
{
|
||||
this.Invoke(mUpdateStatus, Heading, SubHeading, Message, ShowProgress, Progress);
|
||||
}
|
||||
catch (Exception) { }
|
||||
}
|
||||
private void UpdateStatusDo(string Heading, string SubHeading, string Message, Nullable<bool> ShowProgress, Nullable<int> Progress)
|
||||
{
|
||||
if (Heading != null)
|
||||
if (this.labelHeading.Text != Heading)
|
||||
this.labelHeading.Text = Heading;
|
||||
if (SubHeading != null)
|
||||
if (this.labelSubHeading.Text != SubHeading)
|
||||
this.labelSubHeading.Text = SubHeading;
|
||||
if (Message != null)
|
||||
if (this.labelMessage.Text != Message)
|
||||
this.labelMessage.Text = Message;
|
||||
|
||||
if (ShowProgress.HasValue)
|
||||
{
|
||||
if (ShowProgress.Value)
|
||||
{
|
||||
this.progressBar.Visible = true;
|
||||
if (Progress.HasValue)
|
||||
{
|
||||
if (Progress.Value > 0)
|
||||
{
|
||||
this.progressBar.Value = Math.Min(Progress.Value, 100);
|
||||
this.progressBar.Style = ProgressBarStyle.Continuous;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.progressBar.Style = ProgressBarStyle.Marquee;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.progressBar.Visible = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,120 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
@@ -1,12 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace Disco.ClientBootstrapper
|
||||
{
|
||||
interface IStatus
|
||||
{
|
||||
void UpdateStatus(string Heading, string SubHeading, string Message, Nullable<bool> ShowProgress = null, Nullable<int> Progress = null);
|
||||
}
|
||||
}
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace Disco.ClientBootstrapper
|
||||
{
|
||||
interface IStatus
|
||||
{
|
||||
void UpdateStatus(string Heading, string SubHeading, string Message, Nullable<bool> ShowProgress = null, Nullable<int> Progress = null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,62 +1,62 @@
|
||||
Option Explicit
|
||||
|
||||
Dim objFSO, objReg, objShell, objFile
|
||||
Dim SourceFolder, DestinationFolder, GroupPolicyScriptLocation
|
||||
Const HKLM = &H80000002
|
||||
|
||||
DestinationFolder = "C:\Disco"
|
||||
|
||||
Set objFSO = CreateObject("Scripting.FileSystemObject")
|
||||
Set objReg = GetObject("winmgmts:root\default:StdRegProv")
|
||||
Set objShell = CreateObject("WScript.Shell")
|
||||
|
||||
If objFSO.FolderExists(DestinationFolder) Then
|
||||
Call objFSO.DeleteFolder(DestinationFolder)
|
||||
End If
|
||||
Call objFSO.CreateFolder(DestinationFolder)
|
||||
SourceFolder = Mid(WScript.ScriptFullName, 1, InStrRev(WScript.ScriptFullName, "\"))
|
||||
Call objFSO.CopyFile(SourceFolder & "*.*", DestinationFolder, True)
|
||||
|
||||
GroupPolicyScriptLocation = objShell.ExpandEnvironmentStrings("%WinDir%\System32\GroupPolicy\Machine\Scripts\scripts.ini")
|
||||
If objFSO.FileExists(GroupPolicyScriptLocation) Then
|
||||
Call objFSO.DeleteFile(GroupPolicyScriptLocation)
|
||||
End If
|
||||
Set objFile = objFSO.CreateTextFile(GroupPolicyScriptLocation, True, True)
|
||||
Call objFile.WriteLine()
|
||||
Call objFile.WriteLine("[Startup]")
|
||||
Call objFile.WriteLine("0CmdLine=C:\Disco\Disco.ClientBootstrapper.exe")
|
||||
Call objFile.WriteLine("0Parameters=/Uninstall")
|
||||
Call objFile.Close()
|
||||
Set objFile = Nothing
|
||||
|
||||
Set objFSO = Nothing
|
||||
|
||||
Call objReg.SetDWORDValue(HKLM, "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "HideStartupScripts", 0)
|
||||
Call objReg.SetDWORDValue (HKLM, "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "RunStartupScriptSync", 1)
|
||||
|
||||
Call objReg.CreateKey(HKLM, "SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\Scripts\Shutdown")
|
||||
Call objReg.CreateKey(HKLM, "SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\Scripts\Startup\0\0")
|
||||
Call objReg.SetStringValue(HKLM, "SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\Scripts\Startup\0", "GPO-ID", "LocalGPO")
|
||||
Call objReg.SetStringValue(HKLM, "SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\Scripts\Startup\0", "SOM-ID", "Local")
|
||||
Call objReg.SetStringValue(HKLM, "SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\Scripts\Startup\0", "FileSysPath", "C:\WINDOWS\System32\GroupPolicy\Machine")
|
||||
Call objReg.SetStringValue(HKLM, "SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\Scripts\Startup\0", "DisplayName", "Local Group Policy")
|
||||
Call objReg.SetStringValue(HKLM, "SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\Scripts\Startup\0", "GPOName", "Local Group Policy")
|
||||
Call objReg.SetDWORDValue(HKLM, "SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\Scripts\Startup\0", "PSScriptOrder", 1)
|
||||
Call objReg.SetStringValue(HKLM, "SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\Scripts\Startup\0\0", "Script", DestinationFolder & "\Disco.ClientBootstrapper.exe")
|
||||
Call objReg.SetStringValue(HKLM, "SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\Scripts\Startup\0\0", "Parameters", "/Uninstall")
|
||||
Call objReg.SetDWORDValue(HKLM, "SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\Scripts\Startup\0\0", "IsPowershell", 0)
|
||||
Call objReg.SetBinaryValue(HKLM, "SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\Scripts\Startup\0\0", "ExecTime", array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0))
|
||||
|
||||
Call objReg.CreateKey(HKLM, "SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\State\Machine\Scripts\Shutdown")
|
||||
Call objReg.CreateKey(HKLM, "SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\State\Machine\Scripts\Startup\0\0")
|
||||
Call objReg.SetStringValue(HKLM, "SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\State\Machine\Scripts\Startup\0", "GPO-ID", "LocalGPO")
|
||||
Call objReg.SetStringValue(HKLM, "SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\State\Machine\Scripts\Startup\0", "SOM-ID", "Local")
|
||||
Call objReg.SetStringValue(HKLM, "SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\State\Machine\Scripts\Startup\0", "FileSysPath", "C:\Windows\System32\GroupPolicy\Machine")
|
||||
Call objReg.SetStringValue(HKLM, "SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\State\Machine\Scripts\Startup\0", "DisplayName", "Local Group Policy")
|
||||
Call objReg.SetStringValue(HKLM, "SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\State\Machine\Scripts\Startup\0", "GPOName", "Local Group Policy")
|
||||
Call objReg.SetDWORDValue(HKLM, "SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\State\Machine\Scripts\Startup\0", "PSScriptOrder", 1)
|
||||
Call objReg.SetStringValue(HKLM, "SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\State\Machine\Scripts\Startup\0\0", "Script", DestinationFolder & "\Disco.ClientBootstrapper.exe")
|
||||
Call objReg.SetStringValue(HKLM, "SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\State\Machine\Scripts\Startup\0\0", "Parameters", "/Uninstall")
|
||||
Call objReg.SetBinaryValue(HKLM, "SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\State\Machine\Scripts\Startup\0\0", "ExecTime", array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0))
|
||||
|
||||
Option Explicit
|
||||
|
||||
Dim objFSO, objReg, objShell, objFile
|
||||
Dim SourceFolder, DestinationFolder, GroupPolicyScriptLocation
|
||||
Const HKLM = &H80000002
|
||||
|
||||
DestinationFolder = "C:\Disco"
|
||||
|
||||
Set objFSO = CreateObject("Scripting.FileSystemObject")
|
||||
Set objReg = GetObject("winmgmts:root\default:StdRegProv")
|
||||
Set objShell = CreateObject("WScript.Shell")
|
||||
|
||||
If objFSO.FolderExists(DestinationFolder) Then
|
||||
Call objFSO.DeleteFolder(DestinationFolder)
|
||||
End If
|
||||
Call objFSO.CreateFolder(DestinationFolder)
|
||||
SourceFolder = Mid(WScript.ScriptFullName, 1, InStrRev(WScript.ScriptFullName, "\"))
|
||||
Call objFSO.CopyFile(SourceFolder & "*.*", DestinationFolder, True)
|
||||
|
||||
GroupPolicyScriptLocation = objShell.ExpandEnvironmentStrings("%WinDir%\System32\GroupPolicy\Machine\Scripts\scripts.ini")
|
||||
If objFSO.FileExists(GroupPolicyScriptLocation) Then
|
||||
Call objFSO.DeleteFile(GroupPolicyScriptLocation)
|
||||
End If
|
||||
Set objFile = objFSO.CreateTextFile(GroupPolicyScriptLocation, True, True)
|
||||
Call objFile.WriteLine()
|
||||
Call objFile.WriteLine("[Startup]")
|
||||
Call objFile.WriteLine("0CmdLine=C:\Disco\Disco.ClientBootstrapper.exe")
|
||||
Call objFile.WriteLine("0Parameters=/Uninstall")
|
||||
Call objFile.Close()
|
||||
Set objFile = Nothing
|
||||
|
||||
Set objFSO = Nothing
|
||||
|
||||
Call objReg.SetDWORDValue(HKLM, "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "HideStartupScripts", 0)
|
||||
Call objReg.SetDWORDValue (HKLM, "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "RunStartupScriptSync", 1)
|
||||
|
||||
Call objReg.CreateKey(HKLM, "SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\Scripts\Shutdown")
|
||||
Call objReg.CreateKey(HKLM, "SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\Scripts\Startup\0\0")
|
||||
Call objReg.SetStringValue(HKLM, "SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\Scripts\Startup\0", "GPO-ID", "LocalGPO")
|
||||
Call objReg.SetStringValue(HKLM, "SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\Scripts\Startup\0", "SOM-ID", "Local")
|
||||
Call objReg.SetStringValue(HKLM, "SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\Scripts\Startup\0", "FileSysPath", "C:\WINDOWS\System32\GroupPolicy\Machine")
|
||||
Call objReg.SetStringValue(HKLM, "SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\Scripts\Startup\0", "DisplayName", "Local Group Policy")
|
||||
Call objReg.SetStringValue(HKLM, "SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\Scripts\Startup\0", "GPOName", "Local Group Policy")
|
||||
Call objReg.SetDWORDValue(HKLM, "SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\Scripts\Startup\0", "PSScriptOrder", 1)
|
||||
Call objReg.SetStringValue(HKLM, "SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\Scripts\Startup\0\0", "Script", DestinationFolder & "\Disco.ClientBootstrapper.exe")
|
||||
Call objReg.SetStringValue(HKLM, "SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\Scripts\Startup\0\0", "Parameters", "/Uninstall")
|
||||
Call objReg.SetDWORDValue(HKLM, "SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\Scripts\Startup\0\0", "IsPowershell", 0)
|
||||
Call objReg.SetBinaryValue(HKLM, "SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\Scripts\Startup\0\0", "ExecTime", array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0))
|
||||
|
||||
Call objReg.CreateKey(HKLM, "SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\State\Machine\Scripts\Shutdown")
|
||||
Call objReg.CreateKey(HKLM, "SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\State\Machine\Scripts\Startup\0\0")
|
||||
Call objReg.SetStringValue(HKLM, "SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\State\Machine\Scripts\Startup\0", "GPO-ID", "LocalGPO")
|
||||
Call objReg.SetStringValue(HKLM, "SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\State\Machine\Scripts\Startup\0", "SOM-ID", "Local")
|
||||
Call objReg.SetStringValue(HKLM, "SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\State\Machine\Scripts\Startup\0", "FileSysPath", "C:\Windows\System32\GroupPolicy\Machine")
|
||||
Call objReg.SetStringValue(HKLM, "SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\State\Machine\Scripts\Startup\0", "DisplayName", "Local Group Policy")
|
||||
Call objReg.SetStringValue(HKLM, "SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\State\Machine\Scripts\Startup\0", "GPOName", "Local Group Policy")
|
||||
Call objReg.SetDWORDValue(HKLM, "SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\State\Machine\Scripts\Startup\0", "PSScriptOrder", 1)
|
||||
Call objReg.SetStringValue(HKLM, "SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\State\Machine\Scripts\Startup\0\0", "Script", DestinationFolder & "\Disco.ClientBootstrapper.exe")
|
||||
Call objReg.SetStringValue(HKLM, "SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\State\Machine\Scripts\Startup\0\0", "Parameters", "/Uninstall")
|
||||
Call objReg.SetBinaryValue(HKLM, "SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\State\Machine\Scripts\Startup\0\0", "ExecTime", array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0))
|
||||
|
||||
Set objReg = Nothing
|
||||
@@ -1,55 +1,55 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
|
||||
namespace Disco.ClientBootstrapper
|
||||
{
|
||||
class InstallLoop
|
||||
{
|
||||
|
||||
public Thread LoopThread;
|
||||
public delegate void CompleteCallback();
|
||||
private CompleteCallback mCompleteCallback;
|
||||
private string InstallLocation;
|
||||
private string WimImageId;
|
||||
|
||||
public InstallLoop(string InstallLocation, string WimImageId = null)
|
||||
{
|
||||
this.InstallLocation = InstallLocation;
|
||||
this.WimImageId = WimImageId;
|
||||
}
|
||||
|
||||
public void Start(CompleteCallback Callback)
|
||||
{
|
||||
this.mCompleteCallback = Callback;
|
||||
this.LoopThread = new Thread(new ThreadStart(loopHost));
|
||||
this.LoopThread.Start();
|
||||
}
|
||||
private void loopHost()
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
//Program.Status.UpdateStatus(null, null, "Testing UI");
|
||||
//Program.SleepThread(5000, false);
|
||||
Interop.InstallInterop.Install(this.InstallLocation, this.WimImageId);
|
||||
if (this.mCompleteCallback != null)
|
||||
{
|
||||
this.mCompleteCallback.BeginInvoke(null, null);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if (ex.GetType() == typeof(ThreadAbortException))
|
||||
return;
|
||||
if (ex.GetType() == typeof(ThreadInterruptedException))
|
||||
return;
|
||||
Program.WriteAppError(ex);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
|
||||
namespace Disco.ClientBootstrapper
|
||||
{
|
||||
class InstallLoop
|
||||
{
|
||||
|
||||
public Thread LoopThread;
|
||||
public delegate void CompleteCallback();
|
||||
private CompleteCallback mCompleteCallback;
|
||||
private string InstallLocation;
|
||||
private string WimImageId;
|
||||
|
||||
public InstallLoop(string InstallLocation, string WimImageId = null)
|
||||
{
|
||||
this.InstallLocation = InstallLocation;
|
||||
this.WimImageId = WimImageId;
|
||||
}
|
||||
|
||||
public void Start(CompleteCallback Callback)
|
||||
{
|
||||
this.mCompleteCallback = Callback;
|
||||
this.LoopThread = new Thread(new ThreadStart(loopHost));
|
||||
this.LoopThread.Start();
|
||||
}
|
||||
private void loopHost()
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
//Program.Status.UpdateStatus(null, null, "Testing UI");
|
||||
//Program.SleepThread(5000, false);
|
||||
Interop.InstallInterop.Install(this.InstallLocation, this.WimImageId);
|
||||
if (this.mCompleteCallback != null)
|
||||
{
|
||||
this.mCompleteCallback.BeginInvoke(null, null);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if (ex.GetType() == typeof(ThreadAbortException))
|
||||
return;
|
||||
if (ex.GetType() == typeof(ThreadInterruptedException))
|
||||
return;
|
||||
Program.WriteAppError(ex);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,180 +1,180 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.IO;
|
||||
|
||||
namespace Disco.ClientBootstrapper.Interop
|
||||
{
|
||||
public static class CertificateInterop
|
||||
{
|
||||
private static List<string> _tempCerts;
|
||||
public static void RemoveTempCerts()
|
||||
{
|
||||
if (_tempCerts != null && _tempCerts.Count > 0)
|
||||
{
|
||||
Remove(StoreName.My, StoreLocation.LocalMachine, _tempCerts);
|
||||
Remove(StoreName.CertificateAuthority, StoreLocation.LocalMachine, _tempCerts);
|
||||
Remove(StoreName.Root, StoreLocation.LocalMachine, _tempCerts);
|
||||
}
|
||||
}
|
||||
public static void AddTempCerts()
|
||||
{
|
||||
if (_tempCerts == null)
|
||||
_tempCerts = new List<string>();
|
||||
|
||||
var inlineCertificateLocation = Program.InlinePath.Value;
|
||||
|
||||
// Root Certificates
|
||||
try
|
||||
{
|
||||
var CertFiles = Directory.EnumerateFiles(inlineCertificateLocation, "WLAN_Cert_Root_*.*").ToList();
|
||||
if (CertFiles.Count > 0)
|
||||
{
|
||||
foreach (var certFile in CertFiles)
|
||||
{
|
||||
var cert = new X509Certificate2(File.ReadAllBytes(certFile), "password");
|
||||
var result = Add(StoreName.Root, StoreLocation.LocalMachine, cert);
|
||||
if (result)
|
||||
{
|
||||
if (Path.GetFileNameWithoutExtension(certFile).ToLower().Contains("temp"))
|
||||
_tempCerts.Add(cert.SerialNumber);
|
||||
Program.Status.UpdateStatus(null, null, string.Format("Added Root Certificate: {0}", cert.ShortSubjectName()));
|
||||
Program.SleepThread(500, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
|
||||
// Intermediate Certificates
|
||||
try
|
||||
{
|
||||
var CertFiles = Directory.EnumerateFiles(inlineCertificateLocation, "WLAN_Cert_Intermediate_*.*").ToList();
|
||||
if (CertFiles.Count > 0)
|
||||
{
|
||||
foreach (var certFile in CertFiles)
|
||||
{
|
||||
var cert = new X509Certificate2(File.ReadAllBytes(certFile), "password");
|
||||
var result = Add(StoreName.CertificateAuthority, StoreLocation.LocalMachine, cert);
|
||||
if (result)
|
||||
{
|
||||
if (Path.GetFileNameWithoutExtension(certFile).ToLower().Contains("temp"))
|
||||
_tempCerts.Add(cert.SerialNumber);
|
||||
Program.Status.UpdateStatus(null, null, string.Format("Added Intermediate Certificate: {0}", cert.ShortSubjectName()));
|
||||
Program.SleepThread(500, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
|
||||
// Host/Personal Certificates
|
||||
try
|
||||
{
|
||||
var CertFiles = Directory.EnumerateFiles(inlineCertificateLocation, "WLAN_Cert_Personal_*.*").ToList();
|
||||
if (CertFiles.Count > 0)
|
||||
{
|
||||
foreach (var certFile in CertFiles)
|
||||
{
|
||||
var cert = new X509Certificate2(File.ReadAllBytes(certFile), "password", X509KeyStorageFlags.MachineKeySet | X509KeyStorageFlags.PersistKeySet);
|
||||
var result = Add(StoreName.My, StoreLocation.LocalMachine, cert);
|
||||
if (result)
|
||||
{
|
||||
if (Path.GetFileNameWithoutExtension(certFile).ToLower().Contains("temp"))
|
||||
_tempCerts.Add(cert.SerialNumber);
|
||||
Program.Status.UpdateStatus(null, null, string.Format("Added Host Certificate: {0}", cert.ShortSubjectName()));
|
||||
Program.SleepThread(500, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
public static string ShortSubjectName(this X509Certificate2 Certificate)
|
||||
{
|
||||
string s = Certificate.Subject;
|
||||
return s.Substring(s.IndexOf("=") + 1, s.IndexOf(",") - s.IndexOf("=") - 1);
|
||||
}
|
||||
|
||||
public static bool Add(StoreName StoreName, StoreLocation StoreLocation, X509Certificate2 Certificate)
|
||||
{
|
||||
var certStore = new X509Store(StoreName, StoreLocation);
|
||||
bool certAlreadyExists = false;
|
||||
certStore.Open(OpenFlags.ReadWrite);
|
||||
foreach (var cert in certStore.Certificates)
|
||||
{
|
||||
if (cert.SerialNumber.Equals(Certificate.SerialNumber))
|
||||
{
|
||||
certAlreadyExists = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!certAlreadyExists)
|
||||
{
|
||||
certStore.Add(Certificate);
|
||||
}
|
||||
certStore.Close();
|
||||
return !certAlreadyExists;
|
||||
}
|
||||
|
||||
public static bool Remove(StoreName StoreName, StoreLocation StoreLocation, List<Regex> RegexMatches, string SerialException)
|
||||
{
|
||||
var certStore = new X509Store(StoreName, StoreLocation);
|
||||
var removeCerts = new List<X509Certificate2>();
|
||||
certStore.Open(OpenFlags.ReadWrite);
|
||||
foreach (var cert in certStore.Certificates)
|
||||
{
|
||||
if (!cert.SerialNumber.Equals(SerialException))
|
||||
{
|
||||
foreach (var subjectRegex in RegexMatches)
|
||||
{
|
||||
if (subjectRegex.IsMatch(cert.Subject))
|
||||
{
|
||||
removeCerts.Add(cert);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
foreach (var cert in removeCerts)
|
||||
{
|
||||
certStore.Remove(cert);
|
||||
}
|
||||
certStore.Close();
|
||||
return (removeCerts.Count > 0);
|
||||
}
|
||||
public static bool Remove(StoreName StoreName, StoreLocation StoreLocation, List<string> CertificateSerials)
|
||||
{
|
||||
var certStore = new X509Store(StoreName, StoreLocation);
|
||||
var removeCerts = new List<X509Certificate2>();
|
||||
certStore.Open(OpenFlags.ReadWrite);
|
||||
foreach (var cert in certStore.Certificates)
|
||||
{
|
||||
if (CertificateSerials.Contains(cert.SerialNumber))
|
||||
{
|
||||
removeCerts.Add(cert);
|
||||
}
|
||||
}
|
||||
foreach (var cert in removeCerts)
|
||||
{
|
||||
certStore.Remove(cert);
|
||||
}
|
||||
certStore.Close();
|
||||
return (removeCerts.Count > 0);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.IO;
|
||||
|
||||
namespace Disco.ClientBootstrapper.Interop
|
||||
{
|
||||
public static class CertificateInterop
|
||||
{
|
||||
private static List<string> _tempCerts;
|
||||
public static void RemoveTempCerts()
|
||||
{
|
||||
if (_tempCerts != null && _tempCerts.Count > 0)
|
||||
{
|
||||
Remove(StoreName.My, StoreLocation.LocalMachine, _tempCerts);
|
||||
Remove(StoreName.CertificateAuthority, StoreLocation.LocalMachine, _tempCerts);
|
||||
Remove(StoreName.Root, StoreLocation.LocalMachine, _tempCerts);
|
||||
}
|
||||
}
|
||||
public static void AddTempCerts()
|
||||
{
|
||||
if (_tempCerts == null)
|
||||
_tempCerts = new List<string>();
|
||||
|
||||
var inlineCertificateLocation = Program.InlinePath.Value;
|
||||
|
||||
// Root Certificates
|
||||
try
|
||||
{
|
||||
var CertFiles = Directory.EnumerateFiles(inlineCertificateLocation, "WLAN_Cert_Root_*.*").ToList();
|
||||
if (CertFiles.Count > 0)
|
||||
{
|
||||
foreach (var certFile in CertFiles)
|
||||
{
|
||||
var cert = new X509Certificate2(File.ReadAllBytes(certFile), "password");
|
||||
var result = Add(StoreName.Root, StoreLocation.LocalMachine, cert);
|
||||
if (result)
|
||||
{
|
||||
if (Path.GetFileNameWithoutExtension(certFile).ToLower().Contains("temp"))
|
||||
_tempCerts.Add(cert.SerialNumber);
|
||||
Program.Status.UpdateStatus(null, null, string.Format("Added Root Certificate: {0}", cert.ShortSubjectName()));
|
||||
Program.SleepThread(500, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
|
||||
// Intermediate Certificates
|
||||
try
|
||||
{
|
||||
var CertFiles = Directory.EnumerateFiles(inlineCertificateLocation, "WLAN_Cert_Intermediate_*.*").ToList();
|
||||
if (CertFiles.Count > 0)
|
||||
{
|
||||
foreach (var certFile in CertFiles)
|
||||
{
|
||||
var cert = new X509Certificate2(File.ReadAllBytes(certFile), "password");
|
||||
var result = Add(StoreName.CertificateAuthority, StoreLocation.LocalMachine, cert);
|
||||
if (result)
|
||||
{
|
||||
if (Path.GetFileNameWithoutExtension(certFile).ToLower().Contains("temp"))
|
||||
_tempCerts.Add(cert.SerialNumber);
|
||||
Program.Status.UpdateStatus(null, null, string.Format("Added Intermediate Certificate: {0}", cert.ShortSubjectName()));
|
||||
Program.SleepThread(500, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
|
||||
// Host/Personal Certificates
|
||||
try
|
||||
{
|
||||
var CertFiles = Directory.EnumerateFiles(inlineCertificateLocation, "WLAN_Cert_Personal_*.*").ToList();
|
||||
if (CertFiles.Count > 0)
|
||||
{
|
||||
foreach (var certFile in CertFiles)
|
||||
{
|
||||
var cert = new X509Certificate2(File.ReadAllBytes(certFile), "password", X509KeyStorageFlags.MachineKeySet | X509KeyStorageFlags.PersistKeySet);
|
||||
var result = Add(StoreName.My, StoreLocation.LocalMachine, cert);
|
||||
if (result)
|
||||
{
|
||||
if (Path.GetFileNameWithoutExtension(certFile).ToLower().Contains("temp"))
|
||||
_tempCerts.Add(cert.SerialNumber);
|
||||
Program.Status.UpdateStatus(null, null, string.Format("Added Host Certificate: {0}", cert.ShortSubjectName()));
|
||||
Program.SleepThread(500, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
public static string ShortSubjectName(this X509Certificate2 Certificate)
|
||||
{
|
||||
string s = Certificate.Subject;
|
||||
return s.Substring(s.IndexOf("=") + 1, s.IndexOf(",") - s.IndexOf("=") - 1);
|
||||
}
|
||||
|
||||
public static bool Add(StoreName StoreName, StoreLocation StoreLocation, X509Certificate2 Certificate)
|
||||
{
|
||||
var certStore = new X509Store(StoreName, StoreLocation);
|
||||
bool certAlreadyExists = false;
|
||||
certStore.Open(OpenFlags.ReadWrite);
|
||||
foreach (var cert in certStore.Certificates)
|
||||
{
|
||||
if (cert.SerialNumber.Equals(Certificate.SerialNumber))
|
||||
{
|
||||
certAlreadyExists = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!certAlreadyExists)
|
||||
{
|
||||
certStore.Add(Certificate);
|
||||
}
|
||||
certStore.Close();
|
||||
return !certAlreadyExists;
|
||||
}
|
||||
|
||||
public static bool Remove(StoreName StoreName, StoreLocation StoreLocation, List<Regex> RegexMatches, string SerialException)
|
||||
{
|
||||
var certStore = new X509Store(StoreName, StoreLocation);
|
||||
var removeCerts = new List<X509Certificate2>();
|
||||
certStore.Open(OpenFlags.ReadWrite);
|
||||
foreach (var cert in certStore.Certificates)
|
||||
{
|
||||
if (!cert.SerialNumber.Equals(SerialException))
|
||||
{
|
||||
foreach (var subjectRegex in RegexMatches)
|
||||
{
|
||||
if (subjectRegex.IsMatch(cert.Subject))
|
||||
{
|
||||
removeCerts.Add(cert);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
foreach (var cert in removeCerts)
|
||||
{
|
||||
certStore.Remove(cert);
|
||||
}
|
||||
certStore.Close();
|
||||
return (removeCerts.Count > 0);
|
||||
}
|
||||
public static bool Remove(StoreName StoreName, StoreLocation StoreLocation, List<string> CertificateSerials)
|
||||
{
|
||||
var certStore = new X509Store(StoreName, StoreLocation);
|
||||
var removeCerts = new List<X509Certificate2>();
|
||||
certStore.Open(OpenFlags.ReadWrite);
|
||||
foreach (var cert in certStore.Certificates)
|
||||
{
|
||||
if (CertificateSerials.Contains(cert.SerialNumber))
|
||||
{
|
||||
removeCerts.Add(cert);
|
||||
}
|
||||
}
|
||||
foreach (var cert in removeCerts)
|
||||
{
|
||||
certStore.Remove(cert);
|
||||
}
|
||||
certStore.Close();
|
||||
return (removeCerts.Count > 0);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,164 +1,164 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Management;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Disco.ClientBootstrapper.Interop
|
||||
{
|
||||
|
||||
class NetworkAdapter
|
||||
{
|
||||
|
||||
public uint Index { get; set; }
|
||||
public string WmiPath { get; set; }
|
||||
public Guid Guid { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string NetConnectionID { get; set; }
|
||||
public string MACAddress { get; set; }
|
||||
public UInt64 Speed { get; set; }
|
||||
public UInt16 LastConnectionStatus { get; set; }
|
||||
public bool IsWireless { get; set; }
|
||||
public string WirelessInterfaceDescription { get; set; }
|
||||
public int LastWirelessConnectionStatus { get; set; }
|
||||
|
||||
public NetworkAdapter(ManagementObject wmiObject)
|
||||
{
|
||||
UpdateFromWmi(wmiObject);
|
||||
}
|
||||
|
||||
private void UpdateFromWmi(ManagementObject wmiObject)
|
||||
{
|
||||
this.WmiPath = (string)wmiObject.GetPropertyValue("__PATH");
|
||||
this.Index = (UInt32)wmiObject.GetPropertyValue("Index");
|
||||
this.Guid = Guid.Parse((string)wmiObject.GetPropertyValue("GUID"));
|
||||
this.MACAddress = (string)wmiObject.GetPropertyValue("MACAddress");
|
||||
this.Name = (string)wmiObject.GetPropertyValue("Name");
|
||||
this.NetConnectionID = (string)wmiObject.GetPropertyValue("NetConnectionID");
|
||||
this.Speed = (UInt64)wmiObject.GetPropertyValue("Speed");
|
||||
var connectionStatus = ConnectionStatus;
|
||||
this.IsWireless = true;
|
||||
try
|
||||
{
|
||||
var wirelessConnectionStatus = WirelessConnectionStatus;
|
||||
}
|
||||
catch (Exception) {
|
||||
this.IsWireless = false;
|
||||
};
|
||||
}
|
||||
|
||||
public int WirelessConnectionStatus
|
||||
{
|
||||
get {
|
||||
if (this.IsWireless)
|
||||
{
|
||||
IntPtr handle = IntPtr.Zero;
|
||||
uint negotiatedVersion;
|
||||
try
|
||||
{
|
||||
if (NetworkInterop.WlanOpenHandle(1, IntPtr.Zero, out negotiatedVersion, ref handle) != 0)
|
||||
throw new NotSupportedException("This network adapter does not support Wireless");
|
||||
|
||||
IntPtr ptr = new IntPtr();
|
||||
|
||||
uint dataSize;
|
||||
|
||||
var interfaceGuid = this.Guid;
|
||||
|
||||
if (NetworkInterop.WlanQueryInterface(handle, ref interfaceGuid, NetworkInterop.WLAN_INTF_OPCODE.wlan_intf_opcode_interface_state, IntPtr.Zero, out dataSize, ref ptr, IntPtr.Zero) != 0)
|
||||
throw new NotSupportedException("This network adapter does not support Wireless");
|
||||
|
||||
this.LastWirelessConnectionStatus = Marshal.ReadInt32(ptr);
|
||||
|
||||
|
||||
NetworkInterop.WlanFreeMemory(ptr);
|
||||
|
||||
return this.LastWirelessConnectionStatus;
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (handle != IntPtr.Zero)
|
||||
NetworkInterop.WlanCloseHandle(handle, IntPtr.Zero);
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new NotSupportedException("This network adapter does not support Wireless");
|
||||
}
|
||||
}
|
||||
}
|
||||
public string WirelessConnectionStatusMeaning(int status)
|
||||
{
|
||||
switch ((NetworkInterop.WLAN_INTERFACE_STATE)status)
|
||||
{
|
||||
case NetworkInterop.WLAN_INTERFACE_STATE.wlan_interface_state_ad_hoc_network_formed:
|
||||
return "Ad Hoc Network Formed";
|
||||
case NetworkInterop.WLAN_INTERFACE_STATE.wlan_interface_state_associating:
|
||||
return "Associating";
|
||||
case NetworkInterop.WLAN_INTERFACE_STATE.wlan_interface_state_authenticating:
|
||||
return "Authenticating";
|
||||
case NetworkInterop.WLAN_INTERFACE_STATE.wlan_interface_state_connected:
|
||||
return "Connected";
|
||||
case NetworkInterop.WLAN_INTERFACE_STATE.wlan_interface_state_disconnected:
|
||||
return "Disconnected";
|
||||
case NetworkInterop.WLAN_INTERFACE_STATE.wlan_interface_state_disconnecting:
|
||||
return "Disconnecting";
|
||||
case NetworkInterop.WLAN_INTERFACE_STATE.wlan_interface_state_discovering:
|
||||
return "Discovering";
|
||||
case NetworkInterop.WLAN_INTERFACE_STATE.wlan_interface_state_not_ready:
|
||||
return "Not Ready";
|
||||
default:
|
||||
return "Unknown";
|
||||
}
|
||||
}
|
||||
|
||||
public UInt16 ConnectionStatus
|
||||
{
|
||||
get
|
||||
{
|
||||
using (var wmiObject = new ManagementObject(this.WmiPath))
|
||||
{
|
||||
this.LastConnectionStatus = (UInt16)wmiObject.GetPropertyValue("NetConnectionStatus");
|
||||
}
|
||||
return this.LastConnectionStatus;
|
||||
}
|
||||
}
|
||||
public string ConnectionStatusMeaning(UInt16 status)
|
||||
{
|
||||
switch (status)
|
||||
{
|
||||
case (UInt16)0:
|
||||
return "Disconnected";
|
||||
case (UInt16)1:
|
||||
return "Connecting";
|
||||
case (UInt16)2:
|
||||
return "Connected";
|
||||
case (UInt16)3:
|
||||
return "Disconnecting";
|
||||
case (UInt16)4:
|
||||
return "Hardware not present";
|
||||
case (UInt16)5:
|
||||
return "Hardware disabled";
|
||||
case (UInt16)6:
|
||||
return "Hardware malfunction";
|
||||
case (UInt16)7:
|
||||
return "Media disconnected";
|
||||
case (UInt16)8:
|
||||
return "Authenticating";
|
||||
case (UInt16)9:
|
||||
return "Authentication succeeded";
|
||||
case (UInt16)10:
|
||||
return "Authentication failed";
|
||||
case (UInt16)11:
|
||||
return "Invalid address";
|
||||
case (UInt16)12:
|
||||
return "Credentials required";
|
||||
default:
|
||||
return "Unknown";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Management;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Disco.ClientBootstrapper.Interop
|
||||
{
|
||||
|
||||
class NetworkAdapter
|
||||
{
|
||||
|
||||
public uint Index { get; set; }
|
||||
public string WmiPath { get; set; }
|
||||
public Guid Guid { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string NetConnectionID { get; set; }
|
||||
public string MACAddress { get; set; }
|
||||
public UInt64 Speed { get; set; }
|
||||
public UInt16 LastConnectionStatus { get; set; }
|
||||
public bool IsWireless { get; set; }
|
||||
public string WirelessInterfaceDescription { get; set; }
|
||||
public int LastWirelessConnectionStatus { get; set; }
|
||||
|
||||
public NetworkAdapter(ManagementObject wmiObject)
|
||||
{
|
||||
UpdateFromWmi(wmiObject);
|
||||
}
|
||||
|
||||
private void UpdateFromWmi(ManagementObject wmiObject)
|
||||
{
|
||||
this.WmiPath = (string)wmiObject.GetPropertyValue("__PATH");
|
||||
this.Index = (UInt32)wmiObject.GetPropertyValue("Index");
|
||||
this.Guid = Guid.Parse((string)wmiObject.GetPropertyValue("GUID"));
|
||||
this.MACAddress = (string)wmiObject.GetPropertyValue("MACAddress");
|
||||
this.Name = (string)wmiObject.GetPropertyValue("Name");
|
||||
this.NetConnectionID = (string)wmiObject.GetPropertyValue("NetConnectionID");
|
||||
this.Speed = (UInt64)wmiObject.GetPropertyValue("Speed");
|
||||
var connectionStatus = ConnectionStatus;
|
||||
this.IsWireless = true;
|
||||
try
|
||||
{
|
||||
var wirelessConnectionStatus = WirelessConnectionStatus;
|
||||
}
|
||||
catch (Exception) {
|
||||
this.IsWireless = false;
|
||||
};
|
||||
}
|
||||
|
||||
public int WirelessConnectionStatus
|
||||
{
|
||||
get {
|
||||
if (this.IsWireless)
|
||||
{
|
||||
IntPtr handle = IntPtr.Zero;
|
||||
uint negotiatedVersion;
|
||||
try
|
||||
{
|
||||
if (NetworkInterop.WlanOpenHandle(1, IntPtr.Zero, out negotiatedVersion, ref handle) != 0)
|
||||
throw new NotSupportedException("This network adapter does not support Wireless");
|
||||
|
||||
IntPtr ptr = new IntPtr();
|
||||
|
||||
uint dataSize;
|
||||
|
||||
var interfaceGuid = this.Guid;
|
||||
|
||||
if (NetworkInterop.WlanQueryInterface(handle, ref interfaceGuid, NetworkInterop.WLAN_INTF_OPCODE.wlan_intf_opcode_interface_state, IntPtr.Zero, out dataSize, ref ptr, IntPtr.Zero) != 0)
|
||||
throw new NotSupportedException("This network adapter does not support Wireless");
|
||||
|
||||
this.LastWirelessConnectionStatus = Marshal.ReadInt32(ptr);
|
||||
|
||||
|
||||
NetworkInterop.WlanFreeMemory(ptr);
|
||||
|
||||
return this.LastWirelessConnectionStatus;
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (handle != IntPtr.Zero)
|
||||
NetworkInterop.WlanCloseHandle(handle, IntPtr.Zero);
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new NotSupportedException("This network adapter does not support Wireless");
|
||||
}
|
||||
}
|
||||
}
|
||||
public string WirelessConnectionStatusMeaning(int status)
|
||||
{
|
||||
switch ((NetworkInterop.WLAN_INTERFACE_STATE)status)
|
||||
{
|
||||
case NetworkInterop.WLAN_INTERFACE_STATE.wlan_interface_state_ad_hoc_network_formed:
|
||||
return "Ad Hoc Network Formed";
|
||||
case NetworkInterop.WLAN_INTERFACE_STATE.wlan_interface_state_associating:
|
||||
return "Associating";
|
||||
case NetworkInterop.WLAN_INTERFACE_STATE.wlan_interface_state_authenticating:
|
||||
return "Authenticating";
|
||||
case NetworkInterop.WLAN_INTERFACE_STATE.wlan_interface_state_connected:
|
||||
return "Connected";
|
||||
case NetworkInterop.WLAN_INTERFACE_STATE.wlan_interface_state_disconnected:
|
||||
return "Disconnected";
|
||||
case NetworkInterop.WLAN_INTERFACE_STATE.wlan_interface_state_disconnecting:
|
||||
return "Disconnecting";
|
||||
case NetworkInterop.WLAN_INTERFACE_STATE.wlan_interface_state_discovering:
|
||||
return "Discovering";
|
||||
case NetworkInterop.WLAN_INTERFACE_STATE.wlan_interface_state_not_ready:
|
||||
return "Not Ready";
|
||||
default:
|
||||
return "Unknown";
|
||||
}
|
||||
}
|
||||
|
||||
public UInt16 ConnectionStatus
|
||||
{
|
||||
get
|
||||
{
|
||||
using (var wmiObject = new ManagementObject(this.WmiPath))
|
||||
{
|
||||
this.LastConnectionStatus = (UInt16)wmiObject.GetPropertyValue("NetConnectionStatus");
|
||||
}
|
||||
return this.LastConnectionStatus;
|
||||
}
|
||||
}
|
||||
public string ConnectionStatusMeaning(UInt16 status)
|
||||
{
|
||||
switch (status)
|
||||
{
|
||||
case (UInt16)0:
|
||||
return "Disconnected";
|
||||
case (UInt16)1:
|
||||
return "Connecting";
|
||||
case (UInt16)2:
|
||||
return "Connected";
|
||||
case (UInt16)3:
|
||||
return "Disconnecting";
|
||||
case (UInt16)4:
|
||||
return "Hardware not present";
|
||||
case (UInt16)5:
|
||||
return "Hardware disabled";
|
||||
case (UInt16)6:
|
||||
return "Hardware malfunction";
|
||||
case (UInt16)7:
|
||||
return "Media disconnected";
|
||||
case (UInt16)8:
|
||||
return "Authenticating";
|
||||
case (UInt16)9:
|
||||
return "Authentication succeeded";
|
||||
case (UInt16)10:
|
||||
return "Authentication failed";
|
||||
case (UInt16)11:
|
||||
return "Invalid address";
|
||||
case (UInt16)12:
|
||||
return "Credentials required";
|
||||
default:
|
||||
return "Unknown";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,289 +1,289 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Net.NetworkInformation;
|
||||
using System.Management;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Xml;
|
||||
|
||||
namespace Disco.ClientBootstrapper.Interop
|
||||
{
|
||||
static class NetworkInterop
|
||||
{
|
||||
|
||||
#region PInvoke
|
||||
|
||||
[DllImport("Wlanapi", EntryPoint = "WlanOpenHandle")]
|
||||
public static extern uint WlanOpenHandle(uint dwClientVersion, IntPtr pReserved, [Out] out uint pdwNegotiatedVersion, ref IntPtr ClientHandle);
|
||||
[DllImport("Wlanapi", EntryPoint = "WlanCloseHandle")]
|
||||
public static extern uint WlanCloseHandle([In] IntPtr hClientHandle, IntPtr pReserved);
|
||||
[DllImport("Wlanapi", EntryPoint = "WlanFreeMemory")]
|
||||
public static extern void WlanFreeMemory([In] IntPtr pMemory);
|
||||
|
||||
[DllImport("Wlanapi.dll", SetLastError = true)]
|
||||
public static extern uint WlanGetProfileList(IntPtr hClientHandle, ref Guid pInterfaceGuid, IntPtr pReserved, ref IntPtr ppProfileList);
|
||||
[DllImport("Wlanapi.dll", SetLastError = true, CharSet = CharSet.Unicode)]
|
||||
public static extern uint WlanSetProfile(IntPtr hClientHandle, [In] ref Guid pInterfaceGuid, uint dwFlags, string strProfileXml, string strAllUserProfileSecurity, bool bOverwrite, IntPtr pReserved, out uint pdwReasonCode);
|
||||
|
||||
|
||||
[DllImport("Wlanapi", EntryPoint = "WlanQueryInterface")]
|
||||
public static extern uint WlanQueryInterface([In] IntPtr hClientHandle,
|
||||
[In] ref Guid pInterfaceGuid,
|
||||
WLAN_INTF_OPCODE OpCode,
|
||||
IntPtr pReserved,
|
||||
[Out] out uint pdwDataSize,
|
||||
ref IntPtr ppData,
|
||||
IntPtr pWlanOpcodeValueType);
|
||||
|
||||
public enum WLAN_INTF_OPCODE
|
||||
{
|
||||
/// wlan_intf_opcode_autoconf_start -> 0x000000000
|
||||
wlan_intf_opcode_autoconf_start = 0,
|
||||
wlan_intf_opcode_autoconf_enabled,
|
||||
wlan_intf_opcode_background_scan_enabled,
|
||||
wlan_intf_opcode_media_streaming_mode,
|
||||
wlan_intf_opcode_radio_state,
|
||||
wlan_intf_opcode_bss_type,
|
||||
wlan_intf_opcode_interface_state,
|
||||
wlan_intf_opcode_current_connection,
|
||||
wlan_intf_opcode_channel_number,
|
||||
wlan_intf_opcode_supported_infrastructure_auth_cipher_pairs,
|
||||
wlan_intf_opcode_supported_adhoc_auth_cipher_pairs,
|
||||
wlan_intf_opcode_supported_country_or_region_string_list,
|
||||
wlan_intf_opcode_current_operation_mode,
|
||||
wlan_intf_opcode_supported_safe_mode,
|
||||
wlan_intf_opcode_certified_safe_mode,
|
||||
/// wlan_intf_opcode_autoconf_end -> 0x0fffffff
|
||||
wlan_intf_opcode_autoconf_end = 268435455,
|
||||
/// wlan_intf_opcode_msm_start -> 0x10000100
|
||||
wlan_intf_opcode_msm_start = 268435712,
|
||||
wlan_intf_opcode_statistics,
|
||||
wlan_intf_opcode_rssi,
|
||||
/// wlan_intf_opcode_msm_end -> 0x1fffffff
|
||||
wlan_intf_opcode_msm_end = 536870911,
|
||||
/// wlan_intf_opcode_security_start -> 0x20010000
|
||||
wlan_intf_opcode_security_start = 536936448,
|
||||
/// wlan_intf_opcode_security_end -> 0x2fffffff
|
||||
wlan_intf_opcode_security_end = 805306367,
|
||||
/// wlan_intf_opcode_ihv_start -> 0x30000000
|
||||
wlan_intf_opcode_ihv_start = 805306368,
|
||||
/// wlan_intf_opcode_ihv_end -> 0x3fffffff
|
||||
wlan_intf_opcode_ihv_end = 1073741823,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Defines the state of the interface. e.g. connected, disconnected.
|
||||
/// </summary>
|
||||
public enum WLAN_INTERFACE_STATE
|
||||
{
|
||||
/// <summary>
|
||||
/// wlan_interface_state_not_ready -> 0
|
||||
/// </summary>
|
||||
wlan_interface_state_not_ready = 0,
|
||||
/// <summary>
|
||||
/// wlan_interface_state_connected -> 1
|
||||
/// </summary>
|
||||
wlan_interface_state_connected = 1,
|
||||
/// <summary>
|
||||
/// wlan_interface_state_ad_hoc_network_formed -> 2
|
||||
/// </summary>
|
||||
wlan_interface_state_ad_hoc_network_formed = 2,
|
||||
/// <summary>
|
||||
/// wlan_interface_state_disconnecting -> 3
|
||||
/// </summary>
|
||||
wlan_interface_state_disconnecting = 3,
|
||||
/// <summary>
|
||||
/// wlan_interface_state_disconnected -> 4
|
||||
/// </summary>
|
||||
wlan_interface_state_disconnected = 4,
|
||||
/// <summary>
|
||||
/// wlan_interface_state_associating -> 5
|
||||
/// </summary>
|
||||
wlan_interface_state_associating = 5,
|
||||
/// <summary>
|
||||
/// wlan_interface_state_discovering -> 6
|
||||
/// </summary>
|
||||
wlan_interface_state_discovering = 6,
|
||||
/// <summary>
|
||||
/// wlan_interface_state_authenticating -> 7
|
||||
/// </summary>
|
||||
wlan_interface_state_authenticating = 7,
|
||||
}
|
||||
|
||||
public struct WLAN_PROFILE_INFO_LIST
|
||||
{
|
||||
public uint dwNumberOfItems;
|
||||
public uint dwIndex;
|
||||
public WLAN_PROFILE_INFO[] ProfileInfo;
|
||||
|
||||
public WLAN_PROFILE_INFO_LIST(IntPtr ppProfileList)
|
||||
{
|
||||
dwNumberOfItems = (uint)Marshal.ReadInt32(ppProfileList);
|
||||
dwIndex = (uint)Marshal.ReadInt32(ppProfileList, 4);
|
||||
ProfileInfo = new WLAN_PROFILE_INFO[dwNumberOfItems];
|
||||
IntPtr ppProfileListTemp = new IntPtr(ppProfileList.ToInt32() + 8);
|
||||
|
||||
for (int i = 0; i < dwNumberOfItems; i++)
|
||||
{
|
||||
ppProfileList = new IntPtr(ppProfileListTemp.ToInt32() + i * Marshal.SizeOf(typeof(WLAN_PROFILE_INFO)));
|
||||
ProfileInfo[i] = (WLAN_PROFILE_INFO)Marshal.PtrToStructure(ppProfileList, typeof(WLAN_PROFILE_INFO));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
|
||||
public struct WLAN_PROFILE_INFO
|
||||
{
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)]
|
||||
public string strProfileName;
|
||||
public uint dwFlags;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private static List<NetworkAdapter> _networkAdapters;
|
||||
public static List<NetworkAdapter> NetworkAdapters
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_networkAdapters == null)
|
||||
{
|
||||
using (var mSearcher = new ManagementObjectSearcher("SELECT __PATH, Index, GUID, MACAddress, Name, NetConnectionID, Speed FROM Win32_NetworkAdapter WHERE PhysicalAdapter=true AND MACAddress IS NOT NULL AND Name IS NOT NULL AND NetConnectionID IS NOT NULL AND Speed IS NOT NULL"))
|
||||
{
|
||||
|
||||
var mResults = mSearcher.Get();
|
||||
_networkAdapters = new List<NetworkAdapter>(mResults.Count);
|
||||
|
||||
foreach (ManagementObject mResult in mResults)
|
||||
{
|
||||
_networkAdapters.Add(new NetworkAdapter(mResult));
|
||||
}
|
||||
}
|
||||
}
|
||||
return _networkAdapters;
|
||||
}
|
||||
}
|
||||
|
||||
public static bool PingDisco()
|
||||
{
|
||||
using (Ping p = new Ping())
|
||||
{
|
||||
try
|
||||
{
|
||||
PingReply pr = p.Send("disco", 2000);
|
||||
if (pr.Status == IPStatus.Success)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void ConfigureWireless()
|
||||
{
|
||||
// Add Certificates
|
||||
Program.Status.UpdateStatus(null, null, "Configuring Wireless Certificates");
|
||||
CertificateInterop.AddTempCerts();
|
||||
|
||||
// Add Wireless Profiles
|
||||
Program.Status.UpdateStatus(null, null, "Configuring Wireless Profiles");
|
||||
var wirelessInlineProfiles = GetInlineWirelessProfiles();
|
||||
if (wirelessInlineProfiles.Count > 0)
|
||||
{
|
||||
|
||||
IntPtr wlanHandle = IntPtr.Zero;
|
||||
uint negotiatedVersion;
|
||||
|
||||
try
|
||||
{
|
||||
if (WlanOpenHandle(1, IntPtr.Zero, out negotiatedVersion, ref wlanHandle) != 0)
|
||||
throw new NotSupportedException("This device does not support Wireless");
|
||||
|
||||
// Add Profile to Each Wireless Adapter
|
||||
var wirelessAdapters = NetworkAdapters.Where(na => na.IsWireless).ToList();
|
||||
foreach (var na in wirelessAdapters)
|
||||
{
|
||||
foreach (var inlineWirelessProfile in wirelessInlineProfiles)
|
||||
{
|
||||
if (inlineWirelessProfile.AddProfile(wlanHandle, na.Guid))
|
||||
{
|
||||
Program.Status.UpdateStatus(null, null, string.Format("Added Wireless Profile: {0}", inlineWirelessProfile.ProfileName));
|
||||
Program.SleepThread(500, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
Program.Status.UpdateStatus(null, null, string.Format("Unable to add Wireless Profile: {0}", inlineWirelessProfile.ProfileName));
|
||||
Program.SleepThread(5000, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (wlanHandle != IntPtr.Zero)
|
||||
NetworkInterop.WlanCloseHandle(wlanHandle, IntPtr.Zero);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
private class WirelessProfile
|
||||
{
|
||||
public string Filename { get; set; }
|
||||
public string ProfileXml { get; set; }
|
||||
public string ProfileName { get; set; }
|
||||
|
||||
public bool AddProfile(IntPtr WlanHandle, Guid interfaceGuid)
|
||||
{
|
||||
var pInterfaceGuid = interfaceGuid;
|
||||
var pProfileXml = this.ProfileXml;
|
||||
uint pFlag = 0;
|
||||
uint failReason;
|
||||
return (WlanSetProfile(WlanHandle, ref pInterfaceGuid, pFlag, pProfileXml, null, true, IntPtr.Zero, out failReason) == 0);
|
||||
}
|
||||
}
|
||||
|
||||
private static List<WirelessProfile> GetInlineWirelessProfiles()
|
||||
{
|
||||
var inlineProfileFiles = System.IO.Directory.EnumerateFiles(Program.InlinePath.Value, "WLAN_Profile_*.xml").ToList();
|
||||
var inlineProfiles = new List<WirelessProfile>(inlineProfileFiles.Count);
|
||||
foreach (var filename in inlineProfileFiles)
|
||||
{
|
||||
var profile = new WirelessProfile()
|
||||
{
|
||||
Filename = filename,
|
||||
ProfileXml = System.IO.File.ReadAllText(filename)
|
||||
};
|
||||
var profileXml = new XmlDocument();
|
||||
profileXml.LoadXml(profile.ProfileXml);
|
||||
var profileXmlNS = new XmlNamespaceManager(profileXml.NameTable);
|
||||
profileXmlNS.AddNamespace("p", "http://www.microsoft.com/networking/WLAN/profile/v1");
|
||||
var profileXmlNameNode = profileXml.SelectSingleNode("/p:WLANProfile/p:name", profileXmlNS);
|
||||
if (profileXmlNameNode != null)
|
||||
{
|
||||
profile.ProfileName = profileXmlNameNode.InnerText;
|
||||
inlineProfiles.Add(profile);
|
||||
}
|
||||
}
|
||||
return inlineProfiles;
|
||||
}
|
||||
|
||||
private static WLAN_PROFILE_INFO_LIST GetWirelessProfiles(IntPtr WlanHandle, Guid interfaceGuid)
|
||||
{
|
||||
Guid pInterfaceGuid = interfaceGuid;
|
||||
|
||||
IntPtr ppProfileList = new IntPtr();
|
||||
WlanGetProfileList(WlanHandle, ref pInterfaceGuid, new IntPtr(), ref ppProfileList);
|
||||
WLAN_PROFILE_INFO_LIST wlanProfileInfoList = new WLAN_PROFILE_INFO_LIST(ppProfileList);
|
||||
|
||||
NetworkInterop.WlanFreeMemory(ppProfileList);
|
||||
|
||||
return wlanProfileInfoList;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Net.NetworkInformation;
|
||||
using System.Management;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Xml;
|
||||
|
||||
namespace Disco.ClientBootstrapper.Interop
|
||||
{
|
||||
static class NetworkInterop
|
||||
{
|
||||
|
||||
#region PInvoke
|
||||
|
||||
[DllImport("Wlanapi", EntryPoint = "WlanOpenHandle")]
|
||||
public static extern uint WlanOpenHandle(uint dwClientVersion, IntPtr pReserved, [Out] out uint pdwNegotiatedVersion, ref IntPtr ClientHandle);
|
||||
[DllImport("Wlanapi", EntryPoint = "WlanCloseHandle")]
|
||||
public static extern uint WlanCloseHandle([In] IntPtr hClientHandle, IntPtr pReserved);
|
||||
[DllImport("Wlanapi", EntryPoint = "WlanFreeMemory")]
|
||||
public static extern void WlanFreeMemory([In] IntPtr pMemory);
|
||||
|
||||
[DllImport("Wlanapi.dll", SetLastError = true)]
|
||||
public static extern uint WlanGetProfileList(IntPtr hClientHandle, ref Guid pInterfaceGuid, IntPtr pReserved, ref IntPtr ppProfileList);
|
||||
[DllImport("Wlanapi.dll", SetLastError = true, CharSet = CharSet.Unicode)]
|
||||
public static extern uint WlanSetProfile(IntPtr hClientHandle, [In] ref Guid pInterfaceGuid, uint dwFlags, string strProfileXml, string strAllUserProfileSecurity, bool bOverwrite, IntPtr pReserved, out uint pdwReasonCode);
|
||||
|
||||
|
||||
[DllImport("Wlanapi", EntryPoint = "WlanQueryInterface")]
|
||||
public static extern uint WlanQueryInterface([In] IntPtr hClientHandle,
|
||||
[In] ref Guid pInterfaceGuid,
|
||||
WLAN_INTF_OPCODE OpCode,
|
||||
IntPtr pReserved,
|
||||
[Out] out uint pdwDataSize,
|
||||
ref IntPtr ppData,
|
||||
IntPtr pWlanOpcodeValueType);
|
||||
|
||||
public enum WLAN_INTF_OPCODE
|
||||
{
|
||||
/// wlan_intf_opcode_autoconf_start -> 0x000000000
|
||||
wlan_intf_opcode_autoconf_start = 0,
|
||||
wlan_intf_opcode_autoconf_enabled,
|
||||
wlan_intf_opcode_background_scan_enabled,
|
||||
wlan_intf_opcode_media_streaming_mode,
|
||||
wlan_intf_opcode_radio_state,
|
||||
wlan_intf_opcode_bss_type,
|
||||
wlan_intf_opcode_interface_state,
|
||||
wlan_intf_opcode_current_connection,
|
||||
wlan_intf_opcode_channel_number,
|
||||
wlan_intf_opcode_supported_infrastructure_auth_cipher_pairs,
|
||||
wlan_intf_opcode_supported_adhoc_auth_cipher_pairs,
|
||||
wlan_intf_opcode_supported_country_or_region_string_list,
|
||||
wlan_intf_opcode_current_operation_mode,
|
||||
wlan_intf_opcode_supported_safe_mode,
|
||||
wlan_intf_opcode_certified_safe_mode,
|
||||
/// wlan_intf_opcode_autoconf_end -> 0x0fffffff
|
||||
wlan_intf_opcode_autoconf_end = 268435455,
|
||||
/// wlan_intf_opcode_msm_start -> 0x10000100
|
||||
wlan_intf_opcode_msm_start = 268435712,
|
||||
wlan_intf_opcode_statistics,
|
||||
wlan_intf_opcode_rssi,
|
||||
/// wlan_intf_opcode_msm_end -> 0x1fffffff
|
||||
wlan_intf_opcode_msm_end = 536870911,
|
||||
/// wlan_intf_opcode_security_start -> 0x20010000
|
||||
wlan_intf_opcode_security_start = 536936448,
|
||||
/// wlan_intf_opcode_security_end -> 0x2fffffff
|
||||
wlan_intf_opcode_security_end = 805306367,
|
||||
/// wlan_intf_opcode_ihv_start -> 0x30000000
|
||||
wlan_intf_opcode_ihv_start = 805306368,
|
||||
/// wlan_intf_opcode_ihv_end -> 0x3fffffff
|
||||
wlan_intf_opcode_ihv_end = 1073741823,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Defines the state of the interface. e.g. connected, disconnected.
|
||||
/// </summary>
|
||||
public enum WLAN_INTERFACE_STATE
|
||||
{
|
||||
/// <summary>
|
||||
/// wlan_interface_state_not_ready -> 0
|
||||
/// </summary>
|
||||
wlan_interface_state_not_ready = 0,
|
||||
/// <summary>
|
||||
/// wlan_interface_state_connected -> 1
|
||||
/// </summary>
|
||||
wlan_interface_state_connected = 1,
|
||||
/// <summary>
|
||||
/// wlan_interface_state_ad_hoc_network_formed -> 2
|
||||
/// </summary>
|
||||
wlan_interface_state_ad_hoc_network_formed = 2,
|
||||
/// <summary>
|
||||
/// wlan_interface_state_disconnecting -> 3
|
||||
/// </summary>
|
||||
wlan_interface_state_disconnecting = 3,
|
||||
/// <summary>
|
||||
/// wlan_interface_state_disconnected -> 4
|
||||
/// </summary>
|
||||
wlan_interface_state_disconnected = 4,
|
||||
/// <summary>
|
||||
/// wlan_interface_state_associating -> 5
|
||||
/// </summary>
|
||||
wlan_interface_state_associating = 5,
|
||||
/// <summary>
|
||||
/// wlan_interface_state_discovering -> 6
|
||||
/// </summary>
|
||||
wlan_interface_state_discovering = 6,
|
||||
/// <summary>
|
||||
/// wlan_interface_state_authenticating -> 7
|
||||
/// </summary>
|
||||
wlan_interface_state_authenticating = 7,
|
||||
}
|
||||
|
||||
public struct WLAN_PROFILE_INFO_LIST
|
||||
{
|
||||
public uint dwNumberOfItems;
|
||||
public uint dwIndex;
|
||||
public WLAN_PROFILE_INFO[] ProfileInfo;
|
||||
|
||||
public WLAN_PROFILE_INFO_LIST(IntPtr ppProfileList)
|
||||
{
|
||||
dwNumberOfItems = (uint)Marshal.ReadInt32(ppProfileList);
|
||||
dwIndex = (uint)Marshal.ReadInt32(ppProfileList, 4);
|
||||
ProfileInfo = new WLAN_PROFILE_INFO[dwNumberOfItems];
|
||||
IntPtr ppProfileListTemp = new IntPtr(ppProfileList.ToInt32() + 8);
|
||||
|
||||
for (int i = 0; i < dwNumberOfItems; i++)
|
||||
{
|
||||
ppProfileList = new IntPtr(ppProfileListTemp.ToInt32() + i * Marshal.SizeOf(typeof(WLAN_PROFILE_INFO)));
|
||||
ProfileInfo[i] = (WLAN_PROFILE_INFO)Marshal.PtrToStructure(ppProfileList, typeof(WLAN_PROFILE_INFO));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
|
||||
public struct WLAN_PROFILE_INFO
|
||||
{
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)]
|
||||
public string strProfileName;
|
||||
public uint dwFlags;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private static List<NetworkAdapter> _networkAdapters;
|
||||
public static List<NetworkAdapter> NetworkAdapters
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_networkAdapters == null)
|
||||
{
|
||||
using (var mSearcher = new ManagementObjectSearcher("SELECT __PATH, Index, GUID, MACAddress, Name, NetConnectionID, Speed FROM Win32_NetworkAdapter WHERE PhysicalAdapter=true AND MACAddress IS NOT NULL AND Name IS NOT NULL AND NetConnectionID IS NOT NULL AND Speed IS NOT NULL"))
|
||||
{
|
||||
|
||||
var mResults = mSearcher.Get();
|
||||
_networkAdapters = new List<NetworkAdapter>(mResults.Count);
|
||||
|
||||
foreach (ManagementObject mResult in mResults)
|
||||
{
|
||||
_networkAdapters.Add(new NetworkAdapter(mResult));
|
||||
}
|
||||
}
|
||||
}
|
||||
return _networkAdapters;
|
||||
}
|
||||
}
|
||||
|
||||
public static bool PingDisco()
|
||||
{
|
||||
using (Ping p = new Ping())
|
||||
{
|
||||
try
|
||||
{
|
||||
PingReply pr = p.Send("disco", 2000);
|
||||
if (pr.Status == IPStatus.Success)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void ConfigureWireless()
|
||||
{
|
||||
// Add Certificates
|
||||
Program.Status.UpdateStatus(null, null, "Configuring Wireless Certificates");
|
||||
CertificateInterop.AddTempCerts();
|
||||
|
||||
// Add Wireless Profiles
|
||||
Program.Status.UpdateStatus(null, null, "Configuring Wireless Profiles");
|
||||
var wirelessInlineProfiles = GetInlineWirelessProfiles();
|
||||
if (wirelessInlineProfiles.Count > 0)
|
||||
{
|
||||
|
||||
IntPtr wlanHandle = IntPtr.Zero;
|
||||
uint negotiatedVersion;
|
||||
|
||||
try
|
||||
{
|
||||
if (WlanOpenHandle(1, IntPtr.Zero, out negotiatedVersion, ref wlanHandle) != 0)
|
||||
throw new NotSupportedException("This device does not support Wireless");
|
||||
|
||||
// Add Profile to Each Wireless Adapter
|
||||
var wirelessAdapters = NetworkAdapters.Where(na => na.IsWireless).ToList();
|
||||
foreach (var na in wirelessAdapters)
|
||||
{
|
||||
foreach (var inlineWirelessProfile in wirelessInlineProfiles)
|
||||
{
|
||||
if (inlineWirelessProfile.AddProfile(wlanHandle, na.Guid))
|
||||
{
|
||||
Program.Status.UpdateStatus(null, null, string.Format("Added Wireless Profile: {0}", inlineWirelessProfile.ProfileName));
|
||||
Program.SleepThread(500, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
Program.Status.UpdateStatus(null, null, string.Format("Unable to add Wireless Profile: {0}", inlineWirelessProfile.ProfileName));
|
||||
Program.SleepThread(5000, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (wlanHandle != IntPtr.Zero)
|
||||
NetworkInterop.WlanCloseHandle(wlanHandle, IntPtr.Zero);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
private class WirelessProfile
|
||||
{
|
||||
public string Filename { get; set; }
|
||||
public string ProfileXml { get; set; }
|
||||
public string ProfileName { get; set; }
|
||||
|
||||
public bool AddProfile(IntPtr WlanHandle, Guid interfaceGuid)
|
||||
{
|
||||
var pInterfaceGuid = interfaceGuid;
|
||||
var pProfileXml = this.ProfileXml;
|
||||
uint pFlag = 0;
|
||||
uint failReason;
|
||||
return (WlanSetProfile(WlanHandle, ref pInterfaceGuid, pFlag, pProfileXml, null, true, IntPtr.Zero, out failReason) == 0);
|
||||
}
|
||||
}
|
||||
|
||||
private static List<WirelessProfile> GetInlineWirelessProfiles()
|
||||
{
|
||||
var inlineProfileFiles = System.IO.Directory.EnumerateFiles(Program.InlinePath.Value, "WLAN_Profile_*.xml").ToList();
|
||||
var inlineProfiles = new List<WirelessProfile>(inlineProfileFiles.Count);
|
||||
foreach (var filename in inlineProfileFiles)
|
||||
{
|
||||
var profile = new WirelessProfile()
|
||||
{
|
||||
Filename = filename,
|
||||
ProfileXml = System.IO.File.ReadAllText(filename)
|
||||
};
|
||||
var profileXml = new XmlDocument();
|
||||
profileXml.LoadXml(profile.ProfileXml);
|
||||
var profileXmlNS = new XmlNamespaceManager(profileXml.NameTable);
|
||||
profileXmlNS.AddNamespace("p", "http://www.microsoft.com/networking/WLAN/profile/v1");
|
||||
var profileXmlNameNode = profileXml.SelectSingleNode("/p:WLANProfile/p:name", profileXmlNS);
|
||||
if (profileXmlNameNode != null)
|
||||
{
|
||||
profile.ProfileName = profileXmlNameNode.InnerText;
|
||||
inlineProfiles.Add(profile);
|
||||
}
|
||||
}
|
||||
return inlineProfiles;
|
||||
}
|
||||
|
||||
private static WLAN_PROFILE_INFO_LIST GetWirelessProfiles(IntPtr WlanHandle, Guid interfaceGuid)
|
||||
{
|
||||
Guid pInterfaceGuid = interfaceGuid;
|
||||
|
||||
IntPtr ppProfileList = new IntPtr();
|
||||
WlanGetProfileList(WlanHandle, ref pInterfaceGuid, new IntPtr(), ref ppProfileList);
|
||||
WLAN_PROFILE_INFO_LIST wlanProfileInfoList = new WLAN_PROFILE_INFO_LIST(ppProfileList);
|
||||
|
||||
NetworkInterop.WlanFreeMemory(ppProfileList);
|
||||
|
||||
return wlanProfileInfoList;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,108 +1,108 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Disco.ClientBootstrapper.Interop
|
||||
{
|
||||
class RegistryInterop : IDisposable
|
||||
{
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
private struct LUID
|
||||
{
|
||||
public int LowPart;
|
||||
public int HighPart;
|
||||
}
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
private struct TOKEN_PRIVILEGES
|
||||
{
|
||||
public LUID Luid;
|
||||
public int Attributes;
|
||||
public int PrivilegeCount;
|
||||
}
|
||||
|
||||
[DllImport("advapi32.dll", CharSet = CharSet.Auto)]
|
||||
private static extern int OpenProcessToken(int ProcessHandle, int DesiredAccess, ref int tokenhandle);
|
||||
|
||||
[DllImport("kernel32.dll", CharSet = CharSet.Auto)]
|
||||
private static extern int GetCurrentProcess();
|
||||
|
||||
[DllImport("advapi32.dll", CharSet = CharSet.Auto)]
|
||||
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);
|
||||
|
||||
[DllImport("advapi32.dll", CharSet = CharSet.Auto, SetLastError = true)]
|
||||
private static extern int RegLoadKey(uint hKey, string lpSubKey, string lpFile);
|
||||
|
||||
[DllImport("advapi32.dll", CharSet = CharSet.Auto, SetLastError = true)]
|
||||
private static extern int RegUnLoadKey(uint hKey, string lpSubKey);
|
||||
|
||||
private const int TOKEN_ADJUST_PRIVILEGES = 0x00000020;
|
||||
private const int TOKEN_QUERY = 0x00000008;
|
||||
private const int SE_PRIVILEGE_ENABLED = 0x00000002;
|
||||
private const string SE_RESTORE_NAME = "SeRestorePrivilege";
|
||||
private const string SE_BACKUP_NAME = "SeBackupPrivilege";
|
||||
private const uint HKEY_USERS = 0x80000003;
|
||||
|
||||
private RegistryHives Hive { get; set; }
|
||||
private string SubKey { get; set; }
|
||||
private bool IsUnloaded { get; set; }
|
||||
|
||||
public enum RegistryHives : uint
|
||||
{
|
||||
HKEY_USERS = 0x80000003,
|
||||
HKEY_LOCAL_MACHINE = 0x80000002
|
||||
}
|
||||
|
||||
public RegistryInterop(RegistryHives hive, string subKey, string filePath)
|
||||
{
|
||||
int token = 0;
|
||||
int retval = 0;
|
||||
|
||||
TOKEN_PRIVILEGES TP = new TOKEN_PRIVILEGES();
|
||||
TOKEN_PRIVILEGES TP2 = new TOKEN_PRIVILEGES();
|
||||
LUID RestoreLuid = new LUID();
|
||||
LUID BackupLuid = new LUID();
|
||||
|
||||
retval = OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, ref token);
|
||||
retval = LookupPrivilegeValue(null, SE_RESTORE_NAME, ref RestoreLuid);
|
||||
retval = LookupPrivilegeValue(null, SE_BACKUP_NAME, ref BackupLuid);
|
||||
TP.PrivilegeCount = 1;
|
||||
TP.Attributes = SE_PRIVILEGE_ENABLED;
|
||||
TP.Luid = RestoreLuid;
|
||||
TP2.PrivilegeCount = 1;
|
||||
TP2.Attributes = SE_PRIVILEGE_ENABLED;
|
||||
TP2.Luid = BackupLuid;
|
||||
|
||||
retval = AdjustTokenPrivileges(token, 0, ref TP, 1024, 0, 0);
|
||||
retval = AdjustTokenPrivileges(token, 0, ref TP2, 1024, 0, 0);
|
||||
|
||||
uint regHive = (uint)hive;
|
||||
|
||||
this.Hive = hive;
|
||||
this.SubKey = subKey;
|
||||
RegLoadKey(regHive, subKey, filePath);
|
||||
this.IsUnloaded = false;
|
||||
}
|
||||
|
||||
public void Unload()
|
||||
{
|
||||
if (!IsUnloaded)
|
||||
{
|
||||
uint regHive = (uint)this.Hive;
|
||||
string subKey = this.SubKey;
|
||||
RegUnLoadKey(regHive, subKey);
|
||||
this.IsUnloaded = true;
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
Unload();
|
||||
}
|
||||
}
|
||||
}
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Disco.ClientBootstrapper.Interop
|
||||
{
|
||||
class RegistryInterop : IDisposable
|
||||
{
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
private struct LUID
|
||||
{
|
||||
public int LowPart;
|
||||
public int HighPart;
|
||||
}
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
private struct TOKEN_PRIVILEGES
|
||||
{
|
||||
public LUID Luid;
|
||||
public int Attributes;
|
||||
public int PrivilegeCount;
|
||||
}
|
||||
|
||||
[DllImport("advapi32.dll", CharSet = CharSet.Auto)]
|
||||
private static extern int OpenProcessToken(int ProcessHandle, int DesiredAccess, ref int tokenhandle);
|
||||
|
||||
[DllImport("kernel32.dll", CharSet = CharSet.Auto)]
|
||||
private static extern int GetCurrentProcess();
|
||||
|
||||
[DllImport("advapi32.dll", CharSet = CharSet.Auto)]
|
||||
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);
|
||||
|
||||
[DllImport("advapi32.dll", CharSet = CharSet.Auto, SetLastError = true)]
|
||||
private static extern int RegLoadKey(uint hKey, string lpSubKey, string lpFile);
|
||||
|
||||
[DllImport("advapi32.dll", CharSet = CharSet.Auto, SetLastError = true)]
|
||||
private static extern int RegUnLoadKey(uint hKey, string lpSubKey);
|
||||
|
||||
private const int TOKEN_ADJUST_PRIVILEGES = 0x00000020;
|
||||
private const int TOKEN_QUERY = 0x00000008;
|
||||
private const int SE_PRIVILEGE_ENABLED = 0x00000002;
|
||||
private const string SE_RESTORE_NAME = "SeRestorePrivilege";
|
||||
private const string SE_BACKUP_NAME = "SeBackupPrivilege";
|
||||
private const uint HKEY_USERS = 0x80000003;
|
||||
|
||||
private RegistryHives Hive { get; set; }
|
||||
private string SubKey { get; set; }
|
||||
private bool IsUnloaded { get; set; }
|
||||
|
||||
public enum RegistryHives : uint
|
||||
{
|
||||
HKEY_USERS = 0x80000003,
|
||||
HKEY_LOCAL_MACHINE = 0x80000002
|
||||
}
|
||||
|
||||
public RegistryInterop(RegistryHives hive, string subKey, string filePath)
|
||||
{
|
||||
int token = 0;
|
||||
int retval = 0;
|
||||
|
||||
TOKEN_PRIVILEGES TP = new TOKEN_PRIVILEGES();
|
||||
TOKEN_PRIVILEGES TP2 = new TOKEN_PRIVILEGES();
|
||||
LUID RestoreLuid = new LUID();
|
||||
LUID BackupLuid = new LUID();
|
||||
|
||||
retval = OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, ref token);
|
||||
retval = LookupPrivilegeValue(null, SE_RESTORE_NAME, ref RestoreLuid);
|
||||
retval = LookupPrivilegeValue(null, SE_BACKUP_NAME, ref BackupLuid);
|
||||
TP.PrivilegeCount = 1;
|
||||
TP.Attributes = SE_PRIVILEGE_ENABLED;
|
||||
TP.Luid = RestoreLuid;
|
||||
TP2.PrivilegeCount = 1;
|
||||
TP2.Attributes = SE_PRIVILEGE_ENABLED;
|
||||
TP2.Luid = BackupLuid;
|
||||
|
||||
retval = AdjustTokenPrivileges(token, 0, ref TP, 1024, 0, 0);
|
||||
retval = AdjustTokenPrivileges(token, 0, ref TP2, 1024, 0, 0);
|
||||
|
||||
uint regHive = (uint)hive;
|
||||
|
||||
this.Hive = hive;
|
||||
this.SubKey = subKey;
|
||||
RegLoadKey(regHive, subKey, filePath);
|
||||
this.IsUnloaded = false;
|
||||
}
|
||||
|
||||
public void Unload()
|
||||
{
|
||||
if (!IsUnloaded)
|
||||
{
|
||||
uint regHive = (uint)this.Hive;
|
||||
string subKey = this.SubKey;
|
||||
RegUnLoadKey(regHive, subKey);
|
||||
this.IsUnloaded = true;
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
Unload();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,103 +1,103 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Management;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Disco.ClientBootstrapper.Interop
|
||||
{
|
||||
public static class ShutdownInterop
|
||||
{
|
||||
public static void Shutdown()
|
||||
{
|
||||
// 8 = Power Off
|
||||
Shutdown(EWX_POWEROFF);
|
||||
}
|
||||
public static void Reboot()
|
||||
{
|
||||
// 2 = Reboot
|
||||
Shutdown(EWX_REBOOT);
|
||||
}
|
||||
|
||||
private static void Shutdown(int flag)
|
||||
{
|
||||
// Removed 2012-11-23 G# - Migrate to Win32 PInvoke Shutdown for better Privilege Handling
|
||||
//ManagementBaseObject mboShutdown = null;
|
||||
//ManagementClass mcWin32 = new ManagementClass("Win32_OperatingSystem");
|
||||
//mcWin32.Get();
|
||||
|
||||
//// You can't shutdown without security privileges
|
||||
//mcWin32.Scope.Options.EnablePrivileges = true;
|
||||
//ManagementBaseObject mboShutdownParams =
|
||||
// mcWin32.GetMethodParameters("Win32Shutdown");
|
||||
|
||||
//// Flag 1 means we want to shut down the system. Use "2" to reboot.
|
||||
//mboShutdownParams["Flags"] = flag;
|
||||
//mboShutdownParams["Reserved"] = "0";
|
||||
//foreach (ManagementObject manObj in mcWin32.GetInstances())
|
||||
//{
|
||||
// mboShutdown = manObj.InvokeMethod("Win32Shutdown",
|
||||
// mboShutdownParams, null);
|
||||
//}
|
||||
// End Removed 2012-11-23 G#
|
||||
|
||||
// Added 2012-11-23 G# - Migrate to Win32 PInvoke Shutdown
|
||||
bool result;
|
||||
TokPriv1Luid tp;
|
||||
|
||||
IntPtr hproc = GetCurrentProcess();
|
||||
IntPtr htok = IntPtr.Zero;
|
||||
|
||||
result = OpenProcessToken(hproc, TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, ref htok);
|
||||
|
||||
tp.Count = 1;
|
||||
tp.Luid = 0;
|
||||
tp.Attr = SE_PRIVILEGE_ENABLED;
|
||||
|
||||
result = LookupPrivilegeValue(null, SE_SHUTDOWN_NAME, ref tp.Luid);
|
||||
result = AdjustTokenPrivileges(htok, false, ref tp, 0, IntPtr.Zero, IntPtr.Zero);
|
||||
result = ExitWindowsEx(flag, 0);
|
||||
// End Added 2012-11-23 G#
|
||||
}
|
||||
|
||||
#region Win32 PInvoke Interop
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
private struct TokPriv1Luid
|
||||
{
|
||||
public int Count;
|
||||
public long Luid;
|
||||
public int Attr;
|
||||
}
|
||||
|
||||
[DllImport("kernel32.dll", ExactSpelling = true)]
|
||||
private static extern IntPtr GetCurrentProcess();
|
||||
|
||||
[DllImport("advapi32.dll", ExactSpelling = true, SetLastError = true)]
|
||||
private static extern bool OpenProcessToken(IntPtr h, int acc, ref IntPtr phtok);
|
||||
|
||||
[DllImport("advapi32.dll", SetLastError = true)]
|
||||
private static extern bool LookupPrivilegeValue(string host, string name, ref long pluid);
|
||||
|
||||
[DllImport("advapi32.dll", ExactSpelling = true, SetLastError = true)]
|
||||
private static extern bool AdjustTokenPrivileges(IntPtr htok, bool disall, ref TokPriv1Luid newst, int len, IntPtr prev, IntPtr relen);
|
||||
|
||||
[DllImport("user32.dll", ExactSpelling = true, SetLastError = true)]
|
||||
private static extern bool ExitWindowsEx(int flg, int rea);
|
||||
|
||||
private const int SE_PRIVILEGE_ENABLED = 0x00000002;
|
||||
private const int TOKEN_QUERY = 0x00000008;
|
||||
private const int TOKEN_ADJUST_PRIVILEGES = 0x00000020;
|
||||
private const string SE_SHUTDOWN_NAME = "SeShutdownPrivilege";
|
||||
private const int EWX_LOGOFF = 0x00000000;
|
||||
private const int EWX_SHUTDOWN = 0x00000001;
|
||||
private const int EWX_REBOOT = 0x00000002;
|
||||
private const int EWX_FORCE = 0x00000004;
|
||||
private const int EWX_POWEROFF = 0x00000008;
|
||||
private const int EWX_FORCEIFHUNG = 0x00000010;
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Management;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Disco.ClientBootstrapper.Interop
|
||||
{
|
||||
public static class ShutdownInterop
|
||||
{
|
||||
public static void Shutdown()
|
||||
{
|
||||
// 8 = Power Off
|
||||
Shutdown(EWX_POWEROFF);
|
||||
}
|
||||
public static void Reboot()
|
||||
{
|
||||
// 2 = Reboot
|
||||
Shutdown(EWX_REBOOT);
|
||||
}
|
||||
|
||||
private static void Shutdown(int flag)
|
||||
{
|
||||
// Removed 2012-11-23 G# - Migrate to Win32 PInvoke Shutdown for better Privilege Handling
|
||||
//ManagementBaseObject mboShutdown = null;
|
||||
//ManagementClass mcWin32 = new ManagementClass("Win32_OperatingSystem");
|
||||
//mcWin32.Get();
|
||||
|
||||
//// You can't shutdown without security privileges
|
||||
//mcWin32.Scope.Options.EnablePrivileges = true;
|
||||
//ManagementBaseObject mboShutdownParams =
|
||||
// mcWin32.GetMethodParameters("Win32Shutdown");
|
||||
|
||||
//// Flag 1 means we want to shut down the system. Use "2" to reboot.
|
||||
//mboShutdownParams["Flags"] = flag;
|
||||
//mboShutdownParams["Reserved"] = "0";
|
||||
//foreach (ManagementObject manObj in mcWin32.GetInstances())
|
||||
//{
|
||||
// mboShutdown = manObj.InvokeMethod("Win32Shutdown",
|
||||
// mboShutdownParams, null);
|
||||
//}
|
||||
// End Removed 2012-11-23 G#
|
||||
|
||||
// Added 2012-11-23 G# - Migrate to Win32 PInvoke Shutdown
|
||||
bool result;
|
||||
TokPriv1Luid tp;
|
||||
|
||||
IntPtr hproc = GetCurrentProcess();
|
||||
IntPtr htok = IntPtr.Zero;
|
||||
|
||||
result = OpenProcessToken(hproc, TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, ref htok);
|
||||
|
||||
tp.Count = 1;
|
||||
tp.Luid = 0;
|
||||
tp.Attr = SE_PRIVILEGE_ENABLED;
|
||||
|
||||
result = LookupPrivilegeValue(null, SE_SHUTDOWN_NAME, ref tp.Luid);
|
||||
result = AdjustTokenPrivileges(htok, false, ref tp, 0, IntPtr.Zero, IntPtr.Zero);
|
||||
result = ExitWindowsEx(flag, 0);
|
||||
// End Added 2012-11-23 G#
|
||||
}
|
||||
|
||||
#region Win32 PInvoke Interop
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
private struct TokPriv1Luid
|
||||
{
|
||||
public int Count;
|
||||
public long Luid;
|
||||
public int Attr;
|
||||
}
|
||||
|
||||
[DllImport("kernel32.dll", ExactSpelling = true)]
|
||||
private static extern IntPtr GetCurrentProcess();
|
||||
|
||||
[DllImport("advapi32.dll", ExactSpelling = true, SetLastError = true)]
|
||||
private static extern bool OpenProcessToken(IntPtr h, int acc, ref IntPtr phtok);
|
||||
|
||||
[DllImport("advapi32.dll", SetLastError = true)]
|
||||
private static extern bool LookupPrivilegeValue(string host, string name, ref long pluid);
|
||||
|
||||
[DllImport("advapi32.dll", ExactSpelling = true, SetLastError = true)]
|
||||
private static extern bool AdjustTokenPrivileges(IntPtr htok, bool disall, ref TokPriv1Luid newst, int len, IntPtr prev, IntPtr relen);
|
||||
|
||||
[DllImport("user32.dll", ExactSpelling = true, SetLastError = true)]
|
||||
private static extern bool ExitWindowsEx(int flg, int rea);
|
||||
|
||||
private const int SE_PRIVILEGE_ENABLED = 0x00000002;
|
||||
private const int TOKEN_QUERY = 0x00000008;
|
||||
private const int TOKEN_ADJUST_PRIVILEGES = 0x00000020;
|
||||
private const string SE_SHUTDOWN_NAME = "SeShutdownPrivilege";
|
||||
private const int EWX_LOGOFF = 0x00000000;
|
||||
private const int EWX_SHUTDOWN = 0x00000001;
|
||||
private const int EWX_REBOOT = 0x00000002;
|
||||
private const int EWX_FORCE = 0x00000004;
|
||||
private const int EWX_POWEROFF = 0x00000008;
|
||||
private const int EWX_FORCEIFHUNG = 0x00000010;
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,15 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace Disco.ClientBootstrapper
|
||||
{
|
||||
class NullStatus : IStatus
|
||||
{
|
||||
public void UpdateStatus(string Heading, string SubHeading, string Message, bool? ShowProgress = null, int? Progress = null)
|
||||
{
|
||||
// Do Nothing
|
||||
}
|
||||
}
|
||||
}
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace Disco.ClientBootstrapper
|
||||
{
|
||||
class NullStatus : IStatus
|
||||
{
|
||||
public void UpdateStatus(string Heading, string SubHeading, string Message, bool? ShowProgress = null, int? Progress = null)
|
||||
{
|
||||
// Do Nothing
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+191
-191
@@ -1,191 +1,191 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
using System.Threading;
|
||||
|
||||
namespace Disco.ClientBootstrapper
|
||||
{
|
||||
static class Program
|
||||
{
|
||||
public static IStatus Status { get; set; }
|
||||
public static BootstrapperLoop BootstrapperLoop { get; set; }
|
||||
public static InstallLoop InstallLoop { get; set; }
|
||||
|
||||
public static List<string> PostBootstrapperActions { get; set; }
|
||||
public static bool AllowUninstall { get; set; }
|
||||
public static bool ApplicationExiting { get; set; }
|
||||
public static Lazy<string> InlinePath = new Lazy<string>(() =>
|
||||
{
|
||||
return System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
|
||||
});
|
||||
|
||||
/// <summary>
|
||||
/// The main entry point for the application.
|
||||
/// </summary>
|
||||
[STAThread]
|
||||
static void Main(string[] args)
|
||||
{
|
||||
Application.ThreadException += new ThreadExceptionEventHandler(Application_ThreadException);
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
|
||||
if (args.Length > 0)
|
||||
{
|
||||
switch (args[0].ToLower())
|
||||
{
|
||||
case "/install":
|
||||
var statusForm = new FormStatus();
|
||||
Status = statusForm;
|
||||
statusForm.Show();
|
||||
string installLocation = null;
|
||||
string wimImage = null;
|
||||
if (args.Length > 1)
|
||||
installLocation = args[1];
|
||||
if (args.Length > 2)
|
||||
wimImage = args[2];
|
||||
InstallLoop = new InstallLoop(installLocation, wimImage);
|
||||
InstallLoop.Start(new InstallLoop.CompleteCallback(InstallComplete));
|
||||
Application.Run();
|
||||
return;
|
||||
case "/uninstall":
|
||||
AllowUninstall = true;
|
||||
Status = new NullStatus();
|
||||
Interop.InstallInterop.Uninstall();
|
||||
return;
|
||||
case "/allowuninstall":
|
||||
AllowUninstall = true;
|
||||
break;
|
||||
default:
|
||||
AllowUninstall = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (Status == null)
|
||||
{
|
||||
var statusForm = new FormStatus();
|
||||
Status = statusForm;
|
||||
statusForm.Show();
|
||||
}
|
||||
|
||||
BootstrapperLoop = new BootstrapperLoop(Status, new BootstrapperLoop.LoopCompleteCallback(LoopComplete));
|
||||
BootstrapperLoop.Start();
|
||||
|
||||
Application.Run();
|
||||
}
|
||||
|
||||
static void Application_ThreadException(object sender, ThreadExceptionEventArgs e)
|
||||
{
|
||||
WriteAppError(e.Exception);
|
||||
}
|
||||
|
||||
public static void WriteAppError(Exception ex)
|
||||
{
|
||||
try
|
||||
{
|
||||
string AppErrorPath = string.Format("{0}{1}", System.Reflection.Assembly.GetExecutingAssembly().Location, ".errors.txt");
|
||||
System.Text.StringBuilder ErrorMessage = new System.Text.StringBuilder();
|
||||
ErrorMessage.AppendLine();
|
||||
ErrorMessage.AppendLine(DateTime.Now.ToLongDateString());
|
||||
ErrorMessage.AppendLine(DateTime.Now.ToLongTimeString());
|
||||
ErrorMessage.AppendLine(string.Format("Type: {0}", ex.GetType().FullName));
|
||||
ErrorMessage.AppendLine(string.Format("Message: {0}", ex.Message));
|
||||
ErrorMessage.AppendLine(string.Format("Source: {0}", ex.Source));
|
||||
ErrorMessage.AppendLine(string.Format("Stack: {0}", ex.StackTrace));
|
||||
System.IO.File.AppendAllText(AppErrorPath, ErrorMessage.ToString());
|
||||
}
|
||||
catch (Exception) { }
|
||||
}
|
||||
|
||||
public static void LoopComplete()
|
||||
{
|
||||
// Run Post Actions
|
||||
if (PostBootstrapperActions != null)
|
||||
{
|
||||
// Check Uninstall
|
||||
if (AllowUninstall && PostBootstrapperActions.Contains("UninstallBootstrapper"))
|
||||
{
|
||||
Interop.InstallInterop.Uninstall();
|
||||
}
|
||||
|
||||
// Check ShutdownActions
|
||||
if (PostBootstrapperActions.Contains("Shutdown"))
|
||||
{
|
||||
Status.UpdateStatus("System Preparation (Bootstrapper)", "Shutting Down; Finished...", string.Empty, false, 0);
|
||||
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
|
||||
{
|
||||
Status.UpdateStatus("System Preparation (Bootstrapper)", "Starting System; Finished...", string.Empty, false, 0);
|
||||
SleepThread(2000, true);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Status.UpdateStatus("System Preparation (Bootstrapper)", "Starting System; Finished...", string.Empty, false, 0);
|
||||
SleepThread(2000, true);
|
||||
}
|
||||
|
||||
ExitApplication();
|
||||
}
|
||||
|
||||
public static void InstallComplete()
|
||||
{
|
||||
ExitApplication();
|
||||
}
|
||||
|
||||
public static void ExitApplication()
|
||||
{
|
||||
if (!ApplicationExiting)
|
||||
{
|
||||
ApplicationExiting = true;
|
||||
if (BootstrapperLoop != null)
|
||||
{
|
||||
if (BootstrapperLoop.LoopThread != null)
|
||||
{
|
||||
if (BootstrapperLoop.LoopThread.ThreadState == System.Threading.ThreadState.WaitSleepJoin)
|
||||
{
|
||||
BootstrapperLoop.LoopThread.Interrupt();
|
||||
}
|
||||
if (BootstrapperLoop.LoopThread.ThreadState == System.Threading.ThreadState.Running)
|
||||
{
|
||||
BootstrapperLoop.LoopThread.Abort();
|
||||
}
|
||||
}
|
||||
}
|
||||
Application.Exit();
|
||||
}
|
||||
}
|
||||
|
||||
public static void Trace(string Format, params string[] args)
|
||||
{
|
||||
System.Diagnostics.Debug.WriteLine(Format, args);
|
||||
}
|
||||
|
||||
public static void SleepThread(int millisecondsTimeout, bool updateUI)
|
||||
{
|
||||
if (updateUI)
|
||||
{
|
||||
for (int i = 0; i < millisecondsTimeout; i += 500)
|
||||
{
|
||||
int progress = Convert.ToInt32(((Convert.ToDouble(i) / Convert.ToDouble(millisecondsTimeout)) * 100));
|
||||
Status.UpdateStatus(null, null, null, true, progress);
|
||||
Thread.Sleep(500);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Thread.Sleep(millisecondsTimeout);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
using System.Threading;
|
||||
|
||||
namespace Disco.ClientBootstrapper
|
||||
{
|
||||
static class Program
|
||||
{
|
||||
public static IStatus Status { get; set; }
|
||||
public static BootstrapperLoop BootstrapperLoop { get; set; }
|
||||
public static InstallLoop InstallLoop { get; set; }
|
||||
|
||||
public static List<string> PostBootstrapperActions { get; set; }
|
||||
public static bool AllowUninstall { get; set; }
|
||||
public static bool ApplicationExiting { get; set; }
|
||||
public static Lazy<string> InlinePath = new Lazy<string>(() =>
|
||||
{
|
||||
return System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
|
||||
});
|
||||
|
||||
/// <summary>
|
||||
/// The main entry point for the application.
|
||||
/// </summary>
|
||||
[STAThread]
|
||||
static void Main(string[] args)
|
||||
{
|
||||
Application.ThreadException += new ThreadExceptionEventHandler(Application_ThreadException);
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
|
||||
if (args.Length > 0)
|
||||
{
|
||||
switch (args[0].ToLower())
|
||||
{
|
||||
case "/install":
|
||||
var statusForm = new FormStatus();
|
||||
Status = statusForm;
|
||||
statusForm.Show();
|
||||
string installLocation = null;
|
||||
string wimImage = null;
|
||||
if (args.Length > 1)
|
||||
installLocation = args[1];
|
||||
if (args.Length > 2)
|
||||
wimImage = args[2];
|
||||
InstallLoop = new InstallLoop(installLocation, wimImage);
|
||||
InstallLoop.Start(new InstallLoop.CompleteCallback(InstallComplete));
|
||||
Application.Run();
|
||||
return;
|
||||
case "/uninstall":
|
||||
AllowUninstall = true;
|
||||
Status = new NullStatus();
|
||||
Interop.InstallInterop.Uninstall();
|
||||
return;
|
||||
case "/allowuninstall":
|
||||
AllowUninstall = true;
|
||||
break;
|
||||
default:
|
||||
AllowUninstall = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (Status == null)
|
||||
{
|
||||
var statusForm = new FormStatus();
|
||||
Status = statusForm;
|
||||
statusForm.Show();
|
||||
}
|
||||
|
||||
BootstrapperLoop = new BootstrapperLoop(Status, new BootstrapperLoop.LoopCompleteCallback(LoopComplete));
|
||||
BootstrapperLoop.Start();
|
||||
|
||||
Application.Run();
|
||||
}
|
||||
|
||||
static void Application_ThreadException(object sender, ThreadExceptionEventArgs e)
|
||||
{
|
||||
WriteAppError(e.Exception);
|
||||
}
|
||||
|
||||
public static void WriteAppError(Exception ex)
|
||||
{
|
||||
try
|
||||
{
|
||||
string AppErrorPath = string.Format("{0}{1}", System.Reflection.Assembly.GetExecutingAssembly().Location, ".errors.txt");
|
||||
System.Text.StringBuilder ErrorMessage = new System.Text.StringBuilder();
|
||||
ErrorMessage.AppendLine();
|
||||
ErrorMessage.AppendLine(DateTime.Now.ToLongDateString());
|
||||
ErrorMessage.AppendLine(DateTime.Now.ToLongTimeString());
|
||||
ErrorMessage.AppendLine(string.Format("Type: {0}", ex.GetType().FullName));
|
||||
ErrorMessage.AppendLine(string.Format("Message: {0}", ex.Message));
|
||||
ErrorMessage.AppendLine(string.Format("Source: {0}", ex.Source));
|
||||
ErrorMessage.AppendLine(string.Format("Stack: {0}", ex.StackTrace));
|
||||
System.IO.File.AppendAllText(AppErrorPath, ErrorMessage.ToString());
|
||||
}
|
||||
catch (Exception) { }
|
||||
}
|
||||
|
||||
public static void LoopComplete()
|
||||
{
|
||||
// Run Post Actions
|
||||
if (PostBootstrapperActions != null)
|
||||
{
|
||||
// Check Uninstall
|
||||
if (AllowUninstall && PostBootstrapperActions.Contains("UninstallBootstrapper"))
|
||||
{
|
||||
Interop.InstallInterop.Uninstall();
|
||||
}
|
||||
|
||||
// Check ShutdownActions
|
||||
if (PostBootstrapperActions.Contains("Shutdown"))
|
||||
{
|
||||
Status.UpdateStatus("System Preparation (Bootstrapper)", "Shutting Down; Finished...", string.Empty, false, 0);
|
||||
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
|
||||
{
|
||||
Status.UpdateStatus("System Preparation (Bootstrapper)", "Starting System; Finished...", string.Empty, false, 0);
|
||||
SleepThread(2000, true);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Status.UpdateStatus("System Preparation (Bootstrapper)", "Starting System; Finished...", string.Empty, false, 0);
|
||||
SleepThread(2000, true);
|
||||
}
|
||||
|
||||
ExitApplication();
|
||||
}
|
||||
|
||||
public static void InstallComplete()
|
||||
{
|
||||
ExitApplication();
|
||||
}
|
||||
|
||||
public static void ExitApplication()
|
||||
{
|
||||
if (!ApplicationExiting)
|
||||
{
|
||||
ApplicationExiting = true;
|
||||
if (BootstrapperLoop != null)
|
||||
{
|
||||
if (BootstrapperLoop.LoopThread != null)
|
||||
{
|
||||
if (BootstrapperLoop.LoopThread.ThreadState == System.Threading.ThreadState.WaitSleepJoin)
|
||||
{
|
||||
BootstrapperLoop.LoopThread.Interrupt();
|
||||
}
|
||||
if (BootstrapperLoop.LoopThread.ThreadState == System.Threading.ThreadState.Running)
|
||||
{
|
||||
BootstrapperLoop.LoopThread.Abort();
|
||||
}
|
||||
}
|
||||
}
|
||||
Application.Exit();
|
||||
}
|
||||
}
|
||||
|
||||
public static void Trace(string Format, params string[] args)
|
||||
{
|
||||
System.Diagnostics.Debug.WriteLine(Format, args);
|
||||
}
|
||||
|
||||
public static void SleepThread(int millisecondsTimeout, bool updateUI)
|
||||
{
|
||||
if (updateUI)
|
||||
{
|
||||
for (int i = 0; i < millisecondsTimeout; i += 500)
|
||||
{
|
||||
int progress = Convert.ToInt32(((Convert.ToDouble(i) / Convert.ToDouble(millisecondsTimeout)) * 100));
|
||||
Status.UpdateStatus(null, null, null, true, progress);
|
||||
Thread.Sleep(500);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Thread.Sleep(millisecondsTimeout);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+73
-73
@@ -1,73 +1,73 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.17929
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Disco.ClientBootstrapper.Properties {
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// </summary>
|
||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources {
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources() {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Disco.ClientBootstrapper.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
set {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap Background_BW {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("Background_BW", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.17929
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Disco.ClientBootstrapper.Properties {
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// </summary>
|
||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources {
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources() {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Disco.ClientBootstrapper.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
set {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap Background_BW {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("Background_BW", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,124 +1,124 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<data name="Background_BW" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\Background-BW.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<data name="Background_BW" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\Background-BW.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
</root>
|
||||
+30
-30
@@ -1,30 +1,30 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.225
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Disco.ClientBootstrapper.Properties
|
||||
{
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
|
||||
{
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
||||
public static Settings Default
|
||||
{
|
||||
get
|
||||
{
|
||||
return defaultInstance;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.225
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Disco.ClientBootstrapper.Properties
|
||||
{
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
|
||||
{
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
||||
public static Settings Default
|
||||
{
|
||||
get
|
||||
{
|
||||
return defaultInstance;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
|
||||
<Profiles>
|
||||
<Profile Name="(Default)" />
|
||||
</Profiles>
|
||||
<Settings />
|
||||
</SettingsFile>
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
|
||||
<Profiles>
|
||||
<Profile Name="(Default)" />
|
||||
</Profiles>
|
||||
<Settings />
|
||||
</SettingsFile>
|
||||
|
||||
@@ -1,48 +1,48 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<asmv1:assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<assemblyIdentity version="1.0.0.0" name="DiscoClientBootstrapper.app"/>
|
||||
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
|
||||
<security>
|
||||
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||
<!-- UAC Manifest Options
|
||||
If you want to change the Windows User Account Control level replace the
|
||||
requestedExecutionLevel node with one of the following.
|
||||
|
||||
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
|
||||
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
|
||||
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
|
||||
|
||||
Specifying requestedExecutionLevel node will disable file and registry virtualization.
|
||||
If you want to utilize File and Registry Virtualization for backward
|
||||
compatibility then delete the requestedExecutionLevel node.
|
||||
-->
|
||||
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
|
||||
</requestedPrivileges>
|
||||
</security>
|
||||
</trustInfo>
|
||||
|
||||
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
|
||||
<application>
|
||||
<!-- A list of all Windows versions that this application is designed to work with. Windows will automatically select the most compatible environment.-->
|
||||
|
||||
<!-- If your application is designed to work with Windows 7, uncomment the following supportedOS node-->
|
||||
<!--<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>-->
|
||||
|
||||
</application>
|
||||
</compatibility>
|
||||
|
||||
<!-- Enable themes for Windows common controls and dialogs (Windows XP and later) -->
|
||||
<!-- <dependency>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity
|
||||
type="win32"
|
||||
name="Microsoft.Windows.Common-Controls"
|
||||
version="6.0.0.0"
|
||||
processorArchitecture="*"
|
||||
publicKeyToken="6595b64144ccf1df"
|
||||
language="*"
|
||||
/>
|
||||
</dependentAssembly>
|
||||
</dependency>-->
|
||||
|
||||
</asmv1:assembly>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<asmv1:assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<assemblyIdentity version="1.0.0.0" name="DiscoClientBootstrapper.app"/>
|
||||
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
|
||||
<security>
|
||||
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||
<!-- UAC Manifest Options
|
||||
If you want to change the Windows User Account Control level replace the
|
||||
requestedExecutionLevel node with one of the following.
|
||||
|
||||
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
|
||||
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
|
||||
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
|
||||
|
||||
Specifying requestedExecutionLevel node will disable file and registry virtualization.
|
||||
If you want to utilize File and Registry Virtualization for backward
|
||||
compatibility then delete the requestedExecutionLevel node.
|
||||
-->
|
||||
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
|
||||
</requestedPrivileges>
|
||||
</security>
|
||||
</trustInfo>
|
||||
|
||||
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
|
||||
<application>
|
||||
<!-- A list of all Windows versions that this application is designed to work with. Windows will automatically select the most compatible environment.-->
|
||||
|
||||
<!-- If your application is designed to work with Windows 7, uncomment the following supportedOS node-->
|
||||
<!--<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>-->
|
||||
|
||||
</application>
|
||||
</compatibility>
|
||||
|
||||
<!-- Enable themes for Windows common controls and dialogs (Windows XP and later) -->
|
||||
<!-- <dependency>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity
|
||||
type="win32"
|
||||
name="Microsoft.Windows.Common-Controls"
|
||||
version="6.0.0.0"
|
||||
processorArchitecture="*"
|
||||
publicKeyToken="6595b64144ccf1df"
|
||||
language="*"
|
||||
/>
|
||||
</dependentAssembly>
|
||||
</dependency>-->
|
||||
|
||||
</asmv1:assembly>
|
||||
|
||||
@@ -1,54 +1,54 @@
|
||||
Option Explicit
|
||||
|
||||
On Error Resume Next
|
||||
|
||||
Dim objWMIService, objWMIProcesses, objFSO, objShell
|
||||
Dim WaitForProcessID, DeleteDirectory, GroupPolicyScriptLocation
|
||||
|
||||
'WaitForProcessID = CInt(WScript.Arguments.Named.Item("WaitForProcessID"))
|
||||
DeleteDirectory = Mid(WScript.ScriptFullName, 1, InStrRev(WScript.ScriptFullName, "\") - 1)
|
||||
|
||||
'If WaitForProcessID > 0 Then
|
||||
' Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
|
||||
' Do
|
||||
' Set objWMIProcesses = objWMIService.ExecQuery("SELECT ProcessId FROM Win32_Process WHERE ProcessId=" & WaitForProcessID)
|
||||
' If objWMIProcesses.Count = 0 Then
|
||||
' Exit Do
|
||||
' End If
|
||||
' WScript.Sleep 500
|
||||
' Loop
|
||||
' Err.Clear
|
||||
'End If
|
||||
'Set objWMIService = Nothing
|
||||
'Set objWMIProcesses = Nothing
|
||||
|
||||
Set objShell = CreateObject("WScript.Shell")
|
||||
Set objFSO = CreateObject("Scripting.FileSystemObject")
|
||||
|
||||
Do
|
||||
Call Err.Clear()
|
||||
If objFSO.FolderExists(DeleteDirectory) Then
|
||||
objFSO.DeleteFolder DeleteDirectory, True
|
||||
End If
|
||||
WScript.Sleep 1000
|
||||
Loop Until Err.Number = 0
|
||||
|
||||
GroupPolicyScriptLocation = objShell.ExpandEnvironmentStrings("%WinDir%\System32\GroupPolicy\Machine\Scripts\scripts.ini")
|
||||
If objFSO.FileExists(GroupPolicyScriptLocation) Then
|
||||
Call objFSO.DeleteFile(GroupPolicyScriptLocation)
|
||||
End If
|
||||
|
||||
Set objFSO = Nothing
|
||||
|
||||
objShell.RegDelete("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\HideStartupScripts")
|
||||
objShell.RegDelete("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\RunStartupScriptSync")
|
||||
objShell.RegDelete("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\Scripts\Shutdown\")
|
||||
objShell.RegDelete("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\Scripts\Startup\0\0\")
|
||||
objShell.RegDelete("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\Scripts\Startup\0\")
|
||||
objShell.RegDelete("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\Scripts\Startup\")
|
||||
objShell.RegDelete("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\State\Machine\Scripts\Shutdown\")
|
||||
objShell.RegDelete("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\State\Machine\Scripts\Startup\0\0\")
|
||||
objShell.RegDelete("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\State\Machine\Scripts\Startup\0\")
|
||||
objShell.RegDelete("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\State\Machine\Scripts\Startup\")
|
||||
|
||||
Option Explicit
|
||||
|
||||
On Error Resume Next
|
||||
|
||||
Dim objWMIService, objWMIProcesses, objFSO, objShell
|
||||
Dim WaitForProcessID, DeleteDirectory, GroupPolicyScriptLocation
|
||||
|
||||
'WaitForProcessID = CInt(WScript.Arguments.Named.Item("WaitForProcessID"))
|
||||
DeleteDirectory = Mid(WScript.ScriptFullName, 1, InStrRev(WScript.ScriptFullName, "\") - 1)
|
||||
|
||||
'If WaitForProcessID > 0 Then
|
||||
' Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
|
||||
' Do
|
||||
' Set objWMIProcesses = objWMIService.ExecQuery("SELECT ProcessId FROM Win32_Process WHERE ProcessId=" & WaitForProcessID)
|
||||
' If objWMIProcesses.Count = 0 Then
|
||||
' Exit Do
|
||||
' End If
|
||||
' WScript.Sleep 500
|
||||
' Loop
|
||||
' Err.Clear
|
||||
'End If
|
||||
'Set objWMIService = Nothing
|
||||
'Set objWMIProcesses = Nothing
|
||||
|
||||
Set objShell = CreateObject("WScript.Shell")
|
||||
Set objFSO = CreateObject("Scripting.FileSystemObject")
|
||||
|
||||
Do
|
||||
Call Err.Clear()
|
||||
If objFSO.FolderExists(DeleteDirectory) Then
|
||||
objFSO.DeleteFolder DeleteDirectory, True
|
||||
End If
|
||||
WScript.Sleep 1000
|
||||
Loop Until Err.Number = 0
|
||||
|
||||
GroupPolicyScriptLocation = objShell.ExpandEnvironmentStrings("%WinDir%\System32\GroupPolicy\Machine\Scripts\scripts.ini")
|
||||
If objFSO.FileExists(GroupPolicyScriptLocation) Then
|
||||
Call objFSO.DeleteFile(GroupPolicyScriptLocation)
|
||||
End If
|
||||
|
||||
Set objFSO = Nothing
|
||||
|
||||
objShell.RegDelete("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\HideStartupScripts")
|
||||
objShell.RegDelete("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\RunStartupScriptSync")
|
||||
objShell.RegDelete("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\Scripts\Shutdown\")
|
||||
objShell.RegDelete("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\Scripts\Startup\0\0\")
|
||||
objShell.RegDelete("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\Scripts\Startup\0\")
|
||||
objShell.RegDelete("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\Scripts\Startup\")
|
||||
objShell.RegDelete("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\State\Machine\Scripts\Shutdown\")
|
||||
objShell.RegDelete("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\State\Machine\Scripts\Startup\0\0\")
|
||||
objShell.RegDelete("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\State\Machine\Scripts\Startup\0\")
|
||||
objShell.RegDelete("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\State\Machine\Scripts\Startup\")
|
||||
|
||||
Set objShell = Nothing
|
||||
Reference in New Issue
Block a user