diff --git a/dmsctl.vbs b/dmsctl.vbs
index 8f63aaa..8b952d1 100644
--- a/dmsctl.vbs
+++ b/dmsctl.vbs
@@ -1,25 +1,373 @@
-' This script should only be invoked for Vista and Windows 7
+'
+' KnowledgeTree
+'
+'
+'
+
+' Service Name Consts
+Const KTOFFICE = "KTOpenOffice"
+Const KTSCHEDULER = "KTScheduler"
+Const KTLUCENE = "KTLucene"
+
+' Service Control Manager Error Code Consts
+Const SVC_SUCCESS = 0 ' Success
+Const SVC_NOT_SUPPORTED = 1 ' Not Supported
+Const SVC_ACCESS_DENIED = 2 ' Access Denied
+Const SVC_DEPENDENT_SERVICES_RUNNING = 3 ' Dependent Services Running
+Const SVC_INVALID_SERVICE_CONTROL = 4 ' Invalid Service Control
+Const SVC_SERVICE_CANNOT_ACCEPT_CONTROL = 5 ' Service Cannot Accept Control
+Const SVC_SERVICE_NOT_ACTIVE = 6 ' Service Not Active
+Const SVC_SERVICE_REQUEST_TIMEOUT = 7 ' Service Request Timeout
+Const SVC_UNKNOWN_FAILURE = 8 ' Unknown Failure
+Const SVC_PATH_NOT_FOUND = 9 ' Path Not Found
+Const SVC_SERVICE_ALREADY_RUNNING = 10 ' Service Already Running
+Const SVC_SERVICE_DATABASE_LOCKED = 11 ' Service Database Locked
+Const SVC_SERVICE_DEPENDENCY_DELETED = 12 ' Service Dependency Deleted
+Const SVC_SERVICE_DEPENDENCY_FAILURE = 13 ' Service Dependency Failure
+Const SVC_SERVICE_DISABLED = 14 ' Service Disabled
+Const SVC_SERVICE_LOGON_FAILURE = 15 ' Service Logon Failure
+Const SVC_SERVICE_MARKED_FOR_DELETION = 16 ' Service Marked For Deletion
+Const SVC_SERVICES_NO_THREAD = 17 ' Service No Thread
+Const SVC_STATUS_CIRCULAR_DEPENDENCY = 18 ' Status Circular Dependency
+Const SVC_STATUS_DUPLICATE_NAME = 19 ' Status Duplicate Name
+Const SVC_INVALID_NAME = 20 ' Status Invalid Name
+Const SVC_STATUS_INVALID_PARAMETER = 21 ' Status Invalid Parameter
+Const SVC_INVALID_SERVICES_ACCOUNT = 22 ' Status Invalid Service Account
+Const SVC_STATUS_SERVICE_EXISTS = 23 ' Status Service Exists
+Const SVC_SERVICE_ALREADY_PAUSED = 24 ' Service Already Paused
'Detecting current OS
-strComputer = "."
+Dim strComputer, currOS, doRunAs
+
+strComputer = "."
currOS = ""
doRunAs = false
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colOperatingSystems = objWMIService.ExecQuery ("Select * from Win32_OperatingSystem")
-For Each objOperatingSystem in colOperatingSystems
- currOS = objOperatingSystem.Caption & " " & objOperatingSystem.Version
- currOS = trim(currOS)
+For Each objOperatingSystem in colOperatingSystems
+ currOS = objOperatingSystem.Caption & " " & objOperatingSystem.Version
+ currOS = trim(currOS)
Next
-If left(currOS, 19) = "Microsoft Windows 7" Then
- doRunAs = true
-End If
+Public Function isWindowsVista()
+ isWindows7 = false
+ If left(currOS, 19) = "Microsoft Windows Vista" Then
+ isWindows7 = true
+ End If
+End Function
+
+Public Function isWindows7()
+ isWindows7 = false
+ If left(currOS, 19) = "Microsoft Windows 7" Then
+ isWindows7 = true
+ End If
+End Function
+
+Public Function isWindows2008()
+ isWindows7 = false
+ If left(currOS, 19) = "Microsoft Windows 2008" Then
+ isWindows7 = true
+ End If
+End Function
+' Will call this further down when the individual services need starting
If doRunAs = true Then
- Set objShell = CreateObject("Shell.Application")
- Set objFolder = objShell.Namespace("C:\Program Files (x86)\Zend\ktdms\knowledgetree")
- Set objFolderItem = objFolder.ParseName("dmsctl_install.bat")
- objFolderItem.InvokeVerb "runas"
-End If
\ No newline at end of file
+ 'runAs "C:\Program Files (x86)\Zend\ktdms\knowledgetree", "dmsctl_install.bat"
+End If
+
+Public Sub runAs(ByVal strFolder, ByVal strFile)
+ Set objShell = CreateObject("Shell.Application")
+ Set objFolder = objShell.Namespace(strFolder)
+ Set objFolderItem = objFolder.ParseName(strFile)
+ objFolderItem.InvokeVerb "runas"
+End Sub
+
+dim objArgs, errMsg, result, strUsage, isSuccess
+
+strUsage = "USAGE:" &_
+"dmsctl.bat
- !!NB!! You are advised to backup the database before attempting the upgrade. !!NB!! + You are advised to backup the database before attempting the upgrade.
If you have already done this, you may skip this step and can continue directly to the upgrade. diff --git a/setup/upgrade/upgradeWizard.php b/setup/upgrade/upgradeWizard.php index f41a73e..1e4c873 100644 --- a/setup/upgrade/upgradeWizard.php +++ b/setup/upgrade/upgradeWizard.php @@ -146,18 +146,6 @@ class UpgradeWizard { } /** - * Create upgrade file - * - * @author KnowledgeTree Team - * @access private - * @param none - * @return void - */ - private function createUpgradeFile() { - touch(SYSTEM_DIR.'var'.DS.'bin'.DS."upgrade.lock"); - } - - /** * Remove upgrade file * * @author KnowledgeTree Team @@ -222,8 +210,6 @@ class UpgradeWizard { */ public function dispatch() { $this->load(); - // is this necessary? - $this->createUpgradeFile(); $response = $this->systemChecks(); if($this->util->installationSpecified()) { // Check if the migrator needs to be accessed $this->util->redirect('../wizard/index.php?step_name=install_type'); diff --git a/setup/upgrade/upgrader.php b/setup/upgrade/upgrader.php index ccabb71..7ceb3f1 100644 --- a/setup/upgrade/upgrader.php +++ b/setup/upgrade/upgrader.php @@ -400,20 +400,6 @@ class Upgrader { for ($i=1; $i< count($steps)+1; $i++) { $this->_upgradeHelper($steps[$i]); } - - $this->_completeUpgrade(); - } - - /** - * Complete upgrade cleanup process - * - * @author KnowledgeTree Team - * @param none - * @access private - * @return void - */ - private function _completeUpgrade() { - touch("upgrade"); } /** diff --git a/setup/wizard/installUtil.php b/setup/wizard/installUtil.php index 9a4f87a..400bd7f 100644 --- a/setup/wizard/installUtil.php +++ b/setup/wizard/installUtil.php @@ -878,7 +878,7 @@ class InstallUtil { return $type; } - return false; + return "community"; } /** diff --git a/setup/wizard/lib/services/windowsLucene.php b/setup/wizard/lib/services/windowsLucene.php index 7d1fdaa..a370651 100644 --- a/setup/wizard/lib/services/windowsLucene.php +++ b/setup/wizard/lib/services/windowsLucene.php @@ -424,7 +424,7 @@ class windowsLucene extends windowsService { $luceneExe = $this->getLuceneExe(); $luceneSource = $this->getLuceneSource(); $luceneDir = $this->getluceneDir(); - $cmd = "\"{$luceneExe}\""." -install \"".$this->getName()."\" -description "."\"".$this->description."\""." \"".$this->getJavaJVM(). "\" -Djava.class.path=\"".$luceneSource."\"". " -start ".$this->getLuceneServer(). " -out \"".$this->getLuceneOut()."\" -err \"".$this->getLuceneError()."\" -current \"".$luceneDir."\" -auto"; + $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 "$cmdThanks to the following contributors for helping us with code contributions and testing...
-[If you feel you should be here too, please let us know at contributions@knowledgetree.com]
- +This software utilizes third-party software from Pear, PHPMailer, Smarty Template Engine, JSCalendar, Mochikit, Moxiecode Systems, Yahoo Developer Network.