SPOOLER SERVICE
very confused here maybe it is one of those days
how do i stop and start the spooler service using the service control table
how do you place the order to stop the service during installation and then restart after installation
or is it easier to use a batch file net stop spooler
net start spooler
how do i stop and start the spooler service using the service control table
how do you place the order to stop the service during installation and then restart after installation
or is it easier to use a batch file net stop spooler
net start spooler
0 Comments
[ + ] Show comments
Answers (13)
Please log in to answer
Posted by:
MSIPackager
15 years ago
Just use the ServiceControl table... all the detail you need is here: http://msdn.microsoft.com/en-us/library/aa371634(VS.85).aspx - the Name column is where you enter spooler
To stop and start the service during install, enter 3 (1+2) in the Event column, to also stop and start the service on uninstall enter 51 (1+2+16+32) in the event column.
The stop / start services actions are standard and already in the installexecutesequence table...
Cheers,
Rob.
To stop and start the service during install, enter 3 (1+2) in the Event column, to also stop and start the service on uninstall enter 51 (1+2+16+32) in the event column.
The stop / start services actions are standard and already in the installexecutesequence table...
Cheers,
Rob.
Posted by:
anonymous_9363
15 years ago
That won't work, if my reading of what you want is correct. That is, you want to:
- stop the spooler
- install (or uninstall) some print-related device
- start the spooler
All the ServiceControl table will do is stop or start the service ONCE during install/uninstall. You need to control it twice. A batch file would work, of course but the control is somewhat less than granular! Use a WMI-based script.
- stop the spooler
- install (or uninstall) some print-related device
- start the spooler
All the ServiceControl table will do is stop or start the service ONCE during install/uninstall. You need to control it twice. A batch file would work, of course but the control is somewhat less than granular! Use a WMI-based script.
Posted by:
Inabus
15 years ago
Posted by:
MSIPackager
15 years ago
All the ServiceControl table will do is stop or start the service ONCE during install/uninstall.
OK, now I'm confused - there is a StopServices and seperate StartServices action in the InstallExecuteSequence table so you can Stop and Start the spooler service during install, and again (if required) during uninstall.
These happen pretty much at the beginning and end of the install routine, allowing the print related device to be installed in-between doesn't it?
Posted by:
cygan
15 years ago
Posted by:
anonymous_9363
15 years ago
you can Stop and Start the spooler service during install, and again (if required) during uninstall.[shame-faced] You're quite correct, Rob. Please accept my apologies for any confusion caused. My excuse is that I almost never use that table or the built-in actions any longer, preferring the control that my hand-rolled script gives me.
Posted by:
MSIPackager
15 years ago
Posted by:
cygan
15 years ago
Posted by:
jmcfadyen
15 years ago
Posted by:
anonymous_9363
15 years ago
Public blnPostersGettingLippy
Public blnSuccess
Const intAcceptableSarcasmLevel = 5
blnSuccess = CheckSarcasmLevel(intAcceptableSarcasmLevel, blnPostersGettingLippy)
If blnSuccess Then
If blnPostersGettingLippy Then
Call PostMessage("I'm watching you...")
End If
End If
Function CheckSarcasmLevel(ByVal intAcceptableLevel, ByRef blnPostersLippy)
Dim objPostReader
Dim objSarcasmChecker
Dim arrContentofPost
Dim strLine
Dim intIndex
Dim intSarcasmLevel
CheckSarcasmLevel = False
On Error Resume Next
Set objPostReader = GetObject("Post.Reader")
If Not IsObject(objPostReader) Then
Exit Function
End If
Set objSarcasmChecker = GetObject("Sarcasm.Checker")
If Not IsObject(objSarcasmChecker) Then
Exit Function
End If
arrContentofPost = objPostReader.ReadAll
If IsEmpty(arrContentofPost) Then
Exit Function
End If
For intIndex = 0 To UBound(arrContentofPost)
strLine = arrContentofPost(intIndex)
If Len(strLine) > 0 Then
intSarcasmLevel = objSarcasmChecker.Check(strLine)
If Err.Number <> 0 Then
Exit Function
End If
If intSarcasmLevel > intAcceptableLevel Then
blnPostersLippy = True
Exit For
End If
End If
Next
On Error Goto 0
Set objSarcasmChecker = Nothing
Set objPostReader = Nothing
End Function
Sub PostMessage(ByVal strMsg)
Dim objPostSender
Set objPostSender= GetObject("Post.Sender")
If Not IsObject(objPostSender) Then
Exit Function
End If
objPostSender.Send(strMsg)
'// Supefluous code, or WHAT!
If Err.Number <> 0 Then
Exit Sub
End If
Set objPostSender = Nothing
End Sub
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.