1

I've created c# program for which I created with the Microsoft Visual Studio Installer Projects. Now I have an updated version of my program and I want to create a setup which either (if the program isn't installed) completely installs my program(lokal DB etc.) or (if it is already installed) just updates the exe so the user doesn't lose his settings and data in the DB.

How do I do that?

Triims
  • 75
  • 6
  • 3
    The setup file has this as an option. It basically compares the version and decides that way if it needs to uninstall previous version or new one. You can see more here in this as its already been answerd. https://stackoverflow.com/questions/39247420/uninstall-previous-version-installed-new-version-of-setup-project – mathis1337 Jun 14 '20 at 23:36
  • Does this answer your question? [Installer won't overwrite existing app](https://stackoverflow.com/questions/6310908/installer-wont-overwrite-existing-app) – PiRocks Jun 15 '20 at 02:22
  • Doesn't that also overwrites the properties and database – Triims Jun 15 '20 at 10:44

1 Answers1

2

If you click on your installer project, select "properties" tab (don't right click/properties) you will see UpgradeCode and ProductCode. You need to generate a new ProductCode. Don't change UpgradeCode. Be sure RemovePreviousVersions is set to true.

Then you can generate a new installer and it will upgrade the app if you always use the same UpgradeCode.

Danivn91
  • 53
  • 5