[izpack-user] Install Location and Generating Log files

746 views
Skip to first unread message

Chetan Dabade

unread,
Dec 31, 2013, 2:20:36 AM12/31/13
to us...@izpack.codehaus.org
I am new to the IzPack (version 4.3.5) installer creation and i am learning the basics of it. I am developing installer which will target Linux machine i have used following files to develop it:

Install.xml and userInputSpec.xml. (Please find attached mentioned files for reference )

Following is the flow of installer:

1  Welcome Screen
2. Configuration Screen  (implemented using userInputSpec.xml)
3. Summary Screen      (implemented using userInputSpec.xml)
4. Install Progress Screen
5. Finish Screen

I have facing the following issues when i try to deploy on Linux machine

1. creation of detailed logging of what are all components have been installed to which location and in addition it should write information of userInputSpec, since i am not using SummaryPanel in my case how should i go ahead. It should create a install.log with detailed information.

2. Again i am not using TargetPanel instead i have customized it under userInputSpec.xml where i am initialing the default to $INSTALL_PATH and i am storing this value in one of the variable, now when i launch installer and proceed to Configuration Details Screen (.i.e. userInputSpec.xml ) enter the required details and by default installation path will be pointing to \usr\local\Demo when i accept the default value and proceed next i am getting a pop "The directory you have chosen either does not exist or is not valid" i need to create a valid directory and provide the path, is this the right way of Izpack behavior ??
and in addition when i provide alternate path (ex: usr/home/install) proceed further, again come back to the configuration screen the path is showing as /usr/local/Installer instead it should usr/home/install please help
 


3. Even during uninstall it showing default path (.i.e usr/local/Installer) though the install location is different when i proceed all files will be deleted form the correct location (.i.e usr/home/installer) but it displays the default path instead of customized path provided during installation.


Please help
--
Thanks and Regards
Chetan V Dabade
+91 9663967000
install1.xml
userInputSpec.xml

Paul Borș

unread,
Dec 31, 2013, 3:10:46 AM12/31/13
to us...@izpack.codehaus.org, us...@izpack.codehaus.org
You have 2 typos:

1) in you install.xml for the SummaryLoggerInstallerListener the os family is Windows and not linux.
    Thus no logs while you're installing on Linux
     Get more familiar with conditions.

2) in your userSpec.xml for the installation path you're setting the wrong variable name to the correct value

Debug your installer by starting it from the shell via:
$> java -DTRACE=TRUE -DSTACKTRACE=TRUE -jar yourInstaller.jar

TRACE should enable a debug panel to the right with all the vars and conditions used. You should see a history of them changing values and you should be able to set their values as well. That's the InstallData.

STACKTRACE will print all the errors and warnings izPack runs into. They might come in handy but if you find them too verbose...

As for you bypassing the TargetPanel... That might be a mistake. That panel has some business logic behind it validating input and such that you might want to move over to your use input panel which might be difficult. Thick of all the script injection a user can type in that text box and run a "sudo rm -rf /" which you might want to prevent.

Have a great day,
    Paul Bors

On Dec 31, 2013, at 2:20 AM, Chetan Dabade <chetan...@gmail.com> wrote:

I am new to the IzPack (version 4.3.5) installer creation and i am learning the basics of it. I am developing installer which will target Linux machine i have used following files to develop it:

Install.xml and userInputSpec.xml. (Please find attached mentioned files for reference )

Following is the flow of installer:

1  Welcome Screen
2. Configuration Screen  (implemented using userInputSpec.x
3. Summary Screen      (implemented using userInputSpec.xml)
4. Install Progress Screen
5. Finish Screen

I have facing the following issues when i try to deploy on Linux machine

1. creation of detailed logging of what are all components have been installed to which location and in addition it should write information of userInputSpec, since i am not using SummaryPanel in my case how should i go ahead. It should create a install.log with detailed information.

2. Again i am not using TargetPanel instead i have customized it under userInputSpec.xml where i am initialing the default to $INSTALL_PATH and i am storing this value in one of the variable, now when i launch installer and proceed to Configuration Details Screen (.i.e. userInputSpec.xml ) enter the required details and by default installation path will be pointing to \usr\local\Demo when i accept the default value and proceed next i am getting a pop "The directory you have chosen either does not exist or is not valid" i need to create a valid directory and provide the path, is this the right way of Izpack behavior ??
and in addition when i provide alternate path (ex: usr/home/install) proceed further, again come back to the configuration screen the path is showing as /usr/local/Installer instead it should usr/home/install please help
 


3. Even during uninstall it showing default path (.i.e usr/local/Installer) though the install location is different when i proceed all files will be deleted form the correct location (.i.e usr/home/installer) but it displays the default path instead of customized path provided during installation.


Please help
--
Thanks and Regards
Chetan V Dabade
+91 9663967000
<install1.xml>
<userInputSpec.xml>

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

   http://xircles.codehaus.org/manage_email

Chetan Dabade

unread,
Jan 1, 2014, 6:20:24 AM1/1/14
to us...@izpack.codehaus.org
Hi Paul,

Happy New Year!!

Thanks for the reply, are you suggesting to change the variable name because i am setting the value to variable install.path as $INSTALL_PATH and i went ahead with suggestion on debugging the installer i got the following pop message when i do back and forth navigation and click  

Details of install.path

3. C:\program Files\Demo (changed value after panel Base-Feature)
2. E:/MS (changed value after panel Base-Feature)
1. C:\program Files\Demo (new after panel Base-Feature)

Please guide me since i am not sure on how to go ahead.

Thanks,
Chetan

Paul Borș

unread,
Jan 1, 2014, 10:42:11 PM1/1/14
to us...@izpack.codehaus.org, us...@izpack.codehaus.org
Base-Feature must be the name of your panel which looks like it changes the variable twice in the after panel method call.

It time to troubleshoot your installer. We need a quick sart, a way to reproduce it with the least configuration.


Have a great day,
    Paul Bors

Paul Bors

unread,
Jan 2, 2014, 10:43:00 AM1/2/14
to us...@izpack.codehaus.org
Okay I think I might have found your 3rd typo too that might explain the behavior you see...
 
In your install.xml you have two panels with the same ID:
 
<panels>
    ...
    <panel classname="UserInputPanel" id="Base-Feature">
        <help iso3="eng" src="E:\Installer\Sources\Help.html" />
    </panel>
    <panel classname="UserInputPanel" id="Base-Feature"/>
    ...
</panels>
 
Make sure those IDs are unique as UserInputPanel is the same class and you want different instances of it.
 

Paul Bors

unread,
Jan 2, 2014, 10:47:51 AM1/2/14
to us...@izpack.codehaus.org
Also, the panel ID must match that of the UserInputSpec.xml's <panel> tag.
 
For example what you might want is this:
 
Install.xml
<panels>
    ...
    <panel classname="UserInputPanel" id="InputSettings">

        <help iso3="eng" src="E:\Installer\Sources\Help.html" />
    </panel>
    <panel classname="UserInputPanel" id="ConfirmSettings"/>
    ...
</panels>
 
UserInputSpec.xml
<panel order="0" id="InputSettings">
    ...
</panel>
<panel order="1" id="ConfirmSettings">
    ...
</panel>

Chetan Dabade

unread,
Jan 3, 2014, 1:56:31 AM1/3/14
to us...@izpack.codehaus.org
Hi Paul,

I tried using TargetPanel and it is working perfectly fine when i do back and forth between the panels,


i have done the following changes to accomplish:

1. In userInputSpec.xml comment out

    <field type="dir" variable="install.path">
      <spec txt="Installation path:" size="20" set="$INSTALL_PATH" ></spec>
    </field>

2. And in Install.xml find and replace $install.path with $INSTALL_PATH

Compile and build it... when i test with changes it works as expected.


I have mirror copy of source code with earlier changes and in that i tried to incorporate the changes you suggested .i.e giving unique names to panles in userInputSpec.xml file and Install.xml

Install.xml
<panels>
    ...
    <panel classname="UserInputPanel" id="InputSettings">

        <help iso3="eng" src="E:\Installer\Sources\Help.html" />
    </panel>
    <panel classname="UserInputPanel" id="ConfirmSettings"/>
    ...
</panels>
 
UserInputSpec.xml
<panel order="0" id="InputSettings">
    ...
</panel>
<panel order="1" id="ConfirmSettings">
    ...
</panel>
No luck !! the installation path is getting reset when i do back and forth between the panels.

Thanks,
Chetan

Paul Borș

unread,
Jan 3, 2014, 2:36:09 AM1/3/14
to us...@izpack.codehaus.org, us...@izpack.codehaus.org
There you go, I guess it should be $INSTALL_PATH. You can always look over the code yourself.

Btw, I mentioned before and I will remind you again. The TargetPanel has extra logic in it validating the user input for the install path which you are now bypassing.

Have a great day,
    Paul Bors

Chetan Dabade

unread,
Jan 8, 2014, 9:12:34 AM1/8/14
to us...@izpack.codehaus.org
Hi Paul,

I have couple of queries regarding IzPack installer

1. During console installation log files are not getting created and when i run using wizard based UI, log files are getting generated
 in addition the log file contains location of installed files, how to write the extra information like in my case i want to write all fields from userInputSpec.xml (like what all data user has entered ).

2. How do i handle installer errors, basically i want to rollback the changes the installer made and keep the machine in the state it was earlier. The installer i have developed will deploy the files and perform the following tasks in background

     a. Create CRON job
     b. Create a dynamic configuration file and place it under $INSTALL_PATH

Thanks,
chetan

Paul Bors

unread,
Jan 8, 2014, 11:46:38 AM1/8/14
to us...@izpack.codehaus.org
1) Depending on which version of the installer you're using the Console or Auto panels might not yet be implemented and thus you need to add them yourself. You should update to the latest version (I'm still behind on 5.0.0-beta11).That being said, what exactly do you mean by "installation log files"?
 
2) For the uninstaller, I have my own listener whcih I could invoke given a fatal error occurs during installation. You could take the same aproach I guess. You would have to write your own tools that perform the "manual uninstallation" and invoke them via a dynamic panel that shows only when a fatal error occurs. That panel would be in charge of rolling back all the changes done to the system. For that see the Conditions element:

Paul Bors

unread,
Jan 8, 2014, 11:48:48 AM1/8/14
to us...@izpack.codehaus.org
Btw, the conditon ties to a panel viw the Panel's condition attribute, see:

Chetan Dabade

unread,
Jan 9, 2014, 5:27:47 AM1/9/14
to us...@izpack.codehaus.org
Hi Paul,

Thanks for the reply.

To be frank i read the documentation related to Panels and Conditions but i am not sure how to implement it when IzPack encounters error. Currently i have the following condition .i.e stage="postinstall" for executable condition.

<pack>
      <!--Create CRON job for PERL-->
      <parsable targetfile="$INSTALL_PATH/CreatePerlCronJob.sh"/>

      <!--Create CRON job for JAVA-->
      <parsable targetfile="$INSTALL_PATH/CreateJavaCronJob.sh"/>

      <executable targetfile="$INSTALL_PATH/CreatePerlCronJob.sh" stage="postinstall" failure="abort">
        <args>
          <arg value="$INSTALL_PATH/download.pl"></arg>
        </args>
      </executable>`


      <executable targetfile="$INSTALL_PATH/CreateJavaCronJob.sh" stage="postinstall" failure="abort">
        <args>
          <arg value="$INSTALL_PATH/LoadXml.jar"></arg>
        </args>
      </executable>

      <!--Create configuration dynamically-->
      <!-- The file will be parsed -->
      <parsable targetfile="$INSTALL_PATH/Config.sh"/>
      <parsable targetfile="$INSTALL_PATH/encrypt.pl"/>
      <executable targetfile="$INSTALL_PATH/Config.sh" stage="postinstall" failure="abort">
        <args>
          <arg value="$INSTALL_PATH"></arg>
          <arg value="$install.url.ftp.location"></arg>
          <arg value="$install.ftp.user"></arg>
          <arg value="$install.ftp.password"></arg>
          <arg value="$install.LandingZone.Path"></arg>
          <arg value="$install.ListOf.Universes"></arg>
          <arg value="$install.RemoteDirectory.Path"></arg>
        </args>
      </executable>
    </pack>

i want to delete the installed files when Izpack encounter error. It will be great if provide code snippet.

Thanks,
Chetan

Paul Bors

unread,
Jan 15, 2014, 11:41:41 AM1/15/14
to us...@izpack.codehaus.org
Since you're running the older 4.3.5 version (as per your original post) then you should consult the older documentation:
 
You can still read part of the new documentation, but that's just for inspiration. You should really read over IzPack's code.
 
I suggest you update at once. But that's another story.
 
Okay, so you have a pack which runs an executable at the postinstall stage and is supposed to abort on failure but is not.
I take it your Config.sh exits with a signal that's not a failure?
 
Go over the script, and make sure it terminates the process with an error.
If it does, then create a small installer that demostrates this (with a small script that returns an error) and attache it to a Jira ticket because this might be an IzPack bug for linux.
 
To be honest, I don't use the <executable> tag in the packs. I use the process panel to handle all this which runs different processes and if the process terminates with an error then the error is caught by the installer. I'm expecting the same would happen here.
 
 
 
 
Reply all
Reply to author
Forward
0 new messages