Wix InstallExecuteSequence throws error on supporting 47th msi instance

508 views Asked by At

The error is thrown while supporting the 47th instance. It runs fine if I remove the action SetMyInstance_Instance47. I need to support 100 instances. The code snippet is as below.

<InstallExecuteSequence>
 <Custom Action="SetMyInstance_Instance46" After="SetMyInstance_Instance45"><![CDATA[ACTION = "INSTALL" AND MYINSTANCE = "DontUseThis" AND  (INSTANCE46INSTALLEDPRODUCTCODE = "" AND INSTANCE46INSTALLEDPRODUCTCODE64 = ""  AND INSTANCE46INSTALLEDPRODUCTCODE32 = "")  AND SECONDEXECUTE <> 1 ]]></Custom>
      <Custom Action="SetMyInstance_Instance47" After="SetMyInstance_Instance46"><![CDATA[ACTION = "INSTALL" AND MYINSTANCE = "DontUseThis" AND  (INSTANCE47INSTALLEDPRODUCTCODE = "" AND INSTANCE47INSTALLEDPRODUCTCODE64 = ""  AND INSTANCE47INSTALLEDPRODUCTCODE32 = "")  AND SECONDEXECUTE <> 1 ]]></Custom>
 </InstallExecuteSequence>

Wix Error: The InstallExecuteSequence table contains an action 'SetMsiNewInstance' which cannot have a unique sequence number because it is scheduled before or after action 'AppSearch'. There is not enough room before or after this action to assign a unique sequence number. Please schedule one of the actions differently so that it will be in a position with more sequence numbers available. Please note that sequence numbers must be an integer in the range 1 - 32767 (inclusive).

2

There are 2 answers

4
Christopher Painter On

MSI doesn't have to have unique sequence numbers. Multiple actions can have the same sequence number it just isn't promised which will run first. If all of these instances are mutually exclusive it wouldn't matter.

The other option would be to have 1 custom action that reads from a custom table and does the same processing but only taking up one sequence position.

4
Stein Åsmul On

For diagnosis - first of all (before any fix), please try this:

  • Open your MSI in Orca or equivalent editor
  • Go to the InstallExecuteSequence, sort by Sequence (right column).
  • What numbers do you see? Notice the gaps in the numbers. Those gaps are to allow other actions "in between" the standard actions. If you run out of "gaps" then you will probably get the message you receive.
  • There are "default numbers" used for the standard actions and they seem to be defined in a file called actions.xml (please do visit that link).

=> Conclusion? You need bigger gaps between the standard actions. At least that is ONE of the things you need. What you really need to do is to stop using so many instances :-).

You can try to manually set the sequence number AND you can assign new numbers to the standard actions:

<InstallExecuteSequence>

   <..>

     <!-- Redefine standard action numbers -->

      <LaunchConditions Sequence='300'></LaunchConditions>
      <FindRelatedProducts Sequence='2'></FindRelatedProducts>

   <..>

     <!-- Manually assign custom action sequence numbers -->

       <Custom Sequence="44" Action='SomethingDoneHere1' />
       <Custom Sequence="45" Action='SomethingDoneHere2' />

   <..>

</InstallExecuteSequence>

Orca