HienHo
Posts: 13
Joined: Thu Feb 25, 2021 6:46 am

Website binding with a hostname

Tue Mar 02, 2021 2:11 am

Hi AI,

I was trying to bind a published website with a host name to the local IP address (https://www.advancedinstaller.com/user- ... nding.html) so that when the installer is complete, it would launch http://www.test.com in the browser:

Below was my website binding from within AI:
Host name: www.test.com
Port number: 80
IP address: 127.0.0.1

And in the Custom Actions, I used OpenURL with the URL - http://www.test.com
But it didn't work (hostname was not being resolved).

Please advise. Thank you.

Regards,
Hien

HienHo
Posts: 13
Joined: Thu Feb 25, 2021 6:46 am

Re: Website binding with a hostname

Tue Mar 02, 2021 5:27 am

In addition to the below, would it be possible to assign the IP address to the IP address of the machine that it's installing from? Thanks.

Regards,
Hien

Catalin
Posts: 6542
Joined: Wed Jun 13, 2018 7:49 am

Re: Website binding with a hostname

Wed Mar 03, 2021 3:54 pm

Hello Hien,

When is the "OpenUrl" custom action scheduled?

Please note that your website is installed towards the end of the installation, therefore you need to schedule your custom action after that.

A solution to this could be adding the custom action without sequence and then triggering it from the "Finish" button from the "ExitDlg" dialog.
In addition to the below, would it be possible to assign the IP address to the IP address of the machine that it's installing from? Thanks.
In order to achieve this, you can create a custom action that takes the IP address from the machine and then store it in a property. After doing so, you can use that property in the "IP address" field.

Hope this helps!

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

HienHo
Posts: 13
Joined: Thu Feb 25, 2021 6:46 am

Re: Website binding with a hostname

Tue Mar 09, 2021 5:48 am

Hi Catalin,

Please find attached a sample aip that illustrates the attempt to assign a hostname to a local IP address and to launch the website when the install is complete. Could you please advise if I have missed out any crucial steps?

And how do I "...create a custom action that takes the IP address from the machine and then store it in a property"?

Thanks a lot in advance.

Regards,
Hien
Attachments
Deploy-Website.zip
(511.42KiB)Downloaded 221 times

Catalin
Posts: 6542
Joined: Wed Jun 13, 2018 7:49 am

Re: Website binding with a hostname

Thu Mar 11, 2021 5:43 pm

Hello Hien,

Thank you for the provided sample project.

When trying to launch a website that is installed locally, please note that the "hosts" file may also need to be updated with the IP binded to the hostname.
The computer file hosts is an operating system file that maps hostnames to IP addresses. It is a plain text file.
The hosts file can be found in the following location:

Code: Select all

C:\Windows\System32\drivers\etc
IP.png
IP.png (19.73KiB)Viewed 5690 times
hosts file.png
hosts file.png (58.92KiB)Viewed 5690 times
CorrectBinding.png
CorrectBinding.png (69.92KiB)Viewed 5690 times

As you can see, now, after the installation, the binding is correctly done, despite the fact that there is a parsing error with the file (most likely, due to a missing resource on my machine).
And how do I "...create a custom action that takes the IP address from the machine and then store it in a property"?
Regarding this, some other users may also find this useful, therefore I will try to create a more comprehensive guide. Please give me some more time and I will update this thread as soon as the guide will be online.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

HienHo
Posts: 13
Joined: Thu Feb 25, 2021 6:46 am

Re: Website binding with a hostname

Thu Mar 11, 2021 11:12 pm

Hi Catalin,

Thank you for your response. Much appreciated.

So I gather that Advanced Installer doesn't map a hostname with ip address during the install? And this step needs to be manually done?

Regards,
Hien

Catalin
Posts: 6542
Joined: Wed Jun 13, 2018 7:49 am

Re: Website binding with a hostname

Fri Mar 12, 2021 2:35 pm

Hello Hien,

Here is the article I have mentioned in my previous thread.

Local IIS Website - automatic IP assignment to Hostname

Hope that will be of help for you!
So I gather that Advanced Installer doesn't map a hostname with ip address during the install? And this step needs to be manually done?
Advanced Installer does that.

However, in case of locally installed websites that are not available on the internet just yet , the "hosts" file will also need to me modified. Normally, a website that is available on the internet will have its hostname and ip address binding by the DNS.

You can find more information about this in the following StackOverflow thread:

Is DNS server And Host file Are different?

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

HienHo
Posts: 13
Joined: Thu Feb 25, 2021 6:46 am

Re: Website binding with a hostname

Sun Mar 14, 2021 11:20 pm

Thank you very much Catalin for the detailed article and response. Awesome.

Regards,
Hien

Catalin
Posts: 6542
Joined: Wed Jun 13, 2018 7:49 am

Re: Website binding with a hostname

Tue Mar 16, 2021 3:19 pm

You are always welcome, Hien!

It is always my pleasure to help! :)

I have noticed your answer to my other thread. I will have a look over it soon and I will follow you up there.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”