We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now


automatic software update

galkin asked
Medium Priority
Last Modified: 2013-11-19
I need to implement automatic software update feature. I want to place INF file, containing information for all up to date version of all client components. Client application would connect to the server and based on INF file will download, decompress and update file on the client. For OLE components solution already exists. It is CoGetClassObjectFromURL that does all these tasks. The problem is that I have to update non-OLE component the same way. I looked at Setup API and found that in general these functions provide me with everything except installing from remote site only from local disk. Is there a link on the Internet with example or could some one give me useful tip how to implement this feature. I want to utilize INF file rather then develop my own protocol.
Watch Question


Edited text of question

You can have a simple GetHttpFile() function get a data file (INF) from your website, the data file would contain information about the lastest upgrade. The program would compare its upgrade and if doesn't have the latest it will download it.

-----MY.INF on site
Version 1.112
File /upgrades/v1.112.zip

-----MY.INF on localhost
Version 1.111

if the client does not have version 1.112 it will download v1.112.zip and do something depending on what you have in the zip file. All you need to do is use a GetHttpFile function (which I can give you if you need it) to get the INF and then get again if you need the zip file.

Is this what you want to do?


I need example of how to parse INF file and decompress updated files. The most important part is how to specify dependency files in INF file and how to handle locked files.

OK, you can read a line at a time from the .inf file. then use strtok() to get the first token in the inf file... make sure you specify terminating characters. As far as the update file goes you would be better off using .CAB files. The CABSDK is on the microsoft site, and I have some source somewhere to use them. Works just like a zip but has c++ implementation (zip you would have to call to DOS or something).

What kind of inf file are you using. the INF file is just a regular text file, if you don't know how to parse a text file RTFM! If you want some source to parse it you better post it up here.


Parsing INF file is only one task. Of cause I can write parser myself but this parser will be custom. Any change in INF file format will affect my parser. I would prefer reuse existing technologies, i.e. use setup API as parser. Also I need clear solution about how to download and replace files. I could download them into temporary files and then replace them but i am not sure this is the most efficient way of doing this. I would like to know what way GoGetClassObjectFromURL does updating OLE server. Ideally I need its functionality execpt I don't need to create object from updated file.

First, the less relevant comment: zip decompression doesn't require a call to DOS. There are free, cross-platform libraries for reading ZIP files. The Info-Zip unzip package comes with complete source code. Much of the code is copyrighted, but you're still free to use it, even within commercial projects. Check http://www.cdrom.com/pub/infozip/ for more information.

As far as the INF format, you don't need to parse it. Call SetupOpenInfFile (if you don't know the name of the .inf file, only the directory it's in--e.g. because you just expanded a random .zip archive--start with SetupGetInfFileList), then use the various Setup functions after that (either SetupInstallFileEx, one by one, or SetupInstallFromInfSection, section by section). That's the easy part.

So here's what you do: You get the file from a URL. That's easy. If it's a CAB you use Microsoft's APIs to go through it; if it's a ZIP you use Info-ZIP; if you want to use .tgz that's just as easy. Once you've gotten your .inf file and all the other files it needs, just use the standard Setup API calls to do your setup.

By the way, I've built the same solution myself a few times, and I've avoided using .cab and .inf because "standards" which change all the time and which are dependent on Microsoft's APIs really aren't of much use to me, unless they make my life much easier. I find it much simpler to FTP a .zip file into a subdirectory of the program's directory (or the Common Files directory or whatever) and expand it... Or to build a real installer program (e.g. using InstallShield) and just have my program download and run it.

Unlock this solution and get a sample of our free trial.
(No credit card required)

Bought This Question.
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.