public abstract class InstallerImpl extends java.lang.Object implements InstallerInterface
Modifier and Type | Class and Description |
---|---|
protected static class |
InstallerImpl.VERSION_OPTION |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ARG_INSTALLDIR
-installdir
optional command-line argument to explicitly set the installation directory for an installer. Ex: -installdir "C:\SAFS" (for SAFS proper) Ex: -installdir "C:\SeleniumPlus" (for SeleniumPlus proper) Ex: -installdir "C:\SeleniumPlus\extra\automation" (for SeleniumPlus OCR, etc.) |
static java.lang.String |
ARG_UNINSTALL
-u
command-line argument to signal an uninstall invocation. |
protected static java.lang.String |
PARAM_SWITCH |
protected static java.lang.String |
PARAM_USE_LATEST_VERSION |
protected IProductDetector |
productDetector
The ProductDetector.
|
(package private) static ProgressIndicator |
progresser |
static java.lang.String |
REGSVR32 |
protected static java.lang.String |
rootdir |
static java.lang.String |
s |
static java.lang.String |
SYSTEM32 |
static java.lang.String |
SYSWOW64 |
Constructor and Description |
---|
InstallerImpl()
Default no-arg constructor.
|
InstallerImpl(java.lang.String _installDir)
Preset the installation directory so it does not need to be deduced.
|
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
appendSystemEnvironment(java.lang.String varname,
java.lang.String append,
java.lang.String sep)
Append a value to an existing Environment variable (CLASSPATH, PATH, etc..)
This adds the value at the end of any existing value. |
protected IProductDetector |
getDefaultProductDetector() |
static java.lang.String |
getEnvValue(java.lang.String key)
Return a System Environment String value.
|
protected java.lang.String |
getInstallationRoot()
Subclasses use this to determine what is the root directory of the current
install/uninstall that is in-progress.
|
static java.lang.String |
getRegistryValue(java.lang.String key,
java.lang.String valuename)
Gets the (Windows) registry value, or null if it doesn't exist.
|
protected IProductDetector |
getUnixProductDetector() |
protected IProductDetector |
getWindowsProductDetector() |
static boolean |
hasRegistryEntry(java.lang.String key,
java.lang.String valuename)
True if the requested "registry key" already exists, false otherwise.
This is currently only supported on Windows. |
protected void |
initilizeProductDetector()
Initialize the IProdcutDetector object according to the Operation System.
A ProductDetectorDefault will be returned if the OS is not Windows or UNIX/LINUX. |
static java.lang.String |
prependSystemEnvironment(java.lang.String varname,
java.lang.String prepend,
java.lang.String sep)
Prepend a value to an existing Environment variable (CLASSPATH, PATH, etc..)
This puts the value at the beginning of any existing value. |
static java.lang.String |
removeSystemEnvironmentSubstring(java.lang.String varname,
java.lang.String substring,
java.lang.String sep)
Remove a substring from an existing Environment variable (CLASSPATH, PATH, etc..)
|
static java.lang.String |
removeSystemEnvironmentSubstringContaining(java.lang.String varname,
java.lang.String substring,
java.lang.String sep)
Remove a string entry from an existing Environment variable (CLASSPATH, PATH, etc..)
In this method, we attempt to do a partial match on an entry between separators to locate the item to remove from the variable. |
static boolean |
setEnvValue(java.lang.String key,
java.lang.String value)
Set a System Environment value.
|
protected static void |
setProgress(int percent) |
static void |
setProgressIndicator(ProgressIndicator _progresser) |
protected static void |
setProgressMessage(java.lang.String message) |
static boolean |
setRegistryValue(java.lang.String key,
java.lang.String valuename,
java.lang.String value) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
install, uninstall
static ProgressIndicator progresser
public static final java.lang.String s
public static final java.lang.String SYSTEM32
public static final java.lang.String SYSWOW64
public static final java.lang.String REGSVR32
protected static final java.lang.String PARAM_USE_LATEST_VERSION
protected static final java.lang.String PARAM_SWITCH
protected IProductDetector productDetector
initilizeProductDetector()
public static final java.lang.String ARG_INSTALLDIR
public static final java.lang.String ARG_UNINSTALL
protected static java.lang.String rootdir
public InstallerImpl()
public InstallerImpl(java.lang.String _installDir)
protected java.lang.String getInstallationRoot()
Needs to be enhanced to temporarily flag what is in-progress, versus what might already exist as deduced from the normal SAFSDIREnv or SELENIUMDIREnv.
protected void initilizeProductDetector() throws java.lang.UnsupportedOperationException
java.lang.UnsupportedOperationException
protected IProductDetector getWindowsProductDetector() throws java.lang.UnsupportedOperationException
java.lang.UnsupportedOperationException
protected IProductDetector getUnixProductDetector() throws java.lang.UnsupportedOperationException
java.lang.UnsupportedOperationException
protected IProductDetector getDefaultProductDetector()
ProductDetectorDefault
public static void setProgressIndicator(ProgressIndicator _progresser)
protected static void setProgress(int percent)
protected static void setProgressMessage(java.lang.String message)
public static java.lang.String getEnvValue(java.lang.String key)
Note: Environment variables set or changed after JVM start are NOT available to the currently running JVM through System.getEnv(). This is because the JVM does not refresh its Environment variable space after launch. Use this routine to get the latest "refreshed" value of any System Environment Variable.
key
- Environment variable value to retrieve.public static boolean setEnvValue(java.lang.String key, java.lang.String value)
Note: Environment variables set or changed after JVM start are NOT available to the currently running JVM through System.getEnv(). This is because the JVM does not refresh its Environment variable space after launch. Use getEnvValue to get the latest "refreshed" value of any System Environment Variable.
key
- name of variable to setvalue
- to be set. Null will remove the variable.NativeWrapper.SetSystemEnvironmentVariable(Object, Object)
,
getEnvValue(String)
public static java.lang.String appendSystemEnvironment(java.lang.String varname, java.lang.String append, java.lang.String sep)
varname
- -- name of Environment variable to modify. cannot be null.append
- -- the value to add if it is not already present. cannot be null.sep
- - optional separator to use between appends. if null, File.pathSeparator is used.
Can also be an empty string to indicate no separator should be used.public static java.lang.String prependSystemEnvironment(java.lang.String varname, java.lang.String prepend, java.lang.String sep)
varname
- -- name of Environment variable to modify. cannot be null.prepend
- -- the value to prepend if it is not already present. cannot be null.sep
- - optional separator to use between values. if null, File.pathSeparator is used.
Can also be an empty string to indicate no separator should be used.public static java.lang.String removeSystemEnvironmentSubstring(java.lang.String varname, java.lang.String substring, java.lang.String sep)
varname
- -- name of Environment variable to modify. cannot be null.substring
- -- the value to remove if it is present. cannot be null.sep
- - optional separator found between values. if null, File.pathSeparator is assumed.
Can also be an empty string to indicate no separator should be considered.public static java.lang.String removeSystemEnvironmentSubstringContaining(java.lang.String varname, java.lang.String substring, java.lang.String sep)
Ex: removeSystemEnvironmentSubstringContaining("CLASSPATH", "\\safs.jar", null);
This will remove the safs.jar reference in CLASSPATH no matter what the path to it might be.
varname
- -- name of Environment variable to modify. cannot be null.substring
- -- the partial match value to remove, if it is present. cannot be null.sep
- - optional separator found between values. if null or zero-length then File.pathSeparator is used.public static boolean hasRegistryEntry(java.lang.String key, java.lang.String valuename)
The Windows version uses Reg.EXE which is supplied with WindowsXP. If this EXE is not present on the Windows system then this function will return false.
key
- For Windows this is a String. Ex:"HKCU\\Environment"valuename
- For Windows this is a String. Ex:"Path". Can be null.public static java.lang.String getRegistryValue(java.lang.String key, java.lang.String valuename)
key
- -- Ex: "HKCU\\Environment"valuename
- -- Ex: "Path". can be nullNativeWrapper.GetRegistryKeyValue(Object, Object)
public static boolean setRegistryValue(java.lang.String key, java.lang.String valuename, java.lang.String value)
key
- valuename
- value
- NativeWrapper.GetRegistryKeyValue(Object, Object)
Copyright © SAS Institute. All Rights Reserved.