3

We would like to brand a piece of software based on which customer's website it is downloaded from. E.g. by showing the customer's logo etc. All we need is an ID, the software can handle the rest of the customization at runtime based on that.

The number of customizations is potentially large, and we would like to avoid prebuilding and storing these installers.

I'm open to consider all options, especially some out-of-the-box ideas.

I think it is impossible to change a signed installer (exe/dmg) without breaking the signature.

Some ideas I'm toying with (and their trade-offs):

  • Store the ID in the installer download filename (Con: Brittle, browsers might change the name or append a suffix to avoid duplicate names)
  • Ask the user to enter a code shown on the download page (Con: some inconvenience for the user)
  • Provide a zip with installer and config-file next to it (Con: some users will not manage to unzip, or only unzip the installer without the config file)
  • On Linux the installer shell script can be modified at download time, as the script cannot be signed.
  • Set up a server that builds and signs installers on the fly at the time of the download request. To speed this up, it could be yet another installer wrapping the main installer, and it's only task would be to extract and run the main installer with the ID parameter. (Con: complex infrastructure, code signing certificates on the public facing server, very slow for MacOS notarization)
Reto Höhener
  • 5,419
  • 4
  • 39
  • 79

1 Answers1

1

Chromium-based browsers like Google Chrome, Chromium, Opera, Microsoft Edge, etc. save the URL of origin and the referrer URL for all downloaded files on Windows 10 (only on NTFS file systems) and Linux (only on Ext4).

For details see for example here. On Windows the metadata is also accessible from command line or direcly from Java.

There seems to be a similar feature on Mac. See for example this question on superuser.

Accessing this metadata from within your installer could help to customize the behavior of your installer. While the data will not be available in all setups (e.g. Internet Explorer stores only a zone ID and no URL) and may get lost (e.g. a user deletes the data or copies the file to a file system that does not support metadata) it could propably cover the majority of your users. Asking users to enter a code when the metadata is not found could still be used as a fallback.

Main concern I would have with this approach is that the Chromium developers may decide to remove this feature in near future or make it optional, like the developers of wget (see for example here)

On latest Windows 10 I still get the following metadata for a downloaded file with both, latest Google Chrome and Microsoft Edge Browser:

[ZoneTransfer]
ZoneId=3
ReferrerUrl=https://httpd.apache.org/
HostUrl=https://mirror.klaus-uwe.me/apache//httpd/httpd-2.4.46.tar.bz2
rmunge
  • 3,653
  • 5
  • 19