0

I have a script custom action that is scheduled to run during installation and upgrade:

<InstallExecuteSequence>
    <Custom Action="CallInstaller" Before="InstallFinalize">
    <![CDATA[NOT Installed OR UPGRADINGPRODUCTCODE]]>
    </Custom>
</InstallExecuteSequence>

The script runs without any issues during installation, but always fails during upgrade.

I tried to schedule the custom action to run at many different stages of the InstallExecuteSequence, but nothing worked.

By checking the install folder, I saw that the files were not being moved to the new location during the upgrade. With that, it makes sense that the custom action fails, since there's not even a script to be called.

At some point I realized it could be related to the fact that I had to change the Guid of my components. Now all of them have Guid="*", but the issue persists.

Am I scheduling the custom action in the wrong way? Are there any restrictions that apply only to script custom actions? Why my files are not at the target installation folder when the custom action is started?

4
  • Hard to say. A verbose log file would sure you more context Commented Oct 18, 2024 at 4:35
  • Your use of UPGRADINGPRODUCTCODE seems to imply that you want to use major upgrades. Normally the condition NOT Installed is sufficient to run a custom action during first install and during upgrade install, because the Installed property only refers to the current version of the product in a major upgrade scenario (it checks if a product with same ProductCode is installed, which changes for each version when using Major Upgrades). UPGRADINGPRODUCTCODE is only set for the package to be removed, you typically use it for uninstall conditions only. Commented Oct 18, 2024 at 12:42
  • @zett42 if I remove the UPGRADINGPRODUCTCODE and <MajorUpgrade AllowSameVersionUpgrades="yes" DowngradeErrorMessage="A newer version of [ProductName] is already installed." />, the minor upgrade actually happens. Going over a tangent here, but would it possible to have a minor upgrade while removing the previous versions without a custom action? As it it right now, the old folder is kept. If I had a custom action, I could possibly deleting it by hand, but it sounds hacky Commented Oct 21, 2024 at 14:04
  • Minor upgrades don't remove the older version by definition. I strongly advise against using minor upgrades as you strictly need to follow component rules with a lot of foresight to ensure the update works correctly. Commented Oct 22, 2024 at 9:35

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.