1

I made a laucher application in c++ that use direct 2d and 3d. Now i making a installer for this. I followed microsoft docs and i made it but there is a issue. I use 'Microsoft Visual Studio Installer Projects' extension to make that. The issue is if i already installed my launcher with a previous installer msi file, if i rebuilt a new installer msi and try to run it it show me this error the error i get

This is the microft docs i followed to make this: https://learn.microsoft.com/en-us/cpp/ide/walkthrough-deploying-your-program-cpp?view=msvc-160

In the future maybe i need make a update for my laucher. It isn't good idea everytime need go to control panel, search and delete the previous application and install the new one manually.

Anyone know how can i make it automatic remove old version and install new one? Maybe there is a better way to create a installer?

Giannis
  • 41
  • 6
  • What VS version are you using? This is for VS2019: an entry about updating MSVC extensions. I don't know if it may be of any help: https://learn.microsoft.com/en-us/visualstudio/extensibility/how-to-update-a-visual-studio-extension?view=vs-2019 – rturrado Feb 05 '21 at 16:55
  • @rturrado i use VS2019 – Giannis Feb 05 '21 at 17:30

1 Answers1

1

Major Upgrade: In order to upgrade properly, you need to use a major upgrade so that your new version uninstalls the old one and then installs itself (this can happen in reverse order too: new version installed and old remnants deleted afterwards, but this is another story). There are further upgrade types, but stick to major upgrades for simplicity.

The message you are receiving is basically because you have a different package code for the new MSI, but not a new product code or version number (or just one of those problems). You need to get the settings straight.

Recommended step-by-step:

  1. Set "RemovePreviousVersions" to True in the project properties.
  2. In the same place: bump up your version number (one of the first 3 digits)
  3. Answer yes when asked to change product code, or do so yourself manually.
  4. Keep the UpgradeCode the same - it needs to be stable across releases.
  5. Rebuild your setups. Clean out your box of old remnants before testing or test on a virtual.

Testing: Remember to simulate your full upgrade process from first version installed to the new one with different version numbers for a few core files and also try to add a few files and such things. Very important to verify.

Heads-Up: Before ending, it is standard procedure to warn about the potential limitations of VSInstaller Projects (shorter list form).

MSI Tools: Here is a short "review" of other MSI tools.


MSI Upgrade Types: Shamelessly stolen from the InstallShield help file (towards bottom):

MSI Upgrade Types

Stein Åsmul
  • 39,960
  • 25
  • 91
  • 164
  • thanks for your answer, the issue was i had the same version number. Also i want ask if there is any way to auto start my application when installer finish – Giannis Feb 05 '21 at 19:10
  • I haven't looked at GUI modification in these project types and I know there are many limitations. I suggest you create another question. Here are a couple of links: [Create custom dialogs for an Setup project in Visual Studio 2015](https://www.codeproject.com/Articles/1028052/Create-custom-dialogs-for-an-Setup-project-in-Visu) and [Custom Action in Visual Studio setup projects](https://www.codeproject.com/Articles/335516/Custom-Action-in-Visual-Studio-setup-projects). – Stein Åsmul Feb 06 '21 at 00:57
  • [And from MSDN](https://social.msdn.microsoft.com/Forums/en-US/b2c90d27-6a61-4100-865a-dce628a71ffe/visual-studio-installer-project-custom-action-wont-run). – Stein Åsmul Feb 06 '21 at 00:59