ravenspoint
ravenspoint

Reputation: 20472

MS Visual Studio Installer option RemovePreviousVersion=FALSE

In microsoft visual studio 2008 when I create a 'deployment project', intending to produce an installer for my application, the default project has an option RemovePreviousVersion which is set to FALSE.

If I leave this at the default, the installer will overwrite an old ( marked with an earlier version ) application with a new, but will leave the old version in the list displayed by the Add/Remove Programs option in the control panel. After a few upgrades, I and my users are left with a long list of these cluttering up the Add/Remove Program list. If I really need to remove an install, it is hard to know which of these to remove. Trying to clean up this is long and tedious, because remove each 'empty' old install takes many minutes.

What is the purpose of this option?

How can I clean up the Add/Remove Program display quickly end efficiently?

If I set the RemovePreviousVersion to TRUE, the Add/Remove list is correctly maintained, but the installation is significantly slowed by a minute or more, during which the progress bar does not move. So much so that some impatient clients have given up, rebooted their computers and reported a critical bug.

Please do NOT suggest other installer tools. While such tools might well 'solve' this particular issue, they will not be so tightly integrated with the visual studio IDE. I do several releases per day of the latest and greatest build, and need a one click install builder that auto-updates to any changes I have just made.

Upvotes: 2

Views: 288

Answers (1)

Tim Lentine
Tim Lentine

Reputation: 7862

Ideally do you want to have only 1 version of your product installed, or do you want to support having multiple versions of the product installed on a single machine?

I want just 1 version of my product - James

This is the first question to answer because I believe it will shape how you proceed with your installers in the future.

My hunch is that each new version of your application is installing to the same directory as the prior version, though you've told Windows Installer that you would like to allow side by side installations of your app. (RemovePreviousVersion=False).

If you wish to allow side by side installations of your application each new version should default its installation to a new directory (a common convention would be to append the product version to the directory name e.g. C:\Program Files\MyCompanyName\MyAwesomeApp2.0).

If you do not wish to allow side by side installations of the application you should change the RemovePreviousVersion to True.

The issue of the installation being slow can be debugged, but without more information about what exactly you are including in the installer and what custom actions you may have in place I don't know that anyone can give you a concrete answer as to what is causing the response time you are seeing. I will say from my experience that the time it takes for Windows Installer to complete the install varies wildly depending upon what the MSI is tasked with doing.

I have experienced this with every project - some install one or two files ( exe and dll ) and some install hundreds. Setting RemovePreviousVersion true delays them all for the same amount of time. James

I don't know of an easy way to clean up the Add\Remove Programs listing other than to continue to remove each version the way you have been.

You may also want to look at some third party tools to help author your installers. I have used several in the past and presently I use Advanced Installer. They have a free version of their tool that you may want to check out to see if it helps simplify the process for you. (I have no affiliation with AI other than I am a paid customer).

Other installer systems would not be so very conveniently integrated with all the other options in the visual studio IDE, AFAIK. James

Upvotes: 2

Related Questions