Old 1st March 2013, 21:21   #1
BubbaBubbs
Junior Member
 
Join Date: Mar 2013
Posts: 1
HTTPHelper plugin (or, how to send an HTTP Request?)

Does anyone know the status of the HTTPHelper plugin for NSIS?

Several months ago, I downloaded HTTPHelper.dll. Unfortunately, I forgot where I downloaded it from. I am now trying to Google it, but cannot find any mention of it. I would like to know the following:

1. Has HTTPHelper been maintained? Who's the author?
2. Where can I download it from?
3. Documentation
4. Is the source code available?

I ran 'strings' on HTTPHelper.dll, and found "Copyright (C) 1999-2012 Mark Russinovich", but am not sure if he is, indeed, the author. I pinged Mark at http://blogs.technet.com/b/markrussinovich/contact.aspx, but have not heard back.

Here's what I am struggling with:
In my NSIS installer, I am using

HTTPHelper::SendHttpRequest <URL>

to send simple InstallerStart and InstallerFinished status logs to my server. I do not need to process the HTTP response. The important thing, however, is that the User-Agent header of the HTTP request be the same as that of IE that's installed on the machine (for technical and business reasons.)
This works fine on Windows XP, Vista, 7, and IE 7-through-9.
On Win8/IE 10, however, the User-Agent for the above HTTPHelper::SendHttpRequest is:

Mozilla/5.0 (compatible; MSIE 9.0)

even though if I'm browsing using IE it correctly sets

Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0)

This is probably because the various User-Agent string seem to be hardcoded – "strings HTTPHelper.dll" shows:

Mozilla/4.0 (compatible; MSIE 6.0)
Mozilla/4.0 (compatible; MSIE 7.0)
Mozilla/4.0 (compatible; MSIE 8.0)
Mozilla/5.0 (compatible; MSIE 9.0)

I am hoping that the up-to-date version of HTTPHelper would correctly set User-Agent to MSIE 10.0. Or, if I could get a hold of the source code maybe I could fix it and recompile it.

Also, I doubt there is a way to programmatically set/force the User-Agent header because the only three exported functions of HTTPHelper.dll are SendHttpRequest, OpenFirefox, OpenInternetExplorer. I have tried calling OpenInternetExplorer [<URL>] hoping that User-Agent would be correctly set if I sent by HTTP request by launching IE. But I can't get OpenInternetExplorer (or OpenFirefox) to work. I probably got the syntax wrong but, again, I don't have the documentation.

Does anyone know if there is another NSIS plugin that would allow me to accomplish the goal?

Thanks
BubbaBubbs is offline   Reply With Quote
Old 3rd March 2013, 07:29   #2
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
I have never before heard of this plug-in. I had no idea Mark Russinovich even uses NSIS. It seems like you're out of luck though, as Microsoft hired him to hide most of his work on the Windows internals. I'm not sure why that would include HTTPRequest though...

You can do this manually with InetC and the /USERAGENT flag.

http://nsis.sourceforge.net/Inetc_plug-in

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump