Solved

automatic software update

Posted on 1998-07-31
8
252 Views
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.
0
Comment
Question by:galkin
8 Comments
 
LVL 7

Author Comment

by:galkin
ID: 1320030
Edited text of question
0
 
LVL 2

Expert Comment

by:lucidity
ID: 1320031
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
 
LVL 7

Author Comment

by:galkin
ID: 1320032
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
 
LVL 2

Expert Comment

by:lucidity
ID: 1320033
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 7

Author Comment

by:galkin
ID: 1320034
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
 
LVL 1

Expert Comment

by:payn
ID: 1320035
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
 
LVL 8

Accepted Solution

by:
Answers2000 earned 200 total points
ID: 1320036
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
 
LVL 13

Expert Comment

by:Mirkwood
ID: 1320037
Bought This Question.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
ADO Memory leak with DELPHI 2007 37 170
Folder Comparison 12 53
ffmpeg - "rtsp://...... Operation not permitted" 4 74
has22 challenge 11 78
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now