public bool StartUpdate() { try { var sucess = false; sucess = StartDownload().Result; if (!sucess) { return(false); } if (RequestUpdate.DefaultExtrationZip) { string zipToUnpack = _DonwloadFilePath; string unpackDirectory = RequestUpdate.PathToExtract; using (ZipFile zip1 = ZipFile.Read(zipToUnpack)) { // here, we extract every entry, but we could extract conditionally // based on entry name, size, date, checkbox status, etc. foreach (ZipEntry e in zip1) { e.Extract(unpackDirectory, ExtractExistingFileAction.OverwriteSilently); } } } if (RequestUpdate.CallFunctionAfterDownload != null) { RequestUpdate.CallFunctionAfterDownload(_DonwloadFilePath); } if (RequestUpdate.ComandLinesToExecutAfterUpdate != null) { foreach (var item in RequestUpdate.ComandLinesToExecutAfterUpdate) { var cmd = new Cmd(item); cmd.Run(); } } return(true); } catch (Exception ex) { Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine("Falha no autoUpdate! " + ex.Message); Console.ForegroundColor = ConsoleColor.White; throw; } }