Hello and welcome to Advanced Installer forums,
Thank you for your interest in Advanced Installer.
Our software writes the following keys in the registry:
HKLM\Software\<Company_Name>\<Product_Name>\<Component_Name>
Components can be installed separately.
So far, on uninstall of a component, we delete <Component_Name> key, but I want to delete also <Company_Name>\<Product_Name>, if and only if the key is empty.
If the registry key was not affected after installation, windows installer should automatically remove it at uninstall time. This is the default Windows Installer behavior. The
Windows Installer will automatically remove registry entries that
are authored into the Registry table when the referenced component is removed, or any registry entry created in the process of registering a COM server using the Class table. However, often times there are registry entries that applications create after the application is installed that must be removed, or registry entries created by a custom action during install. Since these registry key/values
are not authored into the Installer .msi package, the
Windows Installer cannot automatically remove these entries during maintenance mode or during uninstall. In this case, as you already figured out you will need a custom action to remove the related registry entries.
I've investigated the .NET custom action. The solution is ok, but I'll have to deploy also the assembly with the custom action and I don't like that.
PowerShell script - not that happy with it because it adds dependency to the PowerShell being deployed on the target machine... not a solution.
In order to achieve that you can go in the
Custom Actions page and add a
Launch attached file custom action with sequence after the "Install Executin Stage ->Removed Resources" action group and mark it as deferred in
execution time. By using this custom action type the source file (e.g. DLL, EXE. etc) will be embedded in the MSI file but
will not be deployed at install time with the other application files.
If you still don't want to use a "Launch attached file" custom action to run your .Net custom action, then as another solution you can use
Execute inline script code custom action. Using this custom action you will need only to add your VBS code in "Custom Actions" page of your project (no resource file is needed to be attached or deployed by your installation project).
If you have any question let us know.
All the best,
Daniel
FOLLOW US
Get the latest news in Application Packaging