jabbera / my-vsts-tasks

20 stars 18 forks source link

Question: Tasks sequence #25

Closed VoidMonk closed 6 years ago

VoidMonk commented 6 years ago

Hi, these are a useful set of tasks, but it's not clear as to what the sequence of tasks should be. If I follow the sequence below, then the service won't be uninstalled before file copy.

  1. Stop Windows Service
  2. Windows Machine File Copy
  3. Install a Topshelf Service
  4. Start Windows Service

Ideally, between service stop and file copy, there should be an uninstall service task, or am I misunderstanding the sequence?!

Please clarify.

jabbera commented 6 years ago

Hi, that is the correct task sequence. The install task will uninstall first unless you uncheck that option in the task configuration.

VoidMonk commented 6 years ago

Thanks, but wouldn't file copy overwrite the service and cause an issue while uninstalling the old service?

jabbera commented 6 years ago

If the old service doesn't exist, the uninstall silently succeeds. If the service name matches, the service will be uninstalled anyway. (Uninstalling a service is the equivalent of calling: sc delete, you don't need the binaries to even exist to do this)