views:

274

answers:

2

I want to blow away the already installed version of my app without bothering the user to uninstall before installing a new version.

Here are the Deployment Project Properties that I have set:

AddRemovePrograms              Icon(Icon)
Author                         Justin Tanner
Description
DetectNewerInstalledVersion    False
InstallAllUsers                True
Keywords
Localization                   English (United States)
Manufacturer                   Company Name
ManufacturerUrl                
PostBuildEvent
PreBuildEvent
ProductCode                    {3F401BEF-4A95-48AE-A79F-FBB60E90E26A}
ProductName                    Utility App
RemovePreviousVersions         True
RunPostBuildEvent              On successful build
SearchPath
Subject
SupportPhone
SupportUrl
TargetPlatform                 x86
Title                          Utility App
UpgradeCode                    {B2DC1E38-5605-4CC7-A815-2E1F9D7EDE41}
Version                        1.0
A: 

If you want to just run the uninstall operation then select your installer project and go to properties and then set RemovePreviousVersion = True...

S M Kamran
Good idea!, tried that but still get the "Another version of this product is installed. Installation cannot continue...."
Justin Tanner
+2  A: 

Change the Version property of your installer setup project.

After making this change, visual studio will say It is recommended that the ProductCode be changed if you change the version. Do you want to do this? Choose Yes.

The installer created after the version and ProductCode update will automatically "upgrade" previously installed versions prior to the version update.

Unfortunately, I don't know how to configure the setup project to update the version and product code on every build to avoid having to remember to make such changes between every deployment.

iammichael