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\2.2.1.1261_1\Scripts\Octopus.Features.
WindowsService_AfterPreDeploy.ps1:26 char:25
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.
Thanks for getting in touch! In the log, there’s this error:
Resolve-Path : Cannot find path ‘D:\Octopus\Applications\Staging\IGLSAcknowledgement\1.0.0.0_2\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?
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.
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,