I want to detect java at the pre-install phase,if not existed install it deponding on the platform name from a file named java-$platform_name. I've tried this :

<actionGroup>
<actionList>
    <actionGroup>
        <actionList>
            <showProgressDialog>
                <title>Installing files</title>
                <actionList>
                    <runProgram>
                        <program>${installdir}/java/java-linux</program>
                        <programArguments></programArguments>
                    </runProgram>
                </actionList>
            </showProgressDialog>
            <runProgram>
                <program>tar</program>
                <programArguments>xzf ${installdir}/java.tar.gz -C ${installdir}</programArguments>
            </runProgram>
        </actionList>
        <ruleList>
            <platformTest type="linux"/>
        </ruleList>
    </actionGroup>
    <actionGroup>
        <actionList>
            <showProgressDialog>
                <title>Installing Java</title>
            </showProgressDialog>
            <runProgram>
                <program>${build_project_directory}//jre-7u17-windows-i586.exe</program>
                <programArguments></programArguments>
            </runProgram>
        </actionList>
        <ruleList>
            <platformTest type="windows-x86"/>
        </ruleList>
    </actionGroup>
    <actionGroup>
        <actionList>
            <showProgressDialog>
                <title>Installing Java</title>
            </showProgressDialog>
            <runProgram>
                <program>${installdir}/java/java-windows-x64.exe</program>
                <programArguments></programArguments>
            </runProgram>
        </actionList>
        <ruleList>
            <platformTest type="windows-x64"/>
        </ruleList>
    </actionGroup>
</actionList>
</actiongroup>

but when i run the installer it says : "unknow error while running". OS : Windows XP

asked 05 Mar '13, 07:44

Moatez%20Bouhdid's gravatar image

Moatez Bouhdid
1112
accept rate: 0%


The above XML does not look fully correct - the version for windows-x86 tries to run JRE from ${build_project_directory}, which is not valid at installation time. This should probably be ${installdir}/java/jre-7u17-windows-i586.exe.

Installing Java in silent mode requires specifying certain flags - for example:

<programArguments>/s REBOOT=Suppress</programArguments>

Also, installing Java for entire system may cause problems - such as requiring the user to close all of their browsers and removing previous Java runtimes, which may be required for legacy software. We recommend shipping your own version of JRE. This is described in more details in Bundling a JRE section of InstallBuilder user guide.

link

answered 06 Mar '13, 08:29

wojciechka's gravatar image

wojciechka ♦♦
7.8k61122
accept rate: 26%

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:

×38
×36
×8
×4

Asked: 05 Mar '13, 07:44

Seen: 2,132 times

Last updated: 06 Mar '13, 08:29