Example #1
0
        private static bool HandleSquirrel(string[] args)
        {
            if (args.Any(a => a.StartsWith("--squirrel")))
            {
                log.Info("Squirrel handling started...");
                log.Info("Received events: " + string.Join(',', args.Where(a => a.StartsWith("--squirrel"))));

                if (args.Any(a => a == "--squirrel-firstrun"))
                {
                    log.Info("First run, doing nothing");
                    return(false);
                }

                if (args.Any(a => a == "--squirrel-uninstall") && ExplorerIntegrationHandler.IsEnabled())
                {
                    log.Info("Trying to disable ExplorerIntegration");
                    try
                    {
                        ExplorerIntegrationHandler.Disable();
                    }
                    catch (Exception e)
                    {
                        log.Error("Error while disabling ExplorerIntegration", e);
                    }
                }

                log.Info("Exiting after handling Squirrel");
                return(true);
            }
            return(false);
        }
Example #2
0
 private void ExplorerIntegrationBox_CheckedChanged(object sender, EventArgs e)
 {
     if (ExplorerIntegrationBox.Checked)
     {
         ExplorerIntegrationBox.Checked = ExplorerIntegrationHandler.Enable();
     }
     else
     {
         ExplorerIntegrationHandler.Disable();
     }
 }