Proposal for moving windows_package LWRP from the windows cookbook into core Chef.
Chef internal PBI: OC-5114
There are a number of package installer frameworks that are common on Windows, which can specified by the user or detected. Installing packages usually means passing a flag to the installer to indicate it is an unattended installation.
Support for roles features will be handled by a separate resource.
Shortcut Resource Name:
This would be the default package provider on windows, so you would use the 'package' resource and wouldn't necessarily need a shortcut resource.
Utilizing the platform-specific resource functionality introduced in CHEF-2698, add a new package resource with windows specific attributes
class Chef class Resource class WindowsPackage < Chef::Resource::Package provides :package, :on_platforms => ["windows"] def initialize(name, run_context=nil) super @action = :install @allowed_actions = [ :install, :remove ] @provider = Chef::Provider::Package::Windows @resource_name = :windows_package @installer_type = nil @checksum = nil @timeout = 600 @success_codes = [0, 42, 127]
Initial support for the Microsoft Installer (MSI) only, incrementally adding support for additional installers.
All installer support in core must use a unique identifier when available (e.g. Product Code, AppID) to:
* Support upgrade/removal
* Idempotently verify installation state
We must determine the installer type for the user to match the same experience of running the executable on windows itself. Some methods require reading the installer file, so we cannot make this determination in the resource and will do so in this provider, which will call another class specific to the determined installer
We will determine package installation status using
MsiGetProductInfoA using FFI. See the proof of concept code.
windows_package '7-Zip 9.20 (x64 edition)' do source 'http://downloads.sourceforge.net/sevenzip/7z920-x64.msi' action :install end
The existing windows cookbook contains a package LWRP
types: msi, inno, nsis, wise, installshield, custom
examples: putty-0.60-installer.exe, 7z920-x64.msi, 'Google Chrome'
The type is either specified as an attribute or determined from the file extension, and is used to pass the correct arguments for a silent/automated installation to the underlying installer. The
custom type requires the user to specify the correct arguments in the