Initial deployment of windows service fails

I was migrating and existing service to a new server and it kept erroring in the Octopus.Features.WindowsService_AfterPreDeploy.ps1 script.

Here is the error:

Resolve-Path : Cannot find path ‘C:\Program Files (x86)…exe’ because it does not exist.
At C:\Octopus.Tentacle\Octopus.Tentacle\\Scripts\Octopus.Features.
WindowsService_AfterPreDeploy.ps1:26 char:25

  • $fullPath = Resolve-Path <<<< $executablePath
    • CategoryInfo : ObjectNotFound: (C:\Program File…exe:String) [Resolve-Path], ItemNotFoundException + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.ResolvePathCommand
      Script ‘C:\Octopus.Tentacle\Octopus.Tentacle\\Scripts\Octopus.Features.WindowsService_AfterPreDeploy.ps1’ returned non-zero exit code: 1. Deployment terminated.

I ended up creating a dummy file name after my executable in the program files dir, and then it worked. Is this a known issue? Is there some setting I should be setting differently? I tried it with both purging the directory on and off.


Could you email the full deployment log and a screenshot of the step configuration to me? paul at



Thanks for all the detailed information David, I’ve found the bug and will fix it and release a fix today.


Windows service deployment get failed. please find the attached deployment log file for your perusal.

ServerTasks-210.log.txt (7 KB)

Hi Ayan,

Thanks for getting in touch! In the log, there’s this error:

Resolve-Path : Cannot find path ‘D:\Octopus\Applications\Staging\IGLSAcknowledgement\\IGLSAcknowledgement.exe’ because it does not exist.

When you configured the Windows Service step, you specify the path to the executable inside the package. I’m guessing there is either a typo or the executable is actually in a sub folder. Can you remote desktop to the machine and check if the executable file does exist?

Hope that helps!


I’m having a similar problem. The .exe doesn’t exist, because it hasn’t been deployed yet.

Also, the software insists on create a directory with the environment on my server that is inside that environment. Is there a way to override that behavior.

Hi Steve,

We’ll need some more info to work out what is going on here. Can you attach or email us a full deployment log?

You can change the directory by using the custom installation directory feature (go to your package step, then click Features, then choose custom installation directory). Hope that helps,