puppetlabs/puppet — pull request #1008 by joshcooper (2012-08-06 22:08:23+00:00)
Title: (#11870) Support executable package types on Windows

Previously, puppet could only manage MSI packages on Windows. These commits deprecate the `:msi` package provider for Windows, and add a new `:windows` package provider that supports both MSI and self-extracting executable installers.

The default package provider on Windows is now `:windows`. Attempting to use the `:msi` provider explicitly will result in a deprecation warning.

The `:windows` package provider queries the registry to determine that set of installed packages using the logic from .

Puppet will only manage MSI packages that have the following attributes:

Non-empty DisplayName
Are not SystemComponent
Are WindowsInstaller

Puppet will only manage executable packages that have the following attributes:

Non-empty DisplayName
Non-empty UninstallString
Are not SystemComponent
Are not WindowsInstaller
Names don't start with KBXXXXXX
Are not part of another product (ParentKeyName)
Are not Security Update, Update Rollup or Hotfix

These commits also add an `:uninstall_options` parameter to the package type, and allow both `:install_options` and `:uninstall_options` to be specified as an array of strings and/or hashes. For example,

install_options => [ '/S', { 'INSTALLDIR' => 'C:\Program Files\Vendor' } ]

It is backwards compatible with previously specified `:install_options`. For example, to install Java silently:

package { 'Java(TM) 7 Update 5':
ensure => installed,
source => '...\jre-7u5-windows-i586.exe',
install_options => [
'/s', '/v/qn" ADDLOCAL=jrecore REBOOT=Suppress JAVAUPDATE=0"'
]
}

To uninstall Git silently:

package { 'Git version 1.7.11-preview20120710':
ensure => uninstalled,
uninstall_options => ['/SP-', '/VERYSILENT', '/SUPPRESSMSGBOXES'],
}