After several months of educating people that Menu Strip is not RIBBON, I have realized that most people do make that association unconsciously. To avoid any confusion, we have decided to pull the plug on the menu-strip. From the next version of GCF (and VTK Designer); you wont find the menu-strip anymore. Good old toolbar and menubar is good 🙂
In this blog I want to explain how the Software Updater module works in GCF. Towards this I have written a example program – “A simple browser”. The simple browser program provides a main-window with a address-bar (QLineEdit), where you can type a URL and the QWebView below shows the corresponding page. When the simple browser is launched, it shows up like this.
Suppose that I have deployed this application and have a whole lot of people using it. I then want to release updates for this application that should automatically download and install. What do I do?
The Software Updater module in GCF is meant to solve this very problem. The main() function of the browser code has the following code snippet.
GCF has a new built-in component called UpdaterComponent. Before initializing the component we
- Specify the primary server site from where updates can be downloaded. In this case it is the serversite directory within the local file system. It can be a HTTP or FTP location
- Enable/Disable third party update sites. This means you can have applications that can look for updates from other sites also
- Set the frequency of update-finding. Here it is ‘ApplicationStartup’. It can be ‘ApplicationStartupButOnceADay’, ‘UponUserRequest’, ‘OnceInAnHour’ etc…
- Once GCF figures out updates hosted in different sites, it creates a unified (dependency resolved) list of updates. You can configure GCF to automatically download all updates in the list, or just critical updates or even present a dialog box to the user for selecting updates to install. In this example we set the update strategy as ‘SelectAllUpdates’.
Server sites have to host a special file called Updates.xml and list out all the updates served from it. For the ‘simple browser’ example, the Updates.xml looks like this.
Since GCF is based on Qt, which is a cross-platform thing; you can have compressed update files (GVZ files) for each architecture/os-platform combination. Updates.xml should also specify the baseline version against which updates in that server can be installed. GCF provides a tool called ‘CreateGVZ’ to compress a directory into a GVZ file and a tool called ‘ExtractGVZ’ to extract contents of a GVZ file. Each compressed GVZ file contains
- Shared objects, libraries, XML files, config files etc pertaining to the update
- An Install.js script that describes how the update should be installed.
Shown below is a sample Install.js script for the ‘BookmarkComponent’.
The script basically contains a DoInstall() method that performs the update installation. ‘System’ and ‘FileSystem’ objects are provided by environment within which the script is executed. The environment is called ‘UpdateInstaller’ which is explained later in this blog
Now coming back to the code, when GCF::UpdaterComponent::initialize() is called, GCF
- Checks if there are updates in the download queue from the last session. If yes, the downloading of updates is resumed. This means that the user need not have to keep a session active until all updates have been downloaded. Updates can be downloaded over several sessions.
- Depending on frequency of update-finding, GCF spawns a thread and starts looking for updates
- After making a a unified (dependency resolved) list of updates, it then spawns yet another thread and begins downloading selected updates from their respective server sites. Ofcourse the update-strategy is taken into consideration
For communication between threads and between sessions of the same application, GCF::UpdaterComponent creates a special directory called Update within which it dumps all logs, temporary files, downloaded compressed updates and so on. Downloaded updates are dumped into this directory.
Next time when the GCF app is restarted, it checks whether there are any updates that were downloaded in the previous session. If yes, then the user is asked whether he wants to install the updates. If the user responds yes; then a separate process called ‘UpdateInstaller’ is launched and the GCF all quits. UpdateInstaller then installs the updates and restarts the application.
Let me show how this works with the ‘Simple Browser’ example. When I launch the program for the first time, it looks for updates in the primary server site and downloads updates into a special internal directory. Now when I select “Updates” -> “Preferences” you can see that GCF reports 2 available updates.
When the program is restarted, the user is asked…
If the user responds yes, the the ‘simple browser’ application quits and launches the ‘UpdateInstaller’ program, which installs the downloaded updates.
Upon clicking ‘Ok’, the ‘simple browser’ application is restarted.
Now when you look into go to Updates -> Preferences -> Installed Updates, you will notice this
The software updater module dumps sufficient information about its runtime into a log file, which is basically a HTML file.
Even the ‘UpdateInstaller’ dumps information about its runtime into another log file. These log files can be studied to figure out if there were any issues while finding, downloading and installing updates.
Cool module isnt it? If you like it, drop us an email. Checkout a copy of GCF from this SVN location to see all thisfor your self. SideNote: the module is not fully tested yet, so dont bet on it to work perfectly right now
SVN location: https://svn2.hosted-projects.com/vcreatelogic/GCF2/trunk/GCF
GCF is a application development framework for building large applications. Most real world apps out there automatically update themseleves whenever a new version is released by their vendor. We did not want apps developed using GCF to lag behind in this, so since early February this year, we have been working on a new module for GCF called “Software Updater”.
I always wanted to have an updater framework for GCF, but then there were several other things that needed to be completed first. So updater always got postponed. Our company worked on a project called “KDUpdater”, which is currently (or is going to be) a part of KDTools package from KDAB. While working on KDUpdater, I kept telling Till and Mirko (of KDAB) that I wanted to have a updater module for GCF at somepoint. They were very supportive of it too. So much so that when we started working on the Updater module for GCF, they happily gifted some code (like FileDownloaders) from KDUpdater for use within GCF. KDUpdater and GCF have similar backgrounds, but the implementation and architecture are very different.
After about 2 months of development effort, today I saw some success. Before I describe the success itself; let me give a link to the draft documentation of the Updater Module in GCF here. If you update from the SVN today you will find in examples/UpdaterExample some code that will demonstrate the updater in action. I will blog more about this at some point in the near future after we have more test results. We are planning to release a new version of GCF in July 2009, according to the roadmap announced here.
The Software Updater module in GCF is a multi-threaded one. We needed a neat mechanism to serialize log messages from different threads within the updater module into a single log file. Very recently I used log4cxx in a project. Ifound it very interesting and useful. Initially we thought of wrapping log4cxx in Qt for GCF; but then we decided to provide a simple Qt only logger module. Which is where GCF::Logger and friends come into picture. Take a look at this brief doc on the Logger Module in GCF.
I was always a movie addict. I always wanted to have a proper home theatre, as in a PVR like theatre at home!
About 4 months ago we bought a Sony DVD Player + 5.1 Channel Speakers. To be more precise, we bought this for our home.
I got the system fit into my living room with the help of electricians and carpenters. Eventually I had a good music system and DVD player. But still watching movies on a small 29 inch TV was not much fun. I mean the sound was larger than life like; but the video was not. So I decided to go for a Plasma LCD. It did not take much time for me to realize that those things cost a real lot of money :-(.
I was speaking about this with my former boss from Linux Learning Centre, Mr. Ramesh Kumar. He is my gadget-guru. He has an idea about practically everything electronic on this planet; and no I am not joking. He suggested that I go for a home cinema projector that can be connected to my DVD player. Actually he gave me the Acer projector that he uses at his office for a couple of days, just to play around with. When I connected the projector to my DVD player and watched the projected movie on a wall in the living room; I had made up my mind. That evening I demonstrated the setup to my wife and convinced her. Actually I did not have to do much convincing because she is a bit of a movie freak herself ;-).
Then I went back to Mr. Ramesh Kumar and started budgeting the whole thing. We both infact visited Hansa Pictures. My colleague Kiran also came with us to Hansa. We looked at a few projectors and projector screens. Finally I zeroed in on Optoma EP721 and Grandview 50″ x 67″ pull down instalock screen. I also bought a 10 meter HDMI cable to connect the projector to my DVD player. It turns out that the cost of (projector + 83 inch screen + cable+ dvd-player + installation service) is much less than the cost of a 40 in LCD TV!!! (
Once all of these things showed up at my place, Mr. Ramesh Kumar helped arrange for people that can fit all of this into place. I guess the images below will tell you the story.
Had it not been for Kiran, my cousin Adithya, Tassaraj from LLC and my house keeper Shivanna; I would have had a very very tough time installing these things. Anyways, after all this circus, we now have the screen in our living room that can be rolled open when needed and rolled up when not.
The projector is connected to the DVD player via a 10 meter long HDMI cable. So now all I have to do is start the projector and play a DVD 🙂
I got to tell you, the experience is fantastic 🙂 Its not PVR like, but this thing will do until I actually build my house with a theatre in it.
It has been 51 days since VTK Designer 2.7 was out (on 23rd Feb). We have had close to 1000 downloads (binary, source and pdf put together) since then! In the same period the new version of GCF got 360 hits. We know of quite a few open-source project groups that are using GCF directly from the SVN, but then there are those that we dont know of as well.
Considering that version 2.6 of VTKD received only 500 downloads in 4 months, 1000 downloads is less than 2 months is quite a feat! From the support emails that we receive, it is quite clear that we are gaining more and more users from the Academia.
I am teaching a course on OpenGL programming to Computer Science Engineering students in VTU, through its EDUSAT program. In my next class I am supposed to teach rendering of fractal images/models in OpenGL. While preparing for the class, I was intruigued by Sierpinski triangle and pyramid. After writing the OpenGL code for my class, I thought of introducing the same in VTK Designer. Here are the results..
The code for both of these is now available in VTK Designer SVN. I plan to add more such fractals 🙂