[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 300
  • Last Modified:

automatic software update

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.
0
galkin
Asked:
galkin
1 Solution
 
galkinAuthor Commented:
Edited text of question
0
 
lucidityCommented:
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?
0
 
galkinAuthor Commented:
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.
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
lucidityCommented:
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.
0
 
galkinAuthor Commented:
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.
0
 
paynCommented:
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.

0
 
Answers2000Commented:
This may not be what you're looking for...but you said "I would prefer reuse existing technologies"

Why don't you use Microsoft SMS (part of back office) to do the distribution ?  It can do what you want out the box and then some.
0
 
MirkwoodCommented:
Bought This Question.
0

Featured Post

2018 Annual Membership Survey

Here at Experts Exchange, we strive to give members the best experience. Help us improve the site by taking this survey today! (Bonus: Be entered to win a great tech prize for participating!)

Tackle projects and never again get stuck behind a technical roadblock.
Join Now