You can uninstall a prevoius version of an application before you run your new setup using the following;
IF Exist C:\program files\{your old application folder}\{your old application}.exe C:\windows\system32\msiexec.exe /x {6C92f8CDE-4BB8B-46B9-8CD6-DCKJHF2EAAC2} /qb
The IF Exist function checks to see if the old app is installed
Then the windows installer service runs the uninstall of that app using the /x switch.
The string of numbers is the product code of the app you are removing. This can usually be found in the registry under the old app's install keys.
The /qb switch just tells it to run the uninstall unattended with the progress bar visible.
The best way to do this is to create a batch file, add the command line above and then enter your command line to install the new app right after it.