public class ProductDetectorDefault extends java.lang.Object implements IProductDetector
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
BIN
'bin' the sub-folder (relative to product home) holding executables
|
protected InstallerImpl.BIT_OPTION |
productBit
The product's bit, 32 or 64.
|
Constructor and Description |
---|
ProductDetectorDefault() |
ProductDetectorDefault(InstallerImpl.BIT_OPTION productBit) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
appendInstallDirOption(java.lang.String command,
java.lang.String installDirectory)
Append installation directory option to installer and uninstaller
|
java.lang.String |
appendOptions(java.lang.String command,
java.lang.String... options)
Append options to installer and uninstaller
|
java.lang.String |
appendSientOption(java.lang.String command)
Append silent option to installer and uninstaller
|
boolean |
deleteRegistry(java.lang.String keyPrefix,
java.lang.String keySuffix,
java.lang.String value)
To delete the value from registry for path starting with
#HKLM_ST According to product bit productBit , delete the registry's value. |
java.lang.String |
findUnInstaller(java.lang.String home) |
java.lang.String[] |
getBins()
Return an array containing one sub folder 'bin'.
|
java.lang.String |
getDefaultHome()
Return null.
|
java.util.Map<java.lang.String,java.lang.String> |
getHomes()
Return an empty Map.
|
java.lang.String |
getInstaller()
Return null.
|
java.lang.String[] |
getPossibleExecutables()
Return an empty String array.
|
java.lang.String |
getPreferredHome()
Return null.
|
InstallerImpl.BIT_OPTION |
getProductBit() |
java.lang.String |
getRegistryValue(java.lang.String keyPrefix,
java.lang.String keySuffix,
java.lang.String value)
To get the value from registry for path starting with
#HKLM_ST According to product bit productBit , get the registry's value. |
java.lang.String |
getUnInstaller()
Return null.
|
java.io.File |
getValidExecutable(java.io.File home,
java.lang.String defaultExecutable)
Implement the search logic suggested in the interface.
1. |
void |
setProductBit(InstallerImpl.BIT_OPTION productBit) |
public static final java.lang.String BIN
protected InstallerImpl.BIT_OPTION productBit
public ProductDetectorDefault()
public ProductDetectorDefault(InstallerImpl.BIT_OPTION productBit)
public InstallerImpl.BIT_OPTION getProductBit()
getProductBit
in interface IProductDetector
public void setProductBit(InstallerImpl.BIT_OPTION productBit)
setProductBit
in interface IProductDetector
productBit
- BIT_OPTION, the bit (32 or 64) of the product to detect.public java.lang.String getRegistryValue(java.lang.String keyPrefix, java.lang.String keySuffix, java.lang.String value)
#HKLM_ST
productBit
, get the registry's value.keyPrefix
- String, the prefix of the registry path, such as 'HKLM\Software\'.keySuffix
- String, the suffix of the registry path, such as 'GPL Ghostscript\9.23'value
- String, the registry value, it can be "(Default)".public boolean deleteRegistry(java.lang.String keyPrefix, java.lang.String keySuffix, java.lang.String value)
#HKLM_ST
productBit
, delete the registry's value.keyPrefix
- String, the prefix of the registry path, such as 'HKLM\Software\'.keySuffix
- String, the suffix of the registry path, such as 'GPL Ghostscript\9.23'value
- String, the registry value, it can be "(Default)".public java.util.Map<java.lang.String,java.lang.String> getHomes()
getHomes
in interface IProductDetector
public java.lang.String getPreferredHome()
getPreferredHome
in interface IProductDetector
public java.lang.String getDefaultHome()
getDefaultHome
in interface IProductDetector
public java.lang.String findUnInstaller(java.lang.String home) throws java.io.FileNotFoundException
findUnInstaller
in interface IProductDetector
home
- String, the product's home directoryjava.io.FileNotFoundException
- if not foundpublic java.lang.String appendSientOption(java.lang.String command)
IProductDetector
appendSientOption
in interface IProductDetector
public java.lang.String appendInstallDirOption(java.lang.String command, java.lang.String installDirectory)
IProductDetector
appendInstallDirOption
in interface IProductDetector
public java.lang.String appendOptions(java.lang.String command, java.lang.String... options)
IProductDetector
appendOptions
in interface IProductDetector
public java.lang.String getInstaller()
getInstaller
in interface IProductDetector
public java.lang.String getUnInstaller()
getUnInstaller
in interface IProductDetector
public java.lang.String[] getBins()
getBins
in interface IProductDetector
public java.lang.String[] getPossibleExecutables()
getPossibleExecutables
in interface IProductDetector
public java.io.File getValidExecutable(java.io.File home, java.lang.String defaultExecutable) throws java.io.FileNotFoundException
getBins()
sub folder of product homegetPossibleExecutables()
under the product homegetValidExecutable
in interface IProductDetector
home
- File, the product home directorydefaultExecutable
- String, the default executable. It could be name or "path relative to home".java.io.FileNotFoundException
- if no executable could be foundProductDetectorDefault
Copyright © SAS Institute. All Rights Reserved.