matthewshorten
Posts: 6
Joined: Wed Jan 17, 2024 3:27 pm

Wrong version of "Call Method from .Net Assembly" CA executed during upgrade

Hello

I'm struggling with the upgrade of a product that uses several "Call Method from .Net Assembly" Custom Actions in both the install phase and the uninstall phase. The methods called are in assemblies that are copied to the target folder during install.

All works perfectly when
  • product v1 is installed
  • product v1 is uninstalled
  • product v2 is installed
but when
  • product v1 is installed
  • product v1 is upgraded to product v2
the following behaviour (simplified enormously) is observed
v1 installation begins
v1 files are copied into target folder
custom action (install) executes - v1 code observed
v1 installation finished
...
later
...
upgrade from v1 to v2 installation begins
custom action (uninstall) executes - v1 code observed
v1 files are removed from target folder
v2 files are copied into target folder
custom action (install) executes - v1 code observed
...

Notice: when the v2 installer is executed as an upgrade the CA is incorrectly running v1 code. When the same MSI is run as a first-time install it correctly executes v2 code.

Additional info:
  • In the AIP Upgrades Order = Uninstall old version first and then install new version
  • Each CA in the AIP is carefully flagged under "Execution Stage Condition" as either Install or Uninstall (never are both ticked)
  • Using AI version 21.6.1
My suspicion is the "Call Method from .Net Assembly" wrapper is finding a cached or temp copy of the v1 assembly leftover from the uninstall phase of the v1 product when it really should be using the v2 of the assembly included with the v2 product.

Hoping you folks at the forum can help!
Matthew
Liviu
Posts: 1049
Joined: Tue Jul 13, 2021 11:29 am
Contact: Website

Re: Wrong version of "Call Method from .Net Assembly" CA executed during upgrade

Hello Matthew,

I've replied to your email.

Let's continue the conversation there until we reach a conclusion.

Best regards,
Liviu
________________________________________
Liviu Sandu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”