Question: i have created an application called "xyz.msi" and installed. Now i created another application called "abc.msi" and trying to install.

But my question is if "xyz.msi" is installed already then it shouldn't allow to install "abc.msi". 
Thanks in advance

Answer: 
Take a look at the [Upgrade table](http://msdn.microsoft.com/en-us/library/windows/desktop/aa372379%28v=vs.85%29.aspx). You can use this to define the search criteria along with the msidbUpgradeAttributesOnlyDetect attribute to cause your action property to be assigned the ProductCode property that is found. Then you can use your action property in the [LaunchCondition table](http://msdn.microsoft.com/en-us/library/windows/desktop/aa369752%28v=vs.85%29.aspx) to prevent installation.
You are asking how MSI detect an installed application. Its since each MSI will have a unique Product Code 

(Refer to this: <http://msdn.microsoft.com/en-us/library/windows/desktop/aa370854(v=vs.85).aspx>)

whenever you try to install a product it looks up at the product code if it matches it lets you do the re installation or upgrade. if it doesn't it will not. Depends how you creating the MSI. There are lots of ways of creating this but not really sure if you application lets you view the properties or not.