PDA

View Full Version : CheckHTTP Connection



NewsArchive
01-01-2008, 11:29 AM
Are there any known problems with the Web Script Function "Check HTTP
Connection"

I routinely get a return value of : 503010049 when I call the following
scrip line

Set Variable %_SB_RETURN% to FUNCTION:Check HTTP Connection
"http://www.enercalc.com"


Thanks !

Mike

NewsArchive
01-01-2008, 11:29 AM
Mike,

You have to define a valid page. For example:

http://www.enercalc.com/index.html

Just checked it and it returns 0 in your case.

--
Friedrich Linder
Lindersoft
www.lindersoft.com
+1.954.252.3910

"point. click. ship" - that's SetupBuilder 6.7
Create Windows Vista ready installations in minutes

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
01-02-2008, 12:22 PM
Thank you.

The docs don't directly say that. It says "The Check HTTP Connection
function lets you determine whether a given URL is valid or not. It attempts
to open a connection to the URL by downloading the HTML page.". As you know
in most cases the server will return the default page."


The title of the procedure says that it is checking for a connection, not
the existence of a page.

May I suggest changing this procedure to a more pure form of checking that
the user has an http connection on the computer as the name implies -or-
looking for ANY response from an IP address outside of the local computer?

What do you think?

In my case I am just checking to see if the Internet connection exists
before proceeding with my web updating process.

I know my point it somewhat moot because I can always put a specific file at
a specific URL for testing, but the function is defined in general terms and
no mention of needing a file spec is given.

Thanks Friedrich,

Mike

NewsArchive
01-02-2008, 12:23 PM
Hi Mike,

You are right. When I answered the question, I already noticed that the
"Check HTTP Connection..." documentation is "suboptimal". Changed now,
thank you.

The most reliable way to check if a HTTP Connection is possible (and see if
the Internet connection exists) is to download from the server (that's why
all installation tool vendors use that method).

Friedrich

NewsArchive
01-02-2008, 12:25 PM
Mike,

I have attached a source code demo which demonstrate the use of the WinINet
InternetGetConnectedStateA API from a SetupBuilder 6.7 installation script.

Of course, I would *never ever* use the values returned by that function to
see if the Internet connection exists. IMO, the built-in "Check HTTP
Connection..." is the best solution because it tells you if an Internet
connection exists and can guarantee that a connection to a specific host can
be established.

I have posted the project to demonstrate the power of SetupBuilder.

Friedrich

NewsArchive
01-03-2008, 03:06 AM
WOW !

Thank you Friedrich.

As alw

michael d. brooks