com.izforge.izpack.event
Class RegistryInstallerListener

java.lang.Object
  extended bycom.izforge.izpack.event.SimpleInstallerListener
      extended bycom.izforge.izpack.event.NativeInstallerListener
          extended bycom.izforge.izpack.event.RegistryInstallerListener
All Implemented Interfaces:
InstallerListener

public class RegistryInstallerListener
extends NativeInstallerListener

Installer custom action for handling registry entries on Windows. On Unix nothing will be done. The actions which should be performed are defined in a resource file named "RegistrySpec.xml". This resource should be declared in the installation definition file (install.xml), else an exception will be raised during execution of this custom action. The related DTD is appl/install/IzPack/resources/registry.dtd.

Author:
Klaus Bartz

Field Summary
private static java.lang.String REG_BASENAME
           
private static java.lang.String REG_BIN
           
private static java.lang.String REG_DATA
           
private static java.lang.String REG_DWORD
           
private static java.lang.String REG_KEY
           
private static java.lang.String REG_KEYPATH
           
private static java.lang.String REG_MULTI
           
private static java.lang.String REG_OVERRIDE
           
private static java.lang.String REG_ROOT
           
private static java.lang.String REG_STRING
           
private static java.lang.String REG_VALUE
           
private static java.lang.String SPEC_FILE_NAME
          The name of the XML file that specifies the registry entries.
 
Fields inherited from class com.izforge.izpack.event.SimpleInstallerListener
doInformProgressBar, LANG_FILE_NAME, langpack
 
Fields inherited from interface com.izforge.izpack.event.InstallerListener
AFTER_DIR, AFTER_FILE, AFTER_PACK, AFTER_PACKS, BEFORE_DIR, BEFORE_FILE, BEFORE_PACK, BEFORE_PACKS
 
Constructor Summary
RegistryInstallerListener()
          Default constructor.
 
Method Summary
 void afterPacks(AutomatedInstallData idata, AbstractUIProgressHandler handler)
          This method will be called from the unpacker after the installation of all packs was performed.
 void beforePacks(AutomatedInstallData idata, java.lang.Integer npacks, AbstractUIProgressHandler handler)
          This method will be called from the unpacker before the installation of all packs will be performed.
private  byte[] extractBytes(XMLElement element, java.lang.String byteString)
           
private  void initializeRegistryHandler(AutomatedInstallData idata)
           
private  void performKeySetting(XMLElement regEntry, VariableSubstitutor substitutor)
          Perform the setting of one key.
private  void performPack(XMLElement pack, VariableSubstitutor substitutor)
          Performs the registry settings for the given pack.
private  void performValueSetting(XMLElement regEntry, VariableSubstitutor substitutor)
          Perform the setting of one value.
private  int resolveRoot(XMLElement regEntry, java.lang.String root, VariableSubstitutor substitutor)
           
 
Methods inherited from class com.izforge.izpack.event.SimpleInstallerListener
afterDir, afterFile, afterPack, beforeDir, beforeFile, beforePack, getInstalldata, getMsg, getProgressBarCallerCount, getProgressBarCallerId, getSpecHelper, informProgressBar, isFileListener, setInstalldata, setProgressBarCaller, setSpecHelper
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SPEC_FILE_NAME

private static final java.lang.String SPEC_FILE_NAME
The name of the XML file that specifies the registry entries.

See Also:
Constant Field Values

REG_KEY

private static final java.lang.String REG_KEY
See Also:
Constant Field Values

REG_VALUE

private static final java.lang.String REG_VALUE
See Also:
Constant Field Values

REG_ROOT

private static final java.lang.String REG_ROOT
See Also:
Constant Field Values

REG_BASENAME

private static final java.lang.String REG_BASENAME
See Also:
Constant Field Values

REG_KEYPATH

private static final java.lang.String REG_KEYPATH
See Also:
Constant Field Values

REG_DWORD

private static final java.lang.String REG_DWORD
See Also:
Constant Field Values

REG_STRING

private static final java.lang.String REG_STRING
See Also:
Constant Field Values

REG_MULTI

private static final java.lang.String REG_MULTI
See Also:
Constant Field Values

REG_BIN

private static final java.lang.String REG_BIN
See Also:
Constant Field Values

REG_DATA

private static final java.lang.String REG_DATA
See Also:
Constant Field Values

REG_OVERRIDE

private static final java.lang.String REG_OVERRIDE
See Also:
Constant Field Values
Constructor Detail

RegistryInstallerListener

public RegistryInstallerListener()
Default constructor.

Method Detail

beforePacks

public void beforePacks(AutomatedInstallData idata,
                        java.lang.Integer npacks,
                        AbstractUIProgressHandler handler)
                 throws java.lang.Exception
Description copied from interface: InstallerListener
This method will be called from the unpacker before the installation of all packs will be performed.

Specified by:
beforePacks in interface InstallerListener
Overrides:
beforePacks in class NativeInstallerListener
Throws:
java.lang.Exception

afterPacks

public void afterPacks(AutomatedInstallData idata,
                       AbstractUIProgressHandler handler)
                throws java.lang.Exception
Description copied from interface: InstallerListener
This method will be called from the unpacker after the installation of all packs was performed.

Specified by:
afterPacks in interface InstallerListener
Overrides:
afterPacks in class SimpleInstallerListener
Throws:
java.lang.Exception

performPack

private void performPack(XMLElement pack,
                         VariableSubstitutor substitutor)
                  throws java.lang.Exception
Performs the registry settings for the given pack.

Parameters:
pack - XML elemtent which contains the registry settings for one pack
Throws:
java.lang.Exception

performValueSetting

private void performValueSetting(XMLElement regEntry,
                                 VariableSubstitutor substitutor)
                          throws java.lang.Exception
Perform the setting of one value.

Parameters:
regEntry - element which contains the description of the value to be set
substitutor - variable substitutor to be used for revising the regEntry contents
Throws:
java.lang.Exception

extractBytes

private byte[] extractBytes(XMLElement element,
                            java.lang.String byteString)
                     throws java.lang.Exception
Throws:
java.lang.Exception

performKeySetting

private void performKeySetting(XMLElement regEntry,
                               VariableSubstitutor substitutor)
                        throws java.lang.Exception
Perform the setting of one key.

Parameters:
regEntry - element which contains the description of the key to be created
substitutor - variable substitutor to be used for revising the regEntry contents
Throws:
java.lang.Exception

resolveRoot

private int resolveRoot(XMLElement regEntry,
                        java.lang.String root,
                        VariableSubstitutor substitutor)
                 throws java.lang.Exception
Throws:
java.lang.Exception

initializeRegistryHandler

private void initializeRegistryHandler(AutomatedInstallData idata)
                                throws java.lang.Exception
Throws:
java.lang.Exception