private void RestartBloom(string newInstallDir)
{
Control ancestor = Parent;
while (ancestor != null && !(ancestor is Shell))
ancestor = ancestor.Parent;
if (ancestor == null)
return;
var shell = (Shell) ancestor;
var pathToNewExe = Path.Combine(newInstallDir, Path.ChangeExtension(Application.ProductName, ".exe"));
if (!RobustFile.Exists(pathToNewExe))
return; // aargh!
shell.QuitForVersionUpdate = true;
Process.Start(pathToNewExe);
Thread.Sleep(2000);
shell.Close();
}