Why is a service stopping during uninstall even though I told it not to? - Advanced Installer Community
mdpopescu
Posts: 1
Joined: Fri Sep 11, 2020 8:50 am

Why is a service stopping during uninstall even though I told it not to?

I wrote an installer that depends on an external service (called NATS). I am installing that service as part of my installer and everything works as expected.

However, when running the uninstaller, I do not want the NATS service to stop (or worse, be deleted). However, during uninstallation I get a message saying that some files being updated (?!) need that service to be stopped. I cannot proceed without accepting that.

The service in question is used by multiple applications / installers; I do not want it to be stopped when uninstalling (it provides communication services between my applications).

I am attaching the settings for the NATS service (the one I depend on, but which doesn't depend on anything else in my application) and the message I get when running the uninstaller. I can also send you the .aip file if necessary.
nats.png
nats.png (4.05 KiB) Viewed 1882 times
notification.png
notification.png (8.25 KiB) Viewed 1882 times
Catalin
Posts: 7852
Joined: Wed Jun 13, 2018 7:49 am

Re: Why is a service stopping during uninstall even though I told it not to?

Hello and welcome to Advanced Installer forums,

Please accept my apologies for the delayed reply.

In what regards your issue, please note that it is the other way around.

It is not the setup keeping the service in use, it is actually your service (NATS Server) that is keeping one (or more) of the files from your package in use.

When trying to uninstall, the setup notices that its' files are kept in use by the service and prompts you with the respective dialog, which states that:
The following applications are using files that need to be updated by this setup.
Please note that the dialog is automatically spawned by the Windows Installer. For more information about this, please refer to the Microsoft's "FileInUse Dialog" article.

The only way to avoid this dialog would be to automatically stop the service during uninstall, before the check for the files in use is done ("InstallValidate" standard action).

Hope this helps!

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”