2

This doesn't feel like a good question, but please bear with me for a moment.

To put it into perspective, I am using Remember Pattern to save CMD line input property values, and have encountered an issue to schedule my 25+ custom actions to save CMD line supplied properties before AppSearch, as Remember Pattern rely on CMD supplied property values saved before AppSearch. The error message I got looks like this:

error LGHT0179: The InstallUISequence table contains an action 'SaveCmdLine_SERV ICE_ACCOUNT' 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. Plea se note that sequence numbers must be an integer in the range 1 - 32767 (inclusive).

Upon inspection MSI compiled using Orca, the Sequence for AppSearch is 50. It's hard to find documentation about MSI Sequence table if anything at all, but according to link from this SO quesion, AppSearch should have a Sequence of 400. The workaround I am using is to shift AppSearch to a larger sequence number upon inspection of the generate MSI using Orca. Which seems Ok.

But 50 is quite a low number, why it is set to 50 instead of 400? Is it controlled by Windows Installer API or Wix?

Update: After update AppSearch to sequence 400, I encounter an issue where using the following code using bootstrap to require .Net 4.5 will fail.

  <Chain>
  <PackageGroupRef Id="NetFx451Redist" />
  <MsiPackage Name="$(var.OutputName).msi" SourceFile="MyInstaller.msi" DisplayInternalUI="yes" />
</Chain>

Upon inspection, look like I have to schedule LaunchConditions from sequence number 100 to sequence number 600 so that it still happens after AppSearch, so that the check .Net framework pre-request still working. I guess that's probably (one of) the reason why AppSearch was scheduled so early by WiX.

Paul L
  • 2,240
  • 5
  • 36
  • 55
  • The actual value of the sequence number doesn't matter, it only must be greater than zero and of course the order is important (values -4..0 have special meaning). [See the docs](https://msdn.microsoft.com/en-us/library/windows/desktop/aa369500(v=vs.85).aspx). So I find it a little bit strange that WiX is running "out of numbers". – zett42 Aug 30 '18 at 07:59
  • @zett42, the way I am saving CMD line property values relay on a custom action scheduled to save each property before AppSearch (as after that the property value could be overwrite by Registry value saved for that property. Thus `AppSearch` with sequence of 50 and 'FindRelatedProducts` of 25 leave me only 24 slots available. – Paul L Aug 30 '18 at 21:06
  • 2
    Have you tried to insert `` in `InstallExecuteSequence`? Make sure to set "n" only as high as the sequence index of the next standard action minus 1. – zett42 Aug 30 '18 at 21:20
  • @zett42, thanks for that, I didn' t know that you can define sequnence number youself so easily. And it is better than my current solution. – Paul L Aug 30 '18 at 21:38
  • I've also put another related question, but unfortunately, the solution I am looking for might not easily defined as other SO questions. But again, what I am really looking for is just pointers or explanations. for anyone interested to answer. https://stackoverflow.com/questions/52105942/sequence-number-whats-determine-it – Paul L Aug 30 '18 at 22:05

1 Answers1

2

WiX Default Standard Action Sequence Numbers: I suspect - without being able to confirm it for sure - that WiX uses the following XML file (actions.xml) to define the default standard action sequence numbering): https://github.com/wixtoolset/wix3/blob/develop/src/tools/wix/Data/actions.xml (this is the WiX source stored on github.com).

Extract: Inlining the content you specifically asked for:

<actions xmlns="http://schemas.microsoft.com/wix/2003/04/actions">
  <..>
    <action name="AppSearch" sequence="50" InstallExecuteSequence="yes" InstallUISequence="yes" />
  <..>
</actions>

Answer: So I think the answer is that WiX defines the order of most standard actions in this source file (actions.xml). The order does not have anything to do with the MSI API outright - but only a few other configurations would make sense or be allowed. Hence the MSI API impose the restrictions that apply. These standard actions must relate to each other in a standard order - with some leeway.

Exceptions: The standard action RemoveExistingProducts can be moved to a few different locations - as an example of the "leeway". That particular standard action is missing from the above (actions.xml) file - and probably for that reason: it has no fixed, default positioning. It has (at least) 3 configurable ones. I would assume it is handled dynamically deep in the linker code (light.exe).

Roll Your Own?: I believe it is not impossible to compile your own WiX binaries with a different standard action sequence number default scheme, but compiling WiX is no small task.

WiX 4: Note that in WiX 4 the corresponding source file appears to be at: https://github.com/wixtoolset/wix4/blob/develop/src/libs/WixToolset.Data/Data/actions.xml


From the MSI SDK:

The restrictions on standard action sequencing are described in the links below. It appears AppSearch sequencing is unrestricted - third link below):

Stein Åsmul
  • 39,960
  • 25
  • 91
  • 164
  • If it is defined by Wix, for me case it seems, if it annoy me enough, as we have a few projects using the same pattern, I might just sent a bug report and in the mean time change only the AppSearch Sequence number in our MSI project. – Paul L Aug 31 '18 at 00:40