/build/static/layout/Breadcrumb_cap_w.png

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

0 Comments   [ + ] Show comments

Answers (13)

Posted by: MSIPackager 15 years ago
3rd Degree Black Belt
0
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.
Posted by: cygan 15 years ago
Fifth Degree Brown Belt
0
thanks for that cool
Posted by: anonymous_9363 15 years ago
Red Belt
0
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.
Posted by: Inabus 15 years ago
Second Degree Green Belt
0
Or use rundll32 printUI and you dont need to restart the service at all ;)

P
Posted by: MSIPackager 15 years ago
3rd Degree Black Belt
0
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
Fifth Degree Brown Belt
0
thanks all I packaging cutepdf writer 2.3
just trying to install the driver

I have seen a link on this on appdeploy

vbscan you are spot on with what I am trying to do
Posted by: anonymous_9363 15 years ago
Red Belt
0
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
3rd Degree Black Belt
0
Not at all, everyone has their own perferred way of doing things - if your scripting is up to scratch then why not! Just wanted to make sure I wasn't missing something [;)]

Cheers,
Rob.
Posted by: cygan 15 years ago
Fifth Degree Brown Belt
0
cheers msipackager

it worked a treat using the service control table
nice one
Posted by: jmcfadyen 15 years ago
5th Degree Black Belt
0
I am pretty confident Ian's scripting is up to scratch. He is probably the most pedantic coder amonst us (not that it is a bad thing).
Posted by: MSIPackager 15 years ago
3rd Degree Black Belt
0
Yeah I get that impression... [8|]
Posted by: anonymous_9363 15 years ago
Red Belt
0
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
Posted by: MSIPackager 15 years ago
3rd Degree Black Belt
0
Pure class Ian [:D]
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ