Reputation: 2063
I need to try to stop some windows service during installation of my product and try to run after. The service is not related with the product, it may or may not exist on a certain PC. It may or may not run at the moment of product (de)installation. I don't care if service stop/run was successful or not, for example it's fine if the service fails to run after the installation complete.
I added ServiceControl
table in my msi-package, i set Wait
option 0
.
In the case the service is not installed on the system, i get an error MessageBox
Besides /passive
|/quiete
installation option or using CustomAction
, are there ways to get rid of this MessageBox? I just don't want it to appear.
I don't use WiX.
Thank you!
Upvotes: 1
Views: 38
Reputation: 1336
I'm not sure if that error can be suppressed when using the ServiceControl table, but another option is to use Custom Actions:
You could use two type 34 custom actions instead (one to stop, one to start).
Your custom action table will ultimately look similar to this:
Action Type Source Target
NewCustomAction1 3170 SystemFolder NET STOP ServiceName
NewCustomAction2 3170 SystemFolder NET START ServiceName
and your InstallExecuteSequence similar to this:
Action Condition Sequence
NewCustomAction1 NOT Installed 1501
NewCustomAction2 NOT Installed 6599
Upvotes: 1