Custom actions not running in order - Advanced Installer Community
aberns
Posts: 1
Joined: Tue Aug 05, 2025 5:51 pm

Custom actions not running in order

Newbie question:
I have three custom actions
1. A powershell script that uses AI_SetMsiProperty
2. A Launch EXE with Working Directory
3. A Message Box.

All 3 are running in the Execute Sequence

The PowerShell script sits after Add Resources/Bind Image
The MessageBox sits after StartServices, and the LaunchEXE is after that.

I have for all of them the option to Wait for custom action to finish before proceeding.

Even though in the logs, it looks like everything is happening in the correct order (I cannot tell for sure) But I can tell that the message box is running before the PWS, because none of the properties from AI_SetMsiProperty are being passed, and the message box appears before the PWS is ran.

What am I missing?
Liviu
Posts: 1419
Joined: Tue Jul 13, 2021 11:29 am
Contact: Website

Re: Custom actions not running in order

Hello Adams and welcome to our forums,

Please note that I've already replied to your e-mail on this matter.

For others who have a similar question, the problem may arise if your custom actions are set to different execution times (for example, one is scheduled to run immediately, and another during the deferred stage).

“Immediate” Custom Actions are executed straight away in the order in which they appear in the sequence. Because this type of Custom Actions run before any change is made to the target system, they cannot refer or rely on any file that is being installed by the MSI package.

You can check the Immediate vs Deferred CustomActions: The Differences article.

Also, setting MSI installer property values works only when the PowerShell script has "Immediate" execution time. It does not work if the execution time is set to "When the system is being modified (deferred)". Also, the properties will be updated after the PowerShell script runs.

Let us know if you have any questions.

Best regards,
Liviu
________________________________________
Liviu Sandu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”