Interface InstallerResources
-
public interface InstallerResources
Used to access and/or set resources and data contained within an InstallAnywhere installer.
The InstallerResources object is obtained through the one of the custom code Proxy objects by a request for the InstallerResources class, as follows:
Given the InstallerProxy proxy object,
InstallerResources ir = (InstallerResources)proxy.getService(InstallerResources.class);
ir.getInstallSets();
.
.
.
ir.setChosenInstallSet("MyInstallSetName");
-
-
Field Summary
Fields Modifier and Type Field Description static int
CAN_NOT_INSTALL_JRE
When returned bygetBundledJREStatus()
indicates that the installer does not have a JRE to install, or is not capable of installing the bundled JRE.static int
INSTALL_JRE_ALWAYS
When returned bygetBundledJREStatus()
indicates that the installer has been instructed to always install the bundled JRE (if one is present).static int
INSTALL_JRE_WITH_LAX
When returned bygetBundledJREStatus()
indicates that the installer has been instructed to only install the bundled JRE (if one is present) when a LaunchAnywhere executable is installed.
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description long
getAvailableDiskSpace()
A convenience method to get the amount of disk space available on the target system.int
getBundledJREStatus()
Returns an integer base type describing the installer's status in regard to the JRE that may be bundled with it.java.lang.String
getDefaultInstallSet()
Returns a String that is the name of the current default install set (feature).java.util.Vector
getInstallBundles()
Returns a vector of Strings that describe the names of all install bundles (components) whose rules currently evaluate to true.java.util.Vector
getInstallBundleShortNames()
Returns a vector of Strings that describe the short names of all install bundles (components) whose rules currently evaluate to true.java.lang.String
getInstallDirectory()
A convenience method to get the install directory for the installer on the target system.java.util.Vector
getInstallSets()
Returns a vector of Strings that describe the names of all install sets (features) whose rules currently evaluate to true.java.util.Vector
getJavaVMList()
Returns a vector of Strings that contain the paths to all VMs found on the target system.java.util.Vector
getJavaVMList(boolean jre, boolean java, boolean jview)
Deprecated.long
getRequiredDiskSpace()
A convenience method to get the amount of disk space required to install the selected product feature on the target system.java.lang.String
getShortcutDirectory()
A convenience method to get the shortcut directory for the installer on the target system.boolean
installBundledJRE(boolean installJRE)
Instructs the installer to either install the bundled JRE, if present, or not.boolean
setChosenInstallBundles(java.lang.String installBundles)
Instructs the installer to install the components included in the specified install bundle(s) (product component).boolean
setChosenInstallSet(java.lang.String installSet)
Instructs the installer to install the components included in the specified install set (feature).void
setInstallDirectory(java.lang.String installDir)
A convenience method to set the installation directory for the installer on the target system.boolean
setJavaVM(java.lang.String vmPath)
Instructs the installer to use the system virtual machine described by the provided absolute path as the VM for the LaunchAnywhere executables.void
setJavaVMList(java.util.Vector newVMList)
This method allows the list of VM paths to be set externally to the installer's normal mechanism for gathering and saving paths to system VMs.void
setShortcutDirectory(java.lang.String shortcutDir)
A convenience method to set the shortcut directory for the installer on the target system.
-
-
-
Field Detail
-
INSTALL_JRE_ALWAYS
static final int INSTALL_JRE_ALWAYS
When returned by
getBundledJREStatus()
indicates that the installer has been instructed to always install the bundled JRE (if one is present).- See Also:
getBundledJREStatus()
, Constant Field Values
-
INSTALL_JRE_WITH_LAX
static final int INSTALL_JRE_WITH_LAX
When returned by
getBundledJREStatus()
indicates that the installer has been instructed to only install the bundled JRE (if one is present) when a LaunchAnywhere executable is installed.- See Also:
getBundledJREStatus()
, Constant Field Values
-
CAN_NOT_INSTALL_JRE
static final int CAN_NOT_INSTALL_JRE
When returned by
getBundledJREStatus()
indicates that the installer does not have a JRE to install, or is not capable of installing the bundled JRE.- See Also:
getBundledJREStatus()
, Constant Field Values
-
-
Method Detail
-
getInstallSets
java.util.Vector getInstallSets()
Returns a vector of Strings that describe the names of all install sets (features) whose rules currently evaluate to true. Passing the String name of one of the install sets (features) contained in the returned Vector will cause that install set (feature) to be installed.
- Returns:
- a Vector containing the names of all available install sets (features)
- See Also:
setChosenInstallSet(String)
-
getDefaultInstallSet
java.lang.String getDefaultInstallSet()
Returns a String that is the name of the current default install set (feature). This is the install set (feature) that, unless the installer is otherwise instructed, will be installed.
- Returns:
- a String containing the names of the default install set (feature)
- See Also:
getInstallSets()
,setChosenInstallSet(String)
-
setChosenInstallSet
boolean setChosenInstallSet(java.lang.String installSet)
Instructs the installer to install the components included in the specified install set (feature).
The install set (feature) is described by its full name as created in the InstallAnywhere advanced designer or as returned by the call to
getInstallSets()
. Essentially, this call makes the specified install set (feature) the new default install set (feature) for the installer. Calls to this method will override prior calls made to this method and prior calls made tosetChosenInstallBundles
.- Parameters:
installSet
- a String representing the full name of the Install Set to be installed.- Returns:
- a boolean value indicating whether the operation completed successfully.
- See Also:
getInstallSets()
,getDefaultInstallSet()
-
getInstallBundles
java.util.Vector getInstallBundles()
Returns a vector of Strings that describe the names of all install bundles (components) whose rules currently evaluate to true.
Passing the String name of one of the install bundles (components) contained in the returned Vector will cause that install bundle (component) to be installed.
- Returns:
- a Vector containing the names of all available install bundles (component)
- See Also:
setChosenInstallBundles(String)
-
getInstallBundleShortNames
java.util.Vector getInstallBundleShortNames()
Returns a vector of Strings that describe the short names of all install bundles (components) whose rules currently evaluate to true.
- Returns:
- a Vector containing the short names of all available install bundles (component)
-
setChosenInstallBundles
boolean setChosenInstallBundles(java.lang.String installBundles)
Instructs the installer to install the components included in the specified install bundle(s) (product component).
The install bundle(s) are described by a comma-separated String containing the full name of all desired install bundles as created in the InstallAnywhere advanced designer or as returned by the call to
getInstallBundles()
. Calls to this method will override prior calls made to this method and prior calls made tosetChosenInstallSet
.- Parameters:
installBundles
- a comma-separated String containing the full name representation of all the Install Bundles (Components) to be installed.- Returns:
- a boolean value indicating whether the operation completed successfully. The operation completed successfully if at least one install bundle (component) was set.
- See Also:
getInstallBundles()
-
getBundledJREStatus
int getBundledJREStatus()
Returns an integer base type describing the installer's status in regard to the JRE that may be bundled with it.
The return values equate to the field constants described above.
- Returns:
- an integer base type describing the installer's status in regard to the bundled JRE.
- See Also:
setChosenInstallBundles(String)
-
installBundledJRE
boolean installBundledJRE(boolean installJRE) throws CannotInstallJREException
Instructs the installer to either install the bundled JRE, if present, or not.
If the installer is instructed to not install the bundled JRE, the installer will attempt to choose a system virtual machine for any LaunchAnywhere executables that are to be installed.
- Parameters:
installJRE
- a boolean value (true to install the bundled JRE, false to not install the bunlded JRE).- Returns:
- a boolean value indicating whether the operation completed successfully.
- Throws:
CannotInstallJREException
- if the installer is instructed to install the bundled JRE, but there is not bundled JRE to install or the bundled JRE cannot be installed.
-
getJavaVMList
java.util.Vector getJavaVMList()
Returns a vector of Strings that contain the paths to all VMs found on the target system.
When searching for VMs, the installer follows the VM Search Settings configured for each platform.
- Returns:
- a Vector containing the absolute paths of all found VMs.
- See Also:
setJavaVMList(Vector)
,setJavaVM(String)
-
getJavaVMList
java.util.Vector getJavaVMList(boolean jre, boolean java, boolean jview)
Deprecated.Returns a vector of Strings that contain the paths to all VMs that meet the specified criteria that are found on the target system.
When searching for VMs, the installer will search along the user's system PATH, and in the case of Windows systems, the system Registry. This method returns only those VMs on the system that meet the criteria as described in the parameters to the method.
- Parameters:
jre
- a boolean value that indicates whether or not the path to 'jre' executables found on the system should be returned.java
- a boolean value that indicates whether or not the path to 'java' executables found on the system should be returned.jview
- a boolean value that indicates whether or not the path to 'jview' or 'wjview' executables found on the system should be returned (only relevant on Win32 systems).- Returns:
- a Vector containing the absolute paths of all found VMs.
- See Also:
getJavaVMList()
,setJavaVMList(Vector)
,setJavaVM(String)
-
setJavaVMList
void setJavaVMList(java.util.Vector newVMList)
This method allows the list of VM paths to be set externally to the installer's normal mechanism for gathering and saving paths to system VMs.
This will allow the development of actions that will be able to customize the searching and validation of system VMs.
The Java VM list affects the following installer behaviors:- The list of system VMs displayed in the Choose Java VM panel
- The decision on whether or not to install the bundled VM if the installer is configured to only install the bundled VM when a compatible VM is not found in the system. The decision depends on whether the Java VM list is empty or not
- The VM selected by the installer to be used by the LaunchAnywhere actions configured to use the first VM found in the system, which means the first VM in the provided list
- The value returned by the getJavaVMList() method.
- Parameters:
newVMList
- a Vector of Strings containing the VM absolute paths.- See Also:
getJavaVMList()
,setJavaVM(String)
-
setJavaVM
boolean setJavaVM(java.lang.String vmPath)
Instructs the installer to use the system virtual machine described by the provided absolute path as the VM for the LaunchAnywhere executables.
This is only applicable for LaunchAnywhere actions configured to use the VM selected by the installer.
- Parameters:
vmPath
- a String representing the absolute path to a system VM.- Returns:
- a boolean value indicating whether the operation completed successfully.
- See Also:
getJavaVMList()
,getJavaVMList(boolean, boolean, boolean)
,setJavaVMList(Vector)
-
getInstallDirectory
java.lang.String getInstallDirectory()
A convenience method to get the install directory for the installer on the target system. This returns the same value as calling
substitute("$USER_INSTALL_DIR$")
using any of the custom code proxy objects.- Returns:
- a String representing the path of the installation directory.
-
setInstallDirectory
void setInstallDirectory(java.lang.String installDir)
A convenience method to set the installation directory for the installer on the target system. This performs the the same funtion as calling
setVariable("$USER_INSTALL_DIR$", "<my_install_path>")
using any of the custom code proxy objects.- Parameters:
installDir
- a String representing the absolute path of the desired installation directory.
-
getShortcutDirectory
java.lang.String getShortcutDirectory()
A convenience method to get the shortcut directory for the installer on the target system. This returns the same value as calling
substitute("$USER_SHORTCUTS$")
using any of the custom code proxy objects.- Returns:
- a String representing the path of the shortcut directory.
-
setShortcutDirectory
void setShortcutDirectory(java.lang.String shortcutDir)
A convenience method to set the shortcut directory for the installer on the target system. This performs the the same funtion as calling
setVariable("$USER_SHORTCUTS$", "<my_install_path>")
using any of the custom code proxy objects.- Parameters:
shortcutDir
- a String representing the absolute path of the desired shortcut directory.
-
getRequiredDiskSpace
long getRequiredDiskSpace()
A convenience method to get the amount of disk space required to install the selected product feature on the target system.
- Returns:
- a long value containing the raw unformatted amount of disk space required to install the selected product feature on the target system.
-
getAvailableDiskSpace
long getAvailableDiskSpace()
A convenience method to get the amount of disk space available on the target system.
- Returns:
- a long value containing the raw unformatted amount of disk space available on the target system.
-
-