# File lib/installer.rb, line 33
  def install server_type
    if !skip_download
      source = {
        :server => "owncloud.org",
        :path => "/releases/",
        :file => "owncloud-latest.tar.bz2"
      }

      local_source = @settings.tmp_dir + source[:file]

      puts "Downloading owncloud source archive..."
      Net::HTTP.start( source[:server] ) do |http|
        response = http.get( source[:path] + source[:file] )
        open( local_source, "wb") do |file|
          file.write response.body
        end
      end

      puts "Extracting archive..."
      system "cd #{@settings.tmp_dir}; tar xjf #{source[:file]}"
    end

    @source_dir = @settings.tmp_dir + "owncloud"

    write_admin_config
    
    if server_type == "local"
      install_local
    elsif server_type == "ftp"
      install_ftp
    else
      STDERR.puts "Unsupported server type: #{server_type}"
      exit 1
    end
  end