Let me start out by saying that SCCM 2012 R2 is not one of my strong areas. I know in SCCM you can create a package for a EXE but within the pack can you do the following
1) Uninstall a certain program suppress reboot
2) If program A with a certain version if precent, install program 123, if not install program abc
etc...
Either you script your requirement in a single package (i.e. a batch or PowerShell script) or you have to use a task sequence.
In a task sequence you could use a query for a specific software via WMI:
Execute step only when WMI query is true
Open in new window