diff --git a/dmsctl.bat b/dmsctl.bat
index 7137907..139a750 100644
--- a/dmsctl.bat
+++ b/dmsctl.bat
@@ -31,6 +31,7 @@ echo start - start the services
echo stop - stop the services
echo restart - restart the services
echo.
+echo install - install the services
echo uninstall - uninstall the services
echo.
@@ -63,4 +64,11 @@ sc delete %SchedulerServiceName%
sc delete %OpenofficeServiceName%
goto end
+:install
+echo Installing services
+call "%INSTALL_PATH%\var\bin\officeinstall.bat"
+call "%INSTALL_PATH%\var\bin\schedulerinstall.bat"
+call "%INSTALL_PATH%\var\bin\luceneinstall.bat"
+goto end
+
:end
\ No newline at end of file
diff --git a/setup/wizard/lib/services/unixScheduler.php b/setup/wizard/lib/services/unixScheduler.php
index c959d31..eeb10be 100644
--- a/setup/wizard/lib/services/unixScheduler.php
+++ b/setup/wizard/lib/services/unixScheduler.php
@@ -118,8 +118,6 @@ class unixScheduler extends unixService {
$content .= "done";
@fwrite($fp, $content);
@fclose($fp);
- @chmod($fLoc, '0777');
- $this->util->pexec("chmod 777 $fLoc");
}
function install() {
diff --git a/setup/wizard/lib/services/windowsLucene.php b/setup/wizard/lib/services/windowsLucene.php
index 0ca683d..10ecbe6 100644
--- a/setup/wizard/lib/services/windowsLucene.php
+++ b/setup/wizard/lib/services/windowsLucene.php
@@ -395,6 +395,13 @@ class windowsLucene extends windowsService {
return $this->javaJVM;
}
+ private function writeLuceneInstall($cmd) {
+ $luceneInstallFile = SYS_VAR_DIR."bin".DS."luceneinstall.bat";
+ $fp = fopen($luceneInstallFile, "w+");
+ fwrite($fp, $cmd);
+ fclose($fp);
+ }
+
/**
* Install Lucene Service
*
@@ -415,7 +422,8 @@ class windowsLucene extends windowsService {
echo "$cmd
";
return false;
}
- $response = $this->util->pexec($cmd);
+ $this->writeLuceneInstall($cmd);
+ //$response = $this->util->pexec($cmd);
return $response;
}
return $state;
diff --git a/setup/wizard/lib/services/windowsOpenOffice.php b/setup/wizard/lib/services/windowsOpenOffice.php
index 003d26b..40ae6ef 100644
--- a/setup/wizard/lib/services/windowsOpenOffice.php
+++ b/setup/wizard/lib/services/windowsOpenOffice.php
@@ -198,6 +198,13 @@ class windowsOpenOffice extends windowsService {
return $this->options;
}
+ private function writeOfficeInstall($cmd) {
+ $officeInstallFile = SYS_VAR_DIR."bin".DS."officeinstall.bat";
+ $fp = fopen($officeInstallFile, "w+");
+ fwrite($fp, $cmd);
+ fclose($fp);
+ }
+
public function install() {
$status = $this->status();
if($status == '') {
@@ -208,7 +215,8 @@ class windowsOpenOffice extends windowsService {
echo "$cmd
";
return false;
}
- $response = $this->util->pexec($cmd);
+ $this->writeOfficeInstall($cmd);
+ //$response = $this->util->pexec($cmd);
return $response;
}
return $status;
diff --git a/setup/wizard/lib/services/windowsScheduler.php b/setup/wizard/lib/services/windowsScheduler.php
index 3551623..fb98bb8 100644
--- a/setup/wizard/lib/services/windowsScheduler.php
+++ b/setup/wizard/lib/services/windowsScheduler.php
@@ -86,7 +86,7 @@ class windowsScheduler extends windowsService {
* @return void
*/
function load() {
- $this->setSchedulerDIR($this->varDir."bin");
+ $this->setSchedulerDIR(SYS_VAR_DIR."bin");
$this->setSchedulerScriptPath("taskrunner.bat");
$this->setSchedulerSource("schedulerService.php");
@@ -102,7 +102,7 @@ class windowsScheduler extends windowsService {
*/
private function setSchedulerDIR($schedulerDIR) {
if(!file_exists($schedulerDIR)) {
- @mkdir($schedulerDIR);
+ mkdir($schedulerDIR);
}
$this->schedulerDir = $schedulerDIR;
}
@@ -185,15 +185,19 @@ class windowsScheduler extends windowsService {
if(DEBUG) { // Check if bin is readable and writable
echo "Attempt to Create {$this->getSchedulerDir()}\\taskrunner.bat
";
}
- if(is_readable($this->varDir."bin") && is_writable($this->varDir."bin")) {
- $fp = @fopen($this->getSchedulerDir().""."\\taskrunner.bat", "w+");
- $content = "@echo off \n";
- $content .= "\"".$this->util->useZendPhp()."php.exe\" "."\"{$this->getSchedulerSource()}\"";
- @fwrite($fp, $content);
- @fclose($fp);
- } else {
- echo 'Could not write task runner
'; // TODO: Should not reach this point
- }
+ $taskrunner = SYS_VAR_DIR."bin".DS."taskrunner.bat";
+ $fp = fopen($taskrunner, "w+");
+ $content = "@echo off \n";
+ $content .= "\"".$this->util->useZendPhp()."php.exe\" "."\"{$this->getSchedulerSource()}\"";
+ fwrite($fp, $content);
+ fclose($fp);
+ }
+
+ private function writeSchedulerInstall($cmd) {
+ $schedulerInstallFile = SYS_VAR_DIR."bin".DS."schedulerinstall.bat";
+ $fp = fopen($schedulerInstallFile, "w+");
+ fwrite($fp, $cmd);
+ fclose($fp);
}
/**
@@ -227,7 +231,7 @@ class windowsScheduler extends windowsService {
$state = $this->status();
if($state == '') {
$this->writeTaskRunner();
- if (function_exists('win32_create_service')) { // TODO what if it does not exist? check how the dmsctl.bat does this
+ //if (function_exists('win32_create_service')) { // TODO what if it does not exist? check how the dmsctl.bat does this
if(DEBUG) {
echo '
';
print_r(array('service' => $this->name, 'display' => $this->name, 'path' => $this->getSchedulerScriptPath()));
@@ -237,13 +241,15 @@ class windowsScheduler extends windowsService {
echo '';
return ;
}
+ /*
$response = win32_create_service(array(
'service' => $this->name,
'display' => $this->name,
'path' => $this->getSchedulerScriptPath()
));
return $response;
- } else { // Attempt to use the winserv
+ */
+ //} else { // Attempt to use the winserv
// TODO: Add service using winserv
$this->setWinservice();
$this->setOptions();
@@ -252,9 +258,10 @@ class windowsScheduler extends windowsService {
echo "$cmd