# class Chef::Provider::Package::Windows::MSI

### Public Class Methods

new(resource) click to toggle source

    # File lib/chef/provider/package/windows/msi.rb, line 32
    def initialize(resource)
      @new_resource = resource
    end

### Public Instance Methods

expand_options(options) click to toggle source

From Chef::Provider::Package

    # File lib/chef/provider/package/windows/msi.rb, line 37
    def expand_options(options)
      options ? " #{options}" : ""
    end

install_package(name, version) click to toggle source

    # File lib/chef/provider/package/windows/msi.rb, line 54
    def install_package(name, version)
      # We could use MsiConfigureProduct here, but we'll start off with msiexec
      Chef::Log.debug("#{@new_resource} installing MSI package '#{@new_resource.source}'")
      shell_out!("msiexec /qn /i \"#{@new_resource.source}\" #{expand_options(@new_resource.options)}", {:timeout => @new_resource.timeout, :returns => @new_resource.returns})
    end

installed_version() click to toggle source

Returns a version if the package is installed or nil if it is not.

    # File lib/chef/provider/package/windows/msi.rb, line 42
    def installed_version
      Chef::Log.debug("#{@new_resource} getting product code for package at #{@new_resource.source}")
      product_code = get_product_property(@new_resource.source, "ProductCode")
      Chef::Log.debug("#{@new_resource} checking package status and verion for #{product_code}")
      get_installed_version(product_code)
    end

package_version() click to toggle source

    # File lib/chef/provider/package/windows/msi.rb, line 49
    def package_version
      Chef::Log.debug("#{@new_resource} getting product version for package at #{@new_resource.source}")
      get_product_property(@new_resource.source, "ProductVersion")
    end

remove_package(name, version) click to toggle source

    # File lib/chef/provider/package/windows/msi.rb, line 60
    def remove_package(name, version)
      # We could use MsiConfigureProduct here, but we'll start off with msiexec
      Chef::Log.debug("#{@new_resource} removing MSI package '#{@new_resource.source}'")
      shell_out!("msiexec /qn /x \"#{@new_resource.source}\" #{expand_options(@new_resource.options)}", {:timeout => @new_resource.timeout, :returns => @new_resource.returns})
    end