I am looking for the simplest way to get notified when successful installation of a program takes place somewhere. My application is Java based and has Java installer, I could easily put up a client to do any http call with any parameters, this is not an issue. My problem is on the other side - I've got hosted web site and I want direct all traffic there, but I'm not familiar with that part of the programming world :) It would be nice if each successful installation would dump a records in the database (I've got MySql integrated on site). Another options is to send me an email, or at least tail into a log file. The simpler the better. Either would be fine. Can anybody suggest an approach? I know a little bit of PHP and perhaps would be able to do some simple stuff, but without an example or starting point, it's very easy to get lost in today's web technologies maze :)
Do you want to count all installations of your application? Then "Calling home" is not the proper way to go about things. Why don't you just count the downloads of your application? If someone downloads it, the one is usually installing it, too.
If you are more interested in potential bugs in your installer, you can compose a report and send it to your server after you ask the user to do this.
Does your web site have logging already? If so, you've already got a log file which you could grep for the appropriate URL. No programming required :) Just don't link to that URL from anywhere else, and you shouldn't end up with any false positives.
Using a PHP script would be pretty simple. You could just pass all the data in the query string:
// For example, just a simple http call to log.example.com/?version=3.4.5b
$version = $_GET['version'];
$dbh = new PDO('mysql:host=localhost;dbname=mydb', 'myuser', 'mypass');
$sth = $dbh->prepare("INSERT INTO log SET version = :version, installed_at = :installed_at");
$sth->bindParam(':version', $version, PDO::PARAM_STR);
$sth->bindParam(':installed_at', time(), PDO::PARAM_INT);
$sth->exec();
I think Jon Skeet has already answered the questions well enough but..
If you do phone home - for politeness sake make sure that you inform the user and ask their permission.
If you don't you may find that you get a bad reputation.