Automated Installation for JBoss Developer Studio

JBDS installer for version 4.1.0.CR1 supports automated installation since build H323. It lets to control installation process using configuration file in xml format.

Prerequisites

To be able install JBDS without UI you need:

  1. JBDS installer build 4.1.0.CR1-H323 or older;
  2. InstallConfigRecord.xml file to define installation parameters:
    • path to installation folder
    • packages to install
    • shortcuts to create

Create Configuration for an Automated Installation

You can start from regular installation with UI and then use InstallConfigRecord.xml file generated in installation target folder. Here is an example for InstallConfigRecord.xml content:

 

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
     <AutomatedInstallation langpack="eng">
     <com.jboss.jbds.installer.PathInputPanel id="target">
          <installpath>/home/eskimo/jbdevstudio-jbds3</installpath>
     </com.jboss.jbds.installer.PathInputPanel>
     <com.jboss.jbds.installer.JBossAsSelectPanel id="as">
          <installgroup>jbosseap</installgroup>
     </com.jboss.jbds.installer.JBossAsSelectPanel>
     <com.jboss.jbds.installer.UpdatePacksPanel id="UNKNOWN (com.jboss.jbds.installer.UpdatePacksPanel)"/>
     <com.jboss.jbds.installer.DiskSpaceCheckPanel id="UNKNOWN (com.jboss.jbds.installer.DiskSpaceCheckPanel)"/>
     <com.izforge.izpack.panels.SummaryPanel id="summary"/>
     <com.izforge.izpack.panels.InstallPanel id="install"/>
     <com.jboss.jbds.installer.CreateLinkPanel id="UNKNOWN (com.jboss.jbds.installer.CreateLinkPanel)"/>
     <com.izforge.izpack.panels.ShortcutPanel id="shortcut">
          <programGroup name=""/>
          <shortcut KdeSubstUID="false" categories="Applications;Development;" commandLine="" createForAll="true" description="Runs the JBoss Developer Studio 4.1.0.CR1-v201103301142N" encoding="UTF-8" group="true" icon="/home/eskimo/jbdevstudio-jbds3/studio/48-jbds_icon.png" iconIndex="0" initialState="1" mimetype="" name="JBoss Developer Studio 4.1.0.CR1-v201103301142N" target="/home/eskimo/jbdevstudio-jbds3/studio/jbdevstudio" terminal="false" terminalOptions="" tryexec="" type="Application" url="" usertype="0" workingDirectory="/home/eskimo/jbdevstudio-jbds3/studio"/>
          <shortcut KdeSubstUID="false" categories="Applications;Development;" commandLine="-jar &quot;/home/eskimo/jbdevstudio-jbds3/Uninstaller/uninstaller.jar&quot;" createForAll="true" description="Uninstall JBoss Developer Studio 4.1.0.CR1-v201103301142N" encoding="UTF-8" group="true" icon="/home/eskimo/jbdevstudio-jbds3/studio/48-jbds_uninstall_icon.png" iconIndex="0" initialState="1" mimetype="" name="Uninstall JBoss Developer Studio 4.1.0.CR1-v201103301142N" target="java" terminal="false" terminalOptions="" tryexec="" type="Application" url="" usertype="0" workingDirectory="/home/eskimo/jbdevstudio-jbds3/Uninstaller"/>
     </com.izforge.izpack.panels.ShortcutPanel>
     <com.jboss.jbds.installer.ShortcutPanelPatch id="shortcutpatch"/>
     <com.izforge.izpack.panels.SimpleFinishPanel id="finish"/>
</AutomatedInstallation>

What Can Be Changed Inside InstallConfigRecord.xml

 

Because of IzPack 4.3.2 limitations empty nodes must be always presented in this file to avoid NullPointerExceptions during automated installation. There are three adjustable parameters you can play with:

  • text content of AutomatedInstallation/com.jboss.jbds.installer.PathInputPanel/installpath node defines folder where JBDS is installed;
  • text content of AutomatedInstallation/com.jboss.jbds.installer.JBossAsSelectPanel/installgroup node defines what should be installed;
  • content of com.izforge.izpack.panels.ShortcutPanel defines shortcut creation for installed JBDS.

 

To define path where your automated installation should put JBDS bits you need change content of installpath element and update references to this path inside shortcut elements from com.izforge.izpack.panels.ShortcutPanel element. In example above just use your favorite text editor to replace all occurrences of /home/eskimo/jbdevstudio-jbds3 to path you want to install JBDS.

 

JBDS provides two kind of installers: one installs JBDS only, other installs JBDS and let you also select JBoss EAP for installation. For JBDS only installers installgroup element content should be 'jbds'. For JBDS and JBoss EAP installer it can be:

  • 'ibds' to install JBDS only
  • 'jbosseap' to install JBDS and JBoss EAP

 

IzPack has no documentation about shrotcuts related automation. There are two simple options for now. If you need to create shortcuts just use content from com.izforge.izpack.panels.ShortcutPanel element in example above and update installation folder to be the same as in installpath element. If you don't need shortcuts at all just use empty com.izforge.izpack.panels.ShortcutPanel element.

How to Use Automated Installation

To start automated installation use regular command line and add path to InstallConfigRecord.xml file as parameter

 

java -jar /path/to/installer.jar /path/to/InstallConfigRecord.xml

 

If your InstallConfigRecord.xml file contains

 

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<AutomatedInstallation langpack="eng">
     <com.jboss.jbds.installer.PathInputPanel id="target">
          <installpath>/home/eskimo/jbdevstudio-jbds3</installpath>
     </com.jboss.jbds.installer.PathInputPanel>
     <com.jboss.jbds.installer.JBossAsSelectPanel id="as">
          <installgroup>jbosseap</installgroup>
     </com.jboss.jbds.installer.JBossAsSelectPanel>
     <com.jboss.jbds.installer.UpdatePacksPanel id="UNKNOWN (com.jboss.jbds.installer.UpdatePacksPanel)"/>
     <com.jboss.jbds.installer.DiskSpaceCheckPanel id="UNKNOWN (com.jboss.jbds.installer.DiskSpaceCheckPanel)"/>
     <com.izforge.izpack.panels.SummaryPanel id="summary"/>
     <com.izforge.izpack.panels.InstallPanel id="install"/>
     <com.jboss.jbds.installer.CreateLinkPanel id="UNKNOWN (com.jboss.jbds.installer.CreateLinkPanel)"/>
     <com.izforge.izpack.panels.ShortcutPanel id="shortcut">
          <programGroup name=""/>
          <shortcut KdeSubstUID="false" categories="Applications;Development;" commandLine="" createForAll="true" description="Runs the JBoss Developer Studio 4.1.0.CR1-v201103301142N" encoding="UTF-8" group="true" icon="/home/eskimo/jbdevstudio-jbds3/studio/48-jbds_icon.png" iconIndex="0" initialState="1" mimetype="" name="JBoss Developer Studio 4.1.0.CR1-v201103301142N" target="/home/eskimo/jbdevstudio-jbds3/studio/jbdevstudio" terminal="false" terminalOptions="" tryexec="" type="Application" url="" usertype="0" workingDirectory="/home/eskimo/jbdevstudio-jbds3/studio"/>
          <shortcut KdeSubstUID="false" categories="Applications;Development;" commandLine="-jar &quot;/home/eskimo/jbdevstudio-jbds3/Uninstaller/uninstaller.jar&quot;" createForAll="true" description="Uninstall JBoss Developer Studio 4.1.0.CR1-v201103301142N" encoding="UTF-8" group="true" icon="/home/eskimo/jbdevstudio-jbds3/studio/48-jbds_uninstall_icon.png" iconIndex="0" initialState="1" mimetype="" name="Uninstall JBoss Developer Studio 4.1.0.CR1-v201103301142N" target="java" terminal="false" terminalOptions="" tryexec="" type="Application" url="" usertype="0" workingDirectory="/home/eskimo/jbdevstudio-jbds3/Uninstaller"/>
     </com.izforge.izpack.panels.ShortcutPanel>
     <com.jboss.jbds.installer.ShortcutPanelPatch id="shortcutpatch"/>
     <com.izforge.izpack.panels.SimpleFinishPanel id="finish"/>
</AutomatedInstallation>

 

then console output for automated installation should look like:

 

eskimo@dgolovin-desktop:~/Downloads/jbds$ java -jar jbdevstudio-product-eap-linux-gtk-x86_64-4.1.0.v201104111130R-H327-CR1.jar /home/eskimo/jbdevstudio-jbds1/InstallConfigRecord.xml
[ Starting automated installation ]
/home/eskimo/jbdevstudio-jbds3
[ Starting to unpack ]
[ Processing package: JBoss Developer Studio 4.1.0.CR1 (1/2) ]
[ Processing package: JBoss Enterprise Application Platform (2/2) ]

calltarget:

main:
     [echo] Run p2 metadata generator
     [echo] eskimo
       [p2] Generating metadata for /home/eskimo/jbdevstudio-jbds3/studio.
       [p2] Generation completed with success [0 seconds].
   [delete] Deleting: /tmp/artifacts.jar
   [delete] Deleting: /tmp/content.jar
[ Unpacking finished ]
[ Creating shortcuts .. done. ]
[ Add shortcuts to uninstaller .. done. ]
[ Writing the uninstaller data ... ]
[ Automated installation done ]
eskimo@dgolovin-desktop:~/Downloads/jbds$

Current Limitations

 

Current limitations are:

  • Desktop shortcuts are not supported
  • Execution under root credentials to create shortcuts for all is not tested
  • Configuration elements should be presented for all installer's steps. Even for steps without configurable parameters
  • Automated installation doesn't check if target installation folder exists, it just overwrite existing files without warnings
  • There are no options to control what JVM to use for installed JBDS
  • There is no verification that current platform matches the platform which JBDS installer built for