//************************************************************** // AppUpdater Constructor //************************************************************** public AppDownloader(AppUpdater appMan) { AppMan = appMan; Log = new UpdateLog(); UpdateEventArgs = new UpdateCompleteEventArgs(); DownloadEventArgs = new DownloadProgressEventArgs(); }
/* This service should handle automatic updates and restart of application(s) in both application, service modes. * It should be able to detect all the installed Alchemi apps, and update them all. * It should be able to handle manual update mode, and by default do auto-update. * * In service mode, just restart the service(s) once the update download is done. * In app mode, * it should list the Alchemi processes, and restart them if they are just updated. * it should wait for process exit and restart it. * */ public UpdateService() { // This call is required by the Windows.Forms Component Designer. InitializeComponent(); configFile = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "AppStart.config"); config = ServiceUpdaterConfig.getUpdaterConfig(configFile); logger.Debug("Config file=" + configFile + ", AppFolderName=" + config.AppFolderName); //config.SaveConfig(configFile+".1"); currentServiceExePath = config.AppExePath; // // updater // updater = new AppUpdater(); updater.ShowDefaultUI = false; updater.UpdateUrl = config.UpdateURL; updater.ChangeDetectionMode = ChangeDetectionModes.ServerManifestCheck; updater.AutoFileLoad = false; if (updater.Downloader != null) { updater.Downloader.ValidateAssemblies = false; } if (updater.Poller != null) { updater.Poller.AutoStart = config.AutoUpdate; updater.Poller.DownloadOnDetection = true; updater.Poller.InitialPollInterval = config.UpdateInterval; updater.Poller.PollInterval = config.UpdateInterval; } else { logger.Debug("Poller is null"); } updater.OnUpdateDetected += new AppUpdater.UpdateDetectedEventHandler(this.updater_OnUpdateDetected); updater.OnUpdateComplete += new AppUpdater.UpdateCompleteEventHandler(this.updater_OnUpdateComplete); updater.Initialize(); config.SaveConfig(configFile); }
/* This service should handle automatic updates and restart of application(s) in both application, service modes. * It should be able to detect all the installed Alchemi apps, and update them all. * It should be able to handle manual update mode, and by default do auto-update. * * In service mode, just restart the service(s) once the update download is done. * In app mode, * it should list the Alchemi processes, and restart them if they are just updated. * it should wait for process exit and restart it. * */ public UpdateService() { // This call is required by the Windows.Forms Component Designer. InitializeComponent(); configFile = Path.Combine(AppDomain.CurrentDomain.BaseDirectory,"AppStart.config"); config = ServiceUpdaterConfig.getUpdaterConfig(configFile); logger.Debug("Config file="+configFile+", AppFolderName="+config.AppFolderName); //config.SaveConfig(configFile+".1"); currentServiceExePath = config.AppExePath; // // updater // updater = new AppUpdater(); updater.ShowDefaultUI = false; updater.UpdateUrl = config.UpdateURL; updater.ChangeDetectionMode = ChangeDetectionModes.ServerManifestCheck; updater.AutoFileLoad = false; if (updater.Downloader!=null) { updater.Downloader.ValidateAssemblies = false; } if (updater.Poller!=null) { updater.Poller.AutoStart = config.AutoUpdate; updater.Poller.DownloadOnDetection = true; updater.Poller.InitialPollInterval = config.UpdateInterval; updater.Poller.PollInterval = config.UpdateInterval; } else { logger.Debug("Poller is null"); } updater.OnUpdateDetected += new AppUpdater.UpdateDetectedEventHandler(this.updater_OnUpdateDetected); updater.OnUpdateComplete += new AppUpdater.UpdateCompleteEventHandler(this.updater_OnUpdateComplete); updater.Initialize(); config.SaveConfig(configFile); }
//************************************************************** // Constructor() //************************************************************** public ServerPoller(AppUpdater appMan) { AppMan = appMan; }