/build/static/layout/Breadcrumb_cap_w.png

Windows service unninstal

Hello

I developed msi package in VS2010 using Windows Installer. Inside this package are some windows services written in C#. To each service I added installer, i. e. serviceInstaller and processInstaller.
During installation of product, service receive user defined name using this method

private string GetContextParameter(string key)
{
return Context.Parameters[key].ToString();
}

There are of course methods ProjectInstaller_BeforeInstall and ProjectInstaller_BeforeUninstall where is called method GetContextParameter in the beginning of these methods to pass the name of service. And here is problem. When windows service is installed, everything is OK. But when product is unninstalled, there must be also unninstalled services, but they are not. I discovered that when service is uninstalling it don't goes to the method ProjectInstaller_BeforeUninstall where is passed the name of service which is uninstalled.
Do you know the cause of this strange behaviour?
Thanks in advance

0 Comments   [ + ] Show comments

Answers (2)

Posted by: anonymous_9363 12 years ago
Red Belt
0
I suspect you may be over-engineering things.

The Windows Installer service interface has 2 tables for handling services: ServiceInstall and ServiceControl. I would imagine that the underlying functions of these tables can handle your requirement, meaning that all your package need to do is populate the tables with appropriate values and leave the WI engine to do the necessary.
Posted by: Sorg 12 years ago
Senior Yellow Belt
0
Thank you. I know about this tables. But I think these methods can handle it. As I Mentioned, method ProjectInstaller_BeforeInstall worked as it should, it goes inside this method.
One important thing that whole product (including installer) is builded automatically. And if I manually change MSI DB, after build it is of course unchanged. So after each build it has to be changed manually.
There is no critical problem to implement some methods which will make this msi updates before installation, but If I am right methods inside service installer doing this work.
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