diff --git a/src/MainForm.cs b/src/MainForm.cs index 16919fc..83f4b05 100644 --- a/src/MainForm.cs +++ b/src/MainForm.cs @@ -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; } } } @@ -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); } diff --git a/src/WpaEnterprise.cs b/src/WpaEnterprise.cs index a700d54..b3a4d93 100644 --- a/src/WpaEnterprise.cs +++ b/src/WpaEnterprise.cs @@ -54,8 +54,8 @@ public static string GetConfig(string networkName, string username, string passw { List config = new List() { - "network = {", - "\tssid = \"" + networkName + "\"", + "network={", + "\tssid=\"" + networkName + "\"", "\tscan_ssid=1", "\tkey_mgmt=WPA-EAP", "\teap=PEAP", diff --git a/src/WpaPersonal.cs b/src/WpaPersonal.cs index 027c513..ea9e8d6 100644 --- a/src/WpaPersonal.cs +++ b/src/WpaPersonal.cs @@ -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), "}" };