CheckFreeTCPPort on remote server!? - 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!

PDurand
Posts: 3
Joined: Thu Dec 01, 2011 11:08 pm

CheckFreeTCPPort on remote server!?

Ok so I've tried several ways of accomplishing this, but it seems that at every turn I find serious limits with Advanced Installer's ability to let me do what I want. My task is quite simple, Test if a Port is OPEN or CLOSED for a remote service that needs to be in place when I install my software.

We ask for the HOST and IP, put them into the appropriate variables for the CheckFreeTCPPort UI Custom Action, and it works GREAT as long as the HOST is localhost, but for ANY other host, it fails.

WHY? Why can you not do the same test for a remote host? Can someone assist?

I've tried to write my own .NET executable that does the work, and it returns 0 if its successful, and 1 if it fails. My test works fine, however, the Installer QUITS ENTIRELY if the return value is 1, which makes no sense at all. I want the EXE to act as a UI custom action, not a fatal installer action.

Is there a way to get past this? It would be really nice to be able to do this, I've got 2 methods and they both are close to working, however it falls short on each one....

Thanks,

Phil :evil:
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: CheckFreeTCPPort on remote server!?

Hi Phil and welcome to our forums,

I am not sure why our built-in custom action fails to check when the host is localhost. I shall ask my colleagues from development to investigate on this and et back to you as soon as possible.

Regarding your .NET custom action, I'm afraid this is the standard method of interpreting return codes from custom actions of Windows Installer. It is recommended to set your result into a public property an always make sure the custom action returns 0. To have access to public properties from your .NET custom action
you can try building it as we present in the following article:
http://www.advancedinstaller.com/user-g ... rp-ca.html

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
PDurand
Posts: 3
Joined: Thu Dec 01, 2011 11:08 pm

Re: CheckFreeTCPPort on remote server!?

I'm not sure if you made a typo in your reply, or if you misunderstood what I said.

It works ONLY for localhost. It does not work for REMOTE hostnames/IP addresses. Just so we are clear :P

Thanks for the tip about the properties in .NET, hopefully I can still do this from an EXE and not just by calling a DLL function. I want this to be a UI action, not a installer action. I check in the dialog, but I dont want it to check later when its installing files. It has to stay user friendly.

I'll look further into that part, thanks.
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: CheckFreeTCPPort on remote server!?

Hello,

After discussing the matter with the developer responsible for this custom action, it seems CheckFreeTCPPort can only be used to check local machine's TCP ports.

Because some applications may have elaborated configuration, the AI_BIND_TCP_HOST property can be used to check the port for the exact specified IP( used by the local machine ).

The help article was a little unclear, but we will update it for the future version.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”