views:

613

answers:

1

I've seen a confusing behavior regarding the MSI files generated by a VDPROJ file. If I build my MSI in Visual Studio and then right-click and pick "Install" from within Visual Studio, it will automagically uninstall any version that is already installed and then install the new MSI.

However, if take the generated MSI and run it directly it will complain if a previous version is already installed. I have to uninstall it explicitly (in Add/Remove Programs) first.

What's the deal? Is there a command-line argument that Visual Studio executes the MSI with?

+6  A: 

Yes Visual Stuido will be passing the REINSTALLMODE and the REINSTALL properties to the windows installer when it runs your install

something like:

msiexec /i your.msi REINSTALLMODE=vomus REINSTALL=ALL

Check the MSDN documents linked above to see what these options are doing

Edit:
Now I come to think of it. Studio may also just be uninstalling your application first by using the /x command line arg

msiexec /x <package> or <product code>

Maybe someone else can confirm which is being used?

Jamie
Thanks. That's the answer I was looking for. (I love this site!)
dviljoen