I have multiple applications that need to be checked for updates and updated automatically. I have a windows service that runs and using AutomaticUpdaterBackend will check each application to see if it needs updating and carries out the update if required. The general arguments for AutomaticUpdaterBackend are:
auBackend = new AutomaticUpdaterBackend { GUID = "915e1071-9431-4728-a05e-6b3af0c6e55e", UpdateType = UpdateType.Automatic, wyUpdateLocation = Path.Combine(program.Location, "wyUpdate.exe"), wyUpdateCommandline = String.Format(" /fromservice -server=\"{0}://{1}wyserver.wys\" -updatepath=\"{2}\"", program.ServerProtocol, program.ServerUrl, program.ServerUrl), ServiceName = "VTUpdateService" };
where 'program' is an object that holds the information about each application that needs to be updated. For simplicity here lets assume that the service itself does not need to be updated, just various applications that exist at 'program.Location'.
When I test the service against a single application that needs updating the update is carried out successfully. However, what I notice is that the service itself is unloading and reloading after the call to InstallNow. What I mean by loading here is that the service's constructor is run again as well as the OnStart method. I don't want the service itself to reload and I believe this is causing problems when there are more than one application to update.Is there a way to call AutomaticUpdaterBackend without the service restarting?Do i need the to use the argument '/fromservice' in wyUpdateCommandline...?