We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

AlexanderAnishchik
Posts: 18
Joined: Fri Jan 10, 2020 10:54 am

MySQL port discovery

Hi, I need to install MariaDB (the same as MySQL) with my program. I've added MySQL msi file as prerequisite for application but now I need to figure out if MySQL already running on some of predefined ports (3306, 3307, 3308). How Can I achive that? Should I write custom action or use some of Enterprise AI features?
Thanks
Catalin
Posts: 7853
Joined: Wed Jun 13, 2018 7:49 am

Re: MySQL port discovery

Hello Alexander,

You do not have to write your own custom action for this. You can use our predefined custom action "CheckFreeTCPPort".

Please have a look on our How to check if a TCP port is free by using a custom action article for more information about this.

Also, more information about the custom action itself can be found in our "Custom Actions list - Check TCP Port" article.

Hope this helps.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
AlexanderAnishchik
Posts: 18
Joined: Fri Jan 10, 2020 10:54 am

Re: MySQL port discovery

Thanks. What if I want to check several tcp ports? And one more questions: Is it possible to run one inline powershell script created in AI from another one?
Catalin
Posts: 7853
Joined: Wed Jun 13, 2018 7:49 am

Re: MySQL port discovery

Hello Alexander,

There are two ways in which you can check more TCP ports:

1. You can add multiple "CheckFreeTCPPort" custom actions and, after each custom action is executed, have another "Set Property" custom action which will set the value of a property to the value of AI_PORT_TEST_RES property. Basically, you need to save the value of AI_PORT_TEST_RES property in another property due to the fact that each time the custom action is executed, that property will be overwritten.

2. You can follow the approach described in the "Check multiple ports" thread.
Is it possible to run one inline powershell script created in AI from another one?
Unfortunately, this is not possible. This is only possible from a C++/VBS custom action (through the MsiDoAction and Session.DoAction methods).

Hope this helps.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
AlexanderAnishchik
Posts: 18
Joined: Fri Jan 10, 2020 10:54 am

Re: MySQL port discovery

Thanks! I'm using your suggestion about several custom actions in a row but now I need to put them before installation of prerequisites. The time to execute takes around 2-3 sec. I can't bind it to Next button because I want to use Basic UI level for Pre-install. Where should I put these custom actions?
The basic Pre Install UI overlaps progress text. Why so?
Attachments
Screenshot_3.png
Screenshot_3.png (898.41 KiB) Viewed 3789 times
Catalin
Posts: 7853
Joined: Wed Jun 13, 2018 7:49 am

Re: MySQL port discovery

Hello Alexander,

In order to achieve that, you can add your script as a custom action without sequence and then schedule it as an "Init Event" in the "PreparePrereqDlg" dialog ("Dialogs" page --> "Pre-instlall UI")
The basic Pre Install UI overlaps progress text. Why so?
In what regards this, I am not quite sure why this happens. Can you reproduce it constantly?

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”