How to get an uninstall custom action installed - Advanced Installer Community
Homebound Hare
Posts: 2
Joined: Mon Jan 09, 2023 4:15 pm

How to get an uninstall custom action installed

Hi,

Advanced Installer allows custom actions to be marked Uninstall. I believe these custom actions are taken at uninstallation just as the name says but where are they stored until uninstallation takes place? I have a .exe installer created by Advanced Installer with some uninstall custom action in the form of a PowerShell script; The problem I'm facing is that, the custom action is nowhere to be found after once the .exe installer has finished its job. That's although the app itself gets installed as intended. I would expect it to show up in C:\Windows\Installer but there is no sign of it. To be sure, if I uninstall the app, then the custom action is apparently not executed, as the clean-up it is supposed to perform does not take place.

Is it perhaps required to generate a .msi installer if any uninstall custom action is to be installed?

Any help on that would be greatly appreciated.

Kind regards
The Homebound Hare
Catalin
Posts: 7852
Joined: Wed Jun 13, 2018 7:49 am

Re: How to get an uninstall custom action installed

Hello and welcome to our forums,

Custom actions are embedded in the MSI installer.

At install time, a copy of the MSI installer is cached into the C:\Windows\Installer folder.

You can read more about that in the following article:

Do not delete your Windows Installer folder
If you ever delete the whole content of the installer folder, every application that was installed via Windows Installer fails to remove itself.

For an application to be removed, the application must know exactly what to remove from the system (files,registry) or what additional Custom Actions must be triggered during uninstall.
Hope this helps!

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Homebound Hare
Posts: 2
Joined: Mon Jan 09, 2023 4:15 pm

Re: How to get an uninstall custom action installed

Hi, thanks for replying. If you don't mind, I have two follow-up questions:

1) It's not possible to "wrap" a .msi inside a .exe installer? In other words, if you want to have a .msi installed in C:\Windows\Installer because you need an uninstall action, then the installer you begin with must always be a .msi?

2) My tests seem to indicate that a .msi installer does not install itself in C:\Windows\Installer automatically, but that it's required to set the property, msiinstall, to true. Is that right?

Regards
Homebound Hare
Catalin
Posts: 7852
Joined: Wed Jun 13, 2018 7:49 am

Re: How to get an uninstall custom action installed

Hello,
1) It's not possible to "wrap" a .msi inside a .exe installer? In other words, if you want to have a .msi installed in C:\Windows\Installer because you need an uninstall action, then the installer you begin with must always be a .msi?
It is possible, but not as you might think. Each MSI installed on the machine will cache something in the C:\Windows\Installer folder.

Once again, the "Custom Actions" (most of them) are embedded into the MSI database, you can not simply call it whenever.

If you'd like to call the custom action outside the install process, you can create either an EXE, a VBScript file, a PowerShell script file (it needs to be a file).

You can then add this as a "temporary file" with the "Do not remove the file when setup ends" option checked. This way, the file should be on the machine whenever you need it.
2) My tests seem to indicate that a .msi installer does not install itself in C:\Windows\Installer automatically, but that it's required to set the property, msiinstall, to true. Is that right?
The MSI is not installed in that folder, but cached. Regarding the property, I am not aware of such property. Have you red this in an article?

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

Return to “Common Problems”