public void DoUpdate(AgentUpdateInfo agentUpdateInfo) { _agentUpdateInfo = agentUpdateInfo; _logger.Log(String.Format("Received from Agent the following data:\r\nURL:{0}\r\nCHECKSUM:{1}, will resume in a minute", _agentUpdateInfo.url, _agentUpdateInfo.signature)); new Timer(TimerElapsed,null,10000,0); }
public void Execute(AgentUpdateInfo agentUpdateInfo) { _logger.Log("Cleaning temp files/folders ... "); if (Directory.Exists(Constants.AgentServiceBackupPath)) Directory.Delete(Constants.AgentServiceBackupPath, true); if (File.Exists(Constants.AgentServiceReleasePackage)) File.Delete(Constants.AgentServiceReleasePackage); if (Directory.Exists(Constants.AgentServiceUnzipPath)) Directory.Delete(Constants.AgentServiceUnzipPath, true); _logger.Log("Cleaning Complete ..."); }
public void Execute(AgentUpdateInfo agentUpdateInfo) { _logger.Log("Installing a new version of Agent ..."); _logger.Log("Unzipping agent zip..."); UnzipNewAgentVersion(); _logger.Log("Copying new agent files"); Utility.CopyFiles(Constants.AgentServiceUnzipPath, SvcConfiguration.AgentPath, _logger); _logger.Log("Done copying agent files."); }
public void Execute(AgentUpdateInfo agentUpdateInfo) { _logger.Log("Downloading Agent ..."); if (!Directory.Exists(SvcConfiguration.AgentVersionUpdatesPath)) Directory.CreateDirectory(SvcConfiguration.AgentVersionUpdatesPath); var webClient = new WebClient(); webClient.DownloadFile(agentUpdateInfo.url, Constants.AgentServiceReleasePackage); _logger.Log("Agent downloaded."); }
public void Send(AgentUpdateInfo agentUpdateInfo) { IAgentUpdater agentUpdater; try { ConnectToRemotingHost(out agentUpdater); agentUpdater.DoUpdate(agentUpdateInfo); } catch (Exception ex) { throw new UnsuccessfulCommandExecutionException( String.Format("UPDATE FAILED: {0}", ex.Message), new ExecutableResult { ExitCode = "1" }); } }
public void Execute(AgentUpdateInfo agentUpdateInfo) { Setup(Constants.AgentServiceBackupPath); Utility.CopyFiles(SvcConfiguration.AgentPath, Constants.AgentServiceBackupPath, _logger); }