Subversion Repositories Code-Repo

Compare Revisions

No changes between revisions

Ignore whitespace Rev 16 → Rev 14

/SWAT USB App/trunk/SWAT USB App/AboutBox.Designer.cs
File deleted
/SWAT USB App/trunk/SWAT USB App/AboutBox.cs
File deleted
/SWAT USB App/trunk/SWAT USB App/About.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/SWAT USB App/trunk/SWAT USB App/About.png
Property changes:
Deleted: svn:mime-type
-application/octet-stream
\ No newline at end of property
/SWAT USB App/trunk/SWAT USB App/AboutBox.resx
File deleted
\ No newline at end of file
/SWAT USB App/trunk/SWAT USB App/USBSettings.xml
0,0 → 1,113
<?xml version="1.0" encoding="utf-8"?>
<Settings>
<Applications>
<Application>
<Name>Adobe Reader</Name>
<Default>Yes</Default>
<Setup>
<Location Args="">\Installer Files\Adobe\Setup.exe</Location>
</Setup>
</Application>
<Application>
<Name>Google Chrome</Name>
<Default>No</Default>
<Setup>
<Location Args="">\Installer Files\Chrome\Setup.exe</Location>
</Setup>
</Application>
<Application>
<Name>DyKnow x32</Name>
<Default>No</Default>
<Setup>
<Location Args="">\Installer Files\DyKnow 32-bit Installation\DyKnowInstall53_x86.msi</Location>
</Setup>
</Application>
<Application>
<Name>Mozilla Firefox</Name>
<Default>Yes</Default>
<Setup>
<Location Args="">\Installer Files\Firefox 3.6.8\Setup.exe</Location>
</Setup>
</Application>
<Application>
<Name>LabView</Name>
<Default>No</Default>
<Setup>
<Location Args="">\Installer Files\LabView R2009s\Setup.exe</Location>
</Setup>
</Application>
<Application>
<Name>MalwareBytes</Name>
<Default>Yes</Default>
<Setup>
<Location Args="">\Installer Files\MalwareBytes\mbam-setup-1.46.exe</Location>
</Setup>
</Application>
<Application>
<Name>MatLab x32</Name>
<Default>No</Default>
<Setup>
<Location Args="">\Installer Files\Matlab\R2010a-32bit\setup.exe</Location>
</Setup>
</Application>
<Application>
<Name>Microsoft Office 2010</Name>
<Default>Yes</Default>
<Setup>
<Location Args="">\Installer Files\Microsoft\Office 2010\Setup.exe</Location>
</Setup>
</Application>
<Application>
<Name>Microsoft Security Essentials</Name>
<Default>No</Default>
<Setup>
<Location Args="">\Installer Files\Microsoft\Security Essentials\Setup x32.exe</Location>
</Setup>
</Application>
<Application>
<Name>Symantec Antivirus</Name>
<Default>Yes</Default>
<Setup>
<Location Args="">\Installer Files\Symantec Antivirus\vtsep1106000.exe</Location>
</Setup>
</Application>
</Applications>
<Drivers>
<Driver>
<Name>Fujitsu T4220</Name>
<Setup>
<Location Args="/s /sms">\Installer Files\Drivers\Fujitsu\T4220\System Extension\Setup.exe</Location>
<Location Args="/s /sms">\Installer Files\Drivers\Fujitsu\T4220\Audio\Setup.exe</Location>
<Location Args='/s /v\"/qb\"'>\Installer Files\Drivers\Fujitsu\T4220\Bluetooth\Setup.exe</Location>
<Location Args="/s /se">\Installer Files\Drivers\Fujitsu\T4220\Button Driver\DPInst.exe</Location>
<Location Args="-s">\Installer Files\Drivers\Fujitsu\T4220\Display\Setup.exe</Location>
<Location Args='/s /v\"/qb\"'>\Installer Files\Drivers\Fujitsu\T4220\Fingerprint\Setup.exe</Location>
<Location Args="/s /sms">\Installer Files\Drivers\Fujitsu\T4220\Hotkey Utility\Setup.exe</Location>
<Location Args="/s /sms">\Installer Files\Drivers\Fujitsu\T4220\Media Slot O2Micro\Setup.exe</Location>
<Location Args="/s /sms">\Installer Files\Drivers\Fujitsu\T4220\Pen\Setup.exe</Location>
<Location Args="/s /sms">\Installer Files\Drivers\Fujitsu\T4220\SmartCard O2Micro\Setup.exe</Location>
<Location Args="/s /sms">\Installer Files\Drivers\Fujitsu\T4220\Touchpad\Setup.exe</Location>
<Location Args="/s /sms">\Installer Files\Drivers\Fujitsu\T4220\Wireless\Setup.exe</Location>
<Location Args='/s /v\"/qb\"'>\Installer Files\Drivers\Fujitsu\T4220\Button Utilities\Setup.exe</Location>
</Setup>
</Driver>
<Driver>
<Name>Fujitsu T5010</Name>
<Setup>
<Location Args="">\Installer Files\Drivers\Fujitsu\T5010\Setup.exe</Location>
</Setup>
</Driver>
<Driver>
<Name>Toshiba M700</Name>
<Setup>
<Location Args="">\Installer Files\Drivers\Toshiba\tsi4win7.exe</Location>
</Setup>
</Driver>
<Driver>
<Name>Toshiba M750</Name>
<Setup>
<Location Args="">\Installer Files\Drivers\Toshiba\tsi4win7.exe</Location>
</Setup>
</Driver>
</Drivers>
</Settings>
/SWAT USB App/trunk/SWAT USB App/Initialization.cs
11,7 → 11,6
public static class Initialization
{
public static string pathToSWATDrive { get; set; }
public static string computerModel { get; set; }
public static void Initialize()
{
try
67,26 → 66,5
MessageBox.Show(e.ToString());
}
}
public static void GetModelNumber()
{
try
{
Process proc = new Process();
proc.StartInfo.WorkingDirectory = System.Environment.SystemDirectory;
proc.StartInfo.FileName = "systeminfo.exe";
proc.StartInfo.UseShellExecute = false;
proc.StartInfo.RedirectStandardOutput = true;
proc.StartInfo.CreateNoWindow = true;
proc.Start();
string output = "";
for (int i = 0; i < 14; i++)
output = proc.StandardOutput.ReadLine();
computerModel = output.Substring(27);
}
catch (Exception e)
{
MessageBox.Show(e.ToString());
}
}
}
}
/SWAT USB App/trunk/SWAT USB App/SWAT USB App.csproj
64,12 → 64,6
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="AboutBox.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="AboutBox.Designer.cs">
<DependentUpon>AboutBox.cs</DependentUpon>
</Compile>
<Compile Include="DebugText.cs" />
<Compile Include="form_Drivers.cs">
<SubType>Form</SubType>
93,9 → 87,6
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SettingsParser.cs" />
<EmbeddedResource Include="AboutBox.resx">
<DependentUpon>AboutBox.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="form_Drivers.resx">
<DependentUpon>form_Drivers.cs</DependentUpon>
</EmbeddedResource>
/SWAT USB App/trunk/SWAT USB App/SWAT USB App.csproj.user
1,7 → 1,7
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<PublishUrlHistory>publish\</PublishUrlHistory>
<PublishUrlHistory />
<InstallUrlHistory />
<SupportUrlHistory />
<UpdateUrlHistory />
/SWAT USB App/trunk/SWAT USB App/SettingsParser.cs
33,37 → 33,25
 
// Reads the list of applications from the USBSettings.xml file into form_Software.softwareList
DebugText.appendText("Parsing list of applications into List softwareList");
foreach (XElement elem in Settings.Elements("Applications").Elements("Application"))
IEnumerable<XElement> app =
from el in Settings.Elements("Applications").Elements("Application")
select el;
foreach (XElement el in app)
{
DebugText.appendText("Adding application " + elem.Element("Name").Value + " into softwareList");
form_Software.softwareList.Add(elem.Element("Name").Value);
DebugText.appendText("Adding application " + el.Element("Name").Value + " into softwareList");
form_Software.softwareList.Add(el.Element("Name").Value);
}
// Alternate way of reading list of applications
//IEnumerable<XElement> app =
// from el in Settings.Elements("Applications").Elements("Application")
// select el;
//foreach (XElement el in app)
//{
// DebugText.appendText("Adding application " + el.Element("Name").Value + " into softwareList");
// form_Software.softwareList.Add(el.Element("Name").Value);
//}
 
// Reads the list of drivers from the USBSettings.xml file into form_Drivers.driverList
DebugText.appendText("Parsing list of drivers into List driverList");
foreach (XElement elem in Settings.Elements("Drivers").Elements("Driver"))
IEnumerable<XElement> driv =
from el in Settings.Elements("Drivers").Elements("Driver")
select el;
foreach (XElement el in driv)
{
DebugText.appendText("Adding driver " + elem.Element("Name").Value + " into driverList");
form_Drivers.driverList.Add(elem.Element("Name").Value);
DebugText.appendText("Adding driver " + el.Element("Name").Value + " into driverList");
form_Drivers.driverList.Add(el.Element("Name").Value);
}
// Alternate way of reading list of drivers
//IEnumerable<XElement> driv =
// from el in Settings.Elements("Drivers").Elements("Driver")
// select el;
//foreach (XElement el in driv)
//{
// DebugText.appendText("Adding driver " + el.Element("Name").Value + " into driverList");
// form_Drivers.driverList.Add(el.Element("Name").Value);
//}
}
catch (Exception e)
{
77,22 → 65,13
{
// Checks if passed application name is marked as default
bool isDefault = false;
foreach (XElement elem in Settings.Elements("Applications").Elements("Application"))
{
if (elem.Element("Name").Value == applicationName)
if (elem.Element("Default").Value.ToLower() == "yes")
{
isDefault = true;
break;
}
}
// Alternate method of finding if default is marked
//IEnumerable<XElement> def =
// from el in Settings.Elements("Applications").Elements("Application")
// where (string)el.Element("Name") == applicationName
// select el;
//if ((string)def.First().Element("Default").Value.ToLower() == "yes")
// isDefault = true;
 
IEnumerable<XElement> def =
from el in Settings.Elements("Applications").Elements("Application")
where (string)el.Element("Name") == applicationName
select el;
if ((string)def.First().Element("Default").Value.ToLower() == "yes")
isDefault = true;
return isDefault;
}
catch (Exception e)
112,7 → 91,6
from el in Settings.Elements("Applications").Elements("Application")
where (string)el.Element("Name") == fileName
select el;
// Checks drivers if fileName is not found in Applications
if (loc.Count() == 0)
{
loc =
/SWAT USB App/trunk/SWAT USB App/bin/Debug/Debug.txt
File deleted
/SWAT USB App/trunk/SWAT USB App/bin/Debug/SWAT USB App.exe
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/SWAT USB App/trunk/SWAT USB App/bin/Debug/SWAT USB App.pdb
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/SWAT USB App/trunk/SWAT USB App/bin/Release/SWAT USB App.vshost.exe.manifest
File deleted
/SWAT USB App/trunk/SWAT USB App/bin/Release/SWAT USB App.exe
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/SWAT USB App/trunk/SWAT USB App/bin/Release/SWAT USB App.pdb
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/SWAT USB App/trunk/SWAT USB App/form_Drivers.cs
32,70 → 32,39
}
public form_Drivers()
{
this.Load += new EventHandler(form_Drivers_Load);
InitializeComponent();
}
 
void form_Drivers_Load(object sender, EventArgs e)
{
try
{
if (driverList.Count == 0)
DebugText.appendText("Driver form initializing");
// Draws the form with a radiobutton for each driver specified in the text file
InitializeComponent();
// Location placeholder
int nextXLocation = 6, nextYLocation = 19;
// Updates the groupbox size to hold all the radiobuttons
this.groupBox_DriverList.Size = new Size(149, 40 + (driverList.Count - 1) * 23);
// Updates the window size to hold all the radiobuttons + buttons
this.Size = new Size(180, 121 + (driverList.Count - 1) * 23);
formRadioButton.Clear();
// Adds a radiobutton for each software item, adds rdoBtn to list formRadioButton
foreach (string str in driverList)
{
DebugText.appendText("No drivers were found in USBSettings.xml");
MessageBox.Show("No drivers were found in USBSettings.xml");
this.Close();
RadioButton rdoBtn = new RadioButton();
rdoBtn.Name = "rdo_" + str;
rdoBtn.AutoSize = true;
// Removes the brackets from the name
rdoBtn.Text = str;
rdoBtn.Location = new Point(nextXLocation, nextYLocation);
// Increments the location placeholder for the next radiobutton
nextYLocation += 23;
this.groupBox_DriverList.Controls.Add(rdoBtn);
formRadioButton.Add(rdoBtn);
}
else
{
bool modelFound = false;
DebugText.appendText("Driver form initializing");
Initialization.GetModelNumber();
// Draws the form with a radiobutton for each driver specified in the text file
// Location placeholder
int nextXLocation = 6, nextYLocation = 19;
// Updates the groupbox size to hold all the radiobuttons
this.groupBox_DriverList.Size = new Size(149, 40 + (driverList.Count - 1) * 23);
// Updates the window size to hold all the radiobuttons + buttons
this.Size = new Size(180, 121 + (driverList.Count - 1) * 23);
formRadioButton.Clear();
// Adds a radiobutton for each software item, adds rdoBtn to list formRadioButton
foreach (string str in driverList)
{
RadioButton rdoBtn = new RadioButton();
rdoBtn.Name = "rdo_" + str;
rdoBtn.AutoSize = true;
// Removes the brackets from the name
rdoBtn.Text = str;
rdoBtn.Location = new Point(nextXLocation, nextYLocation);
// Increments the location placeholder for the next radiobutton
nextYLocation += 23;
this.groupBox_DriverList.Controls.Add(rdoBtn);
formRadioButton.Add(rdoBtn);
// If model is detected, check the correct entry
if (str.ToLower() == Initialization.computerModel.ToLower() && modelFound == false)
{
modelFound = true;
rdoBtn.Checked = true;
}
}
if (modelFound == true)
{
MessageBox.Show("Drivers were found for this computer.\n" +
"Press OK to continue then OK to install drivers.");
}
else
{
MessageBox.Show("Drivers were not found for this computer.\n" +
"Please go to the manufacturer's site and manually\n" +
"download the drivers for this computer.");
}
}
if (driverList.Count > 0)
formRadioButton[0].Checked = true;
}
catch (Exception ex)
catch (Exception e)
{
DebugText.appendText("Exception Thrown: " + e.ToString());
MessageBox.Show(ex.ToString());
MessageBox.Show(e.ToString());
}
}
private void updateToInstallList()
/SWAT USB App/trunk/SWAT USB App/form_Main_Menu.Designer.cs
30,6 → 30,7
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(form_Main_Menu));
this.grp_Main_Menu = new System.Windows.Forms.GroupBox();
this.lbl_Version = new System.Windows.Forms.Label();
this.btn_Exit = new System.Windows.Forms.Button();
this.btn_Drivers = new System.Windows.Forms.Button();
this.btn_Software = new System.Windows.Forms.Button();
39,6 → 40,7
//
// grp_Main_Menu
//
this.grp_Main_Menu.Controls.Add(this.lbl_Version);
this.grp_Main_Menu.Controls.Add(this.btn_Exit);
this.grp_Main_Menu.Controls.Add(this.btn_Drivers);
this.grp_Main_Menu.Controls.Add(this.btn_Software);
50,6 → 52,16
this.grp_Main_Menu.TabStop = false;
this.grp_Main_Menu.Text = "Main Menu";
//
// lbl_Version
//
this.lbl_Version.AutoSize = true;
this.lbl_Version.Font = new System.Drawing.Font("Microsoft Sans Serif", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lbl_Version.Location = new System.Drawing.Point(245, 0);
this.lbl_Version.Name = "lbl_Version";
this.lbl_Version.Size = new System.Drawing.Size(24, 12);
this.lbl_Version.TabIndex = 6;
this.lbl_Version.Text = "v2.0";
//
// btn_Exit
//
this.btn_Exit.DialogResult = System.Windows.Forms.DialogResult.Cancel;
120,6 → 132,7
private System.Windows.Forms.Button btn_Software;
private System.Windows.Forms.Label lbl_Main_Menu;
private System.Windows.Forms.Button btn_Exit;
private System.Windows.Forms.Label lbl_Version;
}
}
 
/SWAT USB App/trunk/SWAT USB App/form_Main_Menu.cs
59,10 → 59,6
case 'S':
form_Software.software_Form_Instance.ShowDialog();
break;
case '?':
AboutBox newForm = new AboutBox();
newForm.ShowDialog();
break;
}
}
void form_Main_Menu_FormClosing(object sender, FormClosingEventArgs e)
/SWAT USB App/trunk/SWAT USB App/obj/x86/Debug/SWAT_USB_App.AboutBox.resources
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/SWAT USB App/trunk/SWAT USB App/obj/x86/Debug/SWAT_USB_App.AboutBox.resources
Property changes:
Deleted: svn:mime-type
-application/octet-stream
\ No newline at end of property
/SWAT USB App/trunk/SWAT USB App/obj/x86/Debug/ResGen.read.1.tlog
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/SWAT USB App/trunk/SWAT USB App/obj/x86/Debug/ResGen.write.1.tlog
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/SWAT USB App/trunk/SWAT USB App/obj/x86/Debug/ResolveAssemblyReference.cache
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/SWAT USB App/trunk/SWAT USB App/obj/x86/Debug/ResolveAssemblyReference.cache
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/SWAT USB App/trunk/SWAT USB App/obj/x86/Debug/SWAT USB App.csproj.FileListAbsolute.txt
1,7 → 1,6
C:\Users\Administrator\Documents\Visual Studio 2010\Projects\SWAT USB App\SWAT USB App\bin\Debug\SWAT USB App.exe
C:\Users\Administrator\Documents\Visual Studio 2010\Projects\SWAT USB App\SWAT USB App\bin\Debug\SWAT USB App.pdb
C:\Users\Administrator\Documents\Visual Studio 2010\Projects\SWAT USB App\SWAT USB App\obj\x86\Debug\ResolveAssemblyReference.cache
C:\Users\Administrator\Documents\Visual Studio 2010\Projects\SWAT USB App\SWAT USB App\obj\x86\Debug\SWAT_USB_App.AboutBox.resources
C:\Users\Administrator\Documents\Visual Studio 2010\Projects\SWAT USB App\SWAT USB App\obj\x86\Debug\SWAT_USB_App.form_Drivers.resources
C:\Users\Administrator\Documents\Visual Studio 2010\Projects\SWAT USB App\SWAT USB App\obj\x86\Debug\SWAT_USB_App.form_Main_Menu.resources
C:\Users\Administrator\Documents\Visual Studio 2010\Projects\SWAT USB App\SWAT USB App\obj\x86\Debug\SWAT_USB_App.form_Software.resources
/SWAT USB App/trunk/SWAT USB App/obj/x86/Debug/SWAT USB App.exe
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/SWAT USB App/trunk/SWAT USB App/obj/x86/Debug/SWAT USB App.pdb
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/SWAT USB App/trunk/SWAT USB App/obj/x86/Release/SWAT_USB_App.AboutBox.resources
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/SWAT USB App/trunk/SWAT USB App/obj/x86/Release/SWAT_USB_App.AboutBox.resources
Property changes:
Deleted: svn:mime-type
-application/octet-stream
\ No newline at end of property
/SWAT USB App/trunk/SWAT USB App/obj/x86/Release/ResGen.read.1.tlog
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/SWAT USB App/trunk/SWAT USB App/obj/x86/Release/ResGen.write.1.tlog
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/SWAT USB App/trunk/SWAT USB App/obj/x86/Release/SWAT USB App.csproj.FileListAbsolute.txt
1,7 → 1,6
C:\Users\Administrator\Documents\Visual Studio 2010\Projects\SWAT USB App\SWAT USB App\bin\Release\SWAT USB App.exe
C:\Users\Administrator\Documents\Visual Studio 2010\Projects\SWAT USB App\SWAT USB App\bin\Release\SWAT USB App.pdb
C:\Users\Administrator\Documents\Visual Studio 2010\Projects\SWAT USB App\SWAT USB App\obj\x86\Release\ResolveAssemblyReference.cache
C:\Users\Administrator\Documents\Visual Studio 2010\Projects\SWAT USB App\SWAT USB App\obj\x86\Release\SWAT_USB_App.AboutBox.resources
C:\Users\Administrator\Documents\Visual Studio 2010\Projects\SWAT USB App\SWAT USB App\obj\x86\Release\SWAT_USB_App.form_Drivers.resources
C:\Users\Administrator\Documents\Visual Studio 2010\Projects\SWAT USB App\SWAT USB App\obj\x86\Release\SWAT_USB_App.form_Main_Menu.resources
C:\Users\Administrator\Documents\Visual Studio 2010\Projects\SWAT USB App\SWAT USB App\obj\x86\Release\SWAT_USB_App.form_Software.resources
/SWAT USB App/trunk/SWAT USB App/obj/x86/Release/SWAT USB App.exe
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/SWAT USB App/trunk/SWAT USB App/obj/x86/Release/SWAT USB App.pdb
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream