Checking multiple Ports. - Advanced Installer Community

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!

SubZero
Posts: 63
Joined: Mon Mar 14, 2011 10:29 am

Checking multiple Ports.

Hi all,
I found this tutorial that shows how to check if a tcp port is free: http://www.advancedinstaller.com/user-g ... -port.html
In our software we need to check multiple ports. Is it possible to extend the given example to check multiple ports without creating a dialog for every port? We would like to have all ports configured in one dialog.
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Checking multiple Ports.

Hello,

If you want to have multiple input boxes for multiple ports, you can use a custom action to call the "Check TCP Port" UI Custom Action several times for each port.
Please note that the AI_BIND_TCP_PORT property is set after each Check TCP Port call.

In a C++ DLL, installer public properties can be accessed with MsiGetProperty and MsiSetProperty functions.
If you are using a C++ DLL Custom Action you can call "Check TCP Port" using:

Code: Select all

MsiDoAction(hInstall, _T("YOUR_CUSTOM_ACTION"));
In VBScript, installer public properties can be accessed like this:

Code: Select all

' read
value = Session.Property("PROPERTY_NAME")

' write
Session.Property("PROPERTY_NAME") = value
In a VBScript custom action you can call "Check TCP Port" using:

Code: Select all

Session.DoAction("YOUR_CUSTOM_ACTION");
All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”