lib/vagrant-vbguest/detector.rb in vagrant-vbguest-0.3.4 vs lib/vagrant-vbguest/detector.rb in vagrant-vbguest-0.3.5

- old
+ new

@@ -27,10 +27,14 @@ path_platform = if Vagrant::Util::Platform.linux? "/usr/share/virtualbox/VBoxGuestAdditions.iso" elsif Vagrant::Util::Platform.darwin? "/Applications/VirtualBox.app/Contents/MacOS/VBoxGuestAdditions.iso" elsif Vagrant::Util::Platform.windows? - File.join((ENV["PROGRAM_FILES"] || ENV["PROGRAMFILES"]), "/Oracle/VirtualBox/VBoxGuestAdditions.iso") + if (p = ENV["VBOX_INSTALL_PATH"]) && !p.empty? + File.join(p, "VBoxGuestAdditions.iso") + else + File.join((ENV["PROGRAM_FILES"] || ENV["ProgramW6432"] || ENV["PROGRAMFILES"]), "/Oracle/VirtualBox/VBoxGuestAdditions.iso") + end end File.exists?(path_platform) ? path_platform : nil end def web_iso \ No newline at end of file