问题
I am currently deploying my windows services manually on the server.
One time Steps:
- Install Location on server hosting windows server ->
D:\InstallDir
- Copied windows Service related files into this folder
- Created a batch file to Install Windows Service (
InstallUtil.Exe
) and another batch file to uninstall windows service and copied in the install folder - Installed windows service using the install batch file
Here are the steps I perform to upgrade:
- Take backup of existing Install folder (to use in case I need to rollback to prev version)
- Run uninstall batch file to uninstall the windows service (
InstallUtil /u
) - Copy new DLLs from a location on build server into Install Folder (on server hosting windows services)
- Run install batch file to Install the windows service (
InstallUtil WIndowsService.Exe
)
I would like to automate upgrade steps; can you suggest deployment strategy in this scenario?
回答1:
There's a walk through for setting up a Setup Project for a Windows Service. I've used it and it's simple to use and simple to create. It creates a standard .msi file to install from. Since it's a standard Setup project creating a standard msi, you can set it to automatically uninstall previous versions, etc.
http://support.microsoft.com/kb/317421
回答2:
You can use an installer like Inno-setup, check this related question using inno-setup Inno Setup for Windows service.
来源:https://stackoverflow.com/questions/4743064/windows-service-deployment