/// <summary>Checks if Seven Update is running.</summary> /// <param name="sender">The object that called the event.</param> /// <param name="e">The <see cref="System.Timers.ElapsedEventArgs" /> instance containing the event data.</param> static void CheckIfRunning(object sender, ElapsedEventArgs e) { Task.Factory.StartNew( () => { if ( File.Exists( Path.Combine(Environment.ExpandEnvironmentVariables("%WINDIR%"), "Temp", "abort.lock"))) { Download.CancelDownload(); Install.CancelInstall(); try { File.Delete( Path.Combine( Environment.ExpandEnvironmentVariables("%WINDIR%"), "Temp", "abort.lock")); } catch (IOException) { } } if (client == null) { StartWcfHost(); } if (IsInstalling) { return; } if (Process.GetProcessesByName("SevenUpdate").Length > 0 || waiting) { return; } #if (!DEBUG) ShutdownApp(); #endif }); }