There are good answers here, but I just want to add some clarifications:
- Automatic uninstall: By authoring the Upgrade table inside the MSI to implement a "major upgrade" you eliminate the need to manually or separately uninstall the previous version. The install of the new MSI will then silently remove the old MSI prior to installing the new one. Here is a starting point for implementing a major upgrade: http://msdn.microsoft.com/en-us/library/aa372374(v=vs.85).aspx. It is also OK to invoke an uninstall of the old MSI via msiexec.exe, but I find it more elegant that the new MSI removes the old one automagically.
- Command Line install: The msiexec.exe command line feature is very extensive and generally allows you to specify all required details for each MSI so that the install can happen silently. Only public properties (recognized by UPPERCASE captioning) can be specified at the command line. As stated before there are also "default properties" that can be set: http://support.microsoft.com/kb/230781
UPDATE June 2018: Although the tool shown below is no longer available for download, I found it via Wayback machine. I assume it is OK and legal to link to it, seeing as the tool was freeware. Updated links below.
UPDATE: This tool from Wise is regrettably not downloadable anymore. I am not sure if it is OK to distribute it either. It seemed to be a free tool distributed as part of their main Wise Package Studio suite, but I don't think it is open source. I wish they would release it as an open source tool.
The Wise packaging products have been discontinued due to a number of legal issues.
There is a tool available that helps you interactively build an msiexec.exe command line.
To avoid having to construct these silly msiexec command lines manually, use the msi command line builder tool from Wise: http://www2.wise.com/filelib/WICLB.exe (resurrected from Wayback machine).
Please run the download by virustotal.com for safety.
