diff --git a/setup/wizard/lib/services/windowsLucene.php b/setup/wizard/lib/services/windowsLucene.php index 2e313ea..157a34b 100644 --- a/setup/wizard/lib/services/windowsLucene.php +++ b/setup/wizard/lib/services/windowsLucene.php @@ -403,6 +403,10 @@ class windowsLucene extends windowsService { $luceneDir = $this->getluceneDir(); 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) { + echo "$cmd
"; + return ; + } $response = $this->util->pexec($cmd); return $response; } @@ -424,7 +428,8 @@ class windowsLucene extends windowsService { // Check if bin is readable and writable if(is_readable(SYS_BIN_DIR) && is_writable(SYS_BIN_DIR)) { if($this->getluceneDir()) { - $fp = fopen($this->getluceneDir()."KnowledgeTreeIndexer.properties", "w+"); + $propPath = $this->getluceneDir().DS."KnowledgeTreeIndexer.properties"; + $fp = fopen($propPath, "w+"); $content = "server.port=8875\n"; $content .= "server.paranoid=false\n"; $content .= "server.accept=127.0.0.1\n"; @@ -434,6 +439,8 @@ class windowsLucene extends windowsService { fwrite($fp, $content); fclose($fp); } + } else { + //TODO: Should not get here } } } diff --git a/setup/wizard/lib/services/windowsOpenOffice.php b/setup/wizard/lib/services/windowsOpenOffice.php index 423d02b..68cf981 100644 --- a/setup/wizard/lib/services/windowsOpenOffice.php +++ b/setup/wizard/lib/services/windowsOpenOffice.php @@ -192,8 +192,7 @@ class windowsOpenOffice extends windowsService { } private function setOption() { - //print_r($this->getBin()); - $this->options = "-displayname {$this->name} -start auto -binary {$this->getBin()} -headless -invisible -nofirststartwizard" + $this->options = "-displayname {$this->name} -start auto {$this->getBin()} -headless -invisible -nofirststartwizard" . "-accept=\"socket,host={$this->host},port={$this->port};urp;StarOffice.ServiceManager\""; } @@ -208,6 +207,10 @@ class windowsOpenOffice extends windowsService { $this->setBin("{$services['openOfficeExe']}"); $this->setOption(); $cmd = "\"{$this->winservice}\" install $this->name {$this->getOption()}"; + if(DEBUG) { + echo "$cmd
"; + return ; + } $response = $this->util->pexec($cmd); return $response; } diff --git a/setup/wizard/lib/services/windowsScheduler.php b/setup/wizard/lib/services/windowsScheduler.php index 80feba3..58c2f2a 100644 --- a/setup/wizard/lib/services/windowsScheduler.php +++ b/setup/wizard/lib/services/windowsScheduler.php @@ -215,6 +215,10 @@ class windowsScheduler extends windowsService { $this->setWinservice(); $this->setOptions(); $cmd = "\"{$this->winservice}\" install $this->name $this->options"; + if(DEBUG) { + echo "$cmd
"; + return ; + } $response = $this->util->pexec($cmd); return $response; } diff --git a/setup/wizard/output/outJV b/setup/wizard/output/outJV deleted file mode 100644 index b3caea1..0000000 --- a/setup/wizard/output/outJV +++ /dev/null @@ -1,3 +0,0 @@ -java version "1.6.0_0" -OpenJDK Runtime Environment (IcedTea6 1.4.1) (6b14-1.4.1-0ubuntu11) -OpenJDK 64-Bit Server VM (build 14.0-b08, mixed mode) diff --git a/setup/wizard/steps/complete.php b/setup/wizard/steps/complete.php index 74628c8..5db5d24 100644 --- a/setup/wizard/steps/complete.php +++ b/setup/wizard/steps/complete.php @@ -226,8 +226,7 @@ class complete extends Step { foreach ($services->getServices() as $serviceName) { $className = OS.$serviceName; $service = new $className(); - $service->load(); - $status = $services->serviceStatus($service); + $status = $services->serviceStarted($service); if($status) { $this->temp_variables[$serviceName."Status"] = 'tick'; } else { diff --git a/setup/wizard/steps/services.php b/setup/wizard/steps/services.php index 35d6b9b..c17adee 100644 --- a/setup/wizard/steps/services.php +++ b/setup/wizard/steps/services.php @@ -445,7 +445,7 @@ class services extends Step } private function openOfficeInstalled() { - $this->openOfficeExeError = false; + } private function schedulerInstalled() { @@ -474,7 +474,7 @@ class services extends Step $className = OS.$serviceName; $service = new $className(); $service->load(); - $status = $this->serviceStatus($service); + $status = $this->serviceInstalled($service); if($status != 'STARTED') { $msg = $service->getName()." Could not be added as a Service"; $this->temp_variables['services'][] = array('class'=>'cross_orange', 'msg'=>$msg); @@ -505,7 +505,7 @@ class services extends Step foreach ($serverDetails as $serviceName) { $className = OS.$serviceName; $service = new $className(); - $status = $this->serviceStatus($service); + $status = $this->serviceInstalled($service); $flag = strtolower(substr($serviceName,0,1)).substr($serviceName,1)."Installed"; if(!$status) { $allInstalled = false; @@ -822,19 +822,64 @@ class services extends Step } /** - * Returns service status + * Helper to check if service is installed * * @author KnowledgeTree Team * @param object * @access public * @return string */ - public function serviceStatus($service) { + public function serviceInstalled($service) { $statusCheck = OS."ServiceInstalled"; return $this->$statusCheck($service); } /** + * Helper to check if service is started + * + * @author KnowledgeTree Team + * @param object + * @access public + * @return string + */ + public function serviceStarted($service) { + $statusCheck = OS."ServiceStarted"; + return $this->$statusCheck($service); + } + + /** + * Check if windows service installed + * + * @author KnowledgeTree Team + * @param object + * @access public + * @return boolean + */ + public function windowsServiceStarted($service) { + $status = $service->status(); // Check if service has been installed + if($status != 'RUNNING') { // Check service status + return false; + } + return true; + } + + /** + * Check if unix service installed + * + * @author KnowledgeTree Team + * @param object + * @access public + * @return boolean + */ + public function unixServiceStarted($service) { + $status = $service->status(); // Check if service has been installed + if($status != 'STARTED') { // Check service status + return false; + } + return true; + } + + /** * Check if windows service installed * * @author KnowledgeTree Team diff --git a/setup/wizard/templates/services.tpl b/setup/wizard/templates/services.tpl index 475a5f3..a5463d1 100644 --- a/setup/wizard/templates/services.tpl +++ b/setup/wizard/templates/services.tpl @@ -65,7 +65,7 @@ Specify the location of your Open Office executable     - ' style="float:none;"/> + ' style="float:none;"/>     Submit