The issue is that the variable substitution always happens only on the first directory - the 1.0.0-unstable.28 directory. In the output logs it continues to say that the package was installed to /my/path/1.0.0-unstable.28 even though it actually installed to /my/path/1.0.0-unstable.28_2
I’ve done some testing on my end and so far I’ve been unable to replicate the issue you are describing, in that both /my/path/0.0.5 and /my/path/00.0.5_1 have variable transforms correctly applied. The caveat I have here is that I’m testing with Centos so it’s not exactly the same.
Are you able to let me know which version of Octopus you are using, and if possible attach the raw logs from the deployment? If you can also provide a screenshot showing the path you have defined to the file that would be greatly appreciated.