Tentacle Install PS script Install Directory

I’m trying to install the Octopus Tentacle using a powershell script and I’m having an issue passing the Install Directory value to the script. I have included the script and the output below, please help. Thanks!

##############SCRIPT##############
$TentacleInstaller = “D:\ITRM\Tools\Octopus\Octopus.Tentacle.3.13.7.x64.msi”
$InstallTarget = “D:\Program Files\Octopus Deploy\Tentacle”
$TentacleInstallLog = “D:\ITRM\Logs\Installs\TentacleInstall.log”

Write-Output “Installing Tentacle”
$msiExitCode = (Start-Process -FilePath “msiexec.exe” -ArgumentList TARGETDIR=’$InstallTarget’" /i $TentacleInstaller /L*V $TentacleInstallLog /quiet" -Wait -Passthru).ExitCode
if ($msiExitCode -ne 0) {
Write-Output "Tentacle MSI installer returned exit code $msiExitCode"
throw “Installation aborted”
}
##############OUTPUT###################
MSI (s) (A8:F8) [12:19:36:251]: PROPERTY CHANGE: Adding MsiLogFileLocation property. Its value is ‘D:\ITRM\Logs\Installs\TentacleInstall.log’.
MSI (s) (A8:F8) [12:19:36:251]: Command Line: TARGETDIR=$InstallTarget CURRENTDIRECTORY=C:\Users\MRaby CLIENTUILEVEL=3 CLIENTPROCESSID=3960
MSI (s) (A8:F8) [12:19:36:251]: PROPERTY CHANGE: Adding PackageCode property. Its value is ‘{3F1DCC43-64F1-4BA9-AE1D-00C1D2675CD4}’.
#####################ERROR#################
Beginning Tentacle installation
Installing Tentacle
Tentacle MSI installer returned exit code 1603
Installation aborted
At D:\ITRM\Tools\Scripts\InstallTentacle.ps1:66 char:5

  • throw "Installation aborted"
    
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : OperationStopped: (Installation aborted:String) [], RuntimeException
    • FullyQualifiedErrorId : Installation aborted

Hi,

Thanks for getting in touch.
There is some documentation here that describe automatic Tentacle installation: https://octopus.com/docs/installation/installing-tentacles/automating-tentacle-installation

There two issues that I can see. You need to use INSTALLLOCATION instead of TARGETDIR and I don’t think $InstallTarget is resolving because it is enclosed in single quotes.

This is what worked for me:

$msiExitCode = (Start-Process -FilePath "msiexec.exe" -ArgumentList "INSTALLLOCATION=`"$InstallTarget`" /i $TentacleInstaller /L*V $TentacleInstallLog /quiet" -Wait -Passthru).ExitCode 

Cheers,
Shane