Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
176 views
in Technique[技术] by (71.8m points)

c++ - microsoft visual studio installer projects issue

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://docs.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?

question from:https://stackoverflow.com/questions/66066210/microsoft-visual-studio-installer-projects-issue

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...