Commit aaa4f4fe1f2ff8af57ec33ea5bc186403b019e94

Authored by unknown
1 parent f7509909

Detect if UAC is enabled and elevate process if installer not run as admin

PT:1732247

Updated: dmsctl.vbs Fixed Win 2008 Server Detection, Disabled system event logging until Windows Vista
         detection has been tested.

Committed by: Charl Joseph Mert
Showing 1 changed file with 15 additions and 16 deletions
dmsctl.vbs
@@ -5,7 +5,7 @@ @@ -5,7 +5,7 @@
5 ' 5 '
6 6
7 ' Service Name Consts 7 ' Service Name Consts
8 -Const KTOFFICE = "KTOpenOffice" 8 +Const KTOFFICE = "KTOpenoffice"
9 Const KTSCHEDULER = "KTScheduler" 9 Const KTSCHEDULER = "KTScheduler"
10 Const KTLUCENE = "KTLucene" 10 Const KTLUCENE = "KTLucene"
11 11
@@ -56,23 +56,23 @@ For Each objOperatingSystem in colOperatingSystems @@ -56,23 +56,23 @@ For Each objOperatingSystem in colOperatingSystems
56 Next 56 Next
57 57
58 Public Function isWindowsVista() 58 Public Function isWindowsVista()
59 - isWin = false 59 + isWindowsVista = false
60 If left(currOS, 19) = "Microsoft Windows Vista" Then 60 If left(currOS, 19) = "Microsoft Windows Vista" Then
61 - isWin = TRUE 61 + isWindowsVista = TRUE
62 End If 62 End If
63 End Function 63 End Function
64 64
65 Public Function isWindows7() 65 Public Function isWindows7()
66 - isWin = false 66 + isWindows7 = false
67 If left(currOS, 19) = "Microsoft Windows 7" Then 67 If left(currOS, 19) = "Microsoft Windows 7" Then
68 - isWin = TRUE 68 + isWindows7 = TRUE
69 End If 69 End If
70 End Function 70 End Function
71 71
72 Public Function isWindows2008() 72 Public Function isWindows2008()
73 - isWin = false  
74 - If left(currOS, 19) = "Microsoft Windows 2008" Then  
75 - isWin = TRUE 73 + isWindows2008 = false
  74 + If mid(currOS, 27, 42) = "2008 Enterprise" Then
  75 + isWindows2008 = TRUE
76 End If 76 End If
77 End Function 77 End Function
78 78
@@ -91,7 +91,7 @@ End Sub @@ -91,7 +91,7 @@ End Sub
91 dim objArgs, errMsg, result, strUsage, isSuccess 91 dim objArgs, errMsg, result, strUsage, isSuccess
92 92
93 strUsage = "USAGE:" &_ 93 strUsage = "USAGE:" &_
94 -"dmsctl.bat <start|stop|restart|install|uninstall> [servicename]" & vbNewLine &_ 94 +"dmsctl.vbs <start|stop|restart|install|uninstall> [servicename]" & vbNewLine &_
95 vbNewLine &_ 95 vbNewLine &_
96 "help - this screen " & vbNewLine &_ 96 "help - this screen " & vbNewLine &_
97 "start - start the services" & vbNewLine &_ 97 "start - start the services" & vbNewLine &_
@@ -652,13 +652,12 @@ End Sub @@ -652,13 +652,12 @@ End Sub
652 652
653 ' Event logging only works on Server 2003, 2000 and XP 653 ' Event logging only works on Server 2003, 2000 and XP
654 Public Sub logEvent(ByVal strMessage) 654 Public Sub logEvent(ByVal strMessage)
655 -  
656 - If (NOT isWindowsVista() AND NOT isWindows7 AND NOT isWindows2008) Then  
657 - Const EVENT_SUCCESS = 0  
658 - Set objShell = Wscript.CreateObject("Wscript.Shell")  
659 - objShell.LogEvent EVENT_SUCCESS, strMessage  
660 - End If  
661 - 655 + ' Disabled until Windows Vista detection has been tested.
  656 + 'If (NOT isWindowsVista() AND NOT isWindows7() AND NOT isWindows2008()) Then
  657 + ' Const EVENT_SUCCESS = 0
  658 + ' Set objShell = Wscript.CreateObject("Wscript.Shell")
  659 + ' objShell.LogEvent EVENT_SUCCESS, strMessage
  660 + 'End If
662 End Sub 661 End Sub
663 662
664 ' Event logging only works on Server 2003, 2000 and XP 663 ' Event logging only works on Server 2003, 2000 and XP