Custom Install directory fails during first time deployment

Hi,
I am using custom install directory option to install the app in the default path used by octopus. I am using this to ensure every subsequent installation usages same folder and content of the folder is ‘purged’ before the new deployment.

My custom install folder is d:\Octopus\Applications#{Octopus.Environment.Name}#{PackageID}#{Octopus.Release.Number}, please note that this is same location where octopus installs the package by default.
When I deploy a release first time it fails by giving following error:

The custom install directory ‘d:\Octopus\Applications\14Dev\PACKAGE_NAME\3.1.18.0’ is a child directory of the base installation directory ‘D:\Octopus\Applications\14Dev\PACKAGE_NAME\3.1.18.0’, please specify a different destination.

Could you please help? This happens in the first deployment to every environment and it is not good when we do prod releases.

Regards, Sujit

Hi Sujit,

This behavior is actually as desiged to prevent users from using that path with the “Custom Installation Directory”(CID), which is generally a bad practice: https://github.com/OctopusDeploy/Issues/issues/2927

Could you please explain why did you decide to explicitly set that path to the “same” path that Octopus would have chosen by default? This could bring a couple of undesired results with Retention Policies and scenarios where you re-deploy the same release twice.

We strongly recommend you to A) stop using CID and let Octopus handle the paths or B) pick a path that’s not the same as the default.

Best regards,
Dalmiro

Hi Dalmiro,

Thanks for your response.

I am using CID only to ensure same version of release gets deploy to same
folder and not in a new folder.

This is to allow our build test agents to pick the binaries from the known
installation folder. If we do not use custom install directory octopus will
deploy it to different folder everytime same release is deployed by
appending the folder with _n.

Best Regards, Sujit

Hi Sujit,

I see what you mean. In that case then you’ll need to pick a different directory other than d:\Octopus\Applications\#{Octopus.Environment.Name}\#{PackageID}\#{Octopus.Release.Number} for your custom folder structure, as we keep that directory for ourselves for users that want to follow our file structure (meaning not using CID). Something like d:\OctopusDeployments\Applications\#{Octopus.Environment.Name}\#{PackageID}\#{Octopus.Release.Number} should be a good pick.

Thanks,
Dalmiro

Cheers Dalmiro,

Thats what we have been using as a work around. I will communicate this to
others in the team.

Best Regards, Sujit