site_archiver@lists.apple.com Delivered-To: installer-dev@lists.apple.com On Feb 27, 2008, at 7:16 PM, Robert Kukuchka wrote: This code is not optimized, buggy and embarrassing. Here's why: - not optimized: result = true; result = true && something; - buggy: AFAIK, the script might be written this way: function pm_choice0_selected() { /* I'm not a Javascript expert so I just kept the result temp var) */ } - embarrassing: my.target.availableKilobytes > 1 * 1024 * 1024 So I checked again and sure enough, I got the same result. So it's yet another bug in PackageMaker 3. my.target.availableKilobytes > 1000000 _______________________________________________ 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... Hi Stéphane, Thanks for the reply. I appreciate the assistance. Just a few follow ups. 1) Ok, so I'll look more into this Installer Plugin idea. I'm not too familiar with it. I found some sample code on ADC, but nothing in the docs. Based on the fact that FLAT packages don't support Installer Plugins, should I then assume this is deprecated technology? You probably would need to contact ADC to get an answer for this question. But the answer would probably be: "We do not discuss technologies or products that are not available yet." Just remember it took Apple 7 years to bring back the "Arrange By" submenu in the Finder contextual menu, so be patient. 3) When I refer to "radial" behavior I'm referring to as follows: If I have selection A, B, and C which are all initially selected. I'm seeing behavior under "custom" installation where if, for example, I deselect A then try to deselect B, A selects itself again. Then I'll try to deselect C and B selects itself again. It's like whack-a-mole. I don't understand why selection of one particular component will affect any other components. Well, it's not really surprising if you consider the distribution script that is created by PackageMaker 3.0.1 when you define a requirement. function pm_choice0_selected() { result = true; result = result && (my.target.availableKilobytes > 1 * 1024 * 1024); return result; } function pm_choice0_enabled() { result = true; result = result && (my.target.availableKilobytes > 1 * 1024 * 1024); return result; } <choice id="choice0" title="Picture 14" selected="pm_choice0_selected ()" enabled="pm_choice0_enabled()"> When you consider that PackageMaker uses multiple pointless animations that eat millions of CPU/GPU cycles and it's not able to check that a value is set to true, it's mind-blowing. I don't think this is clearly documented somewhere (1) but you need to add a my.choice.selected test in your code so that Installer.app runtime remembers the state of your checkbox. Whenever you click a checkbox, all the other checkboxes are updated (because a checkbox state can depend on the states of other checkboxes). result = (my.target.availableKilobytes > 1 * 1024 * 1024) && my.choice.selected test; return result; While I was writing this, I somehow got confused. The script states that the available size should be more than 1 GB (1,048,576 KB unless I'm on drugs) But I remembered selecting the following requirement in PackageMaker UI: if "Megabytes on Target" is ">" "1" For the record, PackageMaker 2.11 is a bit better with Maths (but there's still progress to be made AFAIK): if you select "1GB available on volume" from the Samples popup button, you end up with this script: Honestly, I don't know how to give my opinion on this 3.0.1 release of PackageMaker without being impolite. (1) this has been explained during an old WWDC session and here in the middle of a paragraph: http://developer.apple.com/documentation/DeveloperTools/Conceptual/ SoftwareDistribution/Managed_Install_Definition/chapter_7_section_3.html This email sent to site_archiver@lists.apple.com