Sha256: 6a8d6772b5630e93329d7925171953435fde5acecc9fb98b304ea0ade5d25a9f

Contents?: true

Size: 1.06 KB

Versions: 19

Compression:

Stored size: 1.06 KB

Contents

require 'pe_build/on_machine'
class PEBuild::Cap::RunInstall::Windows

  extend PEBuild::OnMachine

  def self.run_install(machine, config, archive)

    gt_win2k3_path = '${Env:ALLUSERSPROFILE}\\PuppetLabs'
    le_win2k3_path = '${Env:ALLUSERSPROFILE}\\Application Data\\PuppetLabs'
    testpath = "(Test-Path \"#{gt_win2k3_path}\") -or (Test-Path \"#{le_win2k3_path}\")"

    if machine.communicate.test("If (#{testpath}) { Exit 0 } Else { Exit 1 }")
      machine.ui.warn I18n.t('pebuild.cap.run_install.already_installed'),
        :name => machine.name
      return
    end

    root = File.join('\\\\VBOXSVR\\vagrant', PEBuild::WORK_DIR)

    # The installer will be fed to msiexec. That means the File.join() method
    # is of limited use since it won't execute on the Windows system
    installer = File.join(root, archive.to_s).gsub('/', '\\')

    cmd = []
    cmd << 'msiexec' << '/qn' << '/i' << installer

    cmd << "PUPPET_MASTER_SERVER=#{config.master}"
    cmd << "PUPPET_AGENT_CERTNAME=#{machine.name}"

    argv = cmd.join(' ')

    on_machine(machine, argv)

  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
vagrant-pe_build-0.9.5 lib/pe_build/cap/run_install/windows.rb
vagrant-pe_build-0.9.4 lib/pe_build/cap/run_install/windows.rb
vagrant-pe_build-0.9.3 lib/pe_build/cap/run_install/windows.rb
vagrant-pe_build-0.9.2 lib/pe_build/cap/run_install/windows.rb
vagrant-pe_build-0.9.1 lib/pe_build/cap/run_install/windows.rb
vagrant-pe_build-0.9.0 lib/pe_build/cap/run_install/windows.rb
vagrant-pe_build-0.8.8 lib/pe_build/cap/run_install/windows.rb
vagrant-pe_build-0.8.7 lib/pe_build/cap/run_install/windows.rb
vagrant-pe_build-0.8.6 lib/pe_build/cap/run_install/windows.rb
vagrant-pe_build-0.8.5 lib/pe_build/cap/run_install/windows.rb
vagrant-pe_build-0.8.4 lib/pe_build/cap/run_install/windows.rb
vagrant-pe_build-0.8.3 lib/pe_build/cap/run_install/windows.rb
vagrant-pe_build-0.8.2 lib/pe_build/cap/run_install/windows.rb
vagrant-pe_build-0.8.1 lib/pe_build/cap/run_install/windows.rb
vagrant-pe_build-0.8.0 lib/pe_build/cap/run_install/windows.rb
vagrant-pe_build-0.7.1 lib/pe_build/cap/run_install/windows.rb
vagrant-pe_build-0.7.0 lib/pe_build/cap/run_install/windows.rb
vagrant-pe_build-0.6.0 lib/pe_build/cap/run_install/windows.rb
vagrant-pe_build-0.5.0 lib/pe_build/cap/run_install/windows.rb