Getting the TCP Port of an existing website

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

Getting the TCP Port of an existing website

Postby Justin » Fri Jan 14, 2011 10:44 am

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

Postby giaviv » Tue Jan 18, 2011 10:19 pm

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 795 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

Postby Justin » Wed Jan 19, 2011 8:18 am

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

Postby giaviv » Wed Jan 19, 2011 10:49 am

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

Postby mikel » Mon Mar 07, 2011 7:28 pm

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

Postby giaviv » Tue Mar 08, 2011 4:01 am

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

Postby mikel » Thu Mar 10, 2011 5:33 pm

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

Postby giaviv » Fri Mar 11, 2011 11:09 am

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

Postby mikel » Fri Mar 11, 2011 12:06 pm

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

Postby giaviv » Fri Mar 11, 2011 2:28 pm

Dear mikel,

I touched up the IISGetTCPPort example to add support for IIS 5. Enjoy!
Attachments
IISGetTCPPort.zip
(10.09 KiB) Downloaded 1466 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

Postby mikel » Fri Mar 11, 2011 3:22 pm

Spot on Aviv!!

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

Re: Getting the TCP Port of an existing website

Postby giaviv » Fri Mar 11, 2011 4:38 pm

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


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 59 guests