Skip to content

Commit

Permalink
Fix error if disks with unknown format are present and fix generated …
Browse files Browse the repository at this point in the history
…config text
  • Loading branch information
t1m0thyj committed Sep 14, 2018
1 parent ab8e506 commit 1856b9b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 16 deletions.
28 changes: 15 additions & 13 deletions src/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,23 @@ private void UpdateDriveList()
continue;
}

string itemName;
if (d.VolumeLabel.Length > 0)
try
{
itemName = d.Name.TrimEnd('\\') + " (" + d.VolumeLabel + ")";
string itemName = d.Name;
if (d.VolumeLabel.Length > 0)
{
itemName += " (" + d.VolumeLabel + ")";
}

driveComboBox.Items.Add(itemName);

if (d.VolumeLabel == "boot")
{
driveComboBox.SelectedItem = itemName;
}
}
else
catch (IOException)
{
itemName = d.Name.TrimEnd('\\');
}

driveComboBox.Items.Add(itemName);

if (d.VolumeLabel == "boot")
{
driveComboBox.SelectedItem = itemName;
}
}
}
Expand Down Expand Up @@ -78,7 +80,7 @@ private void ConfigureImage(string bootDrive, string networkConfig, bool enableS
if (writeConfig)
{
string configText = "ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev\n"
+ "update_config = 1\ncountry = US\n\n" + networkConfig + "\n";
+ "update_config=1\ncountry=US\n\n" + networkConfig + "\n";
File.WriteAllText(wpaSupplicantConf, configText);
}

Expand Down
4 changes: 2 additions & 2 deletions src/WpaEnterprise.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ public static string GetConfig(string networkName, string username, string passw
{
List<string> config = new List<string>()
{
"network = {",
"\tssid = \"" + networkName + "\"",
"network={",
"\tssid=\"" + networkName + "\"",
"\tscan_ssid=1",
"\tkey_mgmt=WPA-EAP",
"\teap=PEAP",
Expand Down
3 changes: 2 additions & 1 deletion src/WpaPersonal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,9 @@ public static string GetConfig(string networkName, string password)
{
"network={",
"\tssid=\"" + networkName + "\"",
"\tpsk=" + ComputeHash(password, networkName),
"\tscan_ssid=1",
"\tkey_mgmt=WPA-PSK",
"\tpsk=" + ComputeHash(password, networkName),
"}"
};

Expand Down

0 comments on commit 1856b9b

Please sign in to comment.