0

In the process of converting from installshield to wix, I am porting over the custom actions.

One is for determining previously installed versions and popping up a message if any are found. I guess the guids weren't properly tracked before.

Within installshield, it appears they had the CA scheduled after ValidateProductID. I tried to do the same:

<CustomAction Id="CA_CheckPreviousVersions.SetProperty" Property="CA_CheckPreviousVersions" Value="ERROR_UNINSTALL_VERSION=$(var.ERROR_UNINSTALL_VERSION)" />
<CustomAction Id="CA_CheckPreviousVersions" DllEntry="CheckPreviousVersions" Execute="deferred" BinaryKey="LunaClientCustomActions_dll" />

<InstallExecuteSequence>
...
<Custom Action="CA_CheckPreviousVersions.SetProperty" After="ValidateProductID" />
<Custom Action="CA_CheckPreviousVersions" After="CA_CheckPreviousVersions.SetProperty" >NOT Installed AND NOT PATCH</Custom>
</InstallExecuteSequence> 

Except, I get a nasty warning:

error LGHT0204: ICE77: CA_CheckPreviousVersions is a in-script custom action.  It must be sequenced in between the InstallInitialize action and the InstallFinalize action in the InstallExecuteSequence table

Why am I getting this, whereas IS seemingly permitted it? More to the point, how do I replicate the behaviour that was previously in place?

Jon
  • 1,675
  • 26
  • 57

1 Answers1

2

You haven't shown the custom action definition, but the message indicates it's deferred and must be sequenced as the message indicates. Perhaps the original type was immediate.

If you mean previously installed versions of your product (or in fact any MSI-based product for which you know the UpgradeCode) there is no need for any code. If you were to use a WiX MajorUpgrade element you can detect previous versions because the WIX_UPGRADE_DETECTED property will be set, and you could use that as a launch condition, or whatever it is you plan to do. Or use Upgrade and UpgradeVersion elements to detect previous versions and version ranges. From what you've said there seems no need to run code. Just use the upgrade search properties and show dialogs or errors or whatever.

PhilDW
  • 20,260
  • 1
  • 18
  • 28
  • I edited the original post to show the CA defs. As for your analysis of whether or not I need to "run code"... I have no idea what you're talking about (yet)! LOL The code is checking for specific guids in the hklm\m\w\cv\uninstall key. I am merely porting code that preceeded me and that part is done; my only concern is getting it sequenced in the same place as the installshield version. – Jon Mar 14 '16 at 17:14
  • And... the "deferred" was the culprit. Why would that have made a difference? Is the ValidateProductID step not part of the deferred sequence? – Jon Mar 14 '16 at 17:27
  • The "deferred" part of the install is the part that actually changes the system, the execute sequence between InstallInitialize and InstallFinalize, and all deferred custom actions must be within this range. – PhilDW Mar 15 '16 at 17:53