It installs NOT with the normal Windows service stuff, but by running it with command line options.
And it uninstalls also with command line options.
In the install I run a VB script (.vbs) file after installing it to start it.
And at uninstall time, I run a different VB script file that stops it.
So far everything works well. On install the service starts like a champ. However, I am getting some issues on uninstall:
When I uninstall my application, I am getting funny dialogs like the above if my service is still running. I cannot determine how to stop my service at the very beginning of uninstall. I added a message box to my "stopservice.vbs" file and noticed that this message box does not pop up until well after the above warning dialog.
I tried to add a call to my stop service .vbs file earlier, but the Advanced Installer 2.51 does not appear to let you run external files except at certain places late in the install/uninstall. And if I do not stop my service early in the uninstall, AI/MSI gives me the dialog like the above. If I hit "ignore" my uninstall works just fine. However I would very very much like not to get this dialog.
This is my stop service VB script. It would be great if this was a built-in method that one could call anywhere.
Code: Select all
strComputer = "."
Dim objWMIService
Dim colServiceList
Dim objService
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colServiceList = objWMIService.ExecQuery ("Select * from Win32_Service where Name='RMI CONFIG Agent'")
For each objService in colServiceList
errReturn = objService.StopService()
Next
Thanks,
Davinci Code