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?
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.