Getting the TCP Port of an existing website

Got a problem you cannot solve? Try here.
Post Reply
Justin
Posts: 16
Joined: Wed Jan 12, 2011 3:40 am

Getting the TCP Port of an existing website

Post by Justin »

Hi

I am in the process of creating an installer to install an IIS website. But i need to give the user the option to install onto a New Site, Existing website or a virtual directory. After using the Get IIS Site list to get the existing sites is there any way to retrieve the TCP Port for the selected existing website?

I have so far tried the Get IIS Site Property but have been unsuccessful ("ServerBindings") :( im beginning to think that this may not be possible?

Im currently using IIS6 but would like the installer to run on IIS7 too.

Any help on this would be great.
giaviv
Posts: 2039
Joined: Fri Dec 17, 2010 1:39 pm

Re: Getting the TCP Port of an existing website

Post by giaviv »

Dear Justin,

A few issues have been discovered lately while working with IIS 6/7 in InstallAware. What I would suggest you to do as a work-around is the following:

1) Call iisweb.exe / appcmd.exe in IIS 6 and 7 (respectively) in order to query information about your website.
2) Redirect the output of these commands to a text file.
3) Read that text file and parse it to retrieve the TCP port.

I am attaching a sample project that retrieves the TCP port and supports both IIS 6 and 7, I hope it is helpful.

Best
Attachments
IISGetTCPPort.zip
(8.82 KiB) Downloaded 1224 times
Aviv Giladi
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
Justin
Posts: 16
Joined: Wed Jan 12, 2011 3:40 am

Re: Getting the TCP Port of an existing website

Post by Justin »

Hi Giaviv

Thats brilliant, thank you so much! was very helpful indeed.

:D
giaviv
Posts: 2039
Joined: Fri Dec 17, 2010 1:39 pm

Re: Getting the TCP Port of an existing website

Post by giaviv »

Dear Justin,

You are welcome! Glad to help. Please let me know if you have any more questions.
Aviv Giladi
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
mikel
Posts: 4
Joined: Mon Mar 07, 2011 7:23 pm

Re: Getting the TCP Port of an existing website

Post by mikel »

Is there a way to get the TCP port (MD_SERVER_BINDINGS in metabase) for IIS5.1?
giaviv
Posts: 2039
Joined: Fri Dec 17, 2010 1:39 pm

Re: Getting the TCP Port of an existing website

Post by giaviv »

Dear mikel,

I think that the MD_SERVER_BINDINGS metabase property is a complex variable - am I correct?
Aviv Giladi
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
mikel
Posts: 4
Joined: Mon Mar 07, 2011 7:23 pm

Re: Getting the TCP Port of an existing website

Post by mikel »

I'm not sure if its complex or not... Maybe the more direct question I should have posted is "How do you get the TCP Port number under IIS 5.1?"
giaviv
Posts: 2039
Joined: Fri Dec 17, 2010 1:39 pm

Re: Getting the TCP Port of an existing website

Post by giaviv »

Dear mikel,

If the MD_SERVER_BINDINGS doesn't work, you will have to use the example I attached above.
Aviv Giladi
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
mikel
Posts: 4
Joined: Mon Mar 07, 2011 7:23 pm

Re: Getting the TCP Port of an existing website

Post by mikel »

MD_SERVER_BINDINGS does not work, and I tried the sample above, but does not work on IIS5.1
giaviv
Posts: 2039
Joined: Fri Dec 17, 2010 1:39 pm

Re: Getting the TCP Port of an existing website

Post by giaviv »

Dear mikel,

I touched up the IISGetTCPPort example to add support for IIS 5. Enjoy!
Attachments
IISGetTCPPort.zip
(10.09 KiB) Downloaded 2157 times
Aviv Giladi
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
mikel
Posts: 4
Joined: Mon Mar 07, 2011 7:23 pm

Re: Getting the TCP Port of an existing website

Post by mikel »

Spot on Aviv!!
giaviv
Posts: 2039
Joined: Fri Dec 17, 2010 1:39 pm

Re: Getting the TCP Port of an existing website

Post by giaviv »

No worries - good luck!
Aviv Giladi
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
Post Reply