diff --git a/setup/wizard/installUtil.php b/setup/wizard/installUtil.php index 157a751..d3102fd 100644 --- a/setup/wizard/installUtil.php +++ b/setup/wizard/installUtil.php @@ -765,16 +765,12 @@ class InstallUtil { if($this->installEnvironment() == 'Zend') { if(WINDOWS_OS) { // For Zend Installation only $sysdir = explode(DS, SYSTEM_DIR); - // pop until we find Zend, this should be our Zend root :) - $current = array_pop($sysdir); - while ($current != 'Zend') { - $current = array_pop($sysdir); - } + array_pop($sysdir); + array_pop($sysdir); $zendsys = ''; foreach ($sysdir as $v) { $zendsys .= $v.DS; } - $zendsys .= 'Zend'.DS; $bin = $zendsys."ZendServer".DS."bin".DS; if(file_exists($bin)) return $bin; diff --git a/setup/wizard/steps/database.php b/setup/wizard/steps/database.php index 2e4d670..c6072f3 100644 --- a/setup/wizard/steps/database.php +++ b/setup/wizard/steps/database.php @@ -787,24 +787,42 @@ class database extends Step } } - // if Windows, hard code (relative to SYSTEM_ROOT) where we expect the Zend MSI installer to have placed them + // if Windows, attempt to insert full paths to binaries if (WINDOWS_OS) { $winBinaries = array('php' => 'ZendServer\bin\php.exe', 'python' => 'openoffice\program\python.exe', 'java' => 'jre\bin\java.exe', // since we don't know where convert is yet, let's just assume somewhere for now (manually test) - 'convert' => 'imagick\convert.exe', + 'convert' => 'bin\imagemagick\convert.exe', 'zip' => 'bin\zip\zip.exe', 'unzip' => 'bin\unzip\unzip.exe'); - foreach ($winBinaries as $displayName => $bin) { - // what about config settings which don't yet exist? - // TODO make sure sql install/updates create these entries - $updateBin = 'UPDATE config_settings c SET c.value = "'. str_replace('\\', '\\\\', SYSTEM_ROOT . $bin).'" ' + foreach ($winBinaries as $displayName => $bin) + { + // ignore if we can't find the file + if (!file_exists(SYSTEM_ROOT . $bin)) continue; + + // thumbnails is a special case, being a plugin which won't have an entry on a new installation + if ($displayName == 'convert') { + // check if there is an entry, if not, insert and continue to next loop, else continue to update statement + $query = 'SELECT id FROM config_settings WHERE display_name = "' . $displayName . '"'; + $this->util->dbUtilities->query($query); + $result = $this->util->dbUtilities->fetchAssoc(); + if (is_null($result)) { + $query = "INSERT INTO `config_settings` " + . "(group_name, display_name, description, item, value, default_value, type, options, can_edit) " + . "VALUES ('externalBinary', 'convert', 'The path to the ImageMagick \"convert\" binary', 'convertPath', " + . "'" . str_replace('\\', '\\\\', SYSTEM_ROOT . $bin) . "', 'convert', 'string', NULL, 1);"; + $this->util->dbUtilities->query($query); + continue; + } + } + + $updateBin = 'UPDATE config_settings c SET c.value = "'. str_replace('\\', '\\\\', SYSTEM_ROOT . $bin) . '" ' . 'where c.group_name = "externalBinary" and c.display_name = "'.$displayName.'";'; $this->util->dbUtilities->query($updateBin); } } // if Linux? else { - + // TODO python binary } }