           else
             cb null
 
-  installApp: (options, callback)->
-
-    {username, owner, appPath, appName, version} = options
-    version ?= 'latest'
-
-    cb = (err)->
-      console.error err if err
-      callback? err, null
-
-    kpmAppPath = escapePath "/opt/Apps/#{owner}/#{appName}/#{version}"
-    appPath    = escapePath appPath
-
-    if kpmAppPath.indexOf("/opt/Apps/") isnt 0 or not safeForUser username, appPath
-      callback? new AuthorizationError username
-      return false
-
-    createAppsDir username, (err)->
-      makedirp appPath, username, (err)->
-        if err then cb err
-        else
-          exec "cp #{kpmAppPath}/index.js #{appPath} && cp #{kpmAppPath}/.manifest #{appPath}", (err, stdout, stderr)->
-            if err or stderr.length
-              cb err or "[ERROR] #{stderr}"
-            else
-              exec "chown -R #{username}: #{appPath}", (err, stdout, stderr)->
-                if err or stderr.length
-                  cb err or "[ERROR] #{stderr}"
-                else
-                  cb null
-
   approveApp: (options, callback)->
 
     {username, authorNick, version, appName} = options


module.exports = new Kite 'applications'

  copyAppSkeleton:(options, callback)->
    {username, appPath, type} = options


        exec "rm -f #{latestPath} && ln -s #{versionedPath} #{latestPath}", (err, stdout, stderr)->
          if err or stderr then cb err
          else cb null
