I have a program which is dependent upon postgres. The installer I made will install postgres for the user; however, I would like this to only happen if Postgres is not already installed. I'm attempting to do this through a custom action with conditions, however, I cannot seem to get it to work. Any help would be greatly appreciated. This is what I currently have.
<Property Id="POSTGRESINSTALLED">
<RegistrySearch Id="POSTGRESINSTALLED_SEARCH" Key="SOFTWARE\PostgreSQL\Installations\postgresql-x64-9.5" Root="HKLM" Type="raw" Name="Branding" />
</Property>
<InstallExecuteSequence>
<Custom Action='postgres_install_action' After='vc_redist_install_action'> ( NOT POSTGRESINSTALLED ) OR ( REINSTALL ) </Custom>
</InstallExecuteSequence>