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:received:received:in-reply-to:references :mime-version:content-type:message-id:cc:content-transfer-encoding :from:subject:date:to:x-mailer; bh=u13ZU7OPX1WfyDV7BijXUKxhe+uiX/wSwxBv70T5hJI=; b=PNwwnF+GB0et9X5LyWRxgf9vJUceChwiq5fvCqnlqfRpNrY9XVoUDYSsz/VLYez0Dy M0eg2oA1fVd3NdjZDRql92NixXd/bPIEBK6mkldqM8mhaQEH0y46eZSDRp2yCrzGvFI4 Nbhq0QlBt1CyZZGwBvmoMNOG9EecQ679xH2F4= Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=in-reply-to:references:mime-version:content-type:message-id:cc :content-transfer-encoding:from:subject:date:to:x-mailer; b=OdG9aph+3FXRluablcPgwGG9VZlvjrHKBG0nidtHMDFGIeWnmOQpexZY3jgYdeOx+W UnAp7scKEHZajLy11zt0F/xfuAnJ3N8K6AvFxOAp85b1wzxbyTGcJsSAcq/XD5lDJcuf 20PgkraCZJvRKzxz3aGTyba8O8qNM3UxJidsY= On Jan 21, 2010, at 11:41 PM, Adam Mercer wrote: On Jan 21, 2010, at 9:50 PM, Adam Mercer wrote: Hi 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 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: if (system.sysctl('hw.cputype')==7) { if (system.sysctl('hw.ncpu')>=2) { return true; } } } return false; } With PackageMaker: 1. Go to the requirements pane 2. Add a requirement 3. Select Result of JavaScript 4. Type the name of the function 5. Set the true/false popupbutton to the value that makes sense. 7. Copy the code With Packages: 1. Go to the Requirements & Resources pane 2. Add a requirement 3. Select a JavaScript requirement 4. Write the function 5. Select the function name in the popup menu. You can define an error message. It can be localized easily. _______________________________________________ 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... On Thu, Jan 21, 2010 at 16:37, Iceberg-Dev <dev.iceberg@gmail.com> wrote: 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. 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. 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 Use the value returned by system.sysctl('hw.optional.64bitops') then instead of the one returned by system.sysctl('hw.ncpu'). How do I go about using such a custom function? 6. Click on the button to display the text editor. You will probably want to write the code in a separate text editor as the text view is very small. You can define the error message in case the requirement is not set. It can not be localized easily. I'm writing this from the top of my mind so the names of the button may be a little bit different. This email sent to site_archiver@lists.apple.com
participants (1)
-
Iceberg-Dev