使用 PHP 修改安装文件
我有一个应用程序,在某些大陆下载时需要品牌化。例如,当安装在北美时,该应用程序在运行时会显示与欧洲不同的徽标和公司名称。
安装文件是通过 PHP 脚本提供的。目前有一个适用于 Windows 的 Inno Setup 可执行文件和一个适用于 Mac OS X 的 DMG。
我已经看到当下载 Google Chrome 时,您可以指定是否发送使用统计信息。简单看一下控制它的 JavaScript,就会发现它只是通过 &usagestats=0
或 &usagestats=1
发送回服务器。
我将如何根据 PHP 下载页面指定的设置来影响安装?
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 different 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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您可以根据地区打包不同版本的应用程序,那么您可以使用某种形式的 IP 地址到国家数据库,该数据库将确定允许用户下载哪个文件。
您可以使用在线服务来查找用户所在的位置 ( http://www.ip2location.com/ )或获取数据库并进行自己的查询(几个我现在不记得的免费来源)。
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 ).
对于 Chrome 示例,您可以了解他们如何使用(现已开源) 修改安装程序奥马哈项目又名。 Google 更新。
文档显示他们正在修改 Authenticode 数字签名的一部分可下载的 EXE,下载的 EXE 将提取文件,读取修改后的 Authenticode 签名,然后使用所需参数启动安装程序。
在我们公司,我们构建了多个(200 多个)安装程序“变体”,其中嵌入了不同的参数或默认打开/关闭的选项。不同的安装者被标记有不同的“跟踪”代码,以了解单个活动的推广效果如何。此外,同一活动可能有多个安装程序,这些安装程序的选择取决于用户在下载前勾选的选项(例如 32 位、64 位、包括模块 A/B/C)
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)