Stephan Grieger - GUI Computing
Distribution of applications, to a wide range of users in an organisation, has always been somewhat of a pain to the majority of developers. Whenever there was an update to an executable, or the data in a look-up table was modified, developers would often need to distribute the new files to clients over the enterprise.
With the advent of Visual Basic 4.0 and using Enterprise features such as remote OLE, this job became significantly easier as you could store the application on a server with the data and all of the application's components. However, catering for users that were not on the LAN and/or in remote places still posed a problem.
The approach we often employed was to create patch disks that would install themselves and update all the necessary files and tables. This, over time, became a bore and we weren't always sure which version a site was running, whether they had the latest copy of all the reference, or look-up, tables, etc. It was time to get serious.
One of our projects had offices all over the country. Many of these offices were not connected to the LAN nor even Mail via RAS. Yet we still required the ability to send them updates of executables, look-up tables and data. To make matters worse, the client wanted to be able to take advantage of the fact that an office was on the LAN or on Mail. This meant that we couldn't really make a one-size-fits-all solution.
Or could we? We didn't really want to have to write code to cater for each different distribution method. We also wanted to be able to send not only data but executables. As we were thinking about how to do this in a simple one application solution, I received a mail message asking for a certain file. I simply attached the file the mail message and sent it down the line. (BING!). That feeling of the penny dropping is one of the most beautiful in the world isn't it?
An Exchange clone would enable us to create a message, enter recipients, attach files and tables and specify the transport mechanism all in one application. And why not re-develop Exchange, I've cloned nearly everything else in Windows? Let someone else come up with the interface and let us give the client working solutions quickly I say.
So, the next question was how to package these changes into a format that we can send via Mail, LAN or Floppy Disk. The tables were easy, simply place the new tables into a distribution database, attach some commands to the table and unpick at the other end. The executables were a slightly different matter. We could attach them as they were but then we had to distribute several files and we only really wanted one - max two.
Thankfully, Visual Basic allows us to read in files as binary and then store the data inside a memo field, which we could then read back in and write to disk. So there we had it, a really simple solution which would enable us to distribute just about anything we wanted. We could even include a subject text which would display on the user's computer when the download was complete.
In all of this, we did actually employ some rather nifty technology. Below is sort of a summary of what we did and some of the problems we encountered along the way.
Attached to this article is distrib.zip (161Kb), which is the full source code of the distribution engine which you can then modify for your own purposes. To use the source, you will require Colllist.VBX (supplied), MHGLBX.VBX, MHSplit.VBX, Push.VBX (supplied) and TList.VBX.