Sha256: 3656969bf0ac98c354906dbc56a997a8eee8e3b22c0515386770a7dfca6c0c8b
Contents?: true
Size: 1.15 KB
Versions: 17
Compression:
Stored size: 1.15 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 = machine.communicate.shell.cmd('ECHO %SYSTEMDRIVE%')[:data][0][:stdout].chomp root = File.join("#{root}\\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
17 entries across 17 versions & 1 rubygems