Sha256: f86a385e3ed14ede24d387afadb7b7c91286b34e5ecad6ef571f45b381d17785

Contents?: true

Size: 741 Bytes

Versions: 13

Compression:

Stored size: 741 Bytes

Contents

require 'rake'
module Albacore
  def self.find_msbuild_versions
    return nil unless ::Rake::Win32.windows?
    require 'win32/registry'
    retval = Hash.new
    begin
      Win32::Registry::HKEY_LOCAL_MACHINE.open('SOFTWARE\Microsoft\MSBuild\ToolsVersions') do |toolsVersion|
        toolsVersion.each_key do |key|
          begin
            versionKey = toolsVersion.open(key)
            version = key.to_i
            msb = File.join(versionKey['MSBuildToolsPath'],'msbuild.exe')
            retval[version] = msb
          rescue
            error "failed to open #{key}"
          end
        end
      end
    rescue
      error "failed to open HKLM\\SOFTWARE\\Microsoft\\MSBuild\\ToolsVersions"
    end
    return retval
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
albacore-2.6.4 ./lib/albacore/task_types/find_msbuild_versions.rb
albacore-2.6.3 ./lib/albacore/task_types/find_msbuild_versions.rb
albacore-2.6.2 ./lib/albacore/task_types/find_msbuild_versions.rb
albacore-2.6.1 ./lib/albacore/task_types/find_msbuild_versions.rb
albacore-2.6.0 ./lib/albacore/task_types/find_msbuild_versions.rb
albacore-2.5.14 ./lib/albacore/task_types/find_msbuild_versions.rb
albacore-2.5.13 ./lib/albacore/task_types/find_msbuild_versions.rb
albacore-2.5.11 ./lib/albacore/task_types/find_msbuild_versions.rb
albacore-2.5.10 ./lib/albacore/task_types/find_msbuild_versions.rb
albacore-2.5.9 ./lib/albacore/task_types/find_msbuild_versions.rb
albacore-2.5.8 ./lib/albacore/task_types/find_msbuild_versions.rb
albacore-2.5.6 lib/albacore/task_types/find_msbuild_versions.rb
albacore-2.5.5 lib/albacore/task_types/find_msbuild_versions.rb