diff --git a/dmsctl.sh b/dmsctl.sh
index ada34fb..bd8a767 100755
--- a/dmsctl.sh
+++ b/dmsctl.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
# Boot KnowledgeTree services
# chkconfig: 2345 55 25
@@ -6,6 +6,8 @@
#
# processname: ktdms
+cd $(dirname $0)
+
HOSTNAME=`hostname`
RETVAL=0
PID=""
@@ -16,6 +18,14 @@ INSTALL_PATH=`pwd`
JAVABIN=/usr/bin/java
ZEND_DIR=/usr/local/zend
+if [ -f /etc/zce.rc ];then
+ . /etc/zce.rc
+else
+ echo "/etc/zce.rc doesn't exist!"
+ exit 1;
+fi
+
+
# OpenOffice
SOFFICEFILE=soffice
SOFFICE_PIDFILE=$INSTALL_PATH/var/log/soffice.bin.pid
@@ -279,6 +289,24 @@ noserver() {
help
}
+firstrun() {
+ echo "We running for the first time, FIX ZEND"
+ if grep --quiet LD_LIBRARAY_PATH /etc/zce.rc ; then
+ echo "Nothing to be done ... maybe"
+ else
+ echo "PATH=/usr/local/zend/bin:$PATH" >> /etc/zce.rc
+ if [ -z $LD_LIBRARY_PATH ] ; then
+ echo "LD_LIBRARY_PATH=$ZEND_DIR/lib" >> /etc/zce.rc
+ else
+ echo "LD_LIBRARY_PATH=$ZEND_DIR/lib:$LD_LIBRARY_PATH" >> /etc/zce.rc
+ fi
+ fi
+
+ touch $INSTALL_PATH/var/bin/.dmsinit.lock
+
+ $ZEND_DIR/bin/zendctl.sh restart
+}
+
[ $# -lt 1 ] && help
if [ ! -z ${2} ]; then
@@ -291,6 +319,8 @@ if [ "x$3" != "x" ]; then
MYSQL_PASSWORD=$3
fi
+# Are we running for first time
+[[ -e $INSTALL_PATH/var/bin/.dmsinit.lock ]] || firstrun
case $1 in
help) help
@@ -302,6 +332,7 @@ case $1 in
start_soffice
start_lucene
start_scheduler
+ #[[ -e $ZEND_DIR/bin/zendctl.sh ]] && $ZEND_DIR/bin/zendctl.sh restart
fi
;;
stop) if [ "${SERVER}" != "all" ]; then
@@ -327,4 +358,4 @@ case $1 in
;;
esac
-exit $ERROR
\ No newline at end of file
+exit $ERROR
diff --git a/plugins/thumbnails/thumbnails.php b/plugins/thumbnails/thumbnails.php
index 811c526..fb5c055 100755
--- a/plugins/thumbnails/thumbnails.php
+++ b/plugins/thumbnails/thumbnails.php
@@ -170,6 +170,11 @@ class thumbnailGenerator extends BaseProcessor
$default->log->debug('Thumbnail Generator Plugin: PDF file does not exist, cannot generate a thumbnail');
return false;
}
+
+ if (WINDOWS_OS) {
+ $thumbnailfile = KT_DIR . $thumbnailfile;
+ }
+
// if a previous version of the thumbnail exists - delete it
if (file_exists($thumbnailfile)) {
@unlink($thumbnailfile);
@@ -177,7 +182,10 @@ class thumbnailGenerator extends BaseProcessor
// do generation
// if (extension_loaded('imagick')) {
$pathConvert = (!empty($default->convertPath)) ? $default->convertPath : 'convert';
- $result = shell_exec("{$pathConvert} -size 200x200 {$pdfFile}[0] -resize 200x200 $thumbnailfile");
+ if (WINDOWS_OS) {
+ $pathConvert = '"' . $pathConvert . '"';
+ }
+ $result = KTUtil::pexec("{$pathConvert} -size 200x200 {$pdfFile}[0] -resize 200x200 $thumbnailfile");
return true;
//}else{
//$default->log->debug('Thumbnail Generator Plugin: Imagemagick not installed, cannot generate a thumbnail');
@@ -212,6 +220,10 @@ class ThumbnailViewlet extends KTDocumentViewlet {
global $default;
$varDir = $default->internalVarDirectory;
$thumbnailfile = $varDir . '/thumbnails/'.$documentId.'.jpg';
+
+ if (WINDOWS_OS) {
+ $thumbnailfile = KT_DIR . $thumbnailfile;
+ }
// if the thumbnail doesn't exist try to create it
if (!file_exists($thumbnailfile)){
diff --git a/search2/indexing/extractors/PSExtractor.inc.php b/search2/indexing/extractors/PSExtractor.inc.php
index b953b7e..0657769 100755
--- a/search2/indexing/extractors/PSExtractor.inc.php
+++ b/search2/indexing/extractors/PSExtractor.inc.php
@@ -61,6 +61,8 @@ class PSExtractor extends ApplicationExtractor
public function diagnose()
{
+ // no rpm's available for pstotext, removing the diagnose for it so it doesn't prevent the indexing from running
+ return null;
if (OS_WINDOWS)
{
// pstotext is not available under windows, so no need to diagnose it
diff --git a/setup/wizard/lib/services/windowsLucene.php b/setup/wizard/lib/services/windowsLucene.php
index 4a0e3df..f27dd5e 100644
--- a/setup/wizard/lib/services/windowsLucene.php
+++ b/setup/wizard/lib/services/windowsLucene.php
@@ -429,7 +429,6 @@ class windowsLucene extends windowsService {
$luceneExe = $this->getLuceneExe();
$luceneSource = $this->getLuceneSource();
$luceneDir = $this->getluceneDir();
-// $javaJVM = $this->getJavaJVM();
if($luceneExe && $luceneSource && $luceneDir) {
$cmd = "\"{$luceneExe}\""." -install \"".$this->getName()."\" \"".$this->getJavaJVM(). "\" -Djava.class.path=\"".$luceneSource."\"". " -start ".$this->getLuceneServer(). " -out \"".$this->getLuceneOut()."\" -err \"".$this->getLuceneError()."\" -current \"".$luceneDir."\" -auto";
if(DEBUG) {
diff --git a/setup/wizard/lib/services/windowsOpenOffice.php b/setup/wizard/lib/services/windowsOpenOffice.php
index 716b9ad..a662419 100644
--- a/setup/wizard/lib/services/windowsOpenOffice.php
+++ b/setup/wizard/lib/services/windowsOpenOffice.php
@@ -201,7 +201,6 @@ class windowsOpenOffice extends windowsService {
public function install() {
$status = $this->status();
if($status == '') {
- //$binary = $this->util->openOfficeSpecified();
$binary = $this->getBin();
if($binary != '') {
$cmd = "\"{$this->winservice}\" install $this->name "."-displayname {$this->name} -start auto \"".$binary."\" -headless -invisible -nofirststartwizard -\"accept=socket,host={$this->host},port={$this->port};urp;\"";;
diff --git a/setup/wizard/steps/database.php b/setup/wizard/steps/database.php
index a9003d4..2e4d670 100644
--- a/setup/wizard/steps/database.php
+++ b/setup/wizard/steps/database.php
@@ -781,7 +781,7 @@ class database extends Step
if($binaries) {
foreach ($binaries as $k=>$bin) {
if($k != 1) {
- $updateBin = 'UPDATE config_settings c SET c.value = "'.$bin.'" where c.group_name = "externalBinary" and c.display_name = "'.$k.'";';
+ $updateBin = 'UPDATE config_settings c SET c.value = "'.str_replace('\\', '\\\\', $bin).'" where c.group_name = "externalBinary" and c.display_name = "'.$k.'";';
$this->util->dbUtilities->query($updateBin);
}
}
@@ -790,6 +790,7 @@ 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_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',
'zip' => 'bin\zip\zip.exe', 'unzip' => 'bin\unzip\unzip.exe');
diff --git a/setup/wizard/templates/services.tpl b/setup/wizard/templates/services.tpl
index 9c64788..b3b0fef 100644
--- a/setup/wizard/templates/services.tpl
+++ b/setup/wizard/templates/services.tpl
@@ -10,6 +10,7 @@
The wizard will review your system to determine whether you can run KnowledgeTree background services.
Once the scan is completed, you’ll see whether your system has met the requirements or whether there are areas you need to address.