I think it's not recommended to connect to the database of server A, with a install script on server B, because you have to include your db-password then...
You could send the install script to a page on server A that inserts something in the database (like the IP of server B or something..) But when server B is offline, it has no use.
I think it's easier to log how many times your file is downloaded.
And if you have time: make an install script, that requires a 'product key', you can count how many product keys are requested. This is because you don't want to count the users that download your programm, but never install it.