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

Comments

Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Answers

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.
Answered 06/09/2009 by: MSIPackager
Third Degree Black Belt

Please log in to comment
0
thanks for that cool
Answered 06/09/2009 by: cygan
Fifth Degree Brown Belt

Please log in to comment
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.
Answered 06/09/2009 by: VBScab
Red Belt

Please log in to comment
0
Or use rundll32 printUI and you dont need to restart the service at all ;)

P
Answered 06/09/2009 by: Inabus
Second Degree Green Belt

Please log in to comment
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?
Answered 06/09/2009 by: MSIPackager
Third Degree Black Belt

Please log in to comment
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
Answered 06/09/2009 by: cygan
Fifth Degree Brown Belt

Please log in to comment
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.
Answered 06/09/2009 by: VBScab
Red Belt

Please log in to comment
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.
Answered 06/09/2009 by: MSIPackager
Third Degree Black Belt

Please log in to comment
0
cheers msipackager

it worked a treat using the service control table
nice one
Answered 06/09/2009 by: cygan
Fifth Degree Brown Belt

Please log in to comment
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).
Answered 06/09/2009 by: jmcfadyen
Fifth Degree Black Belt

Please log in to comment
0
Yeah I get that impression... [8|]
Answered 06/10/2009 by: MSIPackager
Third Degree Black Belt

Please log in to comment
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
Answered 06/10/2009 by: VBScab
Red Belt

Please log in to comment
0
Pure class Ian [:D]
Answered 06/10/2009 by: MSIPackager
Third Degree Black Belt

Please log in to comment
Answer this question or Comment on this question for clarity