void bgWorker_DoWork(object sender, DoWorkEventArgs e)
{
// oh that's just lame
string exepath = e.Argument.ToString().Split('|')[0];
string args = e.Argument.ToString().Split('|')[1];
//ProcessStartInfo startInfo = new ProcessStartInfo(Path.Combine(this._exec_clam, "freshclam.exe"), e.Argument.ToString())
ProcessStartInfo startInfo = new ProcessStartInfo(exepath, args)
{
WindowStyle = ProcessWindowStyle.Hidden,
UseShellExecute = false,
RedirectStandardOutput = true,
CreateNoWindow = true,
};
update_process = new Process()
{
StartInfo = startInfo
};
update_process.OutputDataReceived += process_OutputDataReceived;
update_process.Start();
update_process.BeginOutputReadLine();
update_process.WaitForExit();
// check if we ran freshclam to update virus definition database
if (exepath.Contains("freshclam.exe"))
{
// se we can save the date
Settings.Default.ClamWin_Update = false;
Settings.Default.ClamWin_LastDBUpdate = DateTime.Now;
Settings.Default.Save();
}
}