I need to install the Java component, and then run a program and present choices based on the program results. I would then write their choice to a file.

Can I do this AFTER install has finished, and before the final page is presented? If so, how?

thanks!

asked 20 Mar '12, 11:10

bstoke's gravatar image

bstoke
16222224
accept rate: 0%


You can add a <choiceParamter> and configure it to appear just before the final page:

<parameterList>
    ...
    <choiceParameter>
        <name>choice</name>
        <description></description>
        <explanation>Please select an option</explanation>
        <value></value>
        <default></default>
        <allowEmptyValue>1</allowEmptyValue>
        <displayType>combobox</displayType>
        <insertBefore>installationFinished</insertBefore>
        <ordering>default</ordering>
        <width>30</width>
        <optionList>
        </optionList>
        <postShowPageActionList>
           <writeFile>
             <path>${installdir}/selected_option.txt</path>
             <text>${choice}</text>
           </writeFile>
        </postShowPageActionList>
    </choiceParameter>
    ...
</parameterList>

And add the choices using the stdout of the program:

<postInstallationActionList>
    <runProgram>
        <program>${installdir}/some/command</program>
        <programArguments></programArguments>
    </runProgram>
    <addChoiceOptionsFromText>
        <name>choice</name>
        <text>${program_stdout}</text>
    </addChoiceOptionsFromText>
</postInstallationActionList>

The code above assumes the returned stdout is in the format expected by the <addChoiceOptionsFromText> action (you can find the details here). If it is not the case, you can use a combination of a <while> and <setInstallerVariableFromRegEx>. You can find some examples in the above-mentioned article.

link

answered 20 Mar '12, 11:21

juanjo's gravatar image

juanjo ♦♦
5.8k413
accept rate: 23%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×36
×11
×5

Asked: 20 Mar '12, 11:10

Seen: 1,974 times

Last updated: 20 Mar '12, 11:21