You do this using the Upgrade
element. See this question: How to implement WiX installer upgrade?
If you only want to detect whether the application is already installed, use the OnlyDetect
attribute (Rob's answer has an example of this use).
If you are actually trying to perform an upgrade of your product, the official WiX documentation describes the easiest way to do this.