Understanding Product Code and Update Code (GUIDs) - Advanced Installer Community
McKool
Posts: 113
Joined: Wed Jan 19, 2011 12:35 pm
Location: Darmstadt, Germany
Contact: Website

Understanding Product Code and Update Code (GUIDs)

AI Version: 12.1

Hello,

I'm using AI and doing setups since a couple of years.Now I found an unexpected behavior regarding the installation of a product.

Problem-Background: We have a product that sometimes need to be updated (we don't use Patch projects). We did always the changes in the project without changing the product code, only the "build number" of the product version, so that the user was instructed to uninstall the current version and to try again. But those users wanted the installation to uninstall older versions, so we changed the Product code to achive this but we got other behavior than expected.

Here the scenario (I use single numbers for GUIDs for simple reading):
  • I create a project with Product Version""1.1.1.1", Product Code "1", Upgrade Code "2"
  • I compile and install that setup
  • I change the Product Code to "3", but let all the rest same (Upgrade Code "2", Version "1.1.1.1")
  • I try to install the new setup (without uninstalling the other)
  • At this point I would expect one of two things:
    • The setup fails wiht a message like "Already installed", or "other version already installed"
    • The setup uninstalls, i.e. updates, the current installed product.
Nevertheless, other than expected, the setup goes ahead and installs a second time the product. The problem here is that I have configured the AI project to avoid side by side product installations (that is, selecting "automatically upgrade older product versions" in the "Application upgrades page" of AI). Since the update code for both setups is the same, I would'n expect to see in the software list two entries of the same product:
software.jpg
software.jpg (132.13 KiB) Viewed 7617 times
Ok, I think we should maybe use a Patch project or something like that, or maybe I'm misunderstanding something here, so it would be great if you could help me understanding this. So here what we would like to do:
  1. The version number of the project (major, manor, and revision) should be the same in two or more different releases (background: an internal component gives actually the version number)
  2. The build number is the actual "setup-release" number
  3. When installing, if an older version if found, i.e. a smaller build number, it must be uninstalled first.
  4. If the last step is not possible, it should be avoided to install the product twice
Thanks in advance!
Keneth
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Understanding Product Code and Update Code (GUIDs)

Hi Keneth,

This is happening because you are using different ProductCode for the installation packages and you are also using the fourth field of the ProductVersion.

Please note that the fourth field of the Product Version is ignored by Windows Installer when comparing product versions.
When the first three fields of the old and upgraded version are identical, then the upgrade installation will either fail with "Another version of this product is already installed" message or will be installed side by side with the old version (when using different Product Codes).

In order to upgrade the old version when using the fourth field of the ProductVersion, please follow the steps from the How do I remove the old version when using the fourth field of the Product Version? article.

Should there be any difficulty you encounter implementing something, please do not hesitate to contact me and I will gladly assist.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
McKool
Posts: 113
Joined: Wed Jan 19, 2011 12:35 pm
Location: Darmstadt, Germany
Contact: Website

Re: Understanding Product Code and Update Code (GUIDs)

Hello Dan,

thanks a lot. Using the workaround wiht the "AI upgrade rules" works! just as summary, here the two different behaviors one can expect when using this:

Configuration A:
  • Same mayor, minor and revision versions
  • Same product code,
  • Different (greater) build (fourth field of product version).
Behavior: new installation fails with the error "Another version installed..."

Configuration B:
  • Same mayor, minor and revision versions
  • Different product code,
  • Different (greater) build (fourth field of product version).
Behavior: Old version will be deinstalled, new one installed.

Best regards,
Keneth
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Understanding Product Code and Update Code (GUIDs)

You're welcome Keneth,

Indeed, the encountered behaviour is correct in each case. Also, thank you for your summary.

If there is anything else I can help you with, please let me know.

Kind regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”