Sha256: 91dcaca97916bc658b3bf7da2a6f00175e072a4f18ead6afd1f3ef489de5a740

Contents?: true

Size: 964 Bytes

Versions: 23

Compression:

Stored size: 964 Bytes

Contents

module VagrantPlugins
  module Parallels
    module GuestWindowsCap
      class InstallParallelsTools
        def self.install_parallels_tools(machine)
          machine.communicate.tap do |comm|
            pti_agent_path = File.expand_path(
              machine.provider.driver.read_guest_tools_iso_path('windows'),
              machine.env.root_path
            )

            remote_file = '$env:TEMP\PTIAgent.exe'
            comm.upload(pti_agent_path, remote_file)

            install_script = <<-EOH
            Start-Process -FilePath #{remote_file} `
              -ArgumentList "/install_silent" `
              -Verb RunAs `
              -Wait
            EOH

            cleanup_script = <<-EOH
            If (Test-Path #{remote_file}){
              Remove-Item #{remote_file}
            }
            EOH

            comm.execute(install_script)
            comm.execute(cleanup_script)
          end
        end
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
vagrant-parallels-2.4.2 lib/vagrant-parallels/guest_cap/windows/install_parallels_tools.rb
vagrant-parallels-2.4.1 lib/vagrant-parallels/guest_cap/windows/install_parallels_tools.rb
vagrant-parallels-2.4.0 lib/vagrant-parallels/guest_cap/windows/install_parallels_tools.rb
vagrant-parallels-2.3.1 lib/vagrant-parallels/guest_cap/windows/install_parallels_tools.rb
vagrant-parallels-2.3.0 lib/vagrant-parallels/guest_cap/windows/install_parallels_tools.rb
vagrant-parallels-2.2.6 lib/vagrant-parallels/guest_cap/windows/install_parallels_tools.rb
vagrant-parallels-2.2.5 lib/vagrant-parallels/guest_cap/windows/install_parallels_tools.rb
vagrant-parallels-2.2.4 lib/vagrant-parallels/guest_cap/windows/install_parallels_tools.rb
vagrant-parallels-2.2.3 lib/vagrant-parallels/guest_cap/windows/install_parallels_tools.rb
vagrant-parallels-2.2.2 lib/vagrant-parallels/guest_cap/windows/install_parallels_tools.rb
vagrant-parallels-2.2.1 lib/vagrant-parallels/guest_cap/windows/install_parallels_tools.rb
vagrant-parallels-2.2.0 lib/vagrant-parallels/guest_cap/windows/install_parallels_tools.rb
vagrant-parallels-2.1.0 lib/vagrant-parallels/guest_cap/windows/install_parallels_tools.rb
vagrant-parallels-2.0.1 lib/vagrant-parallels/guest_cap/windows/install_parallels_tools.rb
vagrant-parallels-2.0.0 lib/vagrant-parallels/guest_cap/windows/install_parallels_tools.rb
vagrant-parallels-1.7.8 lib/vagrant-parallels/guest_cap/windows/install_parallels_tools.rb
vagrant-parallels-1.7.7 lib/vagrant-parallels/guest_cap/windows/install_parallels_tools.rb
vagrant-parallels-1.7.6 lib/vagrant-parallels/guest_cap/windows/install_parallels_tools.rb
vagrant-parallels-1.7.5 lib/vagrant-parallels/guest_cap/windows/install_parallels_tools.rb
vagrant-parallels-1.7.4 lib/vagrant-parallels/guest_cap/windows/install_parallels_tools.rb