3rd party app - chocolatey install

Support forums for the Habitat Automate plugin
bmcfarlane
Posts: 18
Joined: Wed Jun 26, 2019 9:19 pm
4

3rd party app - chocolatey install

Post by bmcfarlane »

Does 3rd party app updater require Chocolatey to already be installed?

I have at least one machine that it seems like Chocolatey will not install via a script we have and when I run an upgrade on an app like Google I get the message "The system cannot find the path specified"

Will the 3rd party app updater automatically install Chocolatey?

bmcfarlane
Posts: 18
Joined: Wed Jun 26, 2019 9:19 pm
4

Re: 3rd party app - chocolatey install

Post by bmcfarlane »

I think I may have answered my own question. If I push Chocolatey via script it seems to then allows the 3rd party app plug in to do its stuff. The one where it would not push via our script I used the Powershell plug-in to run the command on the machine and it then installed Chocolatey and seems to now be performing updates.

JvdMaat
Posts: 42
Joined: Wed Feb 21, 2018 1:31 am
6

Re: 3rd party app - chocolatey install

Post by JvdMaat »

Wait, the 3rd party app Habitat tool needs Chocolatey?

User avatar
Cubert
Posts: 2450
Joined: Tue Dec 29, 2015 7:57 pm
8
Contact:

Re: 3rd party app - chocolatey install

Post by Cubert »

That is correct, In simple terms,

3rd Party App Manager reviews the software posted in Automate as installed on the end agent against the searches listed to determine if updates for found software exists. If enabled it will use chocolatey to acquire the updates and to apply them to the end agent.

JvdMaat
Posts: 42
Joined: Wed Feb 21, 2018 1:31 am
6

Re: 3rd party app - chocolatey install

Post by JvdMaat »

I'm new to the software deployment scene, but we're looking to get our toes wet. When you say we need Chocolatey, what does that look like in practice?
Is it as easy as just installing a Chocolatey agent on all target workstations? Or do we need further Chocolatey infrastructure or licensing? How does the Chocolatey for Automate plugin play in to this. Does this sort of replace that functionality, or is this more of a subset?
If I wanted to create my own packages (so we can deploy our AV tools, or customer requested custom software), what do I need (from a software and licensing perspective)
I looked on the Chocolatey website, but that's sort of vague in this area. And the Chocolatey for Automate plugin doesn't spell it out either.

User avatar
Cubert
Posts: 2450
Joined: Tue Dec 29, 2015 7:57 pm
8
Contact:

Re: 3rd party app - chocolatey install

Post by Cubert »

All you need is our plugin installed and active, We do all the rest for you. If you want more Chocolatey abilities then the public version you have the option to license Chocolatey which will then have chocolatey use extended features.

For that information visit https://chocolatey.org/compare to see the open community versus PRO and Business

bmcfarlane
Posts: 18
Joined: Wed Jun 26, 2019 9:19 pm
4

Re: 3rd party app - chocolatey install

Post by bmcfarlane »

Not sure if your 3rd party app script is installing Chocolatey. In my tests, the updating does not work until I push Chocolatey install through another script we have and then it works fine. Can you confirm the 3rd party app updater is pushing Chocolatey properly if it does not find it installed?

User avatar
Cubert
Posts: 2450
Joined: Tue Dec 29, 2015 7:57 pm
8
Contact:

Re: 3rd party app - chocolatey install

Post by Cubert »

Yes it should be installing Chocolatey during agent scans.

What I need from you is on an agent that does not have Chocolatey installed, Enable and verify that Habitat is scheduling the Habitat App Management script. During the run of this script it should log and find no chocolatey instance and revert to installing it. Watching the scripts log and command logs inside the agent console should tell you every step we are taking and what the agent returned. You should see script requesting the Chocolatey install via powershell command and an output of that install should be in the commands log.

If the executed commands return an "OK" they there may be some timeout with Automate where Automate bails on the execution. You should see some level of logged output from install.

The fact you say that as soon as Chocolatey is installed it starts working tells me that the script is scheduled and must be failing install some place.

Might be the level of permissions the agent automate service runs at. Does it have the ability to write files to c:\programdata and to c:\windows\ltsvc\

bmcfarlane
Posts: 18
Joined: Wed Jun 26, 2019 9:19 pm
4

Re: 3rd party app - chocolatey install

Post by bmcfarlane »

Thanks. So I turned on Enable Workstations at a client site and it scans the machines fine. When I try to push an app update like Google Chrome I get the following if Chocolatey is not installed:
App Manager Running Agent Update Checks for [Google Chrome]...
The system cannot find the path specified

These are the command entries from last night when it tried to update apps on its own:
0|C:\ProgramData\chocolatey\bin\choco.exe-File or Directory Does Not Exist
cmd.exe!!! /c "@CHOCOEXE@ install jre8 -fy"-'CHOCOEXE@' is not recognized as an internal or external command,
operable program or batch file.
cmd.exe!!! /c "@CHOCOEXE@ install googlechrome -fy"-'CHOCOEXE@' is not recognized as an internal or external command,
operable program or batch file.
cmd.exe!!! /c "@CHOCOEXE@ install dropbox -fy"-'CHOCOEXE@' is not recognized as an internal or external command,
operable program or batch file.
-Software Inventories have been Updated.

And this is the command when I try to upgrade by right clicking:
cmd.exe!!! /c "C:\ProgramData\chocolatey\bin\choco.exe upgrade -fy googlechrome"-The system cannot find the path specified.

If I run the following PowerShell command via Habitat:
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))

Here is the output from that command:
Executing -> Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
.....Getting latest version of the Chocolatey package for download.
Getting Chocolatey from https://chocolatey.org/api/v2/package/c ... ey/0.10.15.
Downloading 7-Zip commandline tool prior to extraction.
Extracting C:\Windows\TEMP\chocolatey\chocInstall\chocolatey.zip to C:\Windows\TEMP\chocolatey\chocInstall...
Installing chocolatey on this machine
Creating ChocolateyInstall as an environment variable (targeting 'Machine')
Setting ChocolateyInstall to 'C:\ProgramData\chocolatey'
WARNING: It's very likely you will need to close and reopen your shell
before you can use choco.
Restricting write permissions to Administrators
We are setting up the Chocolatey package repository.
The packages themselves go to 'C:\ProgramData\chocolatey\lib'
(i.e. C:\ProgramData\chocolatey\lib\yourPackageName).
A shim file for the command line goes to 'C:\ProgramData\chocolatey\bin'
and points to an executable in 'C:\ProgramData\chocolatey\lib\yourPackageName'.

I then tell it via Habitat to upgrade Chrome again and it upgrades fine. Text file attached has what it shows on the log area. Looks like it has permissions to C:\Programdata fine?
Attachments
ChromeUpgrade.rtf
(25.18 KiB) Downloaded 357 times

User avatar
Cubert
Posts: 2450
Joined: Tue Dec 29, 2015 7:57 pm
8
Contact:

Re: 3rd party app - chocolatey install

Post by Cubert »

Ok that might be the issue,

If you enable a client and then force a app update before applications show up in app list
then the agent has not had its first scan yet and as such Chocolatey was not yet installed. You need to allow at least 24 hours or so for the agents to start showing last scan dates. Once thats there Chocolatey was installed successfully and a full software scan has happened. Select an agent from the left to see what apps are installer (right)

Capture.PNG
Capture.PNG (57.12 KiB) Viewed 11461 times

Post Reply

Return to “Habitat”