How to create options in installation profile/ distribution to enable custom content types? I have created a custom installation profile/ distribution with exported config files of a site. I have 4 content types in this site from which two will be installed by default but for other two are optional.

I can see a couple of options:


Creating a custom module for each content type and putting related config files in it. (This does not allow any option at installation time although I can enable the module using info file of profile)
Custom form alter of installation form and add check boxes.(If I want to combine this with option 1 then how can I do that?)

Checkbox-> Content type 1 (This is disabled and checked)

Checkbox-> Content type 2 (This is disabled and checked)

Checkbox-> Content type 3 (Optional)

Checkbox-> Content type 4 (Optional)

All the related config files of checked content types should be enabled at installation. 


I would like to go with option two and give user check boxes at the time of installation of profile but if there are any better ways to do it then please do suggest.

Thanks in advance.
I would think in either case, you should provide the Content types as modules and allow the user to enable them any time after installation. Otherwise, how do you expect them to enable the content types if he chooses to skip them during install?

The way to provide additional options during a profile install is hook_install_tasks(), also check this blog.