How to update Windows.net service from the center

We created the .NET Windows Service , which we install on client PCs to monitor and download data (via a web service) from these PCs. I am looking for a way to update the Windows service on all client computers centrally - without the need for remote storage in each repository.

Here are some features (though, I don’t think it really matters):

  • Windows service: .NET version 2 (due to client PC restrictions) - VB.NET
  • Web Service: .NET Version 4 - VB.NET
  • Client PC OS: Win2000 - Win7, POSReady, WEPOS

Additional Information

  • We have an installation file that works very well, but we need to remotely manage each repository. And there are 100 stores!
  • We considered installing the installation file on an FTP site, but said that Windows Embedded OSes does not support FTP, so we can send the file through the web service
  • Each time, each Windows service calls a web service method that returns some XML that can be used to send instructions for updating the web service.

This seems like a standard problem that developers would have to solve many times. If anyone has any advice or can suggest the process they are using, this will really help us.

UPDATE

  • I can change the Windows service and the web service to add new update functionality.
  • It looks like I have a way to get the installation file (download from the web service method), but how to run it? How to start the installer and then make sure that the Windows service is disabled? Does the installer do this or a Windows service?
+4
source share
2 answers

If you have a web service, you can add a method to update.

Create a small update installer or application (which you run locally).
Then, in the web service, add a method that returns an array of Stream or byte [].
In the web service method, read the binary installation file into an array or byte [] stream and send it to the client.

Then ask the client to save this stream to a file, and now you have the installer on the client machine.
It remains only to start this process and update the service.

+3
source

If the patch is an MSI package, you can use Active Directory to push the update to computers on the same network that are running an AD server. The update will be performed immediately or at the next start.

You can push packets yourself, but there must be some kind of transport mechanism that is listened on the other end, controlled by the program with sufficient skills and privileges for automatic updates.

Ban AD, this is probably your best shot: use regular network files to bring the update to the client. The client computer MUST work, but it may be on the welcome screen. Then place the batch file in the Documents and Users / All Users / Start / Startup folder, in which the MSI will complete the installation (basically, telling MSI to perform an unattended installation with the default installation options) . The next time you log in, the batch file will be launched, performing the installation. After that, MSI should possibly clear the batch file. If you can remotely access the registry of the client computer (I doubt it very much), you can put the batch file in the temp directory somewhere and put a link to it in the RunOnce registry folder.

After going through this rigamarole, you will probably teach you how to structure such applications to check and download your own updates through a well-known web service or configure them to use ClickOnce deployments (this does the installation boot directories, but deploying updates becomes MUCH simple).

+1
source

Source: https://habr.com/ru/post/1338324/


All Articles