Uninstall does not remove service executable - Advanced Installer Community
JosephFerano
Posts: 3
Joined: Thu Mar 12, 2020 4:23 pm

Uninstall does not remove service executable

Greetings,

Problem Description:

When we try to uninstall a service installed with Advanced Installer, the executable itself remains in the ProgramFiles directory. The service is also not being removed from win10 and it appears in services.msc. Then when we try to install a new version (without a new product code or version, it's just a dev iteration) it does not overwrite the existing one. The ICO and RTF files also sometimes remain. The service does indeed restart though, albeit with the old version of the service executable. This was replicated on a VM and a physical installation.

How to reproduce ?

Install service, without a restart, then uninstall. Try reinstalling both after a restart and without and it still remains like this. Then try to install again with a modified version of the installer (same product code and product version). Old installation executable remains. We are using AI 16.9.

Environment

We compared logs from times where it was successful and times when it wasn't. These stood out to us
MSI (s) (60:B0) [23:15:07:849]: Disallowing uninstallation of component: {4C8CC14C-BC1F-48FB-ADB0-BB196842FC22} since another client exists
We looked into this and saw this link;
https://www.advancedinstaller.com/user- ... uestion193
However, when trying to find the registry entry, we were unable to find it.
MSI (s) (18:E4) [04:13:28:634]: RESTART MANAGER: Detected that the service AwesomeService.exe will be stopped due to a service control action authored in the package before the files are updated. So, we will not attempt to stop this service using Restart Manager
This one happened on a successful uninstall
JosephFerano
Posts: 3
Joined: Thu Mar 12, 2020 4:23 pm

Re: Uninstall does not remove service executable

Update: We ended up finding the entries in the registry. Our theory is that throughout the different installs/uninstalls, at one point something got botched and windows still thinks there's a separate resource that depends on the file. If there are any ideas/tips on how to avoid/handle this in case it happens in the future, I'd appreciate you sharing them. Thanks.
Catalin
Posts: 7852
Joined: Wed Jun 13, 2018 7:49 am

Re: Uninstall does not remove service executable

Hello Joseph and welcome to Advanced Installer forums,

Indeed, the explanation of why this happens can be found in the article you've linked.
Our theory is that throughout the different installs/uninstalls, at one point something got botched and windows still thinks there's a separate resource that depends on the file.
You are right. Most probably, this is the case

What I would advise you to do is (as stated in the article as well) testing your setups on clean Virtual Machines.

Another pieces of advice I would like to share are:
  • Never use a single project (Advanced Installer Project - .AIP) file to create multiple projects. If you want have a project as a template (from which you can create multiple other projects) it is recommended to use the "Save as Template" option.
The major difference here is the fact that when using the "Save as Template" option, all the GUIDS from the project will be changed. If that does not happen, the Windows Installer will think that the files installed are the same (shared) and you will encounter issues when trying to uninstall.

Let's consider the following example:

- you have a simple project, with a simplet .txt file that has the following GUID: AAA-BBB-CCC

You install this on the machine. After doing so, you want to add 1 more file to the project and then create a new project. You do so by using the same project file used to build the first installer.

This way, the GUID of the .txt file will still be: AAA-BBB-CCC

When installing the second product, Windows Installer will detect the .txt file and, instead of adding a new registry entry, it will increment the refcount for the already existing entry.

After doing so, when trying to uninstall any of the two products, the issue you are describing will occur.
  • Make sure that you do not have the "Shared DLL Reference Count" option selected for your components. For instance, you can go to "Files and Folders" page --> select your service executable --> right click on it --> "Go to Component" (or simply press the F8 button). This will redirect you to "Organization" page where the component matching your service executable will be selected.
Hope this helps somehow.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
JosephFerano
Posts: 3
Joined: Thu Mar 12, 2020 4:23 pm

Re: Uninstall does not remove service executable

Thank you very much for the response. That indeed explains why the ICO and RTF files remain; I did base the new project on an older one. It doesn't quite explain the service .exe, and now we ran into another issue unfortunately. I bumped the patch version and after updating, uninstalling no longer works for the dev; all files remain.
Catalin
Posts: 7852
Joined: Wed Jun 13, 2018 7:49 am

Re: Uninstall does not remove service executable

Hello Joseph,

You are always welcome!

I am glad my explanation was helpful to you.

In what regards your second issue, I can not say for sure why this happens.
I bumped the patch version
By this, do you mean that you have created a patch and applied it to your already installed setup (after which, the uninstall process no longer works)? If so, what are the changes you tried to bring to your setup with the patch?

If possible, I would like to have a look over the uninstallation log (verbose log), to see what I can find. In our How do I create an installation log? article you can find more details about how to create a log file.

After doing so, please forward me log file, either here or by e-mail at support at advancedinstaller dot com so I can further investigate this.

A verbose log file can be created with a command line such as:

Code: Select all

msiexec /i <path_to_msi> /L*V <path_to_logFile>

Code: Select all

setup.exe /L*V <path_to_logFile>
for installation scenarios.

Code: Select all

msiexec /x <path_to_msi> /L*V <path_to_logFIle>

Code: Select all

setup.exe /x // /L*V <path_to_logFIle>
for uninstallation scenarios.

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

Return to “Common Problems”