I have an application that needs branding when downloaded in certain continents. When installed in North America, for instance, the application, when run, displays a differe开发者_如何学编程nt logo and company name than in Europe.
The setup file is provided through a PHP script. Presently there is a Inno Setup executable for Windows and a DMG for Mac OS X.
I have seen that when downloading Google Chrome, you can specify whether or not it should send usage statistics. A brief look at the JavaScript that controls it reveals that this is simply sent back to the server with &usagestats=0
or &usagestats=1
.
How would I go about influencing the installation based upon settings specified via the PHP download page?
If you can package different versions of your app depending on the region then you can use some form of IP address to country database that will determine which file the user is allowed to download.
You can use an online service to find out where the user is ( http://www.ip2location.com/ ) or get hold of a database and do your own queries ( several free sources which I can't remember right now ).
For the Chrome example, you can see how they're modifying the installer using the (now open-sourced) Omaha project aka. Google Update.
The documentation shows that they're modifying a portion of the Authenticode digital signature on the downloadable EXE, the downloaded EXE will extract the files, reads the modified Authenticode signature and then launches setup with the desired parameters.
In our company we build multiple (200+) installer "variations" with different parameters embedded or options switched on/off by default. Different installers are tagged with different 'tracking' codes to see how effective the promotion of an individual campaign is. Additionally the same campaign may have multiple installers which are selected depending on what options the user ticked before download (e.g. 32-bit, 64-bit, module A/B/C included)
精彩评论