views:

559

answers:

3

I distribute my application using a VS2008 install package, which normally works great. When I create new versions of the app, I go in and increment the Version property on the install package and verify the RemovePreviousVersions property is set to True.

This works just fine most of the time - I just run the install package for the newer version and the older version is uninstalled and the newer version replaces it.

However, occasionally the install package will run successfully, but when I start the program the old version starts up. Apparently the old version of the .exe is still present.

I end up having to completely uninstall the software and install the new version, which always works, but is a pain.

The file isn't in use as far as I can tell and the install package doesn't tell me to reboot.

Any ideas about what's going on here?

+3  A: 

Not a direct answer, but the key difference between an upgrade and an uninstall+ a reinstall is that any custom uninstall steps are not called in 2k8 but are in 2k5.

This is referenced in http://stackoverflow.com/questions/370940/visual-studio-2008-service-installer-project-upgrade-issue

The other difference related to this is that in 2k8, the files get upgraded based on the version info resource - if your modules dont have newer versions, they dont get replaced.

In some cases whether you strong name also has effects, but I'm pretty confident the last paragraph covers the issue you're seeing.

Ruben Bartelink
A: 

We need to set REINSTALLMODE property of our msi file to amus.

Following is the link to know more about the meaning of 'amus' http://msdn.microsoft.com/en-us/library/aa371182%28VS.85%29.aspx

There are two ways to do that.

  1. By using msiexec.exe which comes with .NET SDK (if you have VS 2005 or VS 2008 it will come with it, just browse to command prompt of visual studio and you will find it there)

once you find msiexec.exe just type following command to set REINSTALLMODE property to amus for your installer.

msiexec.exe /i foo.msi REINSTALLMODE=amus

Jinal Desai - LIVE
+1  A: 

second is By using orca

Orca is utility to modify msi files.

You can download 'Orca' from following links. http://www.softpedia.com/get/Authoring-tools/Setup-creators/Orca.shtml

Steps:

 a. Install orca into your computer.
 b. Open orca
 c. Drag and drop your msi into orca UI
 d. Into left panel it will list the name of tables
 e. select property table
 f. go to right panel and right click
 g. click on 'Add Row'
 h. into 'Property' type REINSTALLMODE
 i. into 'Value' type amus
 j. save msi file
 k. and that's it

Now when you install it will overwrite all files.

Jinal Desai - LIVE
Thanks for the detailed directions! I could not find these directions anywhere.
Miguel Sevilla