tserg
Posts: 7
Joined: Wed Oct 06, 2021 5:22 pm

How to properly run a custom action after everything was installed

Thu Mar 30, 2023 4:26 pm

hello,

i have a strange issue. I built an installer deploying some dependencies as 'Chained' to be able to setup product using nested MSI rather than full-blown installer. They are IIS Rewrite module and Request Router.

i have to run PS script to enable Request Router. So well I have a custom action to run on the execution time 'After the system has been successfully modified (commit)'.

so i ran into issue - debug output from this action is not in the log file. Something went wrong, but i can't check what happens. Other custom actions are run and logged properly. But without this one.

i selected 'Install', 'First time Install', 'Upgrade' and 'Maintenance' execution stages. This action run as local system.

Liviu
Posts: 1035
Joined: Tue Jul 13, 2021 11:29 am
Contact:  Website

Re: How to properly run a custom action after everything was installed

Fri Mar 31, 2023 2:21 pm

Hello,

I'm not sure why this happens.

In order for us to further investigate this, could you please forward me the following resources:

1. the .AIP (setup project) file
2. the installation log
3. the content of your script (it it is a custom action from file).

by email to support at advancedinstaller dot com?

You can also add the "Write-Output" cmdlet to your PowerShell custom action to find more details about the failure and debug it. If the script is failing at a specific line, try adding a try/catch block around that line to catch any exceptions and log or display them.

More details on the Powershell Custom actions that write to Install Log article.

Hope this helps!

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

tserg
Posts: 7
Joined: Wed Oct 06, 2021 5:22 pm

Re: How to properly run a custom action after everything was installed

Fri Mar 31, 2023 7:20 pm

Liviu, thank you for your help.

i found that specifically in case of settings i posted "Write-Output" cmdlet did not produce output to installer log. It obscured me at first. Later i added own logging functionality and found that custom action runs well. Also it let me found the root cause. I found that AI automatically restart service it replaced with the new binary, even if i add special 'stop service' action.

So this topic may be purged.

Liviu
Posts: 1035
Joined: Tue Jul 13, 2021 11:29 am
Contact:  Website

Re: How to properly run a custom action after everything was installed

Mon Apr 03, 2023 8:45 am

Hello,

Thank you for your follow-up on this.

Let us know if you have any other questions.

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

Return to “Common Problems”