Commit 39deceebd3705bf31fbd212a684ac15f58af1879
1 parent
68cc1b4b
KTS-4438: Updated Services
Committed by: Jarrett Jordaan Reviewed by: Megan Watson
Showing
6 changed files
with
90 additions
and
9 deletions
setup/wizard/installUtil.php
| @@ -748,17 +748,17 @@ class InstallUtil { | @@ -748,17 +748,17 @@ class InstallUtil { | ||
| 748 | */ | 748 | */ |
| 749 | public function useZendPhp() { | 749 | public function useZendPhp() { |
| 750 | if($this->installEnvironment() == 'Zend') { | 750 | if($this->installEnvironment() == 'Zend') { |
| 751 | - if(WINDOWS_OS) { | 751 | + if(WINDOWS_OS) { // For Zend Installation only |
| 752 | $sysdir = explode(DS, SYSTEM_DIR); | 752 | $sysdir = explode(DS, SYSTEM_DIR); |
| 753 | array_pop($sysdir); | 753 | array_pop($sysdir); |
| 754 | array_pop($sysdir); | 754 | array_pop($sysdir); |
| 755 | - array_pop($sysdir); | ||
| 756 | - array_pop($sysdir); | ||
| 757 | $zendsys = ''; | 755 | $zendsys = ''; |
| 758 | foreach ($sysdir as $k=>$v) { | 756 | foreach ($sysdir as $k=>$v) { |
| 759 | $zendsys .= $v.DS; | 757 | $zendsys .= $v.DS; |
| 760 | } | 758 | } |
| 761 | - return $zendsys."ZendServer".DS."bin".DS; | 759 | + $bin = $zendsys."ZendServer".DS."bin".DS; |
| 760 | + if(file_exists($bin)) | ||
| 761 | + return $bin; | ||
| 762 | } else { | 762 | } else { |
| 763 | return DS."usr".DS."local".DS."zend".DS."bin".DS; | 763 | return DS."usr".DS."local".DS."zend".DS."bin".DS; |
| 764 | } | 764 | } |
setup/wizard/lib/services/windowsLucene.php
| @@ -377,10 +377,32 @@ class windowsLucene extends windowsService { | @@ -377,10 +377,32 @@ class windowsLucene extends windowsService { | ||
| 377 | } elseif (file_exists($this->getJavaBin().DS."bin".DS."server".DS."jvm.dll")) { | 377 | } elseif (file_exists($this->getJavaBin().DS."bin".DS."server".DS."jvm.dll")) { |
| 378 | $this->javaJVM = $this->getJavaBin().DS."bin".DS."server".DS."jvm.dll"; | 378 | $this->javaJVM = $this->getJavaBin().DS."bin".DS."server".DS."jvm.dll"; |
| 379 | } else { | 379 | } else { |
| 380 | - return false; | 380 | + $javaJVM = $this->useZendJVM(); |
| 381 | + if(file_exists($javaJVM)) { | ||
| 382 | + $this->javaJVM = $javaJVM; | ||
| 383 | + } | ||
| 381 | } | 384 | } |
| 382 | } | 385 | } |
| 383 | 386 | ||
| 387 | + public function useZendJVM() { | ||
| 388 | + if($this->util->installEnvironment() == 'Zend') { | ||
| 389 | + if(WINDOWS_OS) { // For Zend Installation only | ||
| 390 | + $sysdir = explode(DS, SYSTEM_DIR); | ||
| 391 | + array_pop($sysdir); | ||
| 392 | + array_pop($sysdir); | ||
| 393 | + $zendsys = ''; | ||
| 394 | + foreach ($sysdir as $k=>$v) { | ||
| 395 | + $zendsys .= $v.DS; | ||
| 396 | + } | ||
| 397 | + $jvm = $zendsys."jre".DS."bin".DS."client".DS."jvm.dll"; | ||
| 398 | + if(file_exists($jvm)) | ||
| 399 | + return $jvm; | ||
| 400 | + } | ||
| 401 | + } | ||
| 402 | + | ||
| 403 | + return false; | ||
| 404 | + } | ||
| 405 | + | ||
| 384 | /** | 406 | /** |
| 385 | * Get Java JVM path | 407 | * Get Java JVM path |
| 386 | * | 408 | * |
setup/wizard/lib/services/windowsOpenOffice.php
| @@ -203,7 +203,7 @@ class windowsOpenOffice extends windowsService { | @@ -203,7 +203,7 @@ class windowsOpenOffice extends windowsService { | ||
| 203 | //$binary = $this->util->openOfficeSpecified(); | 203 | //$binary = $this->util->openOfficeSpecified(); |
| 204 | $binary = $this->getBin(); | 204 | $binary = $this->getBin(); |
| 205 | if($binary != '') { | 205 | if($binary != '') { |
| 206 | - $cmd = "\"{$this->winservice}\" install $this->name "."-displayname {$this->name} -start auto \"".$binary."\" -headless -invisible -\"accept=socket,host={$this->host},port={$this->port};urp;\"";; | 206 | + $cmd = "\"{$this->winservice}\" install $this->name "."-displayname {$this->name} -start auto \"".$binary."\" -headless -invisible -nofirststartwizard -\"accept=socket,host={$this->host},port={$this->port};urp;\"";; |
| 207 | if(DEBUG) { | 207 | if(DEBUG) { |
| 208 | echo "Command : $cmd<br/>"; | 208 | echo "Command : $cmd<br/>"; |
| 209 | return ; | 209 | return ; |
setup/wizard/lib/services/windowsScheduler.php
| @@ -209,6 +209,9 @@ class windowsScheduler extends windowsService { | @@ -209,6 +209,9 @@ class windowsScheduler extends windowsService { | ||
| 209 | echo '<pre>'; | 209 | echo '<pre>'; |
| 210 | print_r(array('service' => $this->name, 'display' => $this->name, 'path' => $this->getSchedulerScriptPath())); | 210 | print_r(array('service' => $this->name, 'display' => $this->name, 'path' => $this->getSchedulerScriptPath())); |
| 211 | echo '</pre>'; | 211 | echo '</pre>'; |
| 212 | + echo '<pre>'; | ||
| 213 | + print_r(file_get_contents($this->getSchedulerScriptPath())); | ||
| 214 | + echo '</pre>'; | ||
| 212 | return ; | 215 | return ; |
| 213 | } | 216 | } |
| 214 | $response = win32_create_service(array( | 217 | $response = win32_create_service(array( |
setup/wizard/lib/validation/luceneValidation.php
| @@ -355,6 +355,25 @@ class luceneValidation extends serviceValidation { | @@ -355,6 +355,25 @@ class luceneValidation extends serviceValidation { | ||
| 355 | } | 355 | } |
| 356 | } | 356 | } |
| 357 | 357 | ||
| 358 | + public function useZendJava() { | ||
| 359 | + if($this->util->installEnvironment() == 'Zend') { | ||
| 360 | + if(WINDOWS_OS) { // For Zend Installation only | ||
| 361 | + $sysdir = explode(DS, SYSTEM_DIR); | ||
| 362 | + array_pop($sysdir); | ||
| 363 | + array_pop($sysdir); | ||
| 364 | + $zendsys = ''; | ||
| 365 | + foreach ($sysdir as $k=>$v) { | ||
| 366 | + $zendsys .= $v.DS; | ||
| 367 | + } | ||
| 368 | + $java = $zendsys."jre".DS."bin".DS."java.exe"; | ||
| 369 | + if(file_exists($java)) | ||
| 370 | + return $java; | ||
| 371 | + } | ||
| 372 | + } | ||
| 373 | + | ||
| 374 | + return false; | ||
| 375 | + } | ||
| 376 | + | ||
| 358 | /** | 377 | /** |
| 359 | * Attempts to use user input and configure java settings | 378 | * Attempts to use user input and configure java settings |
| 360 | * | 379 | * |
| @@ -374,11 +393,24 @@ class luceneValidation extends serviceValidation { | @@ -374,11 +393,24 @@ class luceneValidation extends serviceValidation { | ||
| 374 | if(WINDOWS_OS) { | 393 | if(WINDOWS_OS) { |
| 375 | $cmd = "\"$javaExecutable\" -cp \"".SYS_DIR.";\" javaVersion \"".$this->outputDir."outJV\""." \"".$this->outputDir."outJVHome\""; | 394 | $cmd = "\"$javaExecutable\" -cp \"".SYS_DIR.";\" javaVersion \"".$this->outputDir."outJV\""." \"".$this->outputDir."outJVHome\""; |
| 376 | $func = OS."ReadJVFromFile"; | 395 | $func = OS."ReadJVFromFile"; |
| 377 | - if($this->$func($cmd)) return true; | 396 | + if($this->$func($cmd)) { |
| 397 | + return true; | ||
| 398 | + } else { | ||
| 399 | + $this->java = $this->useZendJava(); // Java not installed | ||
| 400 | + $javaExecutable = $this->java; | ||
| 401 | + $cmd = "\"$javaExecutable\" -cp \"".SYS_DIR.";\" javaVersion \"".$this->outputDir."outJV\""." \"".$this->outputDir."outJVHome\""; | ||
| 402 | + if($this->$func($cmd)) { | ||
| 403 | + return true; | ||
| 404 | + } | ||
| 405 | + } | ||
| 378 | } else { | 406 | } else { |
| 379 | $cmd = "\"$javaExecutable\" -version > ".$this->outputDir."outJV 2>&1 echo $!"; | 407 | $cmd = "\"$javaExecutable\" -version > ".$this->outputDir."outJV 2>&1 echo $!"; |
| 380 | $func = OS."ReadJVFromFile"; | 408 | $func = OS."ReadJVFromFile"; |
| 381 | - if($this->$func($cmd)) return true; | 409 | + if($this->$func($cmd)) { |
| 410 | + return true; | ||
| 411 | + } else { | ||
| 412 | + // TODO: Not sure | ||
| 413 | + } | ||
| 382 | } | 414 | } |
| 383 | 415 | ||
| 384 | $this->javaVersionInCorrect(); | 416 | $this->javaVersionInCorrect(); |
setup/wizard/lib/validation/openofficeValidation.php
| @@ -159,9 +159,33 @@ class openofficeValidation extends serviceValidation { | @@ -159,9 +159,33 @@ class openofficeValidation extends serviceValidation { | ||
| 159 | return $pathToBinary; | 159 | return $pathToBinary; |
| 160 | } | 160 | } |
| 161 | } | 161 | } |
| 162 | - | 162 | + $pathToBinary = $this->useZendOffice(); // Check for openoffice in zend |
| 163 | + if(file_exists($pathToBinary)) { | ||
| 164 | + return $pathToBinary; | ||
| 165 | + } | ||
| 166 | + | ||
| 163 | return false; | 167 | return false; |
| 164 | } | 168 | } |
| 169 | + | ||
| 170 | + public function useZendOffice() { | ||
| 171 | + if($this->util->installEnvironment() == 'Zend') { | ||
| 172 | + if(WINDOWS_OS) { // For Zend Installation only | ||
| 173 | + $sysdir = explode(DS, SYSTEM_DIR); | ||
| 174 | + array_pop($sysdir); | ||
| 175 | + array_pop($sysdir); | ||
| 176 | + $zendsys = ''; | ||
| 177 | + foreach ($sysdir as $k=>$v) { | ||
| 178 | + $zendsys .= $v.DS; | ||
| 179 | + } | ||
| 180 | + $soffice = $zendsys."openoffice".DS."program".DS."soffice.exe"; | ||
| 181 | + if(file_exists($soffice)) | ||
| 182 | + return $soffice; | ||
| 183 | + } | ||
| 184 | + } | ||
| 185 | + | ||
| 186 | + return false; | ||
| 187 | + } | ||
| 188 | + | ||
| 165 | /** | 189 | /** |
| 166 | * Set all silent mode varibles | 190 | * Set all silent mode varibles |
| 167 | * | 191 | * |