Win32 Application Online Update (Manually)

Anyone knows that updating such that distributed application is a boring activity, especially for those who have tons of PCs. It can make peoples from IT department wasting their times to upgrading client application. Moreover, looking forward email contain application attachment from software vendor also can bring much troubles for wide company and I mean this is an old-fashioned way. Why don’t you just suggest the vendor to change the update method with an online way? But for this, you need to make sure that the client PCs has internet capability so that you only have to tell the operator to download the update.

The update method is very simple and I did this to one of my client across Jakarta. It’s easy for them to update and me as the software developer to publish the application. Any latest update, I just store it to my domain immediately. How to do that? Look at image simulate the process below:



The process is quite plain; just tell the application to generate a link in any latest version available from web server, but simply ignore the priors so that it will only show the fresh version link. Got that? Ok, let say that you have an online web server named abc.com. Next, prepare a single web based script to generate a link if there is any newest version on hand (on this example, I used PHP script and named it with app.php). Now, the question is, how the scripts can detect and compare between current version and others up-to-date? Well, it’s as simply as that app.php needs to catch what the current application version is. This means that you need to retrieve current version number from the program and make it as a parameter when the URL has navigated to app.php. In case I used Borland Delphi for this test, so I drop-in a TWebBrowser component in a form and let it navigate to http://www.abc.com/app.php?v=1. The "1" number refers to current version application.


const InfoNum = 10;
InfoStr: array[1..InfoNum] of string = ('CompanyName', 'FileDescription', 'FileVersion', 'InternalName', 'LegalCopyright', 'LegalTradeMarks', 'OriginalFileName', 'ProductName', 'ProductVersion', 'Comments');


procedure TFAbout.FormShow(Sender: TObject);
var S: string;
n, Len, i: DWORD;
Buf: PChar;
Value: PChar;
Begin
S := Application.ExeName;
n := GetFileVersionInfoSize(PChar(S), n);
if n > 0 then
begin
Buf := AllocMem(n);
Memo1.Lines.Add('VersionInfoSize = ' + IntToStr(n));
GetFileVersionInfo(PChar(S), 0, n, Buf);
for i := 3 to 3 do
if VerQueryValue(Buf, PChar('StringFileInfo\040904E4\' + InfoStr[i]), Pointer(Value), Len) then
WebBrowser1.Navigate('http://www.abc.com/app.php?v='+Value);
FreeMem(Buf, n);
end;
end;


Done with client application, now it turns to PHP script app.php. The app.php consist of comparison between both current version (delivered from client via TWebBrowser component) and others up-to-date version. Take a look at completely app.php below:

<?
$v=$_GET['v'];
?>
<html>
<head>
<title>Download Update</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body bgcolor="#E4E4E4">
<em>Current Version: <?=$v?></em><strong><br>Download Update</strong>:<br>

<?php
$wrong=0;
$right=0;
if ($handle = opendir('.')) {
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != ".." && $file !="app.php") {
$file_zip = substr($file,0,1);
$file_tmp = substr($file,1,1);
if ($file_tmp>$v && $file_zip=="v")
{
$right++;
echo "&#8226; <a href='$file'>$file_tmp</a> (" . filesize($file)/1000 . " Kb)<br>";
}
else $wrong++;
}
}
closedir($handle);
}
if ($right==0 && $wrong>0) echo "-"; // shows �-� if no update available
?>
</body>
</html>



Store both of app.php and latest zipped application (v2.zip on sample) in a same path over the web server. At last, try to do a test.



Voila, those little scripts now works helping IT department from updating application task over the internet and buried the ancient way. The above scripts can be expanded to do various things for your Win32 application. Good day and don’t forget to leave your comment here.

Labels: , , , , , ,

  Post a Comment Bookmark and Share

Accessing Nokia OVI Mail from Outlook Express

Do you ever see those left banner right up on NOKIA Indonesia website? It’s a door prize offered to anyone who use free OVI email service. This time NOKIA would like to introduce this latest service and – anyway - the promotion looks great since the lottery will be drawing in every month from August to December 2009 with pretty fair rewards. Just check it out the requisite and follow the instruction to register and signing up to OVI. Once you have been registered to OVI, your ovi.com mail will be available.



Especially to whom has preferred email address, accessing OVI mail as your secondary mail from browser is unusual behavior, unless you have this as your primary email. But if you has multiple mail addresses and already manage it with mail client such as Outlook Express, checking out inbox will be much simpler. This article will explain on how to setting up OVI mail within Outlook Express so that you can retrieve and sending mail from it without need to open the mail from browser.

Create new account from Outlook Express and give with your name. Also fill with complete email address on address name column with youraccount@ovi.com.



Select IMAP (OVI doesn’t support POP3) and type imap.mail.ovi.com as incoming mail server. Whereas the Outgoing mail server is smtp.mail.ovi.com. Don’t forget to set the authentication for the outgoing mail server.



Note that both of incoming and outgoing mail server is using SSL port. So, make sure that you have to fill the port number with 993 for IMAP incoming and 465 for outgoing.



Ok, that’s it. It’s enough for the configuration & now is the time to make a trial. Go for icon Send and Receive All from Outlook Express & select the appropriate link for your OVI client name. If the synchronization is going well, make a turn to try sending a mail.



In my first attempt, the retrieval & sending test is success with above configuration. Please make a try & comment here.

Labels: , , ,

  Post a Comment Bookmark and Share

Happy Ied-Day 1430H

The editorial staff of paparadit.blogspot.com would like to say:

"Happy Ied-Day 1430H, Minal Aidzin Wal Faidzin, Please forgive me with all your heart"

I'll meet you again here with latest article based on my best experiences on early October. Thanks for passing by.

Labels: , ,

  Post a Comment Bookmark and Share