How to stop Print Spooler in Services from MSI/MST
I have package for a printer install. It requires the Print Spooler Service be stopped when uninstalling the previous version as part of my package installation. I otherwise receive an error message when trying to install. I have the previous version as a supersedence in SCCM. When installing manually (no transform, by MSI alone), I was able to install it manually without any error following these steps:
Programs/Features – Uninstalled previous version
Services – Stopped Print Spooler
Installed the new version/MSI
If I were to not stop services in between the uninstall then install, I get an AddPrinterDriver error message. I searched on this site and found instructions for adding a Service Control. I am using Installshield. As per the instructions, in my transform, I added the below Service Control within Direct Editor\ServiceControl:
Service Control "AnyName"
Event "51" (this stops and starts the service during install and uninstall of the msi)
Argument "leave empty"
Wait "leave empty"
Component "Choose any Component that is going to be installed and uninstalled completely"
I launched the install with the transform wrapped on the MSI. I then observed the Print Spooler status during the uninstall of the previous version and then again observed as my new version installed. This was all done without rebooting. At no point did the Print Spooler “stop” and resulted in a failed install. What am I missing here? Is Event 51 specific to the print spooler? The only other bit of info is that there is no executable whose component I can select when “choosing any component that is going to be installed and uninstalled completely”. Though they all are removed when uninstalled, all the components are linked to DLLs. I don’t know if this has any bearing but there you have it just the same.
I am getting a different error message. Below is how I entered the Service Control:
After hitting OK, this is what I end up with in the transform:
I tried using 3, 33, and 51 in the Event (i2) field. I am now getting error:
I know this is not a rights issue as I am working on a vm of which I have full admin rights. Also, I can manually toggle services without error.
You mentioned Installshield should have a UI for toggling start/stop during install. I did not see this option..?