Commit 1b952d6a84bb6e4184689ed6e1a467b037d8491e

Authored by Jarrett Jordaan
1 parent 4999d1d1

Story Id:1627025 Added dmsctl.bat and updated windows services to not auto start

Committed by: Jarrett Jordaan

Reviewed by: Paul Barrett
dmsctl.bat
@@ -31,7 +31,6 @@ echo start - start the services @@ -31,7 +31,6 @@ echo start - start the services
31 echo stop - stop the services 31 echo stop - stop the services
32 echo restart - restart the services 32 echo restart - restart the services
33 echo. 33 echo.
34 -echo install - install the services  
35 echo uninstall - uninstall the services 34 echo uninstall - uninstall the services
36 echo. 35 echo.
37 36
@@ -64,4 +63,4 @@ sc delete %SchedulerServiceName% @@ -64,4 +63,4 @@ sc delete %SchedulerServiceName%
64 sc delete %OpenofficeServiceName% 63 sc delete %OpenofficeServiceName%
65 goto end 64 goto end
66 65
67 -:end 66 -:end
  67 +:end
68 \ No newline at end of file 68 \ No newline at end of file
setup/wizard/lib/services/windowsLucene.php
@@ -150,26 +150,6 @@ class windowsLucene extends windowsService { @@ -150,26 +150,6 @@ class windowsLucene extends windowsService {
150 $this->setLuceneOut("lucene-out.txt"); 150 $this->setLuceneOut("lucene-out.txt");
151 $this->setLuceneError("lucene-err.txt"); 151 $this->setLuceneError("lucene-err.txt");
152 } 152 }
153 -  
154 -  
155 - /**  
156 - * Retrieve Status Service  
157 - *  
158 - * @author KnowledgeTree Team  
159 - * @access public  
160 - * @param none  
161 - * @return string  
162 - */  
163 - public function status() {  
164 - $cmd = "sc query {$this->name}";  
165 - $response = $this->util->pexec($cmd);  
166 - if($response['out']) {  
167 - $state = preg_replace('/^STATE *\: *\d */', '', trim($response['out'][3])); // Status store in third key  
168 - return $state;  
169 - }  
170 -  
171 - return '';  
172 - }  
173 153
174 /** 154 /**
175 * Set Java Directory path 155 * Set Java Directory path
@@ -196,7 +176,7 @@ class windowsLucene extends windowsService { @@ -196,7 +176,7 @@ class windowsLucene extends windowsService {
196 176
197 return false; 177 return false;
198 } 178 }
199 - 179 +
200 /** 180 /**
201 * Get Java Directory path 181 * Get Java Directory path
202 * 182 *
@@ -444,6 +424,35 @@ class windowsLucene extends windowsService { @@ -444,6 +424,35 @@ class windowsLucene extends windowsService {
444 return $state; 424 return $state;
445 } 425 }
446 426
447 - 427 + /**
  428 + * Start Service
  429 + *
  430 + * @author KnowledgeTree Team
  431 + * @access public
  432 + * @param none
  433 + * @return mixed
  434 + */
  435 + public function start() { // User has to manually start the services
  436 + return false;
  437 + }
  438 +
  439 + /**
  440 + * Retrieve Status Service
  441 + *
  442 + * @author KnowledgeTree Team
  443 + * @access public
  444 + * @param none
  445 + * @return string
  446 + */
  447 + public function status() {
  448 + $cmd = "sc query {$this->name}";
  449 + $response = $this->util->pexec($cmd);
  450 + if($response['out']) {
  451 + $state = preg_replace('/^STATE *\: *\d */', '', trim($response['out'][3])); // Status store in third key
  452 + return $state;
  453 + }
  454 +
  455 + return '';
  456 + }
448 } 457 }
449 ?> 458 ?>
450 \ No newline at end of file 459 \ No newline at end of file
setup/wizard/lib/services/windowsOpenOffice.php
@@ -236,5 +236,17 @@ class windowsOpenOffice extends windowsService { @@ -236,5 +236,17 @@ class windowsOpenOffice extends windowsService {
236 236
237 return ''; 237 return '';
238 } 238 }
  239 +
  240 + /**
  241 + * Start Service
  242 + *
  243 + * @author KnowledgeTree Team
  244 + * @access public
  245 + * @param none
  246 + * @return mixed
  247 + */
  248 + public function start() { // User has to manually start the services
  249 + return false;
  250 + }
239 } 251 }
240 ?> 252 ?>
241 \ No newline at end of file 253 \ No newline at end of file
setup/wizard/lib/services/windowsScheduler.php
@@ -173,6 +173,29 @@ class windowsScheduler extends windowsService { @@ -173,6 +173,29 @@ class windowsScheduler extends windowsService {
173 return false; 173 return false;
174 } 174 }
175 175
  176 + private function setWinservice($winservice = "winserv.exe") {
  177 + $this->winservice = SYS_BIN_DIR . "win32" . DS . $winservice;
  178 + }
  179 +
  180 + private function setOptions() {
  181 + $this->options = "-displayname {$this->name} -start auto -binary \"{$this->getSchedulerScriptPath()}\" -headless -invisible ";
  182 + }
  183 +
  184 + private function writeTaskRunner() {
  185 + if(DEBUG) { // Check if bin is readable and writable
  186 + echo "Attempt to Create {$this->getSchedulerDir()}\\taskrunner.bat<br>";
  187 + }
  188 + if(is_readable($this->varDir."bin") && is_writable($this->varDir."bin")) {
  189 + $fp = @fopen($this->getSchedulerDir().""."\\taskrunner.bat", "w+");
  190 + $content = "@echo off \n";
  191 + $content .= "\"".$this->util->useZendPhp()."php.exe\" "."\"{$this->getSchedulerSource()}\"";
  192 + @fwrite($fp, $content);
  193 + @fclose($fp);
  194 + } else {
  195 + echo 'Could not write task runner<br>'; // TODO: Should not reach this point
  196 + }
  197 + }
  198 +
176 /** 199 /**
177 * Retrieve Status Service 200 * Retrieve Status Service
178 * 201 *
@@ -235,28 +258,17 @@ class windowsScheduler extends windowsService { @@ -235,28 +258,17 @@ class windowsScheduler extends windowsService {
235 } 258 }
236 return $state; 259 return $state;
237 } 260 }
238 -  
239 - private function setWinservice($winservice = "winserv.exe") {  
240 - $this->winservice = SYS_BIN_DIR . "win32" . DS . $winservice;  
241 - }  
242 -  
243 - private function setOptions() {  
244 - $this->options = "-displayname {$this->name} -start auto -binary \"{$this->getSchedulerScriptPath()}\" -headless -invisible ";  
245 - }  
246 -  
247 - private function writeTaskRunner() {  
248 - if(DEBUG) { // Check if bin is readable and writable  
249 - echo "Attempt to Create {$this->getSchedulerDir()}\\taskrunner.bat<br>";  
250 - }  
251 - if(is_readable($this->varDir."bin") && is_writable($this->varDir."bin")) {  
252 - $fp = @fopen($this->getSchedulerDir().""."\\taskrunner.bat", "w+");  
253 - $content = "@echo off \n";  
254 - $content .= "\"".$this->util->useZendPhp()."php.exe\" "."\"{$this->getSchedulerSource()}\"";  
255 - @fwrite($fp, $content);  
256 - @fclose($fp);  
257 - } else {  
258 - echo 'Could not write task runner<br>'; // TODO: Should not reach this point  
259 - } 261 +
  262 + /**
  263 + * Start Service
  264 + *
  265 + * @author KnowledgeTree Team
  266 + * @access public
  267 + * @param none
  268 + * @return mixed
  269 + */
  270 + public function start() { // User has to manually start the services
  271 + return false;
260 } 272 }
261 } 273 }
262 ?> 274 ?>
263 \ No newline at end of file 275 \ No newline at end of file