'Azure DevOps Continuous Deployment for Windows Service

I'm looking how to setup a task or a step to Azure DevOps Continuous Deployment to install and update a Windows Service.

On Azure DevOps / Section Release I can define a Continuous Deployment porcess and use these tasks:

enter image description here

I'm not yet using any of this. I'm using a simple command line but I get error too often. Sometine on uninstall, sometime on install. sometime on staging, sometime on production. I cannot explain. detail of message tell me the service does bot exist. This is wierd.

enter image description here

My command line to unsintalll is

C:\Windows\Microsoft.NET\Framework\v4.0.30319\InstallUtil /u Service.Notifications.exe

My command line to install is

C:\Windows\Microsoft.NET\Framework\v4.0.30319\InstallUtil /i Service.Notifications.exe

What is the best practice for this. Using command line? Using a task created by someone?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source