Windows Chef-Client does not install an EXE Application


#1

Hi

I am unable to install an exe application on a windows node after a successful bootstrap from a windows workstation, the default recipe contents are as below

include_recipe “windows”

windows_package ‘7z1701-x64’ do
source '7z1701-x64.exe’
options '-ms’
installer_type :custom
action :install
end

‘7z1701-x64.exe’ has been placed in files folder

My metadata has the below entry also
depends “windows”

Please let me know if i am missing something, both of my windows workstation and node are EC2 windows instance
Please find the output of the command chef-client -l debug on the node is as below ( Summarized output), let me know if you guys need the complete output of the command, I m unable to attach the error text file.

2017-10-18T11:23:48+00:00] DEBUG: Sleeping for 0 seconds
[2017-10-18T11:23:48+00:00] DEBUG: Running Ohai with the following configuration: {}
Starting Chef Client, version 13.5.3e[0m
[2017-10-18T11:23:48+00:00] INFO: *** Chef 13.5.3 ***
[2017-10-18T11:23:48+00:00] INFO: Platform: x64-mingw32
[2017-10-18T11:23:48+00:00] INFO: Chef-client pid: 1704

[2017-10-18T11:23:51+00:00] DEBUG: Did not find hint gce.json in the hint path(s): C:\chef\ohai\hints
[2017-10-18T11:23:51+00:00] DEBUG: Mixin HttpHelper: can_socket_connect? failed setting up socket connection: getaddrinfo: No such host is known.
[2017-10-18T11:23:51+00:00] DEBUG: Plugin GCE: looks_like_gce? == false

[2017-10-18T11:23:52+00:00] WARN: The windows::default recipe has been deprecated. The gems previously installed in this recipe ship in the Chef MSI.
[2017-10-18T11:23:52+00:00] DEBUG: Resources for generic windows_package resource enabled on node include: [Chef::Resource::WindowsPackage]
[2017-10-18T11:23:52+00:00] DEBUG: Resource for windows_package is Chef::Resource::WindowsPackage

Recipe: awscookbook::defaulte[0m

  • windows_package[7z1701-x64] action install[2017-10-18T11:23:52+00:00] INFO: Processing windows_package[7z1701-x64] action install (awscookbook::default line 30)
    [2017-10-18T11:23:52+00:00] DEBUG: Providers for generic windows_package resource enabled on node include: [Chef::Provider::package::Windows]
    [2017-10-18T11:23:52+00:00] DEBUG: Provider for action install on resource windows_package[7z1701-x64] is Chef::Provider::package::Windows
    [2017-10-18T11:23:52+00:00] DEBUG: Finding uninstall entries for 7z1701-x64
    [2017-10-18T11:23:52+00:00] DEBUG: Failure to read property ‘DisplayName’
    [2017-10-18T11:23:52+00:00] DEBUG: Failure to read property ‘DisplayName’
    [2017-10-18T11:23:52+00:00] DEBUG: Failure to read property ‘DisplayName’
    [2017-10-18T11:23:52+00:00] DEBUG: Failure to read property ‘DisplayName’

[2017-10-18T11:23:52+00:00] DEBUG: Registry error opening hive ‘#Win32::Registry::PredefinedKey:0x00000000042b65e8’ :: 131097: The system cannot find the file specified.
[2017-10-18T11:23:52+00:00] DEBUG: windows_package[7z1701-x64] is EXE with type ‘custom’
[2017-10-18T11:23:52+00:00] DEBUG: windows_package[7z1701-x64] checking package version
[2017-10-18T11:23:52+00:00] DEBUG: windows_package[7z1701-x64] 7z1701-x64 not installed, installing latest
[2017-10-18T11:23:52+00:00] DEBUG: windows_package[7z1701-x64] installing package ‘’
[2017-10-18T11:23:52+00:00] INFO: windows_package[7z1701-x64] installed 7z1701-x64 at latest

e[32m- install version latest of package 7z1701-x64e[0m

e[0m[2017-10-18T11:23:52+00:00] DEBUG: Saving the current state of node ATM1
[2017-10-18T11:23:52+00:00] DEBUG: Chef::HTTP calling Chef::HTTP::JSONInput#handle_request
[2017-10-18T11:23:52+00:00] DEBUG: Chef::HTTP calling Chef::HTTP::JSONOutput#handle_request
[2017-10-18T11:23:52+00:00] DEBUG: Chef::HTTP calling Chef::HTTP::CookieManager#handle_request
[2017-10-18T11:23:52+00:00] DEBUG: Chef::HTTP calling Chef::HTTP::Decompressor#handle_request
[2017-10-18T11:23:52+00:00] DEBUG: Chef::HTTP calling Chef::HTTP::Authenticator#handle_request
[2017-10-18T11:23:52+00:00] DEBUG: Signing the request as ATM1
[2017-10-18T11:23:52+00:00] DEBUG: String to sign: 'Method:PUT

unning handlers:e[0m
[2017-10-18T11:23:52+00:00] INFO: Running report handlers
Running handlers complete
e[0m[2017-10-18T11:23:52+00:00] INFO: Report handlers complete

Regards
Victor


#2

It looks like its having issues with the package itself. But it also looks
like it installs it:

[2017-10-18T11:23:52+00:00] INFO: windows_package[7z1701-x64] installed
7z1701-x64 at latest

A couple suggestions though:

  1. Have you tried using 7-zip’s MSI instead of their EXE? The MSI
    installer may be cleaner than the EXE.

  2. Don’t put packages in your cookbook/files folder. Put them into a
    shared location and pull them using remote_file.

  3. Skip all of that and use chocolatey as a Windows Package Manager:
    chocolatey.org.

My package install looks like this:

node[‘winbox’][‘choco_packages’].each do |pack|
chocolatey_package pack do
action :upgrade
end
end


#3

Hi

I tried using 7-zip’s MSI, still does not work.
I even tried using the below code
windows_package “Notepad++” do
source 'C:npp.7.5.1.Installer.x64.exe’
action :install
end

Iam i missing any dependency ?
Any ideas , I got this with debug

[2017-10-20T07:51:34+00:00] DEBUG: Provider for action install on resource windows_package[Notepad++] is Chef::Provider::package::Windows
[2017-10-20T07:51:34+00:00] DEBUG: Finding uninstall entries for Notepad++
[2017-10-20T07:51:34+00:00] DEBUG: Failure to read property ‘DisplayName’
[2017-10-20T07:51:34+00:00] DEBUG: Failure to read property ‘DisplayName’

[2017-10-20T07:51:34+00:00] DEBUG: Failure to read property ‘DisplayName’
[2017-10-20T07:51:34+00:00] DEBUG: Registry error opening hive ‘#Win32::Registry::PredefinedKey:0x00000000048ea2c0’ :: 131097: The system cannot find the file specified.
[2017-10-20T07:51:34+00:00] DEBUG: windows_package[Notepad++] is EXE with type ‘’
[2017-10-20T07:51:34+00:00] DEBUG: windows_package[Notepad++] checking package version
[2017-10-20T07:51:34+00:00] DEBUG: windows_package[Notepad++] Notepad++ not installed, installing latest
[2017-10-20T07:51:34+00:00] DEBUG: windows_package[Notepad++] installing package ‘’
[2017-10-20T07:51:34+00:00] INFO: windows_package[Notepad++] installed Notepad++ at latest

I still dont find the app installed.


#4

The Below code worked for me

windows_package ‘7zip’ do
action :install
source 'https://netix.dl.sourceforge.net/project/sevenzip/7-Zip/15.14/7z1514-x64.msi
end