rmoc
Posts: 49
Joined: Tue Mar 14, 2017 8:27 pm

AI COM-Interface: Delete Feature not possible

Before building, we customize the project and remove some features if necessary. We use a C# program for this, which is supposed to remove the feature via the COM interface of AdvancedInstaller. First, all file components of the feature are removed, and then the feature itself. The problem is that we have file components that are also linked to one or more registry values.
FeatureToDelete.png
FeatureToDelete.png (17.38 KiB) Viewed 140 times
However, I cannot find a way to determine these values via the file component and therefore cannot delete them. When I try to delete the feature anyway, I get the following error message.
FeatureToDelete2.png
FeatureToDelete2.png (112.39 KiB) Viewed 140 times
Attached (
DeleteFeatures.zip
(6.04 KiB) Downloaded 7 times
) you will find the test project and C# tool.

Best regards,
René
Liviu
Posts: 1325
Joined: Tue Jul 13, 2021 11:29 am
Contact: Website

Re: AI COM-Interface: Delete Feature not possible

Hello René,

I’ve tested this and it appears that there’s currently no way to determine which component a registry key belongs to, so we cannot delete it later from the Registry.

However, I’ve added this improvement to our TODO list, and we plan to include component information for registry keys in a future version of Advanced Installer.

I apologize for the inconvenience.

Best regards,
Liviu
________________________________________
Liviu Sandu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
rmoc
Posts: 49
Joined: Tue Mar 14, 2017 8:27 pm

Re: AI COM-Interface: Delete Feature not possible

Hello Liviu,

Thanks in advance for extending the interface in a future version. I have found a workaround – it’s not particularly elegant and a bit cumbersome, but it allows me to implement the desired functionality for now. Instead of deleting the components I don’t need, I move them into a special feature using the function ...OrganizationComponent.MoveComponentToFeature(). This feature is excluded from the final setup by the build filter. The only issue arises with components that are shared across multiple features. At the moment, there is no quick way to determine which features an IComponent belongs to. A list of “parents” would be helpful here. But that might be something to consider for a future version. ;)

Regards,
René
Liviu
Posts: 1325
Joined: Tue Jul 13, 2021 11:29 am
Contact: Website

Re: AI COM-Interface: Delete Feature not possible

Hello René,

Thank you for sharing your workaround. Using a dedicated feature excluded by the build filter is indeed a valid solution in this situation.

I’ll log this suggestion as well and consider it for a future improvement of the interface.

We appreciate your feedback, it really helps us make Advanced Installer better.

Best regards,
Liviu
________________________________________
Liviu Sandu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
rmoc
Posts: 49
Joined: Tue Mar 14, 2017 8:27 pm

Re: AI COM-Interface: Delete Feature not possible

Hello Liviu,

Unfortunately, the workaround doesn’t work as intended. The issue is that the features/components are moved, but they still end up in the final setup, since the feature itself does not use the build filter. Currently, the interface does not provide any way to assign allowed builds to an IFeature. That would probably be the fastest way to explicitly exclude a feature from the setup before the build. At the moment, I cannot implement it this way and will have to wait for the interface to be extended.

Still, thank you.

Regards,
René
Liviu
Posts: 1325
Joined: Tue Jul 13, 2021 11:29 am
Contact: Website

Re: AI COM-Interface: Delete Feature not possible

Hello René,

You are correct, the Builds section of a feature does not yet support PowerShell.

I will also pass this along to our development team.

Best regards,
Liviu
________________________________________
Liviu Sandu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”