ckoch
Posts: 13
Joined: Thu Sep 04, 2014 12:46 am

Custom IIS port

I have an installer that creates an asp.net application in iis and we are specifying port 8088. The user may change this after install directly in iis. When they update to a new version of our app, it replaces the old files (ok) but changes the port back to 8088 (not ok). Is it possible to query the user for the port they prefer, or not override the port in use prior to the update?
ckoch
Posts: 13
Joined: Thu Sep 04, 2014 12:46 am

Re: Custom IIS port

I forgot to mention - in Professional. I saw GetFreeTCPPort custom action but don't know how to use that in Professional or detect the port already used before updating.
Daniel
Posts: 8282
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Custom IIS port

Hello,
I have an installer that creates an asp.net application in iis and we are specifying port 8088. The user may change this after install directly in iis. When they update to a new version of our app, it replaces the old files (ok) but changes the port back to 8088 (not ok). Is it possible to query the user for the port they prefer, or not override the port in use prior to the update?
Yes, this is possible. You can use our "Dialog Editor" feature to create a custom dialog on which the user can input the desired port number (for example on an edit box control associated with PORT_PROP property). Then, you can simply add a reference to the PORT_PROP property in the "Web Site Binding" dialog from "Web Site Bindings/SSL Settings" tab. Please keep in mind that our "Dialog Editor" feature is available only starting with an "Enterprise" project type.

If you don't have an "Enterprise" license, then you can create your own UI custom action which will get the user PORT info and save it into an installer property (e.g. PORT_PROP). The custom action can be added as a custom action with sequence after "Install Execution Stage -> Searches" actions group.
I forgot to mention - in Professional. I saw GetFreeTCPPort custom action but don't know how to use that in Professional or detect the port already used before updating.
I'm afraid that in order to add the "Get a free TCP port" predefined custom action you will have to use the "Dialog Editor" feature to add the custom action as a control event on a dialog control. For example you can schedule the custom action to run on a button push.

If you have any questions/doubts just let us know.

All the best,
Daniel


All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
ckoch
Posts: 13
Joined: Thu Sep 04, 2014 12:46 am

Re: Custom IIS port

To clarify then. For first time install, I would create a little application with a ui to ask the user which port they want to use. This would run as a custom action to launch an attached file. The app would somehow pass the port back to the installer property PORT_PROP. And in the IIS setting for binding, rather than putting a port number, I would put the installer property PORT_PROP.

Is that a custom property PORT_PROP? How is it created? How would the app then pass the port back to PORT_PROP?

And for updates, would I run the same app and the user would have to remember what port they were using and fill it in?
ckoch
Posts: 13
Joined: Thu Sep 04, 2014 12:46 am

Re: Custom IIS port

Skip those questions. I have it working from a custom c# dll. It's working great except for one thing. The c# opens a form and asks the user for a port. When that form opens, it shows up behind the installer dialog and not in front of it. The user can't see it unless they see it in the taskbar. How can it be launched in front of the installer window?
Daniel
Posts: 8282
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Custom IIS port

Hello,

Please take a look on our "Application is launched in the background(Windows 7 problem)" thread which debates a similar issue and see if this helps you.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
ckoch
Posts: 13
Joined: Thu Sep 04, 2014 12:46 am

Re: Custom IIS port

I read the post. I spent a couple of hours investigating and trying everything I found and couldn't get it to show on top of the installer.

I'm sure plenty of people have run into this issue. Does anyone have anything concrete that works?
visualsi
Posts: 40
Joined: Fri Oct 14, 2011 4:16 pm

Re: Custom IIS port

Hi,

We do this in our installers.
  • We actually needed the users to give us several different ports when they initially installed the system for different types of traffic (one for outside access, another for access inside the firewall, another for administrative access, etc.)
  • We created Properties on the "Install Parameters" page and it was important that their names were in ALL CAPS, so that they were globally known
  • It was also important that when we set them up on this page, we checked "Set Persistent Property" - I believe you mentioned something about the installer not resetting the value - this will cause it to remember the values they entered in previously
  • In your dialog boxes in the UI, make sure you update your Properties in your "Next" button on the dialog box
  • Make sure you use your properties to update values in your config files and in the IIS Settings and for substitutions in SQL Scrits, etc. As long as the name is in ALL CAPS, you should be OK
Hope this helps,
Rob
ckoch
Posts: 13
Joined: Thu Sep 04, 2014 12:46 am

Re: Custom IIS port

Excellent. Thank you. Setting persistent was what we were missing on our custom property. That part is working great!

Now all we need is to be able to have the custom dll form appear on top of the installer instead of behind it. Which is a professional problem where you don't have the ability to customize dialogs in the installer. Has anyone found a way to get a custom dll form show up in the foreground?
Teodor
Posts: 73
Joined: Thu Jul 25, 2013 9:56 am

Howto get a custom DLL form show up in the foreground?

Hi
ckoch wrote:Now all we need is to be able to have the custom dll form appear on top of the installer instead of behind it. Which is a professional problem where you don't have the ability to customize dialogs in the installer. Has anyone found a way to get a custom dll form show up in the foreground?
We had a similar problem with our Launch file custom actions. The problem was caused by ::SwitchToThisWindow() API that is unpredictable in this area.
The solution for us was replace the call with ::BringWindowToTop().

Best regards
Teodor Micu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”