cancel
Showing results for 
Search instead for 
Did you mean: 
sysadmin-blr
Flexera beginner

uninstall windows service not removing from services.msc

we have windows service with multi instance support and installer class integrated.

installation is fine, but un-installation removes the folder content but not the service entry from services.msc

please suggest.

Labels (1)
0 Kudos
12 Replies
Flexera Jenifer
Flexera

Re: uninstall windows service not removing from services.msc

Hi @sysadmin-blr ,

 

If you expand the events section of the service you've added (components section: advanced settings, services, your service), there will be 6 events (you might need to create a new key to see these) - one of which is "Uninstall Delete". The default is no, change it to yes and you'll be good. (I also set Uninstall Stop to yes as well).

 

Thanks,

Jenifer

0 Kudos
sysadmin-blr
Flexera beginner

Re: uninstall windows service not removing from services.msc

Hi @Jenifer ,

thanks for the  reply, I am not getting where you want me to add new key, unable to find the event, can you please share some screenshots for the same.

also can you please copy this email to srinivaasan.sundar@enfs.com, there is no option to add cc

 

 

0 Kudos
sysadmin-blr
Flexera beginner

Re: uninstall windows service not removing from services.msc

Hi, 

I got the event where you are pointing, even after giving the flag to true, it is still showing up in services.msc, please suggest
events.pngevents section

0 Kudos
Flexera Jenifer
Flexera

Re: uninstall windows service not removing from services.msc

Hi @sysadmin-blr ,

 

Can you try setting this service file(Eg-Service.exe) as a key file of the component that you had added and give it a try?

 

Thanks,

Jenifer

0 Kudos
sysadmin-blr
Flexera beginner

Re: uninstall windows service not removing from services.msc

Hi @Jenifer,

Thanks for the reply, 

sorry i am unable to understand where you want to set this, can you please share some screenshot on where i have to do this.

 

can you copy srinivaasan.sundar@enfs.com as well?

0 Kudos
Flexera Jenifer
Flexera

Re: uninstall windows service not removing from services.msc

Hi @sysadmin-blr ,

 

For any component you can set file(s) as Key file(s) as attached in snapshot.On setting this can you try for uninstalling service whether it works or not?Assuming that you had made settings in events section for service uninstall which i had already mentioned.Set_Key_Component.png

 

Thanks,

Jenifer

0 Kudos
sysadmin-blr
Flexera beginner

Re: uninstall windows service not removing from services.msc

hi Thanks for the reply, 

i tried earlier all the files are enabled as key file

i disabled and kept only primary output as key file

also under System configuration->Services-[ProductName] is given to support multi instance and the same product name will appear in services.msc.

this suggestion also i am not getting desired output, the service name remains listed in services.msc post uninstallation.

can you suggest how to trigger a batch file upon uninstallation to delete this entry or a better approach will be helpful.

 

Thanks.

0 Kudos
Flexera Jenifer
Flexera

Re: uninstall windows service not removing from services.msc

Hi @sysadmin-blr ,

 

You can add vb-script based custom action which can have code like below:

 

Set WshShell = CreateObject("WScript.Shell")

Set oWmi = GetObject("winmgmts:")
sWmiq = "select * from Win32_Process where name='servicename.exe'"//Mention the name of the service instead of servicename.exe

Set oQResult = oWmi.Execquery(sWmiq)
If oQResult.Count > 0 Then
For Each oProcess In oQResult
iRet = oProcess.Terminate(1)

Next
End If

Custom action settings can be of:

Return Processing - Synchronous (ignore exit code)
In-Script Execution - Deferred in System context
Exec Scheduling - always execute
After InstallInitialise in Install Exec Sequence
Install Exec condition - REMOVE=ALL

 

Hope it helps,

Thanks,

Jenifer

0 Kudos
sysadmin-blr
Flexera beginner

Re: uninstall windows service not removing from services.msc

thanks @Jenifer 

this code looks generic, how to feed the instance name to this vbscript?

is there a sequence we have to follow or just enable run on uninstallation is fine, please suggest.

 

0 Kudos