Check port with vbscript - Advanced Installer Community
Tim0n
Posts: 14
Joined: Fri Sep 05, 2014 10:59 am

Check port with vbscript

Hello,

im trying to check (several) ports in a vbscript, but i can't get it to work:

Code: Select all

Session.Property("AI_BIND_TCP_PORT") = "8080"
Session.DoAction("Check TCP port")
MsgBox "RES1: " & Session.Property("AI_PORT_TEST_RES")
Session.Property("AI_BIND_TCP_PORT") = "8090"
Session.DoAction("Check TCP port")
MsgBox "RES2: " & Session.Property("AI_PORT_TEST_RES")
The "AI_PORT_TEST_RES" property is always empty in this procedure.. what im doing wrong? :(

Regards,
Timon
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Check port with vbscript

Hello Timon,

The Check TCP port custom action which allows you to check if a TCP port is free is named CheckFreeTCPPort in the aicustact.dll. You can take a look on the How to check if a TCP port is free by using a custom action? article which may be useful to you.

By the way, Advanced Installer has a predefined Get a free TCP port custom action which allows you to get a free TCP port. Please take a look on the How to get a free TCP port by using a custom action? article with related information for hints and guidance.

Please note that we also recommend you to use a DLL custom action instead of VBScript and you can see some reasons why not to use VBScript .

Let us know if that helped.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Tim0n
Posts: 14
Joined: Fri Sep 05, 2014 10:59 am

Re: Check port with vbscript

Hello Dan,

Thanks for your reply! I will check out the tutorials you linked.

Is it possible to create DLLs with visual studio express? Also with C# or only vb? Last time I used these tools/language is a couple of years ago ;)

Regards,
Timon
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Check port with vbscript

Hello Timon,
Is it possible to create DLLs with visual studio express?
As I know, you can create DLLs using the express version of Visual Studio.
Here's the Options to integrate and debug custom actions article which can help you.

By the way, using the predefined custom actions from Advanced Installer, (e.g. Check TCP port or Get a free TCP port) you don't have to write any line of code.

If there is anything else I can help you with, please let me know.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”