Installing software deployed in a package using powershell

Hi,

I have an installer exe file inside a nuget package that I am trying to install. Using a post-deploy script (non embedded) I have tried referencing a powershell script to do this that resides inside the package and also by running the powershell command directly within the post-deploy to no avail.

Unfortunately using the tentacle.exe (http://octopusdeploy.com/blog/testing-powershell-scripts) to run the script works fine (software installs correctly) as does running the script directly on the target server. RavenDB appears in the installed software list in Control Panel.

The only clue I have is an error in windows event log: Restart Manager - Application or Service 'RavenDB could not be restarted" 10007

The software to be installed is RavenDB v2916

Here is the code:

.\RavenDB-Build-2916.Setup.exe --% /quiet /log C:\do\raven_log.txt /msicl “RAVEN_TARGET_ENVIRONMENT=DEVELOPMENT TARGETDIR=C:\ INSTALLFOLDER=C:\RavenDB RAVEN_INSTALLATION_TYPE=SERVICE REMOVE=IIS ADDLOCAL=Service” | Out-Null

The application log for RavenDB reports that the install is successful (but nothing in Installed Applications . I wonder if you are able to reproduce on Windows 2012 R2? As mentioned this script works fine if called by tentacle.exe (which I understand should indicate accurately how a script will run when deployed). The tentacle is running as local system.

Thanks

Hi Leigh,

Thanks for getting in touch! That blog post is for Octopus 1.x. The way to test scripts and how they behave on a Tentacle is through Octopus itself using the Script Console found under the Tasks menu item.
I you try this and remove the “| Out-Null” part does it show any errors? You will have to hard link to the raven installer using this method to test the command.

Let me know what you find.
Vanessa

Hi,

Script ran successfully but still no RavenDB in the installed software list :frowning:

Script run completed successfully.
Info 17:29:10
============================================== PowerShell exit code: 0 ==============================================

here is the code I ran on the script mgt console:

C:\Octopus\Applications\DevOps\do-RavenDB\1.4_4\RavenDB-Build-2916.Setup.exe --% /quiet /log C:\do\raven_log.txt /msicl “RAVEN_TARGET_ENVIRONMENT=DEVELOPMENT TARGETDIR=C:\ INSTALLFOLDER=C:\RavenDB RAVEN_INSTALLATION_TYPE=SERVICE REMOVE=IIS ADDLOCAL=Service”

As soon as I run this exact command locally it installs correctly. Please can you let me know your thoughts?

Thanks

Hi Leigh,

If you are getting the same issue running the command in the console, that is the user it is running as on the Tentacle.
When you run it locally, are you logging in as the same user on Tentacle?

Also error logs would really help here, can you attach the output from C:\do\raven_log.txt so we can see if any errors are being created.
Or alternately you could have the Octopus Tentacle run under the same user that you are connecting as when it is working and see if that resolves the problem.

Let me know what you find.
Vanessa

OK. changed tentacle service logon account from “local system” to the local admin acct and it worked as expected. Thanks for the tip. I had mistakenly assumed the local system account would have all required privileges but I guess not…probably a Microsoft quirk…

Thankyou

Hi Leigh,

Yeah there could be any part of the install that Tentacle just does not have access to - such as specific directories or other services.
Glad you got it working.

Vanessa