     # of the first package isn't skewed by being the first to require atom
     require '../exports/atom'
 
-    packagePaths = @getAvailablePackagePaths()
-    packagePaths = packagePaths.filter (packagePath) => not @isPackageDisabled(path.basename(packagePath))
-    packagePaths = _.uniq packagePaths, (packagePath) -> path.basename(packagePath)
+    packages = @getAvailablePackages().filter((p) => not @isPackageDisabled(p.name))
     @config.transact =>
-      @loadPackage(packagePath) for packagePath in packagePaths
+      for pack in packages
+        @loadPackage(pack.path)
       return
     @initialPackagesLoaded = true
     @emitter.emit 'did-load-initial-packages'

    @packageDirPaths = []
    @deferredActivationHooks = []
    @triggeredActivationHooks = new Set()
    @packagesCache = require('../package.json')?._atomPackages ? {}
    @initialPackagesLoaded = false
    @initialPackagesActivated = false
    @loadedPackages = {}


  # Public: Returns an {Array} of {String}s of all the available package paths.
  getAvailablePackagePaths: ->
    @getAvailablePackages().map((a) -> a.path)

  # Public: Returns an {Array} of {String}s of all the available package names.
  getAvailablePackageNames: ->
    @getAvailablePackages().sort((a) -> a.name)

  # Public: Returns an {Array} of {String}s of all the available package metadata.
  getAvailablePackageMetadata: ->
    packages = []
    for pack in @getAvailablePackages()
      metadata = @getLoadedPackage(pack.name)?.metadata ? @loadPackageMetadata(pack.path, true)
      packages.push(metadata)
    packages

  getAvailablePackages: ->
    packages = []
    packagesByName = new Set()

    for packageDirPath in @packageDirPaths
      if fs.isDirectorySync(packageDirPath)
        for packagePath in fs.readdirSync(packageDirPath)
          packageName = path.basename(packagePath)
          if not packageName.startsWith('.') and not packagesByName.has(packageName) and fs.isDirectorySync(packagePath)
            packages.push({
              name: packageName,
              path: path.join(packageDirPath, packagePath),
              isBundled: false
            })
            packagesByName.add(packageName)

    for packageName of @packageDependencies
      unless packagesByName.has(packageName)
        packages.push({
          name: packageName,
          path: path.join(@resourcePath, 'node_modules', packageName),
          isBundled: true
        })

    packages.sort((a, b) -> a.name.toLowerCase().localeCompare(b.name.toLowerCase()))

  ###
  Section: Private
  ###
