Hello Chris,
Thank you for your patience on this and for the provided files.
I have further investigated this and I found the culprit. Both your PowerShell script and the SQL Query are correct (syntax and logic wise). However, the problem here is that the custom action that executes your SQL Query is
skipped (does not execute):
Portion taken from the log generated with a test project:
MSI (s) (A4:88) [17:07:59:236]: Doing action: SqlQueryAction
Action 17:07:59: SqlQueryAction.
Action start 17:07:59: SqlQueryAction.
MSI (s) (A4:88) [17:07:59:246]: Skipping action due to msidbCustomActionTypeFirstSequence option.
Action ended 17:07:59: SqlQueryAction. Return value 0.
What I would like you to notice here is the
msidbCustomActionTypeFirstSequence flag. Basically, this flag is similar to the following option in Advanced Installer:
"Custom Actions" page --> the custom action that executes your query --> under
"Execution Stage Condition" -->
"Advanced execution scenarios ..." hyperlink -->
"Skip action in Install Execution Stage if executed in Dialogs Stage".
If you clicked on the hyperlink I've earlier given, you can notice that it states that:
Execute no more than once if present in both sequence tables. Always skips action in execute sequence if UI sequence has run. No effect in UI sequence. The action is not required to be present or run in the UI sequence to be skipped in the execute sequence. Not affected by install service registration.
With that being said, this is the reason why your custom action is skipped. In order to execute it, please click on the
"Advanced Execution Scenarios ..." hyperlink and check the
"Always execute" radio button.
Quick note: when adding an SQL Query in Advanced Installer, the custom action that executes this query is added automatically in the
Custom Actions page. By default, this custom action is added as shared between the two stages (
"Wizard Dialogs Stage" and
"Install Execution Stage"), therefore the "Skip action in Install Execution Stage if executed in Dialogs Stage" is selected by default. However, if one of the custom actions is deleted (e.g. the one from the
"Wizard Dialogs Page"), by my logic, the option should be changed automatically to
"Always Execute". However, we do not currently do this and this is, as you can see, causing some troubles. An improvement request has already been made in this regard and hopefully it will be implemented in a future version of Advanced Installer.
Hope this helps.
Best regards,
Catalin
FOLLOW US
Get the latest news in Application Packaging