[izpack-user] Relative path errors while using refpack

147 views
Skip to first unread message

Hemal Shah

unread,
Mar 11, 2010, 5:29:14 PM3/11/10
to us...@izpack.codehaus.org
Hello,

We have couple of projects and we are planning to use Izpack to install all projects in single installer.
We have refpack.xml for each project and main project's install.xml includes those using refpack element.

Main insaller project's config xml is located at c:\p4ws\depot\release\installer\install.xml
Child project's(triggersystem)  config xml  is located at c:\p4ws\depot\release\triggersystem\2\x\refpack.xml

When I run child project (triggersystem) individually, it works. It's pack has single fileset entry as shown below.
                <fileset dir="target/classes/" targetdir="$INSTALL_PATH/classes" includes="**"/>

But when I include that project in main installer project using following refpack element  it throws invalid directory ("target/classes") error.   Detailed error message is at bottom of the email.
            <refpack file="../triggersystem/2/x/refpack.xml" />

It does find relavant refpack.xml and it tries to execute filseset copy task. But it fails because it is trying to lookup target\classes  dir as relative to main installer project instead of triggersystem project.
I cannot give absolute path in as source directory in fileset element of triggersystem because user can checkout the code under any directory.

I even tried with ./target/classes in dir attribute but got same error.

Can some shed some light what I am missing?

I was thinking that when izpack compiles reference packs, it would treat refpack.xml's directory as current directory for executing task under refpack.

--------------- Error Message ---------------------------------------

C:\p4ws\depot\release\installer>compile install.xml

.::  IzPack - Version 4.3.3 ::.

< compiler specifications version: 1.0 >

- Copyright (c) 2001-2008 Julien Ponge
- Visit http://izpack.org/ for the latest releases
- Released under the terms of the Apache Software License version 2.0.

-> Processing  : install.xml
-> Output      : install.jar
-> Base path   : .
-> Kind        : standard
-> Compression : default
-> Compr. level: -1
-> IzPack home : C:\dev\apps\IzPack\bin\..

Adding resource: IzPack.uninstaller
Setting the installer information
Setting the GUI preferences
Adding langpack: eng
Adding resource: flag.eng
Adding content of jar: file:/C:/dev/apps/IzPack/lib/standalone-compiler.jar!/bin/panels/HelloPanel.jar
Adding content of jar: file:/C:/dev/apps/IzPack/lib/standalone-compiler.jar!/bin/panels/TargetPanel.jar
Adding content of jar: file:/C:/dev/apps/IzPack/lib/standalone-compiler.jar!/bin/panels/PacksPanel.jar
Adding content of jar: file:/C:/dev/apps/IzPack/lib/standalone-compiler.jar!/bin/panels/InstallPanel.jar
Adding content of jar: file:/C:/dev/apps/IzPack/lib/standalone-compiler.jar!/bin/panels/FinishPanel.jar
-> Fatal error :
   install.xml:74: Invalid directory 'dir': target/classes/
com.izforge.izpack.compiler.CompilerException: install.xml:74: Invalid directory 'dir': target/classes/
        at com.izforge.izpack.compiler.CompilerConfig.parseError(Unknown Source)
        at com.izforge.izpack.compiler.CompilerConfig.addPacksSingle(Unknown Source)
        at com.izforge.izpack.compiler.CompilerConfig.addPacksSingle(Unknown Source)
        at com.izforge.izpack.compiler.CompilerConfig.addPacks(Unknown Source)
        at com.izforge.izpack.compiler.CompilerConfig.executeCompiler(Unknown Source)
        at com.izforge.izpack.compiler.CompilerConfig.main(Unknown Source)
        at com.izforge.izpack.compiler.Compiler.main(Unknown Source)

Thanks,
Hemal Shah
install.xml
refpack.xml

Kjell Braden

unread,
Mar 14, 2010, 7:40:31 AM3/14/10
to us...@izpack.codehaus.org
On 11.03.2010 23:29, Hemal Shah wrote:
> It does find relavant refpack.xml and it tries to execute filseset copy
> task. But it fails because it is trying to lookup target\classes dir as
> relative to main installer project instead of triggersystem project.
> I cannot give absolute path in as source directory in fileset element of
> triggersystem because user can checkout the code under any directory.

Hi,

I'd suggest making all paths in the refpack relative to the main
projects xml. In case you need to compile the single installer on it's
own you can use the -b switch of the IzPack compiler to specify
"c:\p4ws\depot\release\installer\" as the base directory.

HTH
-Kjell

signature.asc

Hemal Shah

unread,
Mar 15, 2010, 7:13:59 PM3/15/10
to us...@izpack.codehaus.org
Thank you Kjell. That worked.
I think it would be very nice feature to have that automatically changes current directory as per ref pack xml location.
Reply all
Reply to author
Forward
0 new messages