/build/static/layout/Breadcrumb_cap_w.png

How i can stop a service with is 12!!!!

Hi everybody,

i use installshield 12 for 21 days :-) ! that the version free for to test this product !

i'd like to stop a service when a install my product name 1 :-)

on the component, right click => componenent wizard and i've choice the second option, lets me select a type

enter a name of service : right click on the service property and see the name :
MSSQLSERVER

i enter the name of the service in the componenent wizard of installshield and select option !
install start : no
install stop : yes

and so on and so on !

i run the program , and i see nothing i not sure that the service is stop when i install my product and stop when i uninstall the product too !

is there something other to do for to stop and start service when i install a product !?

thanks and sorry for my english and my question for beginner !

christophe

0 Comments   [ + ] Show comments

Answers (10)

Posted by: AngelD 17 years ago
Red Belt
0
I'm not a InstallShield user but verify that the ServiceControl table is correct populated.
Check up ServiceControl Table in MSI.CHM.

To start the MSSQLSERVER service on Install and stop and delete it during uninstall (including waiting for the actions to complete before proceeding) the entry in the ServiceControl table should look something like:
ServiceControl,Name,Event,Arguments,Wait,Component_
ControlService,MSSQLSERVER,161,,1,ServiceControl
Posted by: christopheOce 17 years ago
Senior Yellow Belt
0
Hi,

thanks in advance for to see in my little problem !

yes in table service control i have two events

with a name (the name fo the service) ,an events too as an integer ? , a wait as 0 for both and the same componenent for both.

now when i install my product i don't see if the installer stop the service !
i open the windows service i look while the setup is launch but nothing can happen i think !

i have install with the trace => /l*v and in this log file i see stop service and start service

are you agree with me if i tell the setup program stop and start the service !?

How i can check if the service is stopped when i installed my product !

Thanks
Christophe
Posted by: christopheOce 17 years ago
Senior Yellow Belt
0
its too me :-)

here is it some line present in my log file /l*v

MSI (s) (BC:04) [16:52:22:340]: Doing action: StopServices
Action 16:52:22: StopServices. Stopping services
Action start 16:52:22: StopServices.
MSI (s) (BC:04) [16:52:22:340]: Note: 1: 2262 2: ServiceControl 3: -2147287038
Action ended 16:52:22: StopServices. Return value 1.


MSI (s) (BC:04) [16:52:22:636]: Doing action: StartServices
Action 16:52:22: StartServices. Starting services
Action start 16:52:22: StartServices.
MSI (s) (BC:04) [16:52:22:652]: Note: 1: 2262 2: ServiceControl 3: -2147287038
Action ended 16:52:22: StartServices. Return value 1.

for me i think that the installer stop the service but i d like to have the opion about other person !

thanks for all
Christophe
Posted by: turbokitty 17 years ago
6th Degree Black Belt
0
Is SQL installed with the MSI? If so, expand out the component for the service executable and under "Advanced Settings > Control NT Services" create a stop event there. Don't use an argument, it will know to call the service executable.
Posted by: christopheOce 17 years ago
Senior Yellow Belt
0
Hi turboKitty,

thanks for your reply !

no there no exe sql installed with this setup program just four dll and some other files.

but i must to stop the service before to install this product and i wonder if the service i try tp stop start is well stop and start because if i open the windows panel service (start => administratif tools => service) and i run my program i don't see the service stop !

and often i press a refresh !

someone can tell how i can verify if the service is well stop or start when i installed my product !?

Thanks you for all and sorry for my bad english
Christophe
Posted by: Cygonz 17 years ago
Senior Yellow Belt
0
ChristopheOce,

According to your log file snipit the return value for the stop action and then start action were both 1. According to Microsoft an action return value of 1 indicates the action was successful. Trust the log file. The service was stopped and started.
Posted by: turbokitty 17 years ago
6th Degree Black Belt
0
Yes, if you're really paranoid about this, just take out the custom action that restarts the service and manually check if it has stopped.
Posted by: christopheOce 17 years ago
Senior Yellow Belt
0
Hi both,

no i m not paranoid but i see in the log file the action stop service and start service with value 1 !
all right, service is well start and stop !

but when i remove the product, i do a custom action who restore some dll.
There are 4 dll, 3 are correctly restore and one are not restore because the service is not stop ! i 've place a messagebox and when the messagebox appears with the error message i read the message of course and if a wait a few time i see the service stop after some second !

the dll is not restore because the service is not stop ! i m sure !!!!
well, i v" place my custom action just before startservice with condition Installed.

Now i think windows tell to the installer the service is stop THEN THAT THE SERVICE IS NOT STOP !
Is it possible ?!

last things: if i place this code in my custom action all works perfectly :

ServiceStopService( szServiceName );

all dll are correctly restore !

But is it a good things/pratice to place a script for to stop and start service !?

Thanks for all
Christophe
Posted by: turbokitty 17 years ago
6th Degree Black Belt
0
Try REMOVE=ALL
Put the CA after InstallValidate.
Posted by: christopheOce 17 years ago
Senior Yellow Belt
0
hi,


thanks for your idea but i ' ve try it and i was found the problem !

the service stop after 40 sec less or more and after 30sec windows tells to the installer that the service is STOP than the service IS NOT STOP !!!!

For to solve this problem i do a script with a while as this :

nResult = CopyFil(....myfile.dll..

and i test the result !

if(nResult == 0)then

MessageBox("Restore ok", INFORMATION);

else

while (VAL == 0)

nResult = CopyFil(....myfile.dll..


As a matter of fact, while the return code is not 0 i try to restore the file dll ! i do this action on each seconde and the service stop after +- 40 45 sec !!!!! that wrok i ve tested this setup and i m happy that work !

thanks you for your comment and help !
Thanks for all
Christophe
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