Add net.tcp binding - Advanced Installer Community
artieleech
Posts: 5
Joined: Tue Sep 17, 2013 4:11 pm

Add net.tcp binding

Hi,

Does anyone know how to add a binding for net.tcp in Advanced installer?

I need my web.config to end up with an entry something like:

Code: Select all

<protocolMapping>
    <add binding="netTcpBinding" scheme="net.tcp" />
</protocolMapping>    
I'm looking under the Server / IIS settings, but can't see anything obvious.

Any help much appreciated,

Thanks

archie
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Add net.tcp binding

Hello Archie and welcome to Advanced Installer forums,

Thank you for your interest in Advanced Installer.

Currently Advanced Installer has support only for adding HTTP and HTTPS bindings, other types are not supported. However, in order to achieve what you want you can create your own custom action to add a binding for net.tcp. Also, the custom action should be scheduled after "Install Execution Stage -> Finish Execution" action group.

Also, starting with our next version of Advanced Installer you will have predefined support for adding a binding for net.tcp. We will notify you when this feature will be available.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
artieleech
Posts: 5
Joined: Tue Sep 17, 2013 4:11 pm

Re: Add net.tcp binding

Daniel wrote:
However, in order to achieve what you want you can create your own custom action to add a binding for net.tcp. Also, the custom action should be scheduled after "Install Execution Stage -> Finish Execution" action group.
Hi Daniel, thanks for your feedback.

Ok, so I've used a Custom Action before, but only for renaming files.

How would I use the Custom Action to update the IIS configuration to add another binding?

Thanks

Archie
artieleech
Posts: 5
Joined: Tue Sep 17, 2013 4:11 pm

Re: Add net.tcp binding

Ah, you mean to use Advanced Installer to call out to some command line work?

I think I'm getting there - looks like I need to use appcmd.exe, and something like the following:

Code: Select all

%systemroot%\system32\inetsrv\appcmd set app "Default Web Site/path/to/webapp" /enabledProtocols:net.tcp,http
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Add net.tcp binding

Hello Archie,

Indeed, you can create your own BAT file (file.bat) containing a command line like this:

Code: Select all

appcmd set app "Default Web Site/path/to/webapp" /enabledProtocols:net.tcp,http
After this you can add, in "Files and Folders" page, the file.bat as a temporary file to your installation project. Then, from "Custom Actions" page you can add a "Launch file" custom action with sequence, scheduled as deferred with no impersonation just before "Install Execution Stage -> Finish Execution -> InstallFinalize" standard action, like this:
  • File To Launch: [&file.bat]
    Working Directory: [SystemFolder]\inetsrv
Also, you can take a look on "Command line to add net.tcp bindings in IIS" link which could be useful for you.

If you have any questions let us know.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
artieleech
Posts: 5
Joined: Tue Sep 17, 2013 4:11 pm

Re: Add net.tcp binding

Hi again, Daniel,

Something higher priority came up, so I won't be able to revisit this until next week.

I'll add more feedback on how it goes, later...

Cheers

Archie
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Add net.tcp binding

Hello Archie,

This improvement was added starting with version 10.6 of Advanced Installer released on September 30, 2013. In order to achieve what you want you can add IIS Custom Properties like this:
  • Section: <WebSite>
    Name: bindings/collection

    Section: <WebSite>
    Name: applicationDefaults/enabledProtocols
Also, please keep in mind that for the "bindings/collection" property it is mandatory to select the [...] button, from right side of the "Name" field, and then select "bindings -> collection" property in the "Select an IIS Property" dialog. However, for the "applicationDefaults/enabledProtocols" property you should manually type the text in the "Name" field (without using the [...] right side button). This must be done due to a current Advanced Installer limitation.

If you have any questions let us know.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
artieleech
Posts: 5
Joined: Tue Sep 17, 2013 4:11 pm

Re: Add net.tcp binding

Hi Daniel,

I finally got back round to this project, and I got it working, roughly as we discussed above. I didn't call out to a batch file in the end, because we decided to keep everything in the .aip file.

So, instead, under Custom Behavior, Custom Actions, I added a new action in the Install Execution Stage. This action had Source Type Executable, and the command was:

Code: Select all

[RESULT_PROPERTY_CMD.EXE] /c  %systemroot%\system32\inetsrv\appcmd set app "Default Web Site/Path/To/WebService" /enabledProtocols:net.tcp,http
Thanks for letting me know about this functionality in the later version. Unfortunately, we're only on v9.8 just now. But when we update, we'll try it the other way you suggested.

Thanks again,

Archie
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Add net.tcp binding

You're always welcome Archie.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”