Example #1
0
 /// <summary>
 /// Verfies the OpenVPN installation and ensures the tap driver was installed.
 /// If the registry keys do not exist but the process is still avaliable for use, then ignore and continue.
 /// </summary>
 public static void VerifyInstall()
 {
     try
     {
         if (
             new Process
         {
             StartInfo =
             {
                 FileName        = "openvpn",
                 UseShellExecute = true,
                 CreateNoWindow  = true,
                 WindowStyle     = ProcessWindowStyle.Hidden
             }
         }.Start())
         {
             InternalData.SaveSettings();
             return;
         }
     }
     catch (Exception)
     {
     }
     MessageBox.Show(
         "OpenVPN and the TAP driver are required for this application to work. Please follow the install guide on Atlir.org.",
         "Installation Incomplete", MessageBoxButtons.OK, MessageBoxIcon.Error);
     Environment.Exit(1);
 }
Example #2
0
 private void DoLogin()
 {
     statusBar.Text  = "Working...";
     button1.Enabled = !button1.Enabled;
     Atlir.Api.Login(username.Text, password.Text, (success, value) => Invoke((MethodInvoker) delegate
     {
         statusBar.Text = (string)value;
         if (success)
         {
             InternalData.SettingsGrid.Username = username.Text;
             InternalData.SettingsGrid.Password = password.Text;
             InternalData.SaveSettings();
             new Controller().Show();
             Visible = false;
         }
         else
         {
             if (Program.Arguments.Contains("-silent"))
             {
                 Close();
             }
             button1.Enabled = !button1.Enabled;
         }
     }));
 }
Example #3
0
 private void settingsGrid_PropertyValueChanged(object s, PropertyValueChangedEventArgs e)
 {
     InternalData.SaveSettings();
 }
Example #4
0
 private void Controller_ResizeEnd(object sender, EventArgs e)
 {
     InternalData.SettingsGrid.Height = Height;
     InternalData.SettingsGrid.Width  = Width;
     InternalData.SaveSettings();
 }