Delphi Handbooks Collection


Delphi XE Handbook


Delphi 2010 Handbook


June 4, 2007

Auto Updating and Tracking Users

A question I'm asking myself is how (and how much) to track users, while they updating my Delphi application (or asking for updates).

A follow-up to the problem I posed last week about an Auto Updating Delphi Application (and for which I got a large amount of feedback, without having had time to implement any... hopefully next week). A question I'm asking myself is how (and how much) to track users, while they updating my Delphi application (or asking for updates).

This is the scenario: I want to distribute this application as much as possible, so I don't want to ask for an email of each user downloading it, or anything of that sort. However, I'd love to have some idea of its users base. One of the options is to track the users while they ask for an update (in the current implementation, each time the program starts and there is an active Internet connection). In practice, this works by default, as I'll get hits to the file with the version number(s) and can use Apache logs to create my own stats. However, I could use a little more information.

In theory, I could append to the request a user name / email asked while configuring the program. This seems very unfriendly, as far as the users privacy is concerned. Another option, which is my current favorite, is to generate a unique GUID for each "installation" and pass that ID in the incoming URL. This way I could easily count the requests I get in a day for each "unique" user and know how many "different" users have started the program... without having any real information about the users and better respecting their privacy. I guess a small disclaimer id due anyway.

On the other hand, I could write a simple server to process the data right away, instead of using off-line stats, but I don't want to pose a useless burden on the server (you know, in case the programs becomes very popular <g>). I'm also thinking of hosting the program download at some external site... but hosting the check for updates externally might eventually make sense...

I guess this is something many of you had to tackle... and I'd like to know what you have done and what you suggest in my scenario.





 

5 Comments

Auto Updating and Tracking Users 

I'd go the unique token way, I use a combination of 
the pc name and then values from:

HKLM\HARDWARE\DESCRIPTION\System\CentralProcessor\0
\~Mhz 
HKLM\HARDWARE\DESCRIPTION\System\SystemBiosDate 
HKLM\HARDWARE\DESCRIPTION\System\VideoBiosDate
Comment by Mark Robinson [http://www.dundeemedia.com] on June 4, 19:50

Auto Updating and Tracking Users 

I have done this before and ended up with the 
following solution. The application uses a well-known 
static end point that contains nothing more than a 
configuration file (mine is xml) that contains 
pointers to updates, application server end points, 
etc. Each user is assigned a GUID during first 
execution that is not removed during an uninstall (if 
you have a lot of users you will have 
uninstall/install sequence as a general purpose 
configuration fix eventually).

When making a request for the above version 
configuration file the application appends the user 
GUID as well as the current version number (build #) 
of the application making the request as query 
parameters. The parameters do nothing since it is a 
static file but ensures the log file is populated 
with the necessary data elements. This makes it quite 
easy to extract the logs and determine usage and 
version distribution patterns.

The pointer for the version upgrade is actually a 
reference to another xml configuration file that 
describes the update more completely (including 
pointers to betas). The application includes the same 
query parameters as before but this lets me redirect 
to the actual download where I have it currently 
hosted as well as more easily establish upgrade paths 
that are being followed. Knowing the percent of users 
you have on each version makes sure you focus your 
upgrade testing where it needs to be.
Comment by Ryan VanIderstine [http://www.run-time-systems.com] on June 4, 20:33

Auto Updating and Tracking Users 

I've got a Delphi app which users can download from my
website.  It auto-updates by checking my website on
startup, and downloading a new InnoSetup installer if
a newer version exists.  My program then runs the
installer silently. The installer sends a message to
my app to shutdown so that the installer can complete
successfully.  After the installer completes, it
starts my application again.
From a tracking point of view, I use Google Analytics
on my website, which can track which versions of my
app users have downloaded.
When the update installer finishes, it opens a browser
window pointing to a "Congratulations, you've updated
to version X" page on my website, which then means
Google Analytics can tell me how many people have
automatically updated to the latest version of my app,
as opposed to new users who will just have downloaded
the installer manually.
Comment by Conor Boyd [http://gloss.ildica.com] on June 5, 01:04

Auto Updating and Tracking Users 

Hi Marco,

The quickest way for me is to generate an GUID too.
For addition I'm preparing and XML file which is
uploaded to an asp page which automatically uploads
the xml data to sql server.

Let me explain:
the xml could like like
<MyAppUserInfo>
 <UserID>[GUID]</UserID>
 <RegisteredEMail>user@some.net<RegisteredEMail>
 <UsedVersion>1.00</UsedVersion>
 <UpdateTo>1.21<UpdateTo>
 <UpdatedDate>12/12/2006<UpdateDate>
 ..... [whatever you want else] ....
</MyAppUserInfo>

in aps page:
(Sorry, I had to write that with c# by managers
request but it must be clear enough. In pasting code I
also skipped a lot of checks and try catch blocks for
shortness):
...
// 
if (Request.Files.Count == 1)
{
  HttpPostedFile PostedFile = Request.Files[0];

  using (SqlBulkCopy BulkCopy = new
SqlBulkCopy(System.Web.Configuration.WebConfigurationManager.ConnectionStrings["DBConnectionString"].ToString()))
  {
    DataSet dataSet = new DataSet();
    dataSet.ReadXml(PostedFile.InputStream);
    BulkCopy.DestinationTableName = "[ATableName]";
    BulkCopy.WriteToServer(dataSet.Tables[0]);
  }
...

In practice you can send this XML file during updates
or periodically or all the time. For me it works as
collecting which parts of application user uses and
time to time uploading it if user agrees to do that.
Comment by Georgi hadzhigeorgiev on June 5, 13:23

Auto Updating and Tracking Users 

Hi Marco,

we have developer a "simple" system for auto updating
and traking for our application.

It's SOA REST based, require only port 80 for work and
track all check and download in firebird database.

There is a technical explanation in dedicated web page.

this is the link
http://www.bittime.it/site/bitupdater/index.php

(sorry Italian only)

Comment by Daniele Teti [http://www.bittime.it] on June 19, 15:25


Post Your Comment

Click here for posting your feedback to this blog.

There are currently 0 pending (unapproved) messages.