Order of Custom Actions and SQL Scripts - Advanced Installer Community
Dunkelmann
Posts: 3
Joined: Fri Jul 26, 2013 3:21 pm

Order of Custom Actions and SQL Scripts

I've created a custom action that reads a version number from a database into a (global) property. It is executed on Install.

I've used that property value to run or not run some SQL Scripts through the Script Condition.

However it appears that the SQL Scripts are executed before my custom action. So the value has not been set and the Script Condition is thus invalid.

Is it possible to have a custom action executed before the SQL Scripts and if so, how would it be done?

If it is not possible then I assume I can simply embed the controlling logic and sql script execution into the custom action. However it would be nice to use the standard AI mechanism.

Thanks
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Order of Custom Actions and SQL Scripts

Hello and welcome to Advanced Installer forums,

Thank you for your interest in Advanced Installer.

I'm not sure why you encountered this behavior. In order to have a more conclusive answer can you please send us the .AIP (project file) and a verbose log of the installation to support at advancedinstaller dot com so we can investigate them? If it contains confidential information you can send us a small test project which reproduce this behavior.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Dunkelmann
Posts: 3
Joined: Fri Jul 26, 2013 3:21 pm

Re: Order of Custom Actions and SQL Scripts

I've found a work around. I set the property during one of the dialogs. These are "executed" before the SQL scripts.

If possible could AI explain (say here or in the help) the order of execution of Custom Actions and SQL Scripts please. It would be good to know what has been executed before the SQL scripts and what gets executed after.

Thanks.
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Order of Custom Actions and SQL Scripts

Hello,

You should add your custom action with sequence before the “Install Execution stage” >> “Add Resources” group.

Also, you can see which custom action is executed in what sequence if you go in the “Table Editor” page, in the “InstallExecuteSequence” table. Every time you add a custom action in the related page, or a script, a sequence is automatically assigned.
(e.g. for a script there is the “AI_SqlInstall” custom action and its sequence is 5499).

Please note that the “Table Editor” page is only available in a “Enterprise” or higher project.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”