views:

328

answers:

1

I have an InnoSetup for my C# application. And I'd like the setup to check for updates before installing (to make sure the user always gets the latest version). To do this, I need a bit of C++ code to parse an xml file from a remote location (which contains a version string) and have a method return it.

From InnoSetup I can call the DLL and compare it to a local variable in the InnoSetup code.

Any clues on how to do this?

+3  A: 

If you have access to the server side, it might be better to not use XML, just return version string. If you can't avoid XML, you should write your C++ code (if that's you question, I suggest using TinyXML), then create a dll export for a function returning the version string.

Tamás Szelei
Thnx, I could do a simple text file with the version string. My c++ is a little rusty, any examples on that? The whole getting a remote file thing is a bit unknown to me.
Zyphrax
If that's the case, you can avoid C++ completely, and do it all in Inno Setup. The Inno Setup Quickstart pack (or what's-it-called) contains ISSI which can be used to start a HTTP request. (You don't need to download a file; you do a request and get a string as a response.)
Tamás Szelei
@sztomi: Could you please edit your answer to include the HTTP request? A short script example would be great!
Treb
Sorry I was mistaken, you can only download a file, and not do a request. I suggest this example: http://www.codeproject.com/KB/install/dotnetfx_innosetup_instal.aspxLook for isxdl_ functions. You can still avoid C++, and read the file using the pascal script.
Tamás Szelei