[izpack-user] How to specify default value of INSTALL_PATH variable

1,610 views
Skip to first unread message

Barbara Rosi-Schwartz

unread,
Apr 23, 2012, 8:28:33 AM4/23/12
to us...@izpack.codehaus.org

Hello.

 

When I run my installer, which contains the TargetPanel, the installation path field is automatically filled in with a default path which I have not defined. How do I go about changing that default path in the configuration files?

 

 

BARBARA ROSI-SCHWARTZ

Senior Developer

 

IG Group|Cannon Bridge House

25 Dowgate Hill|London|EC4R ZYA

 

t: +44(0)20 7573 0208 (Direct)

t: +44(0)20 7896 0011 (Switchboard)

w: www.iggroup.com

 



The information contained in this email is strictly confidential and for the use of the addressee only, unless otherwise indicated. If you are not the intended recipient, please do not read, copy, use or disclose to others this message or any attachment. Please also notify the sender by replying to this email or by telephone (+44 (0)20 7896 0011) and then delete the email and any copies of it. Opinions, conclusions (etc) that do not relate to the official business of this company shall be understood as neither given nor endorsed by it. IG Group Holdings plc is a company registered in England and Wales under number 04677092. VAT registration number 761 2978 07. Registered Office: Cannon Bridge House, 25 Dowgate Hill, London EC4R 2YA. Listed on the London Stock Exchange. Its subsidiaries IG Markets Limited and IG Index Limited are authorised and regulated by the Financial Services Authority (IG Markets Limited FSA registration number 195355 and IG Index Limited FSA registration number 114059).

Tim Anderson

unread,
Apr 23, 2012, 8:57:47 AM4/23/12
to us...@izpack.codehaus.org
I don't know about IzPack 4, but in IzPack 5, you can't do it via the configuration files.
You can either:
* set the INSTALL_PATH system property. E.g., on the command line:
    java -DINSTALL_PATH=my-install-path  -jar installer.jar

* set the installation path in code, by invoking the setInstallPath(String path) method of AutomatedInstallData.
   You could do this within an InstallerListener, or a PanelAction, for example.

-Tim

Dustin Kut Moy Cheung

unread,
Apr 23, 2012, 8:59:19 AM4/23/12
to us...@izpack.codehaus.org
Hi Barbara!

In your install.xml, have this

<variables>
    <variable name=TargetPanel.dir" value="haha" />
</variables>

Read this link if you want to be more specific:
http://izpack.org/documentation/panels.html#targetpanel


If you want to define a variables.xml file instead [so that install.xml only contains packs information, and all variables information are placed in a different file, do so:

    <variables xmlns:xi="http://www.w3.org/2001/XInclude">
        <xi:include href="variables.xml"/>
    </variables>


and in variables.xml:

<?xml version="1.0"?>
    <xfragment>
      <variable name=TargetPanel.dir" value="haha" />
    </xfragment>

Hope this helped!

Cheers,
Dustin

Tim Anderson

unread,
Apr 23, 2012, 9:56:49 AM4/23/12
to us...@izpack.codehaus.org
Ah yes - thats probably the same in IzPack 5.0 as well.
However, internally the install path will be populated with the IzPack default value, until it is overridden by TargetPanel.

-Tim

Dustin Kut Moy Cheung

unread,
Apr 23, 2012, 10:45:54 AM4/23/12
to us...@izpack.codehaus.org

So I guess the TargetPanel should be one of the first panels then, to avoid the DEFAULT value being put in $INSTALL_PATH for some panels placed before the TargetPanel.

Barbara Rosi-Schwartz

unread,
Apr 23, 2012, 12:01:42 PM4/23/12
to us...@izpack.codehaus.org

Unfortunately neither one of the two solutions (TargetPanel.dir or env variable) seems to work for me. The TargetPanel keeps on showing izpack’s default value regardless of how early display that panel. I am using IzPack 4.3.4.

 

Any other ideas?

 

Thanks,

B.

Earl Hood

unread,
Apr 23, 2012, 12:15:55 PM4/23/12
to us...@izpack.codehaus.org
On Mon, Apr 23, 2012 at 11:01 AM, Barbara Rosi-Schwartz wrote:
> Unfortunately neither one of the two solutions (TargetPanel.dir or env
> variable) seems to work for me. The TargetPanel keeps on showing izpack’s
> default value regardless of how early display that panel. I am using IzPack
> 4.3.4.

We have the following:

<resources>
...
<res id="TargetPanel.dir.windows"
src="install/default-dir-win.txt"/>
<res id="TargetPanel.dir.unix"
src="install/default-dir-unix.txt"/>
...
</resources>

The referenced text files include the default pathnames to use for the
given OS.

--ewh

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


Barbara Rosi-Schwartz

unread,
Apr 24, 2012, 5:45:57 AM4/24/12
to us...@izpack.codehaus.org
This last solution that uses a resource works for me, thank you very much, Earl!!!

And many thanks also to Dustin and Tim for offering alternatives.

B.
-----Original Message-----
From: earl...@gmail.com [mailto:earl...@gmail.com] On Behalf Of Earl Hood
Sent: 23 April 2012 17:16
To: us...@izpack.codehaus.org
Subject: Re: [izpack-user] How to specify default value of INSTALL_PATH variable

Tim Anderson

unread,
Apr 24, 2012, 5:58:42 PM4/24/12
to us...@izpack.codehaus.org
On 24/04/2012 2:15 AM, Earl Hood wrote:
> On Mon, Apr 23, 2012 at 11:01 AM, Barbara Rosi-Schwartz wrote:
>> Unfortunately neither one of the two solutions (TargetPanel.dir or env
>> variable) seems to work for me. The TargetPanel keeps on showing izpack’s
>> default value regardless of how early display that panel. I am using IzPack
>> 4.3.4.
> We have the following:
>
> <resources>
> ...
> <res id="TargetPanel.dir.windows"
> src="install/default-dir-win.txt"/>
> <res id="TargetPanel.dir.unix"
> src="install/default-dir-unix.txt"/>
> ...
> </resources>
>
> The referenced text files include the default pathnames to use for the
> given OS.
>
> --ewh
That seems very convoluted. A better solution would involve variables e.g.:
<variables>
<variable name="TargetPanel.dir.windows" value="c:/My Install Dir"/>
<variable name="TargetPanel.dir.unix" value="/usr/local/bin"/>
</variable>

I'll JIRA for 5.0.

-Tim
Reply all
Reply to author
Forward
0 new messages