Download the IDT installer script and trigger runInstaller().
779345
function downloadInstaller(cb) {
  const url = win ?
    'https://ibm.biz/yeoman-idt-win-install' :
    'http://ibm.biz/yeoman-idt-install';

  const fileName = url.split('/').pop()

  console.log(chalk.blue('Downloading installer from:'), url);

  const file = fs.createWriteStream(fileName);

  request
    .get({url, followAllRedirects: true})
    .on('error', (err) => { console.error(err); })
    .pipe(file)
    .on('finish', () => runInstaller(fileName, cb));
}
925172
function runInstaller(fileName, cb) {
  const shell = win ? 'powershell.exe' : 'bash';

  const filePath = path.resolve(__dirname, fileName);
  console.log(`Now running: ${shell} ${filePath}`);

  cp.spawnSync(shell, [filePath], {stdio: 'inherit'});
  typeof cb === 'function' && cb();
}
120616
function install(items, callback) {

    var item = items[next],
        command = item.command,
        args = item.args,
        admin = item.admin,
        spawnopt = (item.spawnopt || {}),
        print;


    // set the spawn object according to the passed admin argument
    admin = setSpawnObject(admin);

    // run the command
    if (isLinux) {
        if (admin) {
            // use sudo
            args.unshift(command);
            print = args.join(" ");
            logger.console.log("[package-script] Running Installer command: " + print);

            sudoopt.spawnOptions = {};
            jsutils.Object.copy(spawnopt, sudoopt.spawnOptions);
            cprocess = spawn(args, sudoopt);
        } else {
            //use child_process
            print = args.join(" ");
            logger.console.log("[package-script] Running Installer command: " + command + " " + print);
            cprocess = spawn(command, args, spawnopt);
        }
    } else {
        args.unshift(command);
        args.unshift("/c");
        command = "cmd";
        print = [command, args.join(" ")].join(" ");
        logger.console.log("[package-script] Running Installer command: " + print);
        cprocess = spawn(command, args, spawnopt);

    }

    // -- Spawn Listeners
    cprocess.stdout.on('data', function (data) {
        var log = 'CAT Installer: ' + data;
        logger.logall(log);
    });

    cprocess.stderr.on('data', function (data) {
        if (data && (new String(data)).indexOf("npm ERR") != -1) {
            logger.logall('Package Script : ' + data);
        } else {
            logger.log2file('Package Script : ' + data);
        }
    });

    cprocess.on('close', function (code) {
        logger.log2file('Package Script Complete ' + code);
        next++;
        if (next < size) {
            install(items, callback);

        } else {
            // callback
            if (callback && _.isFunction(callback)) {
                callback.call(this, code);

            }
        }
    });
}
1315634
def create_installer(self, rpm_py_version, **kwargs):
        """"""
        return DebianInstaller(rpm_py_version, self.python, self.rpm, **kwargs)
980798
def run(self):
        

        self.announce("Moving scripts files", level=3)

        self.skip_build = True

        bin_dir = self.distribution.bin_dir

        scripts_dirs = [os.path.join(bin_dir, _dir) for _dir in
                        os.listdir(bin_dir) if
                        os.path.isdir(os.path.join(bin_dir, _dir))]

        for scripts_dir in scripts_dirs:

            dst_dir = os.path.join(self.build_dir,
                                   os.path.basename(scripts_dir))

            # Mostly in case of weird things happening during build
            if os.path.exists(dst_dir):
                
                if os.path.isdir(dst_dir): 

                    shutil.rmtree(dst_dir)

                elif os.path.isfile(dst_dir):

                    os.remove(dst_dir)

            shutil.move(scripts_dir,
                        os.path.join(self.build_dir,
                                     os.path.basename(scripts_dir)))

        # Mark the scripts for installation, adding them to 
        # distribution.scripts seems to ensure that the setuptools' record 
        # writer appends them to installed-files.txt in the package's egg-info

        self.distribution.scripts = scripts_dirs

        super().run()
1206026
def install():
    
    from .core.import_hooks import ExtensionImporter
    importer = ExtensionImporter()
    sys.meta_path.append(importer)
274690
function(){
		if (destinationIsRelative){
			_destination = _path.join(process.cwd(), "../..", _destination);
		}
		
		if(!_fs.existsSync(_destination)){
			_fs.mkdirSync(_destination);
		}
		
		var destinationPath = _path.join(_destination, "/" + SCRIPT_NAME);
		var sourcePath = _path.resolve(_path.dirname(module.filename), "../src/" + SCRIPT_NAME);
		var source = _fs.createReadStream(sourcePath);
		var dest = _fs.createWriteStream(destinationPath);
		dest.pipe(source);
		
		console.log("Client Installation Complete!\n");
		console.log(SCRIPT_NAME + " has been installed at: " + destinationPath);
		_prompt.close();
	}
641778
async def install_agent(self, connection, nonce, machine_id):
        

        # The path where the Juju agent should be installed.
        data_dir = "/var/lib/juju"

        # Disabling this prevents `apt-get update` from running initially, so
        # charms will fail to deploy
        disable_package_commands = False

        client_facade = client.ClientFacade.from_connection(connection)
        results = await client_facade.ProvisioningScript(
            data_dir,
            disable_package_commands,
            machine_id,
            nonce,
        )

        self._run_configure_script(results.script)
1237177
def run_setup(setup_script, args):
    """"""
    setup_dir = os.path.abspath(os.path.dirname(setup_script))
    with setup_context(setup_dir):
        try:
            sys.argv[:] = [setup_script] + list(args)
            sys.path.insert(0, setup_dir)
            # reset to include setup dir, w/clean callback list
            working_set.__init__()
            working_set.callbacks.append(lambda dist: dist.activate())

            # __file__ should be a byte string on Python 2 (#712)
            dunder_file = (
                setup_script
                if isinstance(setup_script, str) else
                setup_script.encode(sys.getfilesystemencoding())
            )

            with DirectorySandbox(setup_dir):
                ns = dict(__file__=dunder_file, __name__='__main__')
                _execfile(setup_script, ns)
        except SystemExit as v:
            if v.args and v.args[0]:
                raise
91469
def run(self):
        """"""
        try:
            if not self._is_rpm_all_lib_include_files_installed():
                self._make_lib_file_symbolic_links()
                self._copy_each_include_files_to_include_dir()
                self._make_dep_lib_file_sym_links_and_copy_include_files()
                self.setup_py.add_patchs_to_build_without_pkg_config(
                    self.rpm.lib_dir, self.rpm.include_dir
                )
            self.setup_py.apply_and_save()
            self._build_and_install()
        except InstallError as e:
            if not self._is_rpm_all_lib_include_files_installed():
                org_message = str(e)
                message = '''
Install failed without rpm-devel package by below reason.
Can you install the RPM package, and run this installer again?
'''
                message += org_message
                raise InstallError(message)
            else:
                raise e
828682
def run(self):
        """"""
        try:
            self.linux.verify_system_status()
        except InstallSkipError:
            Log.info('Install skipped.')
            return

        work_dir = tempfile.mkdtemp(suffix='-rpm-py-installer')
        Log.info("Created working directory '{0}'".format(work_dir))

        with Cmd.pushd(work_dir):
            self.rpm_py.download_and_install()
            if not self.python.is_python_binding_installed():
                message = (
                    'RPM Python binding failed to install '
                    'with unknown reason.'
                )
                raise InstallError(message)

            # TODO: Print installed module name and version as INFO.

        if self.is_work_dir_removed:
            shutil.rmtree(work_dir)
            Log.info("Removed working directory '{0}'".format(work_dir))
        else:
            Log.info("Saved working directory '{0}'".format(work_dir))
891012
protected function installCustomScript()
	{
		//install script
		foreach ($this->extension->getManifest()->getInstallPHPFiles() as $script) {
		    if (is_string($script)) {
                $this->runExtensionScript($script);
            } elseif (is_array($script) && isset($script[0]) && is_string($script[0]) && !empty($script[0]) && isset($script[1]) && is_array($script[1])) {
                $this->runExtensionScript($script[0], $script[1]);
            } else {
		        \common_Logger::w("Ignored custom install script because it's call definition is malformed in extension manifest!");
            }
		}

	}
1030128
protected function install()
    {
        $installScripts = array();
        foreach ($this->autoloaderCollection as $dir => $jsonAutoloader) {
            $bundleName = $jsonAutoloader->getBundleName();
            $this->installPackage($dir, $jsonAutoloader);

            // Check if the bundle under exam has attached an ActionManager file
            $actionsManager = $jsonAutoloader->getActionManager();
            if ((!array_key_exists($bundleName, $this->installedBundles) && null !== $actionsManager)) {
                if (null !== $jsonAutoloader->getActionManagerClass()) {
                    $installScripts[$bundleName] = $actionsManager;

                    // Copies the current ActionManager class to app/config/bundles/cache folder
                    // because it must be preserved when a bundle is uninstalled
                    $reflection = new \ReflectionClass($actionsManager);
                    $fileName = $reflection->getFileName();
                    $className = $this->cachePath . '/' . $bundleName . '/' . basename($fileName);
                    $this->filesystem->copy($fileName, $className, true);
                }
            }

            unset($this->installedBundles[$bundleName]);
        }

        $installerScript = $this->scriptFactory->createScript('PreBootInstaller');
        $installerScript->executeActions($installScripts);
    }
566750
function downloadInstaller(requester, isInitialAttempt, updateParams) {
        updateParams = updateParams || _updateParams;
        var currentRequester = requester || "";
        try {
            var ext = path.extname(updateParams.installerName);
            var localInstallerPath = path.resolve(updateDir, Date.now().toString() + ext),
                localInstallerFile = fs.createWriteStream(localInstallerPath),
                requestCompleted = true,
                readTimeOut = 180000;
            progress(request(updateParams.downloadURL, {timeout: readTimeOut}), {})
                .on('progress', function (state) {
                    var target = "retry-download";
                    if (isInitialAttempt) {
                        target = "initial-download";
                    }
                    var info = Math.floor(parseFloat(state.percent) * 100).toString() + '%';
                    var status = {
                        target: target,
                        spans: [{
                            id: "percent",
                            val: info
                        }]
                    };
                    postMessageToBrackets(MessageIds.SHOW_STATUS_INFO, currentRequester, status);
                })
                .on('error', function (err) {
                    console.log("AutoUpdate : Download failed. Error occurred : " + err.toString());
                    requestCompleted = false;
                    localInstallerFile.end();
                    var error = err.code === 'ESOCKETTIMEDOUT' || err.code === 'ENOTFOUND' ?
                                nodeErrorMessages.NETWORK_SLOW_OR_DISCONNECTED :
                                nodeErrorMessages.DOWNLOAD_ERROR;
                    postMessageToBrackets(MessageIds.NOTIFY_DOWNLOAD_FAILURE, currentRequester, error);
                })
                .pipe(localInstallerFile)
                .on('close', function () {
                    if (requestCompleted) {
                        try {
                            fs.renameSync(localInstallerPath, installerPath);
                            postMessageToBrackets(MessageIds.NOTIFY_DOWNLOAD_SUCCESS, currentRequester);
                        } catch (e) {
                            console.log("AutoUpdate : Download failed. Exception occurred : " + e.toString());
                            postMessageToBrackets(MessageIds.NOTIFY_DOWNLOAD_FAILURE,
                                                      currentRequester, nodeErrorMessages.DOWNLOAD_ERROR);
                        }
                    }
                });
        } catch (e) {
            console.log("AutoUpdate : Download failed. Exception occurred : " + e.toString());
            postMessageToBrackets(MessageIds.NOTIFY_DOWNLOAD_FAILURE,
                                  currentRequester, nodeErrorMessages.DOWNLOAD_ERROR);
        }
    }
584717
def BuildWithPyInstaller(self):
    """"""
    self.CleanDirectory(
        config.CONFIG.Get("PyInstaller.distpath", context=self.context))

    logging.info("Copying pyinstaller support files")
    self.spec_file = os.path.join(self.build_dir, "grr.spec")

    with open(self.spec_file, "wb") as fd:
      fd.write(config.CONFIG.Get("PyInstaller.spec", context=self.context))

    with open(os.path.join(self.build_dir, "version.txt"), "wb") as fd:
      fd.write(config.CONFIG.Get("PyInstaller.version", context=self.context))

    shutil.copy(
        src=config.CONFIG.Get("PyInstaller.icon_path", context=self.context),
        dst=os.path.join(self.build_dir, u"grr.ico"))

    # We expect the onedir output at this location.
    self.output_dir = os.path.join(
        config.CONFIG.Get("PyInstaller.distpath", context=self.context),
        "grr-client")

    # Pyinstaller doesn't handle unicode strings.
    args = [
        "--distpath",
        str(config.CONFIG.Get("PyInstaller.distpath", context=self.context)),
        "--workpath",
        str(
            config.CONFIG.Get("PyInstaller.workpath_dir",
                              context=self.context)),
        str(self.spec_file)
    ]
    logging.info("Running pyinstaller: %s", args)
    PyInstallerMain.run(pyi_args=[utils.SmartStr(x) for x in args])

    # Clear out some crud that pyinstaller includes.
    for path in ["tcl", "tk", "pytz"]:
      dir_path = os.path.join(self.output_dir, path)
      try:
        shutil.rmtree(dir_path)
      except OSError:
        logging.error("Unable to remove directory: %s", dir_path)

      try:
        os.mkdir(dir_path)
      except OSError:
        logging.error("Unable to create directory: %s", dir_path)

      file_path = os.path.join(dir_path, path)
      try:
        # Create an empty file so the directories get put in the installers.
        with open(file_path, "wb"):
          pass
      except IOError:
        logging.error("Unable to create file: %s", file_path)

    version_ini = version.VersionPath()
    shutil.copy(version_ini, os.path.join(self.output_dir, "version.ini"))

    with open(os.path.join(self.output_dir, "build.yaml"), "wb") as fd:
      self.WriteBuildYaml(fd)
1233880
Installer newInstaller(
      Path installedSdkRoot, ProgressListener progressListener, ConsoleListener consoleListener) {

    return new Installer(
        installedSdkRoot,
        getInstallScriptProvider(),
        usageReporting,
        progressListener,
        consoleListener,
        CommandRunner.newRunner());
  }
855315
def trigger_frontend_build(self, event):
        """"""

        from hfos.database import instance
        install_frontend(instance=instance,
                         forcerebuild=event.force,
                         install=event.install,
                         development=self.development
                         )