public void Remove() { Logger.Info("Removing Tap device " + DeviceName); NicHelper.Devcon("remove @" + InstanceId); m = null; }
private async void InstallTap_Click(object sender, EventArgs e) { Enabled = false; MessageBox.Show( "JAW will now install the Tap device. If this is the first time you install a Tap " + "device, you will be prompted by Windows to install a device driver. Of course, you " + "must approve the installation in order for the Step to succeed.", "Tap device driver"); if (!NicHelper.InstallAndRenameTap0901Device()) { MessageBox.Show( "Failed to install the Tap device. Please try to manually remove any existing " + "unused Tap devices before retrying.", "Tap device error", MessageBoxButtons.OK, MessageBoxIcon.Error); Enabled = true; return; } await UpdateGui(); Enabled = true; }
public void Rename(string n) { Logger.Info("Renaming Tap device " + DeviceName + " to " + n); NicHelper.Netsh( "interface set interface name=\"" + DeviceName + "\" newname=\"" + n + "\"" ); m = null; }
private async void DeleteTaps_Click(object sender, EventArgs e) { Enabled = false; NicHelper.GetAllTap0901Devices().ForEach(d => d.Remove()); await UpdateGui(); Enabled = true; }
private async void SafeUninstall_Click(object sender, EventArgs e) { Enabled = false; NicHelper.DeleteTap0901JawDev(); ServiceHelper.DeleteVlmcsd(); await UpdateGui(); Enabled = true; }
// checks whether the tap device already exists and updates gui private async Task <bool> Step2Update() { // checks whether the tap device already exist bool adapterInstalled = await Task.Run( () => { return(NicHelper.JawDevInstalled()); }); // update gui if (adapterInstalled) { step2.Enabled = false; step2output.Text = "Tap device installed."; step2action.Text = "No action necessary: device is installed."; } else { previousStepEnabled |= step2.Enabled = !previousStepEnabled; step2output.Text = "Tap device not installed."; step2action.Text = "Action: install Tap device."; } return(true); }