com.izforge.izpack.panels.checkedhello
Class RegistryHelper

java.lang.Object
  extended by com.izforge.izpack.panels.checkedhello.RegistryHelper

public class RegistryHelper
extends Object

Registry helper.

Author:
Klaus Bartz, Tim Anderson

Constructor Summary
RegistryHelper(RegistryDefaultHandler handler, InstallData installData)
          Constructs a RegistryHelper.
 
Method Summary
protected  boolean exists(int root, String key, String value)
          Determines whether a given value under a given key exists.
 String getInstallationPath()
          Returns the installation path of the application.
 String getUninstallCommand()
          Returns the command to uninstall the application, if it is registered.
 String getUninstallName()
          Returns the uninstallation name.
 boolean isRegistered()
          Returns whether the handled application is already registered or not.
 String updateUninstallName()
          Generates an unique uninstall name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RegistryHelper

public RegistryHelper(RegistryDefaultHandler handler,
                      InstallData installData)
Constructs a RegistryHelper.

Parameters:
handler - the registry handler
installData - the installation data
Method Detail

isRegistered

public boolean isRegistered()
                     throws NativeLibException
Returns whether the handled application is already registered or not. The validation will be made only on systems which contains a registry (Windows).

Returns:
true if the application is registered
Throws:
NativeLibException - for any native library error

getUninstallName

public String getUninstallName()
Returns the uninstallation name.

Returns:
the uninstallation name. May be null

getInstallationPath

public String getInstallationPath()
                           throws NativeLibException
Returns the installation path of the application.

NOTE: this uses the UninstallString registry entry

Returns:
the installation path, or null if the application hasn't been installed or the path cannot be determined
Throws:
NativeLibException - for any native library error
IllegalStateException - if the uninstallation name of the application is null

getUninstallCommand

public String getUninstallCommand()
                           throws NativeLibException
Returns the command to uninstall the application, if it is registered.

Returns:
the command, or null if the application isn't registered
Throws:
NativeLibException - for any native library error
IllegalStateException - if the uninstallation name of the application is null

updateUninstallName

public String updateUninstallName()
                           throws NativeLibException
Generates an unique uninstall name.

Returns:
the unique uninstall name, or null if the registry isn't supported on the platform
Throws:
NativeLibException - for any native library error

exists

protected boolean exists(int root,
                         String key,
                         String value)
                  throws NativeLibException
Determines whether a given value under a given key exists.

NOTE: this operation has the side effect that the registry root changes.

Parameters:
root - the root of the registry access.
key - the key name
value - the value name
Returns:
true it exists, otherwise false
Throws:
NativeLibException


Copyright © 2018. All rights reserved.