service - Wix Uninstall service issue - answerstu - answerstu

Wix Uninstall service issue

So basically what I'm trying to do is to have a number of additional parameters (namely SERVICENAME and SERVICEDISPLAYNAME) in the installer of my application (which runs a service) instead of hard-coding them in the installer. The installation runs fine with this change. However the problem I have is when I run a silent uninstall. It appears that the Service Control does not stop the service before removing it from the machine and I get a dialog box telling me that the service is still running and asking me if I want the service to be stopped before uninstalling it. What should I do to make it work (i.e. make the service control to stop the service automatically before removing it)?

1 Answer

  1. Denny- Reply


    The ServiceControl Element is just an abstraction for the underlying ServiceControl Table. Neither "do" anything. Instead, they merely express what needs to be done. The stopping of services is performed by the StopServices Action which gets it's orders from the aforementioned table.

    In Windows Installer, properties are not persisted automatically after an installation is complete. If you log the installer you will likely find that your SERVICENAME property is null and the StopServices action doesn't know what to do with that.

    Take a look at the following:

    The WiX toolset's "Remember Property" pattern

    If you implement this pattern, the data for SERVICENAME should be restored during the uninstall and the

Leave a Reply

Your email address will not be published. Required fields are marked *

You can use these HTML tags and attributes <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>