| InstallerContactSite Map |
Advanced Installer User Guide | |||
How to check if a TCP port is free by using a custom action? |
AnswerIf you install a server application that uses TCP IP protocol for communication is better to know before installation starts that the port you want to use is free. Using Advanced Installer you can make this check using CheckTCPPort predefined custom action.
Bind the port Edit control to the AI_BIND_TCP_PORT property. The Check TCP Port custom action gets the port that will be checked from AI_BIND_TCP_PORT property.
Call the Check TCP Port custom action when the "Next" button is clicked. To do that the "Next" button must publish a DoAction control event with "CheckFreeTCPPort" argument. Verify the return of the check and display a message if the port is used by an other application. Do not go to the next dialog in the chain if the port is used. To display the message create a new spawn dialog and publish a SpawnDialog control event.
Sample Project
|




