class U3d::WindowsInstallation

Public Instance Methods

build_number() click to toggle source
# File lib/u3d/installation.rb, line 402
def build_number
  helper.build_number
end
clean_install?() click to toggle source
# File lib/u3d/installation.rb, line 457
def clean_install?
  do_not_move? || !(root_path =~ UNITY_DIR_CHECK).nil?
end
default_log_file() click to toggle source
# File lib/u3d/installation.rb, line 406
def default_log_file
  if @logfile.nil?
    begin
      loc_appdata = Utils.windows_local_appdata
      log_dir = File.expand_path('Unity/Editor/', loc_appdata)
      UI.important "Log directory (#{log_dir}) does not exist" unless Dir.exist? log_dir
      @logfile = File.expand_path('Editor.log', log_dir)
    rescue RuntimeError => ex
      UI.error "Unable to retrieve the editor logfile: #{ex}"
    end
  end
  @logfile
end
exe_path() click to toggle source
# File lib/u3d/installation.rb, line 420
def exe_path
  File.join(@root_path, 'Editor', 'Unity.exe')
end
module_name_pattern(module_name) click to toggle source
# File lib/u3d/installation.rb, line 444
def module_name_pattern(module_name)
  case module_name
  when 'Documentation'
    return "#{root_path}/Editor/Data/Documentation/"
  when 'StandardAssets'
    return "#{root_path}/Editor/Standard Assets/"
  when 'MonoDevelop'
    return "#{root_path}/MonoDevelop/"
  else
    UI.crash! "No pattern is known for #{module_name} on Windows"
  end
end
packages() click to toggle source
# File lib/u3d/installation.rb, line 429
def packages
  path = "#{root_path}/Editor/Data/"
  pack = []
  IvyPlaybackEngineUtils.list_module_configs(path).each do |mpath|
    pack << IvyPlaybackEngineUtils.module_name(mpath)
  end
  ModulePlaybackEngineUtils.list_module_configs(root_path).each do |mpath|
    pack << ModulePlaybackEngineUtils.module_name(mpath)
  end
  NOT_PLAYBACKENGINE_PACKAGES.each do |module_name|
    pack << module_name unless Dir[module_name_pattern(module_name)].empty?
  end
  pack
end
path() click to toggle source
# File lib/u3d/installation.rb, line 424
def path
  UI.deprecated("path is deprecated. Use root_path instead")
  @root_path || @path
end
version() click to toggle source
# File lib/u3d/installation.rb, line 392
def version
  version = helper.version
  return version unless version.nil?

  path = "#{root_path}/Editor/Data/"
  package = IvyPlaybackEngineUtils.list_module_configs(path).first
  raise "Couldn't find a module under #{path}" unless package
  IvyPlaybackEngineUtils.unity_version(package)
end

Private Instance Methods

helper() click to toggle source
# File lib/u3d/installation.rb, line 463
def helper
  @helper ||= WindowsInstallationHelper.new(exe_path)
end