WHat is the order in which the managedActions are executed?

Jun 23, 2016 at 1:22 PM

I see that my ManagedActions are not called in a top to bottom order. Could someone explain the order in which the managed action is called?
Jun 24, 2016 at 4:42 AM
The order of custom actions is controlled according MSI action scheduling model, which is not trivial:
  • you need to specify the name of the sequence step you want your action to be executed after (or before).
  • you can also specify that your action is to be executed after/before another specific custom action.
  • you also need to remember that there are more that a single sequence and their actions are scheduled independently.
  • you need to be prepared that if you have a two custom actions scheduled by you for the execution at the same sequence step they will be executed in non-deterministic order.
Yes it is that complicated.

That is why Wix# introduces a much simpler event-driven model:

Inside of the event handler (C# code) you can call you sub-routines and any order your want. Everything is clear and there is no any ambiguity about what and when executed. Read more here: https://wixsharp.codeplex.com/wikipage?title=Managed%20Setup
Jun 25, 2016 at 3:54 PM

So just to confirm what i understand. Is it so that even if i define custom actions in a sequence then also there is no guarantee that it will run in the same order?

I have tried events but the problem was that the operation which i want to perform is quite long and then if i start performong this operation in one of the event then the progress bar and its status halts and it looks like as if the installer is stuck for the user , even though its working in the background. So my question is 1) is it ok to run such long operation in the event, if yes then how to handle the progress UI and if No then please suggezt an alternative.

Jun 27, 2016 at 4:32 AM
> Is it so that even if i define custom actions in a sequence then also there is no guarantee that it will run in the same order?
The simple answer is "Correct".
The only guarantee you have is that the action will be execute before or after the sequence step you nominated. The only way of ordering your actions is to specify your another action as a step. But I personally don't like this option as it's is too inflexible and by far inferior to the routine ordering available with programming languages (e.g. C#).

> ...the operation which i want to perform is quite long...
Then you may want to consider using a custom UI for entertaining the user during that long operation. Thus you can completely customize your ProgressDialog and even have an additional progress bar for that lengthy operation.
Jun 27, 2016 at 7:19 AM
Thank you for taking your time to explain and help. Very appreciated.