Sha256: c584ea69c207b619a8bc2c057b63dbbde71bb3eb795bb7c33928695023e75e25

Contents?: true

Size: 893 Bytes

Versions: 39

Compression:

Stored size: 893 Bytes

Contents

require 'pe_build/util/version_string'

# detect_installer implementation for Windows guests
#
# @abstract
# @api protected
class PEBuild::Cap::DetectInstaller::Windows < PEBuild::Cap::DetectInstaller::Base

  def detect
    # Starting with PE 3.7.0, separate 64-bit packages are shipped for Windows.
    if (PEBuild::Util::VersionString.compare(@version, '3.7.0') >= 0) && (arch == 'x64')
      "puppet-enterprise-#{@version}-x64.msi"
    else
      "puppet-enterprise-#{@version}.msi"
    end
  end

  # @since 0.13.0
  def arch
    results = execute_command('if ([System.IntPtr]::Size -eq 4) { "x86" } else { "x64" }')

    unless results[:retval] == 0
      raise PEBuild::Cap::DetectInstaller::DetectFailed,
        :name  => @machine.name,
        :error => "Could not determine Windows architecture on #{@machine.name}: got #{results[:stderr]}"
    end

    results[:stdout]
  end

end

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
vagrant-pe_build-0.17.0 lib/pe_build/cap/detect_installer/windows.rb
vagrant-pe_build-0.16.0 lib/pe_build/cap/detect_installer/windows.rb
vagrant-pe_build-0.15.6 lib/pe_build/cap/detect_installer/windows.rb
vagrant-pe_build-0.15.5 lib/pe_build/cap/detect_installer/windows.rb
vagrant-pe_build-0.15.4 lib/pe_build/cap/detect_installer/windows.rb
vagrant-pe_build-0.15.3 lib/pe_build/cap/detect_installer/windows.rb
vagrant-pe_build-0.15.1 lib/pe_build/cap/detect_installer/windows.rb
vagrant-pe_build-0.15.0 lib/pe_build/cap/detect_installer/windows.rb
vagrant-pe_build-0.14.2 lib/pe_build/cap/detect_installer/windows.rb
vagrant-pe_build-0.14.1 lib/pe_build/cap/detect_installer/windows.rb
vagrant-pe_build-0.14.0 lib/pe_build/cap/detect_installer/windows.rb
vagrant-pe_build-0.13.7 lib/pe_build/cap/detect_installer/windows.rb
vagrant-pe_build-0.13.6 lib/pe_build/cap/detect_installer/windows.rb
vagrant-pe_build-0.13.5 lib/pe_build/cap/detect_installer/windows.rb
vagrant-pe_build-0.13.4 lib/pe_build/cap/detect_installer/windows.rb
vagrant-pe_build-0.13.3 lib/pe_build/cap/detect_installer/windows.rb
vagrant-pe_build-0.13.2 lib/pe_build/cap/detect_installer/windows.rb
vagrant-pe_build-0.13.1 lib/pe_build/cap/detect_installer/windows.rb
vagrant-pe_build-0.13.0 lib/pe_build/cap/detect_installer/windows.rb