Re: What do "Start xyz" options for "On Failure" do?
Re: What do "Start xyz" options for "On Failure" do?
- Subject: Re: What do "Start xyz" options for "On Failure" do?
- From: Paul Cook <email@hidden>
- Date: Thu, 26 Feb 2009 14:38:07 -0600
Again, thanks very much for your help. No, I didn't temper with them.
Unfortunately, JavaScript isn't a language that I have yet learned.
Looks like I need to buy a good book and learn it. If anyone has a
suggestion on a good book that would be relevant to PackageMaker, I'm
interested.
I asked my wife, who does embedded programming for a living, but her
JavaScript experience wasn't recent and it was limited to a web
interface on a piece of networking gear. So she wasn't sure either.
Anyway, Is the following what you had in mind?
Best Wishes,
Paul
I tried a couple more things, but I think this is still the same
version we were discussing.
Before:
<?xml version="1.0" encoding="utf-8"?>
<installer-script minSpecVersion="1.000000"
authoringTool="com.apple.PackageMaker" authoringToolVersion="3.0.3"
authoringToolBuild="174">
<title>Bug Demo</title>
<options customize="always" allow-external-scripts="no"
rootVolumeOnly="false"/>
<script>
function pm_choice1_selected() {
result = true;
result = result && (choices.choice2.choice2Property ==
false);
result = result && (choices.choice3.choice3Property ==
false);
return result;
}</script>
<choices-outline>
<line choice="choice1"/>
<line choice="choice2"/>
<line choice="choice3"/>
</choices-outline>
<choice id="choice1" title="Choice1"
selected="pm_choice1_selected()">
<pkg-ref id="com.pretendco.bugDemo.choice1.pkg"/>
</choice>
<choice id="choice2" title="Choice2" start_selected="false">
<pkg-ref id="com.pretendco.bugDemo.choice2.pkg"/>
</choice>
<choice id="choice3" title="Choice3" start_selected="false">
<pkg-ref id="com.pretendco.bugDemo.choice3.pkg"/>
</choice>
<pkg-ref id="com.pretendco.bugDemo.choice1.pkg" installKBytes="0"
version="1" auth="Root">file:./Contents/Packages/choice1.pkg</pkg-ref>
<pkg-ref id="com.pretendco.bugDemo.choice2.pkg" installKBytes="0"
version="1" auth="Root">file:./Contents/Packages/choice2.pkg</pkg-ref>
<pkg-ref id="com.pretendco.bugDemo.choice3.pkg" installKBytes="0"
version="1" auth="Root">file:./Contents/Packages/choice3.pkg</pkg-ref>
</installer-script>
After (Changes in lines 9 & 10 only):
<?xml version="1.0" encoding="utf-8"?>
<installer-script minSpecVersion="1.000000"
authoringTool="com.apple.PackageMaker" authoringToolVersion="3.0.3"
authoringToolBuild="174">
<title>Bug Demo</title>
<options customize="always" allow-external-scripts="no"
rootVolumeOnly="false"/>
<script>
function pm_choice1_selected() {
result = true;
result = result && (choices.choice2.choice2Property ==
selected);
result = result && (choices.choice3.choice3Property ==
selected);
return result;
}</script>
<choices-outline>
<line choice="choice1"/>
<line choice="choice2"/>
<line choice="choice3"/>
</choices-outline>
<choice id="choice1" title="Choice1"
selected="pm_choice1_selected()">
<pkg-ref id="com.pretendco.bugDemo.choice1.pkg"/>
</choice>
<choice id="choice2" title="Choice2" start_selected="false">
<pkg-ref id="com.pretendco.bugDemo.choice2.pkg"/>
</choice>
<choice id="choice3" title="Choice3" start_selected="false">
<pkg-ref id="com.pretendco.bugDemo.choice3.pkg"/>
</choice>
<pkg-ref id="com.pretendco.bugDemo.choice1.pkg" installKBytes="0"
version="1" auth="Root">file:./Contents/Packages/choice1.pkg</pkg-ref>
<pkg-ref id="com.pretendco.bugDemo.choice2.pkg" installKBytes="0"
version="1" auth="Root">file:./Contents/Packages/choice2.pkg</pkg-ref>
<pkg-ref id="com.pretendco.bugDemo.choice3.pkg" installKBytes="0"
version="1" auth="Root">file:./Contents/Packages/choice3.pkg</pkg-ref>
</installer-script>
On Feb 24, 2009, at 10:33 PM, Stephane Sudre wrote:
On Mon, Feb 23, 2009 at 5:42 PM, Paul Cook <email@hidden>
wrote:
I don't intend to reward your help with more work. So feel free to
ignore these, unless you want to do otherwise. Also, I only ran the
installers far enough to see the effect, not to install anything.
Although, except for littering up the root of your partition, I
don't expect they would do any harm.
Flat Test Case
The first, flat, test case has three choices and only choice1 has
any requirements. I find the fact that you do things on failure of
the test conditions to be a bit confusing. But my goal was to write
requirements such that choice1 will become unselected if choice2 or
choice3 are selected. Since choice2 and choice3 have no
requirements, there is no infinite loop possible.
The one big problem with this test case is that I can't seem to get
choice1 to be selected as an initial condition. If the requirements
are deleted, the Initial State options of the Configuration pane
seem to apply. But when I add these requirements, they do not seem
to have any effect. Otherwise, this seems to work largely as
expected.
The code generated by PackageMaker is incorrect if the package has not
been tampered with after build.
The code refers to choice2Property and choice3Property attributes that
just do not exist.
If you fix the .dist result by replacing them with selected, you get
the result you're looking for.
TEST CASE NESTED
This test case has two sets of choices. Choicesa with subchoices
choice1 through choice3 and Choicesb with subchoices choice4
through choice6.
The choices in choicesa all have requirements that one (or at least
I) might expect to implement a radio button behavior. Selecting any
one of the three of them causes the other three to become unselected.
As above, I can't figure out how to make one of them selected as an
initial condition. But even stranger, selecting any of the choices
in Choicesb causes all the choices in Choicesa to become
unselected. Since there are no requirements referencing choices in
Choicesb, it isn't clear why selecting them should should have this
effect.
The distribution script for this case lacks definitions for some
functions that are used to determine the state of choices.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Installer-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden