Best way to automate the deployment / installation of Windows Service to multiple remote endpoints?

I am looking for the best way to automatically deploy for Windows Services. I looked at AppFabric , however it is very similar to web services / IIS and WCF.

I also looked at MSDeploy, but that doesn't seem to really cover all the functionality I was looking for.

So, as an example, I have a .NET solution with several Windows projects / services. I would like these packages to be remotely deployed to multiple servers and then the Windows services removed. All from one machine script /. Without the need for user login to the appropriate servers and installations manually.

Any software suggestions capable of this?

+4
source share
2 answers

I have programmed tools to handle this, not just for the base example script. However, I will talk about the main examples of scenarios.

The way the script package solves this problem is to call PsExec (one of the SysInternals tools). You can use PsExec to perform remote tasks. The credentials you need to provide must be the local administrator on the remote computer. For instance:

PsExec \\computername -u adminuser -p adminuserpassword somecommand somecommandarguments 

If I wanted to copy a file between two directories, I could do the following:

 PsExec \\computername -u adminuser -p adminuserpassword xcopy "C:\TestFile.txt" "C:\MyDir\TestFile.txt" /i /e /r /y 

I like to load the SysInternals tools into the TOOLS directory and add this to my PATH environment variable, so I don't need to use the full path to PsExec.

You can combine this with packaging and installing Windows Service in MSI. In the MSI package, you can determine how to install the Windows service so that it starts with Windows, manually or in some other way. You can also set up a user account to run it. I always prefer to manually start the service. Use the MSIEXEC command-line tool to run the MSI package. You can combine these commands together to backup and deploy as follows:

 PsExec \\computername -u adminuser -p adminuserpassword xcopy "\\buildserver\DeploymentPackages\MyWinService-v1\MyWinService.msi" "C:\Updates\MyWinService.msi" /i /e /r /y PsExec \\computername -u adminuser -p adminuserpassword MSIEXEC /i "C:\Updates\MyWinService.msi" INSTALLDIR="C:\Program Files (x86)\MyWinService" PsExec \\computername -u adminuser -p adminuserpassword sc start "MyWinService" 

You do not need PsExec to run SC.exe on a remote computer, since it has the ability to specify a machine.

Hope this helps you here and there. I include links to the SysInternals and Windows Installer XML (WiX) tools for creating MSI packages from within Visual Studio.

PsExec from SysInternals Suite

Windows XML Installer (WiX)

+5
source

You can do this with kwatee . It will take care of copying your files over the network to any number of computers and launching remote actions that you can configure to register / unregister and start / stop services. The only catch is that you need to install either telnet / ftp or ssh / scp for purposes.

+1
source

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


All Articles