   mirror = fs.readJsonSync mirror_json_path
   # Don't want to mess with detecting system language here without window.navigator
   language = config.get 'poi.language', 'zh-CN'
-  primaryServer = if language == "zh-CN" then "tsinghua" else "npm"
+  primaryServer = if language == 'zh-CN' then 'taobao' else 'npm'
   server = mirror[config.get "packageManager.mirrorName", primaryServer].server
 
   plugin_names = (n for n of packages)
 
   install_root = path.join building_root, 'poiplugins_install'
-  fs.removeSync install_root
-  fs.ensureDirSync install_root
-  yield installPluginsTo plugin_names, install_root, server
-
   gzip_root = path.join building_root, 'poiplugins'
-  fs.removeSync gzip_root
-  fs.ensureDirSync gzip_root
-  for name in plugin_names
-    yield compressGzipAsync path.join(install_root, "node_modules", name), path.join(gzip_root, name+'.tar.gz')
+  yield installPluginsTo plugin_names, install_root, gzip_root, server
 
   d = new Date()
   str_date = "#{d.getUTCFullYear()}-#{d.getUTCMonth()+1}-#{d.getUTCDate()}"

    Promise.resolve
      log: "Unsupported platform #{platform}."

installPluginsTo = async (plugin_names, install_root, server) ->
  fs.removeAsync install_root
  fs.ensureDirSync install_root
  npmConfig =
    prefix: install_root
    registry: server
  yield promisify(npm.load) npmConfig
  yield promisify(npm.commands.install) plugin_names

module.exports.installPluginsAsync = async (poi_version) ->
  build_root = path.join __dirname, build_dir_name
  building_root = path.join build_root, "building_#{poi_version}"

global.EXROOT = global.APPDATA_PATH
config = require './lib/config'

npm_exec_path = path.join __dirname, 'node_modules', 'npm', 'bin', 'npm-cli.js'

plugin_json_path = path.join ROOT, 'assets', 'data', 'plugin.json'
mirror_json_path = path.join ROOT, 'assets', 'data', 'mirror.json'

