Re: Using AND and OR in package requirements
site_archiver@lists.apple.com Delivered-To: installer-dev@lists.apple.com Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=npsxlK9lt5xw/eAM+exOSTegdfleEhGlneQWbR9+AJY=; b=GwtRsZiHLOFCjKg3m6bLkqcRHE67hXhsnNaPp4BCEOSEIxQfP2NMuDJfE2tIbtqwkT RrUHHoAs7DXyDCG0v0TE6Ngy0V3PtzNcB+AAFDnJhPrAKXfDm4zNSrYI1wATQQPr42So 8y8gWCOnisgBGyWAXQlYgN7Wa47gmjI0iilTQ= Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=ZF5HyJ+zkJ4z5hE05dD+WYSuB3t7Sru/Pe8gTWMdj2HHxwYCcm3VYKGqisSd00n+dJ SXI+2nVPD00DDXYUdHKyaMBqoUduZ8aEozsMCioHCbUzHFagSKaXxgCcpDvPu5lZd2JA EtnKNHgcaHe2WNN1OL5QYihyHMAaoThMMiE0Q= On Thu, Jan 21, 2010 at 16:37, Iceberg-Dev <dev.iceberg@gmail.com> wrote:
On Jan 21, 2010, at 9:50 PM, Adam Mercer wrote:
Hi
I'm creating an installer for some software that requires either Snow Leopard or Intel Leopard, but will only run on a Snow Leopard system that has a Core 2 Duo processor, (its fine on Core Duo systems running Leopard). I'm trying to work out a way that I can specify this in the requirements section of PackageMaker.app but I can't find a way to build up this requirement.
Is something like this possible with PackageMaker? If so how? If not any ideas how I can achieve this another way?
This is possible but you need to write a custom JavaScript function.
I'm not sure a requirement based on a CPU sub family is a good idea. So I switched it to 2 cores or more.
I mean on Snow Leopard it'll not run on a Core Duo, i.e. on Snow Leopard it requires a 64 bit capable machine, but on Intel Leopard it'll run on a 32bit or 64bit capable machine. The number of cores is irrelevant.
That being said, it could look like this:
function complexRequirement() { if ((system.compareVersions(system.version.ProductVersion, '10.6') >= 0) { // Snow Leopard
if (system.sysctl('hw.ncpu')>=2) { return true; } } else if ((system.compareVersions(system.version.ProductVersion, '10.5') >= 0) { // Leopard
// Leopard can run on PowerPC so we need to exclude them
if (system.sysctl('hw.cputype')==7) { if (system.sysctl('hw.ncpu')>=2) { return true; } }
}
return false; }
How do I go about using such a custom function? Cheers Adam _______________________________________________ Do not post admin requests to the list. They will be ignored. Installer-dev mailing list (Installer-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/installer-dev/site_archiver%40lists.a... This email sent to site_archiver@lists.apple.com
participants (1)
-
Adam Mercer