|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.jsdt.support.SupportHelper
com.ibm.jsdt.support.SupportWindowsHelper
public class SupportWindowsHelper
Windows specific helper functionality.
Field Summary |
---|
Fields inherited from class com.ibm.jsdt.support.SupportHelper |
---|
sNEWLN, theSupportBase |
Constructor Summary | |
---|---|
SupportWindowsHelper()
Deprecated. Sole constructor. |
Method Summary | |
---|---|
boolean |
addLocalUser(SupportBase s)
Deprecated. Creates a new user ID and password. |
boolean |
addUser(SupportBase s)
Deprecated. Creates a new user ID. |
boolean |
addUserToGroup(SupportBase s)
Deprecated. Adds a user to a group. |
boolean |
createRegistryKey(SupportBase s)
Deprecated. Creates a registry key. |
int |
createWindowsUser(SupportBase s)
Deprecated. Creates a new user ID and password. |
boolean |
deleteRegistryKey(SupportBase s)
Deprecated. Deletes a registry key (and any subkeys). |
boolean |
deleteRegistryValueField(SupportBase s)
Deprecated. Deletes a value name/field under a key. |
boolean |
doesRegKeyExist(SupportBase s)
Deprecated. Checks for the existence of a particular subkey in the Winodws registry. |
boolean |
doesUserIdExist(SupportBase s)
Deprecated. Determines if the given user ID exists. |
java.lang.String |
getAdministratorsGroupName(SupportBase s)
Deprecated. Gets the administrator's group name. |
java.lang.String |
getIssResponseFileValue(SupportBase s)
Deprecated. Scans an ISS type response file for a key and returns the string value found. |
java.lang.String[] |
getRegistrySubkeys(SupportBase s)
Deprecated. Retrieves a String[] of the names of the subkeys
under a given registry key. |
java.lang.String |
getRegistryValue(SupportBase s)
Deprecated. Gets a String from the Windows registry. |
int |
getRegistryValueInt(SupportBase s)
Deprecated. Gets a number from the Windows registry. |
int |
getServicePack()
Deprecated. Gets the Windows service pack level. |
java.lang.String |
getWinDir(SupportBase s)
Deprecated. Gets the Windows folder. |
java.util.List |
getWindowsDrives(SupportBase s)
Deprecated. Retrieves all of the drives on the Windows system. |
java.lang.String |
getWindowsShortPath(SupportBase s)
Deprecated. Retrieves the Windows short name path for the given path. |
java.lang.String |
getWindowsTempDirectoryPath(SupportBase s)
Deprecated. Retrieves the Windows temporary folder path associated with the current environment of the user program. |
int |
getWindowsVersion()
Deprecated. Gets the current type of Windows operating system. |
void |
grantPrivilegesToUser(SupportBase s)
Deprecated. Adds privileges to an existing user account on Microsoft Windows NT or later operating systems. |
boolean |
isNTFSDirectory(java.lang.String directory)
Deprecated. Determines if the drive where a folder resides is formatted as an NTFS drive. |
boolean |
isNTFSDrive(SupportBase s)
Deprecated. Indicates whether the specified drive is an NTFS formatted volume. |
boolean |
isUserAndPasswordValid(SupportBase s)
Deprecated. Verifies if the given user and password are valid. |
boolean |
isWin2000()
Deprecated. Confirms that the operating system is Windows 2000. |
boolean |
isWin2003()
Deprecated. Confirms that the operating system is Windows 2003. |
boolean |
isWin2008()
Deprecated. Confirms that the operating system is Windows 2008. |
boolean |
isWin95()
Deprecated. Confirms that the operating system is Windows 95. |
boolean |
isWin98()
Deprecated. Confirms that the operating system is Windows 98. |
boolean |
isWinNT40()
Deprecated. Confirms that the operating system is Windows NT 4.0. |
boolean |
isWinVista()
Deprecated. Confirms that the operating system is Windows Vista. |
boolean |
isWinXP()
Deprecated. Confirms that the operating system is Windows XP. |
void |
setIssResponseFileValue(SupportBase s)
Deprecated. Scans an ISS type response file for a key and replaces the key value. |
boolean |
setRegistryNumericValue(SupportBase s,
int sValue)
Deprecated. Sets a registry number (int) value. |
boolean |
setRegistryStringValue(SupportBase s,
java.lang.String sValue)
Deprecated. Sets a registry string value. |
void |
setServiceTypeAutoStart(SupportBase s)
Deprecated. Sets the start type of a Windows service to autostart. |
void |
setServiceTypeManualStart(SupportBase s)
Deprecated. Sets the start type of a Windows service to manual. |
void |
startServices(SupportBase s)
Deprecated. Starts a Windows service program. |
void |
stopServices(SupportBase s)
Deprecated. Stops a Windows service program. |
boolean |
waitForFileOrRegKey(SupportBase s)
Deprecated. Polls the system for the existence of a file or registry key or both. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SupportWindowsHelper()
Method Detail |
---|
public boolean isWin2000()
boolean
true
if the current OS is Windows 2000
false
if the current OS is not Windows 2000public boolean isWinXP()
boolean
true
if the current OS is Windows XP
false
if the current OS is not Windows XPpublic boolean isWin2003()
boolean
true
if the current OS is Windows 2003
false
if the current OS is not Windows 2003public boolean isWinNT40()
boolean
true
if the current OS is Windows NT 4.0
false
if the current OS is not Windows NT 4.0public boolean isWin98()
boolean
true
if the current OS is Windows 98
false
if the current OS is not Windows 98public boolean isWinVista()
boolean
true
if the current OS is Windows Vista
false
if the current OS is not Windows Vistapublic boolean isWin2008()
boolean
true
if the current OS is Windows 2008
false
if the current OS is not Windows 2008public boolean isWin95()
boolean
true
if the current OS is Windows 95
false
if the current OS is not Windows 95public java.lang.String getRegistryValue(SupportBase s)
String
from the Windows registry.
The SupportBase
to be queried must call
SupportBase.setRegistryKey
,
SupportBase.setRegistrySubKey
, and
SupportBase.setRegistryString
before calling this method.
There are 5 valid values for hKey:
1 = HKEY_LOCAL_MACHINE
2 = HKEY_CLASSES_ROOT
3 = HKEY_USERS
4 = HKEY_CURRENT_USER
5 = HKEY_CURRENT_CONFIG
s
- the SupportBase
to be queriedint
that represents a Windows registry key SupportBase.getRegistryKey
String
Windows registry subkey SupportBase.getRegistrySubKey()
String
Windows registry string SupportBase.getRegistryString()
public int getRegistryValueInt(SupportBase s)
The SupportBase
to be queried must call
SupportBase.setRegistryKey
,
SupportBase.setRegistrySubKey
, and
SupportBase.setRegistryString
before calling this method.
There are 5 valid values for hKey:
1 = HKEY_LOCAL_MACHINE
2 = HKEY_CLASSES_ROOT
3 = HKEY_USERS
4 = HKEY_CURRENT_USER
5 = HKEY_CURRENT_CONFIG
s
- the SupportBase
to be queriedint
that represents a Windows registry key SupportBase.getRegistryKey()
String
Windows registry subkey SupportBase.getRegistrySubKey()
String
Windows registry string SupportBase.getRegistryString()
public boolean createRegistryKey(SupportBase s)
The SupportBase
to be queried must call
SupportBase.setRegistryKey
,
SupportBase.setRegistrySubKey
, and
SupportBase.setRegistryString
before calling this method.
There are 5 valid values for hKey:
1 = HKEY_LOCAL_MACHINE
2 = HKEY_CLASSES_ROOT
3 = HKEY_USERS
4 = HKEY_CURRENT_USER
5 = HKEY_CURRENT_CONFIG
s
- the SupportBase
to be queriedint
that represents a Windows registry key SupportBase.getRegistryKey()
String
Windows registry subkey SupportBase.getRegistrySubKey()
boolean
returns true if registry creation is successfulpublic boolean deleteRegistryKey(SupportBase s)
The SupportBase
to be queried must call
SupportBase.setRegistryKey
,
SupportBase.setRegistrySubKey
, and
SupportBase.setRegistryString
before calling this method.
There are 5 valid values for hKey:
1 = HKEY_LOCAL_MACHINE
2 = HKEY_CLASSES_ROOT
3 = HKEY_USERS
4 = HKEY_CURRENT_USER
5 = HKEY_CURRENT_CONFIG
s
- the SupportBase
to be queriedint
that represents a Windows registry key SupportBase.getRegistryKey()
String
Windows registry subkey SupportBase.getRegistrySubKey()
boolean
returns true if registry deletion is successfulpublic boolean deleteRegistryValueField(SupportBase s)
The SupportBase
to be queried must call
SupportBase.setRegistryKey
,
SupportBase.setRegistrySubKey
, and
SupportBase.setRegistryString
before calling this method.
There are 5 valid values for hKey:
1 = HKEY_LOCAL_MACHINE
2 = HKEY_CLASSES_ROOT
3 = HKEY_USERS
4 = HKEY_CURRENT_USER
5 = HKEY_CURRENT_CONFIG
s
- the SupportBase
to be queriedint
that represents a Windows registry key SupportBase.getRegistryKey
String
Windows registry subkey SupportBase.getRegistrySubKey()
String
Windows registry string SupportBase.getRegistryString()
boolean
returns true if deletion is successfulpublic boolean setRegistryStringValue(SupportBase s, java.lang.String sValue)
The SupportBase
to be queried must call
SupportBase.setRegistryKey
,
SupportBase.setRegistrySubKey
, and
SupportBase.setRegistryString
before calling this method.
There are 5 valid values for hKey:
1 = HKEY_LOCAL_MACHINE
2 = HKEY_CLASSES_ROOT
3 = HKEY_USERS
4 = HKEY_CURRENT_USER
5 = HKEY_CURRENT_CONFIG
s
- the SupportBase
to be queriedint
that represents a Windows registry key SupportBase.getRegistryKey
String
Windows registry subkey SupportBase.getRegistrySubKey()
String
Windows registry string SupportBase.getRegistryString()
String
data to be stored with the specified value name boolean
Returns true if registry is updated successfully, false if otherwise.public boolean setRegistryNumericValue(SupportBase s, int sValue)
The SupportBase
to be queried must call
SupportBase.setRegistryKey
,
SupportBase.setRegistrySubKey
, and
SupportBase.setRegistryString
before calling this method.
There are 5 valid values for hKey:
1 = HKEY_LOCAL_MACHINE
2 = HKEY_CLASSES_ROOT
3 = HKEY_USERS
4 = HKEY_CURRENT_USER
5 = HKEY_CURRENT_CONFIG
s
- the SupportBase
to be queriedint
that represents a Windows registry key SupportBase.getRegistryKey
String
Windows registry subkey SupportBase.getRegistrySubKey()
String
Windows registry string SupportBase.getRegistryString()
int
data to be stored with the specified value name boolean
Returns true if registry is updated successfully, false if otherwise.public boolean addLocalUser(SupportBase s)
The SupportBase
to be queried must call
SupportBase.setUserName
and
SupportBase.setPassword
before calling this method.
s
- the SupportBase
to be queriedString
user name SupportBase.getUserName
String
password SupportBase.getPassword
boolean
true
if successfully created
false
all elsepublic boolean addUser(SupportBase s)
The SupportBase
to be queried must call
SupportBase.setUserName
,
SupportBase.setPassword
, and
SupportBase.setGroupName
before calling this method.
s
- the SupportBase
to be queriedString
user name SupportBase.getUserName
String
password SupportBase.getPassword
String
group name SupportBase.getGroupName
boolean
true
if successfully created
false
all elsepublic boolean addUserToGroup(SupportBase s)
The SupportBase
to be queried must call
SupportBase.setUserName
and
SupportBase.setGroupName
before calling this method.
s
- the SupportBase
to be queriedString
user name SupportBase.getUserName
String
group name SupportBase.getGroupName
boolean
true
if successfully added
false
all else public int getServicePack()
public boolean doesRegKeyExist(SupportBase s)
The SupportBase
to be queried must call
SupportBase.setRegistryKey
and
SupportBase.setRegistrySubKey
before calling this method.
There are 5 valid values for setRegistryKey:
HKEY_LOCAL_MACHINE = 1;
HKEY_CLASSES_ROOT = 2;
HKEY_USERS = 3;
HKEY_CURRENT_USER = 4;
HKEY_CURRENT_CONFIG = 5;
The registry subkey should be a string containing the full key path of the subkey.
You must use double backslashes ("\\") as subkey delimiters.
Example:
"SOFTWARE\\IBM\\DB2\\DB2 Workgroup Edition\\CurrentVersion"
s
- the SupportBase
to be queriedString
Windows registry key SupportBase.getRegistryKey
String
Windows registry subkey SupportBase.getRegistrySubKey
boolean
true
if registry key exists
false
all else public java.lang.String getWinDir(SupportBase s)
s
- the SupportBase
to be queried
public boolean waitForFileOrRegKey(SupportBase s)
The purpose of this function is to allow synchronization of a wrapper's installation program with the particular product's installation program. The creation of a particular file or registry key can be taken as an indicator that the product's installation routine is complete.
The SupportBase
to be queried must call
SupportBase.setTimeOut_Sec
(-1 for infinite timeout),
SupportBase.setInterval_Sec
,
SupportBase.setPath
(can be null),
SupportBase.setRegistryKey
(set to 5 if the registry key is to be ignored), and
SupportBase.setRegistrySubKey
(can be null)
before calling this method.
s
- the SupportBase
to be queriedSupportBase.getTimeOut_Sec
SupportBase.getInterval_Sec
SupportBase.getPath
SupportBase.getRegistryKey
SupportBase.getRegistrySubKey
boolean
true
if the file is found (created) or the registry key is found (created)
false
all elsepublic int getWindowsVersion()
int
public java.lang.String getIssResponseFileValue(SupportBase s)
The SupportBase
to be queried must call
SupportBase.setResponseFileName
,
SupportBase.setSection
, and
SupportBase.setKey
before calling this method.
s
- the SupportBase
to be queriedString
response file name SupportBase.getResponseFileName
String
section of the rsp file, may be "" SupportBase.getSection
String
response file key SupportBase.getKey
public void setIssResponseFileValue(SupportBase s)
The SupportBase
to be queried must call
SupportBase.setResponseFileName
,
SupportBase.setSection
,
SupportBase.setKey
, and
SupportBase.setKeyValue
before calling this method.
s
- the SupportBase
to be queriedString
response file name SupportBase.getResponseFileName
String
section of the rsp file, may be "" SupportBase.getSection
String
response file key SupportBase.getKey
String
response file key value SupportBase.getKeyValue
public boolean doesUserIdExist(SupportBase s)
The SupportBase
to be queried must call
SupportBase.setUserName
before calling this method.
s
- the SupportBase
to be queriedString
user name SupportWindowsBase.getUserName
boolean
true
if found
false
all elsepublic void grantPrivilegesToUser(SupportBase s)
The SupportBase
to be queried must call
SupportBase.setUserName
and SupportBase.setPrivileges
before calling this method.
Constants for some common user privileges follow. See your Microsoft documentation for additional privileges.
Log on on as a service = SeServiceLogonRight
Create a token object = SeCreateTokenPrivilege
Increase quotas = SeIncreaseQuotaPrivilege
Replace process level token = SeAssignPrimaryTokenPrivilege
Act as a part of the operating system = SeTcbPrivilege *
s
- the SupportBase
to be queriedSupportBase.getUserName
SupportBase.getPrivileges
public boolean isUserAndPasswordValid(SupportBase s)
The SupportBase
to be queried must call
SupportBase.setUserName
and SupportBase.setPassword
before calling this method.
s
- the SupportBase
to be queriedSupportBase.getUserName
SupportBase.getPassword
boolean
true
if found
false
all elsepublic java.lang.String getAdministratorsGroupName(SupportBase s)
public void stopServices(SupportBase s)
The SupportBase
to be queried must call
SupportBase.setServices
before calling this method
and provide a List of service names as specified in the Windows registry.
s
- the SupportBase
to be queriedString
response file name SupportBase.getServices
public void startServices(SupportBase s)
The SupportBase
to be queried must call
SupportBase.setServices
before calling this method
and provide a List of service names as specified in the Windows registry.
s
- the SupportBase
to be queriedString
response file name SupportBase.getServices
public void setServiceTypeManualStart(SupportBase s)
The SupportBase
to be queried must call
SupportBase.setServices
before calling this method.
s
- the SupportBase
to be queriedString
response file name SupportBase.getServices
public void setServiceTypeAutoStart(SupportBase s)
The SupportBase
to be queried must call
SupportBase.setServices
before calling this method.
s
- the SupportBase
to be queriedString
response file name SupportBase.getServices
public java.lang.String getWindowsShortPath(SupportBase s)
null
.
The SupportBase
to be queried must call
SupportBase.setPath
before calling this method.
s
- the SupportBase
to be queried String
path SupportBase.getPath
public java.lang.String getWindowsTempDirectoryPath(SupportBase s)
A slash will be appended to the path.
No SupportBase
methods need to be called
prior to calling this method.
code
- SupportBase
String
public java.lang.String[] getRegistrySubkeys(SupportBase s)
String[]
of the names of the subkeys
under a given registry key. The names are unqualified.
This method is not available on specification versions prior
to 2.1.1.0. A value of null
is returned
if the method call is attempted on a back-level specification version.
If no subkeys are present, null
is returned.
The SupportBase
to be queried must call
SupportBase.setRegistryKey
to set the
following parameter:
code
- int representing the hive.
There are 5 valid int values for hive:
SupportWindowsBase.HKEY_LOCAL_MACHINE
SupportWindowsBase.HKEY_CLASSES_ROOT
SupportWindowsBase.HKEY_USERS
SupportWindowsBase.HKEY_CURRENT_USER
SupportWindowsBase.HKEY_CURRENT_CONFIG
The SupportBase
to be queried must call
SupportBase.setRegistrySubKey
to set the
following parameter:
code
- String The full key path under the hive (parent key).
You must use double backslashes ("\\") as subkey delimiters.
Example:
"SOFTWARE\\IBM\\DB2\\DB2 Workgroup Edition\\CurrentVersion"
String[]
public boolean isNTFSDrive(SupportBase s)
The SupportBase
to be queried must call
SupportBase.setWindowsDrive
prior to
calling this method.
The specified drive must be a letter appended with a colon and, optionally, a backslash. For example: "C:" or "C:\".
code
- SupportBase
boolean
public java.util.List getWindowsDrives(SupportBase s)
If this method is called on IBM Installation Agents with
specifications prior to 2.1.1.0, an empty
List
is returned.
Nothing needs to be set into the SupportBase
prior to calling this method.
code
- SupportBase
List
public int createWindowsUser(SupportBase s)
Returns a native int
system return code.
Some relevant possible return values are:
Success 1
The user name parameter is not valid. 2202
The password parameter is not valid. 2203
The user account already exists. 2224
The password is shorter than required. 2245
The
SupportBase
to be queried must call
SupportBase.setUserName
and
SupportBase.setPassword< /code> before calling this method.
s
- the SupportBase
to be queried
String
user name SupportBase.getUserName
String
password SupportBase.getPassword
int
public boolean isNTFSDirectory(java.lang.String directory)
boolean
true
if the drive where the folder resides is formatted as an NTFS drive
false
if the folder string is null, zero length, or does not contain a drive letter
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |