Hello !

Today, I'm questioning you about Services.
I'm packaging an application and I have to install a Service used by this application.

I noticed that MSI gives some tools to start, stop, launch services, which are associated with components. The problem is that I have to schedule the installation as follow :

1*/ Copy all the files to the target
2*/ Launch an .exe installed with this package (the setup of my application. I must launch it before the service because the service uses some informations given in the setup)
3*/Launch the service.
4*/End the installation process.


Do you have any idea of how I could do that ?

Thanks !
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
You can only start services etc if they are installed as part of you MSI..

Sounds like you are best off using "net start servicename" command as a custom action at the end of your install.

Regards,
Rob.
Answered 08/16/2005 by: MSIPackager
Third Degree Black Belt

Please log in to comment
0
Do you mean that I should INSTALL the service during the install, and START it at the end ?

[8|] That should run as I would like to, but I didn't think about it... need to sleep :-)

Thanks !
Answered 08/16/2005 by: babric
Senior Purple Belt

Please log in to comment
0
ORIGINAL: MSIPackager

You can only start services etc if they are installed as part of you MSI..

Sounds like you are best off using "net start servicename" command as a custom action at the end of your install.

Regards,
Rob.


Since when did "Windows Installer" stop controlling services that it didn't install??

But "yes" Babric, you should install and control your service using MSI actions if you can.
Answered 08/16/2005 by: WiseUser
Fourth Degree Brown Belt

Please log in to comment
0
Since when did "Windows Installer" stop controlling services that it didn't install??

Could Mister MSIPackager say something wrong ? ooooh nooo ! The world collapses... [:D]

But "yes" Babric, you should install and control your service using MSI actions if you can.

It appears I can't. I have to launch an application I install with the same package, and then, launch the service. But why not Install the service using MSI, and then launch it with some batch commands ?
Answered 08/16/2005 by: babric
Senior Purple Belt

Please log in to comment
0
That's what I'm suggesting...

You could "recapture" or "repackage" your setup into MSI format, and use the "InstallServices" and "StartServices" actions to install and start the service.

Alternatively, run your setup silently (if you can) from a deferred execution custom action - after the "InstallFiles" action but before the "StartServices" action. Try a type 18 custom action (+1024=1042). Then you can start the service using the "StartServices" action.
Answered 08/16/2005 by: WiseUser
Fourth Degree Brown Belt

Please log in to comment
0
That's what I'm suggesting...

You could "recapture" or "repackage" your setup into MSI format, and use the "InstallServices" and "StartServices" actions to install and start the service.


Ok, I understand now :-). The incomprehension was that I'm using InstallShield and the Services options are associated with the components. So I didn't realize that I could separate these 2 actions. In the future, I'll try to always read the Windows Installer help (and not only Installshield help) before asking questions...
[&:]
Answered 08/16/2005 by: babric
Senior Purple Belt

Please log in to comment
0
Alternatively, run your setup silently (if you can) from a deferred execution custom action - after the "InstallFiles" action but before the "StartServices" action. Try a type 18 custom action (+1024=1042). Then you can start the service using the "StartServices" action.

I will run my setup after InstallFinalize, but not silently, because the user have to write some informations. I'll use a Synchronous CA, but could you explain me the difference between a deferred CA and an Immediate CA ?

For example, what is the difference between using a deferred CA, and schedule an immediate CA after InstallFinalize ?


EDIT : I tried to understand the MSDN about it, but don't unerstand really, someone could give me an example ?
Answered 08/16/2005 by: babric
Senior Purple Belt

Please log in to comment
0
For example, what is the difference between using a deferred CA, and schedule an immediate CA after InstallFinalize ?

Missing the boat!

In other words... "timing".

Try using numbered message boxes to see what I mean. Place one after the "InstallFinalize" action in the (immediate), then place several messages at various points during the deferred sequence - including one after the "InstallFiles" action and one before the "StartServices" action.

If you place one just before "InstallFiles" too, you'll clearly see that the files are not copied until this point.
Answered 08/16/2005 by: WiseUser
Fourth Degree Brown Belt

Please log in to comment
0
Since when did "Windows Installer" stop controlling services that it didn't install??

It didn't - I thought the service was being created by the .exe setup and was suggesting net start as a way of starting it at the end of the install.

Sorry if I wasn't crystal clear Mr Gates [&:] just trying to help...
Answered 08/16/2005 by: MSIPackager
Third Degree Black Belt

Please log in to comment
0
Try using numbered message boxes to see what I mean. Place one after the "InstallFinalize" action in the (immediate), then place several messages at various points during the deferred sequence - including one after the "InstallFiles" action and one before the "StartServices" action.

I tried, and I think I have understood something very important about the installation process. The fact that the installer "scripts" and then execute this script was not assimilated. Hope that it is now :-)
Answered 08/17/2005 by: babric
Senior Purple Belt

Please log in to comment
0
Hello,

WiseUser, I tried to follow the way you told me (deferred CA), but I don't succeed in.
This is my Sequence table

http://img354.imageshack.us/img354/8648/execsequence3zi.gif

I have to launch, after the installation of the service but before it starts, an application called "ESServer.cpl".
This app is installed with my product in the SystemFolder. I can see it during the install.

I tried differents CA but I can't launch my program :

I tried to launch it as an exe (CA 18 (+ 1024) ? don't remember) (error 1721)
I tried to launch it from a directory (as I do for the .bat -> CA 34 + ( 1024) ) (error 1721)
I tried to write a VBscript :


Dim oWSH
Set oWSH= CreateObject("WScript.Shell")
oWSH.Run Property("SystemFolder") & "\ESServer.cpl", 1, True
set oWSH = nothing


(error 1720, I think that there is a brackets problem, but I can't resolve it)

and now, I don't now what I could try...

Has anybody any idea ?
Answered 08/17/2005 by: babric
Senior Purple Belt

Please log in to comment
0
A ".cpl" file is not an executable file - "Control.exe" is.
Answered 08/17/2005 by: WiseUser
Fourth Degree Brown Belt

Please log in to comment
0
maybe, but when I double click on it, there is a window that the user has to populate.
That's what I called an executable (even if it's not an exe) :-)
Answered 08/17/2005 by: babric
Senior Purple Belt

Please log in to comment
0
What I'm telling you is that you need to run "control.exe" with the ".cpl" file as a command line parameter.[:D]
Answered 08/17/2005 by: WiseUser
Fourth Degree Brown Belt

Please log in to comment
0
Try a type 34 or a type 50 CA.

Add 1024 (user) or 3072 (system) for deferred mode.

Add 64 to ignore exit code if necessary.

Type 34 CA example:

Action:LaunchESServerCPL
Type:3170
Source:SystemFolder
Target:Control.exe ESServer.cpl

Type= 34 + 3072 + 64 = 3170
Answered 08/17/2005 by: WiseUser
Fourth Degree Brown Belt

Please log in to comment
0
What I'm telling you is that you need to run "control.exe" with the ".cpl" file as a command line parameter.

[8|][&:] I didn't notice that you were talking about THE control.exe :-) And what is funny is that I just tried it because a colleague told me to try that 5 mins ago :-)

So, yes, now it works, but the problem is that the install continues and don't wait for the user having populated the window... Think that is because control.exe end immediately ?

I'll try type 34 & 50 too.

thanks !

EDIT : Works fine with CA 34 following your example.
I looked at the Task Manager during the installation, and "control.exe" end up after 5 or 10 sec... and the installation p'rocess continues :-/ Argh. Not good for me... Another problem, another solution ! [;)]
Answered 08/17/2005 by: babric
Senior Purple Belt

Please log in to comment
0
Tu ne m'écoutes donc pas??[:D]

Je t'ai dit "+64" ("Synchronous").

Edit: Seems to be a problem displaying French characters!
Answered 08/17/2005 by: WiseUser
Fourth Degree Brown Belt

Please log in to comment
0
Tssssssss don't be so nervous :-)
Synchronous doesn't solve the problem, as I explained it. The problem is that it is synchronized on "Control.exe" and not on "ESServer.cpl"...

Non mais !
Answered 08/17/2005 by: babric
Senior Purple Belt

Please log in to comment
0
OK - point taken.[:D]

Use a VBScript then.
Answered 08/17/2005 by: WiseUser
Fourth Degree Brown Belt

Please log in to comment
0
Same problem...
VbScript works as MSI... or do you have a special solution ?
Answered 08/17/2005 by: babric
Senior Purple Belt

Please log in to comment
0
Yes, I think you need to use "Rundll32.exe".

Something like this...

Set oWsh= CreateObject("WScript.Shell")
oWsh.Run "rundll32.exe shell32.dll,Control_RunDLL ESServer.cpl", 1, True
Set oWsh = Nothing

Et voilà![:D]

You could still use a type 34 actually:

Action:LaunchESServerCPL
Type:3106
Source:SystemFolder
Target:rundll32.exe shell32.dll,Control_RunDLL ESServer.cpl

Should work fine!
Answered 08/17/2005 by: WiseUser
Fourth Degree Brown Belt

Please log in to comment
0
Hey ! Same idea ! (Almost...)

Dim objShell
Set objShell = CreateObject("WScript.Shell")
objShell.Run("rundll32 shell32.dll,Control_RunDLL esserver.cpl,@0,1", 0, True)
Set objShell = Nothing


:-) I'll try this tomorrow, my test computer is down now :-(

A big thank for your help !
Answered 08/17/2005 by: babric
Senior Purple Belt

Please log in to comment
0
That works fine :-)

Thanks again !
Answered 08/18/2005 by: babric
Senior Purple Belt

Please log in to comment
0
Hello,

My question is somewhat similar. The only thing is, the services would only start after rebooting the computer. Is there a way for the services to start immediately after the installation w/o restarting the computer?

Thanks
Answered 09/14/2005 by: Justatech
Yellow Belt

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