private function chdirToSugarDir()
    {
        if (!$this->getApplication()->isInstalled()) {
            throw new SugarException('Unable to find an installed instance of SugarCRM in :' . $this->getPath(), 1);
        }
        $this->lastCwd = realpath(getcwd());
        chdir($this->getPath());
    }