user1295380
user1295380

Reputation: 41

uninstall previous version installed new version of setup project

I create a setup project and installed in a windows system. Before going to install setup project I made setting as

DetectNewInstallerVersion = true 

and

RemovePreviousVersion = True 

I have also changed the version every time. But If I rebuild the setup project then again install the msi file it will not overwrite the existing file also it will create a new application in program features. I want to uninstall the previous version and install new version without uninstall manually.

Upvotes: 2

Views: 9336

Answers (2)

Siber195
Siber195

Reputation: 41

In combination with what Wiccio has posted, I also found that setting the property InstallAllUsers to true

InstallAllUsers = True

Upvotes: 2

Wiccio
Wiccio

Reputation: 349

After several trials and attempts, even by reading the replies of this community, I try to give you a more complete answer than I have found.

1) Right click on your solution project, then Properties. In the Application menù keep in mind the version of the Framework (the setup must have the same version) and then click Assembly Information. In here, write your custom version (Assembly Version and File Version should be identical) using the first three blocks (because the setup property doesn't have the fourth block), for example 1.0.0.

2) In the Explore Solutions panel enter inside the treeview of your setup project in the Detected Dependencies folder, then double click in Microsoft .NET Framework and set

Version = .NET Framework (X.X.X)

where X.X.X is the version number of the Framework used in the solution project.

3) Right click on your project solution, then Properties. Set:

DetectNewerInstalledVersion = True
RemovePreviousVersions = True
Version = //the number used in the assembly at the point 1)

It will appear the message It is recommended that the ProductCode be changed if you change the versione. Do you want to do this? Click Yes.

4) Right click on your project solution, then Recompile. If the Output panel doesn't reports any errors, you can go in the debug folder (usually C:\Users\YOURPCNAME\Documents\Visual Studio 2017\Projects\YOURPROJECTNAME\YOURPROJECTNAME\bin\Debug) and use the .msi or the .exe files to install your project.

When you need to change the version number, run the four points above again. I use this mode for my projects and with .msi file has always worked.

Upvotes: 10

Related Questions