Skip to content

Instantly share code, notes, and snippets.

@dasrecht
Last active January 1, 2016 15:09
Show Gist options
  • Save dasrecht/8162576 to your computer and use it in GitHub Desktop.
Save dasrecht/8162576 to your computer and use it in GitHub Desktop.
BitTorrent Installer Deconstruction
/**
* Skip the offer if the current country is not within this list.
*/
var cList = ["AU", "AT", "BR", "CA", "DK", "FI", "FR", "DE", "HK", "IN", "IE", "IT", "KR", "MX", "NL", "NO", "SG", "ES", "SE", "CH", "TW", "GB", "US"];
var country = window.installer.getenv("COUNTRY");
if (country !== "??") {
var ret = cList.filter(function(c) {if (c == country) {return c;}});
if (ret === undefined || ret === null || ret.length === 0) {
window.installer.log("Country not supported by offer");
window.installer.forward();
return;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment