private void DoInstall() { DownloadButton.Text = "Installing"; DownloadButton.Enabled = false; // NOTB - no ask toolbaar string command = ClamConfig.ClamAVInstallFile; string args = "/sp- /silent /norestart /NOTB"; System.Diagnostics.Process installer = new System.Diagnostics.Process(); installer.StartInfo.FileName = command; installer.StartInfo.Arguments = args; installer.Start(); UpdateInstallLabel("Waiting to Kill Process FreshClam "); // Thread.Sleep(3000); while (ClamConfig.WaitForProcess(installer.ProcessName)) { ClamConfig.FindAndKillProcess("freshclam"); } installer.WaitForExit(); UpdateInstallLabel("Waiting to Kill Process ClamTray "); while (ClamConfig.WaitForProcess("ClamTray")) { ClamConfig.FindAndKillProcess("ClamTray"); } // Remove automatic start of ClamAV ClamConfig.RemoveRegistryKeys(); // Set Quarantine option // Also remove warning for update try { ClamConfig clamConfig = new ClamConfig(); clamConfig.WriteClamConfigKey("moveinfected", "1"); clamConfig.WriteClamConfigKey("warnoutofdate", "0"); } catch (Exception ex) { ThrowError.Throw(ex.Message); } CheckStatus(); }
private void StopToolBarButton_Click(object sender, EventArgs e) { ScanLogUpdateTimer.Stop(); UpdateLogUpdateTimer.Stop(); KillServiceThreads(ClamConfig.Services.Scan); KillServiceThreads(ClamConfig.Services.Update); System.Threading.Thread.Sleep(1000); ClamConfig.FindAndKillProcess("clamav"); ClamConfig.FindAndKillProcess("clamscan"); ClamConfig.FindAndKillProcess("freshclam"); ClamConfig.FindAndKillProcess("clamwin"); ClamConfig.FindAndKillProcess("clamtray"); }