Due to a bug in the uninstall of the previous version, I need to first uninstall the prev and only then install the prerequisites and the new versions.
In order to achieve this, you can add your prerequisites as "post-install". If you want to have them as "feature-based", you also need to go in the Custom Actions page and add the "Uninstall previous version" predefined custom action. However, the prerequisites should not be added as "pre-install".
When the "Install" button will be pressed, the "Uninstall previous version" custom action will be executed, which will uninstall the old version and after it the installation of the prerequisites and new version will be performed.
I'm not sure why it did not work. Please make sure that the condition set for that custom action is true during the installation. Also, the uninstallation will be performed only if an older version of the application with the same Upgrade Code is found on the machine.
Please send us a verbose log of the installation if you cannot get it to work.