Example #1
0
        public void Remove()
        {
            Logger.Info("Removing Tap device " + DeviceName);

            NicHelper.Devcon("remove @" + InstanceId);
            m = null;
        }
Example #2
0
        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;
        }
Example #3
0
        public void Rename(string n)
        {
            Logger.Info("Renaming Tap device " + DeviceName + " to " + n);

            NicHelper.Netsh(
                "interface set interface name=\"" + DeviceName + "\" newname=\"" + n + "\""
                );
            m = null;
        }
Example #4
0
        private async void DeleteTaps_Click(object sender, EventArgs e)
        {
            Enabled = false;

            NicHelper.GetAllTap0901Devices().ForEach(d => d.Remove());

            await UpdateGui();

            Enabled = true;
        }
Example #5
0
        private async void SafeUninstall_Click(object sender, EventArgs e)
        {
            Enabled = false;

            NicHelper.DeleteTap0901JawDev();
            ServiceHelper.DeleteVlmcsd();

            await UpdateGui();

            Enabled = true;
        }
Example #6
0
        // 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);
        }