示例#1
0
 /// <summary>
 /// Run wizard
 /// </summary>
 /// <param name="args">Command line arguments</param>
 /// <returns>Exit code</returns>
 static int RunWizard(ArgsWizard args = null)
 {
     if (RegistryUtil.IsAppRegistered())
     {
         RegistryUtil.RegisterApp(); // overwrites default entry with localized strings
     }
     Application.Run(new Wizard());
     return(0);
 }
示例#2
0
 private void ChkContextEntry_CheckedChanged(object sender, EventArgs e)
 {
     try
     {
         if (chkContextEntry.Checked && !RegistryUtil.IsAppRegistered())
         {
             RegistryUtil.RegisterApp();
             MessageBox.Show(Resources.str_message_register_context_menu_success, Resources.str_main_window_title, MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
         else if (!chkContextEntry.Checked && RegistryUtil.IsAppRegistered())
         {
             RegistryUtil.UnRegisterApp();
             MessageBox.Show(Resources.str_message_unregister_context_menu_success, Resources.str_main_window_title, MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message + "\n" + Resources.str_message_run_as_admin, Resources.str_main_window_title, MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
示例#3
0
 /// <summary>
 /// Run only config update
 /// </summary>
 /// <param name="args">Command line arguments</param>
 /// <returns>Exit code</returns>
 static int RunConfig(ArgsConfig args)
 {
     ApplyCommonArgs(args);
     try
     {
         if (args.Register)
         {
             RegistryUtil.RegisterApp();
         }
         if (args.Unregister)
         {
             RegistryUtil.UnRegisterApp();
         }
     }
     catch (Exception ex)
     {
         Console.Error.WriteLine(ex.Message + "\n" + Resources.str_message_run_as_admin);
         return(1);
     }
     return(0);
 }