hsc
Posts: 115
Joined: Wed Mar 02, 2016 2:55 pm

Delete files during uninstallation

Hi,

I believe that the uninstall operation should delete files and folders created during installation. Is this assumption correct? If so, I'm doing something wrong. My uninstallation removes only 2 out of 33 files...

I read through several threads in this forum with similar questions but none of the solutions seem to work for me. One of the files that are removed is an XML file which is edited by an XML editing operation, and the other is a DLL which has no special processing. Of the files that are not removed, the majority are DLL files.
Installation type is "Per machine only", and I see the UAC prompt when I launch the installation package. The package consists of a bootstrap EXE and the MSI file. The aip file is the same file which I sent to Catalin for another problem a few days ago.
I created a log file during uninstallation and found the following difference in log entries:

Component: XXX.dll; Installed: Local; Request: Absent; Action: Null --> file is not removed
Component: YYY.dll; Installed: Local; Request: Absent; Action: Absent --> file is removed

Just for completeness - I launched "uninstall" by starting the *.exe installer file from an elevated command prompt so that I could supply the /L*V parameter. In this case, of course, no UAC prompt was displayed.

Any ideas?
Thank you
Hans
Sorin
Posts: 663
Joined: Mon May 08, 2017 1:03 pm

Re: Delete files during uninstallation

Hello Hans,

This could happen if the same components are shared between multiple packages installed on the same machine. Windows Installer keeps a refcount for the components and does allow removing them until all the applications that use them are removed. For more details please take a look on our FAQ article : Why files are left behind after package uninstall?

If this isn't helpful, please send us the .AIP (project) and a verbose log of the installation to support at advancedinstaller dot com so we can investigate them.

Best regards,
Sorin
Sorin Stefan - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
hsc
Posts: 115
Joined: Wed Mar 02, 2016 2:55 pm

Re: Delete files during uninstallation

Sorin, thank you for your reply. The link you posted gives a perfect explanation for what I am seeing, except that the registry key is not HKEY_CLASSES_ROOT\Installer\Components but HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Components (this may depend on the Windows version... I have Win8.1). This key not only contains some file names but also a registry key name which the installer had created. Being somewhat daring, I deleted all these keys (I took the names from the install log) and the mentioned registry key, and deleted all installed files. Now I can install and uninstall my application, and almost everything is clean afterwards.

"Almost" means that the XML editor creates 2 backup files which are not deleted. Ok, I can live with it :D
Catalin
Posts: 7717
Joined: Wed Jun 13, 2018 7:49 am

Re: Delete files during uninstallation

Hello Hans,

You are always welcome.

I am glad that the solution my colleague Sorin gave was of help for you.

All the best,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”