|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.jsdt.common.Base
com.ibm.jsdt.support.deploymenthelper.DeploymentHelper
com.ibm.jsdt.support.deploymenthelper.WindowsDeploymentHelper
public class WindowsDeploymentHelper
Windows specific helper functionality.
Field Summary | |
---|---|
static java.lang.String |
copyright
|
static int |
HKEY_CLASSES_ROOT
|
static int |
HKEY_CURRENT_CONFIG
|
static int |
HKEY_CURRENT_USER
|
static int |
HKEY_LOCAL_MACHINE
|
static int |
HKEY_USERS
|
Fields inherited from class com.ibm.jsdt.support.deploymenthelper.DeploymentHelper |
---|
DEPLOYER_SPECIFICATION_VERSION_KEY, ENTRY_STAGE, EXIT_STAGE, FAILURE, ISMP_GLOBAL_PROPERTY, ISMP_PRODUCT_PROPERTY, ISMP_WIZARD_PROPERTY, MAIN_STAGE, PDC_CANCEL_INSTALL, PDC_DO_NOT_INSTALL, PDC_DOES_NOT_EXIST, PDC_EXISTS, resourceBundle, SELECTED_TASK_NAMES_KEY, sNEWLN, SUCCESS, VERSIONCHECKER_STAGE, VPD_INSTALL_LOCATION_PIPE, VPD_VERSION_PIPE |
Fields inherited from class com.ibm.jsdt.common.Base |
---|
NEW_LINE, OS_NAME, SLASH |
Constructor Summary | |
---|---|
WindowsDeploymentHelper()
|
Method Summary | |
---|---|
static boolean |
addLocalUser(java.lang.String userName,
java.lang.String password)
Creates a new user ID and password. |
static boolean |
addUser(java.lang.String userName,
java.lang.String password,
java.lang.String groupName)
Creates a new user ID. |
static boolean |
addUserToGroup(java.lang.String userName,
java.lang.String groupName)
Adds a user to a group. |
static boolean |
createRegistryKey(int key,
java.lang.String subKey)
Creates a registry key. |
static boolean |
createRegistryKey32(int key,
java.lang.String subKey)
Creates a registry key. |
static boolean |
createRegistryKey64(int key,
java.lang.String subKey)
Creates a registry key. |
static int |
createWindowsUser(java.lang.String userName,
java.lang.String password)
Creates a new user ID and password. |
static boolean |
deleteRegistryKey(int key,
java.lang.String subKey)
Deletes a registry key (and any subkeys). |
static boolean |
deleteRegistryKey32(int key,
java.lang.String subKey)
Deletes a registry key (and any subkeys). |
static boolean |
deleteRegistryValueField(int key,
java.lang.String subKey,
java.lang.String value)
Deletes a value name/field under a key. |
static boolean |
deleteRegistryValueField32(int key,
java.lang.String subKey,
java.lang.String value)
Deletes a value name/field under a key. |
static boolean |
deleteRegistryValueField64(int key,
java.lang.String subKey,
java.lang.String value)
Deletes a value name/field under a key. |
static boolean |
doesRegKeyExist(int key,
java.lang.String subKey)
Checks for the existence of a particular subkey in the Windows registry. |
static boolean |
doesRegKeyExist32(int key,
java.lang.String subKey)
Checks for the existence of a particular subkey in the Windows registry. |
static boolean |
doesRegKeyExist64(int key,
java.lang.String subKey)
Checks for the existence of a particular subkey in the Windows registry. |
static boolean |
doesUserIdExist(java.lang.String userName)
Determines if the given user ID exists. |
static java.lang.String |
getAdministratorsGroupName()
Gets the administrator's group name. |
static java.lang.String |
getIssResponseFileValue(java.lang.String responseFileName,
java.lang.String section,
java.lang.String key)
Scans an ISS type response file for a key and returns the string value found. |
static java.lang.String[] |
getRegistrySubkeys(int key,
java.lang.String subKey)
Retrieves a String[] of the names of the subkeys
under a given registry key. |
static java.lang.String[] |
getRegistrySubkeys32(int key,
java.lang.String subKey)
Retrieves a String[] of the names of the subkeys
under a given registry key. |
static java.lang.String[] |
getRegistrySubkeys64(int key,
java.lang.String subKey)
Retrieves a String[] of the names of the subkeys
under a given registry key. |
static java.lang.String |
getRegistryValue(int key,
java.lang.String subKey,
java.lang.String value)
Gets a String from the Windows registry. |
static java.lang.String |
getRegistryValue32(int key,
java.lang.String subKey,
java.lang.String value)
Gets a String from the Windows registry. |
static java.lang.String |
getRegistryValue64(int key,
java.lang.String subKey,
java.lang.String value)
Gets a String from the Windows registry. |
static int |
getRegistryValueInt(int key,
java.lang.String subKey,
java.lang.String value)
Gets a number from the Windows registry. |
static int |
getRegistryValueInt32(int key,
java.lang.String subKey,
java.lang.String value)
Gets a number from the Windows registry. |
static int |
getRegistryValueInt64(int key,
java.lang.String subKey,
java.lang.String value)
Gets a number from the Windows registry. |
static int |
getServicePack()
Gets the Windows service pack level. |
static java.lang.String |
getWinDir()
Gets the Windows folder. |
static java.util.List |
getWindowsDrives(java.lang.String compareVersion)
Retrieves all of the drives on the Windows system. |
static java.lang.String |
getWindowsShortPath(java.lang.String path)
Retrieves the Windows short name path for the given path. |
static java.lang.String |
getWindowsTempDirectoryPath()
Retrieves the Windows temporary folder path associated with the current environment of the user program. |
static int |
getWindowsVersion()
Gets the current type of Windows operating system. |
static void |
grantPrivilegesToUser(java.lang.String userName,
java.util.List requestedPrivileges)
Adds privileges to an existing user account on Microsoft Windows NT or later operating systems. |
static boolean |
isNTFSDirectory(java.lang.String directory)
Determines if the drive where a folder resides is formatted as an NTFS drive. |
static boolean |
isNTFSDrive(java.lang.String windowsDrive)
Indicates whether the specified drive is an NTFS formatted volume. |
static boolean |
isUserAndPasswordValid(java.lang.String userName,
java.lang.String password)
Verifies if the given user and password are valid. |
static boolean |
isWin2000()
Confirms that the operating system is Windows 2000. |
static boolean |
isWin2003()
Confirms that the operating system is Windows 2003. |
static boolean |
isWin2008()
Confirms that the operating system is Windows Server 2008. |
static boolean |
isWin95()
Confirms that the operating system is Windows 95. |
static boolean |
isWin98()
Confirms that the operating system is Windows 98. |
static boolean |
isWindows_64()
Determine if the Windows machine is running 64-bit operating system |
static boolean |
isWinNT40()
Confirms that the operating system is Windows NT 4.0. |
static boolean |
isWinVista()
Confirms that the operating system is Windows Vista. |
static boolean |
isWinXP()
Confirms that the operating system is Windows XP. |
protected static java.util.Map |
localeMap()
Answers a mapping of locales to InstallShield response file language codes. |
static int |
runAsWindowsSystemUser(java.lang.String localAdminUser,
java.lang.String localAdminPassword,
java.lang.String command)
Runs the command on the local Windows computer as "SYSTEM". |
static int |
runAsWindowsSystemUser(java.lang.String localAdminUser,
java.lang.String localAdminPassword,
java.lang.String command,
boolean shouldLogOutput)
Runs the command on the local Windows computer as "SYSTEM". |
static void |
setIssResponseFileValue(java.lang.String responseFileName,
java.lang.String section,
java.lang.String key,
java.lang.String keyValue)
Scans an ISS type response file for a key and replaces the key value. |
static boolean |
setRegistryNumericValue(int key,
java.lang.String subKey,
java.lang.String value,
int sValue)
Sets a registry number (int) value. |
static boolean |
setRegistryNumericValue32(int key,
java.lang.String subKey,
java.lang.String valueKey,
int valueData)
Sets a registry number (int) value. |
static boolean |
setRegistryNumericValue64(int key,
java.lang.String subKey,
java.lang.String valueKey,
int valueData)
Sets a registry number (int) value. |
static boolean |
setRegistryStringValue(int key,
java.lang.String subKey,
java.lang.String value,
java.lang.String sValue)
Sets a registry string value. |
static boolean |
setRegistryStringValue32(int key,
java.lang.String subKey,
java.lang.String valueKey,
java.lang.String valueData)
Sets a registry string value. |
static boolean |
setRegistryStringValue64(int key,
java.lang.String subKey,
java.lang.String valueKey,
java.lang.String valueData)
Sets a registry string value. |
static void |
setServiceTypeAutoStart(java.util.List requestedServices)
Sets the start type of a Windows service to autostart. |
static void |
setServiceTypeManualStart(java.util.List requestedServices)
Sets the start type of a Windows service to manual. |
static void |
startServices(java.util.List requestedServices)
Starts a Windows service program. |
static void |
stopServices(java.util.List requestedServices)
Stops a Windows service program. |
static boolean |
waitForFileOrRegKey(int timeOut,
int interval,
java.lang.String path,
int key,
java.lang.String subKey)
Polls the system for the existence of a file, a registry key or both. |
Methods inherited from class com.ibm.jsdt.common.Base |
---|
getBuildPropertiesAccessor, getFullVersion, getMainResources, getResourceString, getResourceString, getResourceString, getResourceString, getResourceString, getResourceStringArray, getResourceStringArray, showBuildProperties, showFullVersion |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String copyright
public static final int HKEY_LOCAL_MACHINE
public static final int HKEY_CLASSES_ROOT
public static final int HKEY_USERS
public static final int HKEY_CURRENT_USER
public static final int HKEY_CURRENT_CONFIG
Constructor Detail |
---|
public WindowsDeploymentHelper()
Method Detail |
---|
protected static java.util.Map localeMap()
Map
of Locale
spublic static boolean isWin2000()
boolean
value oftrue
if the current OS is Windows 2000
false
if the current OS is not Windows 2000public static boolean isWinXP()
boolean
value oftrue
if the current OS is Windows XP
false
if the current OS is not Windows XPpublic static boolean isWin2003()
boolean
value oftrue
if the current OS is Windows 2003
false
if the current OS is not Windows 2003public static boolean isWinNT40()
boolean
value oftrue
if the current OS is Windows NT 4.0
false
if the current OS is not Windows NT 4.0public static boolean isWin98()
boolean
value oftrue
if the current OS is Windows 98
false
if the current OS is not Windows 98public static boolean isWinVista()
boolean
value oftrue
if the current OS is Windows Vista
false
if the current OS is not Windows Vistapublic static boolean isWin2008()
boolean
value oftrue
if the current OS is Windows Server 2008
false
if the current OS is not Windows Server 2008public static boolean isWin95()
boolean
value oftrue
if the current OS is Windows 95
false
if the current OS is not Windows 95public static java.lang.String getRegistryValue(int key, java.lang.String subKey, java.lang.String value)
String
from the Windows registry.
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
key
- - a Windows registry keysubKey
- - a Windows registry subKeyvalue
- - a Windows registry value. If it is not present for the key, it is added to the key.
public static java.lang.String getRegistryValue32(int key, java.lang.String subKey, java.lang.String value)
String
from the Windows registry.
Separate 32 bit and 64 bit registry API must be used on 64 bit versions of Windows Server 2008, Windows Vista, Windows Server 2003, and Windows XP. Starting with Windows 7 and Windows Server 2008 R2, the use of processor specific registry API for 64 bit platforms is no longer required. On 32 bit systems, both the generic registry API and the 32 bit registry API will succeed.
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
key
- - a Windows registry keysubKey
- - a Windows registry subKeyvalue
- - a Windows registry value. If it is not present for the key, it is added to the key.
public static java.lang.String getRegistryValue64(int key, java.lang.String subKey, java.lang.String value)
String
from the Windows registry.
Separate 32 bit and 64 bit registry API must be used on 64 bit versions of Windows Server 2008, Windows Vista, Windows Server 2003, and Windows XP. Starting with Windows 7 and Windows Server 2008 R2, the use of processor specific registry API for 64 bit platforms is no longer required. On 32 bit systems, both the generic registry API and the 32 bit registry API will succeed.
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
key
- - a Windows registry keysubKey
- - a Windows registry subKeyvalue
- - a Windows registry value. If it is not present for the key, it is added to the key.
public static int getRegistryValueInt(int key, java.lang.String subKey, java.lang.String value)
Separate 32 bit and 64 bit registry API must be used on 64 bit versions of Windows Server 2008, Windows Vista, Windows Server 2003, and Windows XP. Starting with Windows 7 and Windows Server 2008 R2, the use of processor specific registry API for 64 bit platforms is no longer required. On 32 bit systems, both the generic registry API and the 32 bit registry API will succeed.
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
key
- - a Windows registry keysubKey
- - a Windows registry subKeyvalue
- - a Windows registry value. If it is not present for the key, it is added to the key.
public static int getRegistryValueInt32(int key, java.lang.String subKey, java.lang.String value)
Separate 32 bit and 64 bit registry API must be used on 64 bit versions of Windows Server 2008, Windows Vista, Windows Server 2003, and Windows XP. Starting with Windows 7 and Windows Server 2008 R2, the use of processor specific registry API for 64 bit platforms is no longer required. On 32 bit systems, both the generic registry API and the 32 bit registry API will succeed.
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
key
- - a Windows registry keysubKey
- - a Windows registry subKeyvalue
- - a Windows registry value. If it is not present for the key, it is added to the key.
public static int getRegistryValueInt64(int key, java.lang.String subKey, java.lang.String value)
Separate 32 bit and 64 bit registry API must be used on 64 bit versions of Windows Server 2008, Windows Vista, Windows Server 2003, and Windows XP. Starting with Windows 7 and Windows Server 2008 R2, the use of processor specific registry API for 64 bit platforms is no longer required. On 32 bit systems, both the generic registry API and the 32 bit registry API will succeed.
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
key
- - a Windows registry keysubKey
- - a Windows registry subKeyvalue
- - a Windows registry value. If it is not present for the key, it is added to the key.
public static boolean createRegistryKey(int key, java.lang.String subKey)
Separate 32 bit and 64 bit registry API must be used on 64 bit versions of Windows Server 2008, Windows Vista, Windows Server 2003, and Windows XP. Starting with Windows 7 and Windows Server 2008 R2, the use of processor specific registry API for 64 bit platforms is no longer required. On 32 bit systems, both the generic registry API and the 32 bit registry API will succeed.
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
key
- - a Windows registry keysubKey
- - a Windows registry subKey
boolean
value oftrue
if registry creation is successful
false
otherwisepublic static boolean createRegistryKey32(int key, java.lang.String subKey)
Separate 32 bit and 64 bit registry API must be used on 64 bit versions of Windows Server 2008, Windows Vista, Windows Server 2003, and Windows XP. Starting with Windows 7 and Windows Server 2008 R2, the use of processor specific registry API for 64 bit platforms is no longer required. On 32 bit systems, both the generic registry API and the 32 bit registry API will succeed.
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
key
- - a Windows registry keysubKey
- - a Windows registry subKey
boolean
value oftrue
if registry creation is successful
false
otherwisepublic static boolean createRegistryKey64(int key, java.lang.String subKey)
Separate 32 bit and 64 bit registry API must be used on 64 bit versions of Windows Server 2008, Windows Vista, Windows Server 2003, and Windows XP. Starting with Windows 7 and Windows Server 2008 R2, the use of processor specific registry API for 64 bit platforms is no longer required. On 32 bit systems, both the generic registry API and the 32 bit registry API will succeed.
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
key
- - a Windows registry keysubKey
- - a Windows registry subKey
boolean
value oftrue
if registry creation is successful
false
otherwisepublic static boolean deleteRegistryKey(int key, java.lang.String subKey)
Note: ISAT cannot delete a 64 bit registry key on 64 bit versions of Windows Server 2008 R1, Windows Vista, Windows Server 2003, and Windows XP.
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
key
- - Windows registry keysubKey
- - Windows registry subKey
boolean
value oftrue
if registry deletion is successful
false
otherwisepublic static boolean deleteRegistryKey32(int key, java.lang.String subKey)
Note: ISAT cannot delete a 64 bit registry key on 64 bit versions of Windows Server 2008 R1, Windows Vista, Windows Server 2003, and Windows XP.
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
key
- - Windows registry keysubKey
- - Windows registry subKey
boolean
value oftrue
if registry deletion is successful
false
otherwisepublic static boolean deleteRegistryValueField(int key, java.lang.String subKey, java.lang.String value)
Separate 32 bit and 64 bit registry API must be used on 64 bit versions of Windows Server 2008, Windows Vista, Windows Server 2003, and Windows XP. Starting with Windows 7 and Windows Server 2008 R2, the use of processor specific registry API for 64 bit platforms is no longer required. On 32 bit systems, both the generic registry API and the 32 bit registry API will succeed.
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
key
- - Windows registry keysubKey
- - Windows registry subKeyvalue
- - Window registry value
boolean
value oftrue
if deletion is successful
false
otherwisepublic static boolean deleteRegistryValueField32(int key, java.lang.String subKey, java.lang.String value)
Separate 32 bit and 64 bit registry API must be used on 64 bit versions of Windows Server 2008, Windows Vista, Windows Server 2003, and Windows XP. Starting with Windows 7 and Windows Server 2008 R2, the use of processor specific registry API for 64 bit platforms is no longer required. On 32 bit systems, both the generic registry API and the 32 bit registry API will succeed.
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
key
- - Windows registry keysubKey
- - Windows registry subKeyvalue
- - Window registry value
boolean
value oftrue
if deletion is successful
false
otherwisepublic static boolean deleteRegistryValueField64(int key, java.lang.String subKey, java.lang.String value)
Separate 32 bit and 64 bit registry API must be used on 64 bit versions of Windows Server 2008, Windows Vista, Windows Server 2003, and Windows XP. Starting with Windows 7 and Windows Server 2008 R2, the use of processor specific registry API for 64 bit platforms is no longer required. On 32 bit systems, both the generic registry API and the 32 bit registry API will succeed.
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
key
- - Windows registry keysubKey
- - Windows registry subKeyvalue
- - Window registry value
boolean
value oftrue
if deletion is successful
false
otherwisepublic static boolean setRegistryStringValue(int key, java.lang.String subKey, java.lang.String value, java.lang.String sValue)
Separate 32 bit and 64 bit registry API must be used on 64 bit versions of Windows Server 2008, Windows Vista, Windows Server 2003, and Windows XP. Starting with Windows 7 and Windows Server 2008 R2, the use of processor specific registry API for 64 bit platforms is no longer required. On 32 bit systems, both the generic registry API and the 32 bit registry API will succeed.
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
key
- - Windows registry keysubKey
- - Windows registry subKeyvalue
- - Windows registry valuesValue
- - value to be updated or created if it does not exist
boolean
value oftrue
if registry is updated successful
false
otherwisepublic static boolean setRegistryStringValue32(int key, java.lang.String subKey, java.lang.String valueKey, java.lang.String valueData)
Separate 32 bit and 64 bit registry API must be used on 64 bit versions of Windows Server 2008, Windows Vista, Windows Server 2003, and Windows XP. Starting with Windows 7 and Windows Server 2008 R2, the use of processor specific registry API for 64 bit platforms is no longer required. On 32 bit systems, both the generic registry API and the 32 bit registry API will succeed.
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
key
- - Windows registry keysubKey
- - Windows registry subKeyvalue
- - Windows registry valuesValue
- - value to be updated or created if it does not exist
boolean
value oftrue
if registry is updated successful
false
otherwisepublic static boolean setRegistryStringValue64(int key, java.lang.String subKey, java.lang.String valueKey, java.lang.String valueData)
Separate 32 bit and 64 bit registry API must be used on 64 bit versions of Windows Server 2008, Windows Vista, Windows Server 2003, and Windows XP. Starting with Windows 7 and Windows Server 2008 R2, the use of processor specific registry API for 64 bit platforms is no longer required. On 32 bit systems, both the generic registry API and the 32 bit registry API will succeed.
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
key
- - Windows registry keysubKey
- - Windows registry subKeyvalue
- - Windows registry valuesValue
- - value to be updated or created if it does not exist
boolean
value oftrue
if registry is updated successful
false
otherwisepublic static boolean setRegistryNumericValue(int key, java.lang.String subKey, java.lang.String value, int sValue)
Separate 32 bit and 64 bit registry API must be used on 64 bit versions of Windows Server 2008, Windows Vista, Windows Server 2003, and Windows XP. Starting with Windows 7 and Windows Server 2008 R2, the use of processor specific registry API for 64 bit platforms is no longer required. On 32 bit systems, both the generic registry API and the 32 bit registry API will succeed.
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
key
- - Windows registry keysubKey
- - Windows registry subKeyvalue
- - Windows registry valuesValue
- - value to be updated or created if it does not exist
boolean
value oftrue
if registry is updated successful
false
otherwisepublic static boolean setRegistryNumericValue32(int key, java.lang.String subKey, java.lang.String valueKey, int valueData)
Separate 32 bit and 64 bit registry API must be used on 64 bit versions of Windows Server 2008, Windows Vista, Windows Server 2003, and Windows XP. Starting with Windows 7 and Windows Server 2008 R2, the use of processor specific registry API for 64 bit platforms is no longer required. On 32 bit systems, both the generic registry API and the 32 bit registry API will succeed.
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
key
- - Windows registry keysubKey
- - Windows registry subKeyvalue
- - Windows registry valuesValue
- - value to be updated or created if it does not exist
boolean
value oftrue
if registry is updated successful
false
otherwisepublic static boolean setRegistryNumericValue64(int key, java.lang.String subKey, java.lang.String valueKey, int valueData)
Separate 32 bit and 64 bit registry API must be used on 64 bit versions of Windows Server 2008, Windows Vista, Windows Server 2003, and Windows XP. Starting with Windows 7 and Windows Server 2008 R2, the use of processor specific registry API for 64 bit platforms is no longer required. On 32 bit systems, both the generic registry API and the 32 bit registry API will succeed.
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
key
- - Windows registry keysubKey
- - Windows registry subKeyvalue
- - Windows registry valuesValue
- - value to be updated or created if it does not exist
boolean
value oftrue
if registry is updated successful
false
otherwisepublic static boolean addLocalUser(java.lang.String userName, java.lang.String password)
userName
- - a user namepassword
- - a password
boolean
true
if user ID and password are successfully created
false
otherwisepublic static boolean addUser(java.lang.String userName, java.lang.String password, java.lang.String groupName)
userName
- - a user namepassword
- - passwordgroupName
- - group name to add user to
boolean
true
if user id is successfully created
false
otherwisepublic static boolean addUserToGroup(java.lang.String userName, java.lang.String groupName)
userName
- - a user namegroupName
- - group name to add user to
boolean
true
if user id is successfully added to the group
false
otherwise public static int getServicePack()
public static boolean doesRegKeyExist(int key, java.lang.String subKey)
Separate 32 bit and 64 bit registry API must be used on 64 bit versions of Windows Server 2008, Windows Vista, Windows Server 2003, and Windows XP. Starting with Windows 7 and Windows Server 2008 R2, the use of processor specific registry API for 64 bit platforms is no longer required. On 32 bit systems, both the generic registry API and the 32 bit registry API will succeed.
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"
key
- - Windows registry keysubKey
- - Widows registry subKey
boolean
value oftrue
if registry key exists
false
otherwise public static boolean doesRegKeyExist32(int key, java.lang.String subKey)
Separate 32 bit and 64 bit registry API must be used on 64 bit versions of Windows Server 2008, Windows Vista, Windows Server 2003, and Windows XP. Starting with Windows 7 and Windows Server 2008 R2, the use of processor specific registry API for 64 bit platforms is no longer required. On 32 bit systems, both the generic registry API and the 32 bit registry API will succeed.
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"
key
- - Windows registry keysubKey
- - Widows registry subKey
boolean
value oftrue
if registry key exists
false
otherwise public static boolean doesRegKeyExist64(int key, java.lang.String subKey)
Separate 32 bit and 64 bit registry API must be used on 64 bit versions of Windows Server 2008, Windows Vista, Windows Server 2003, and Windows XP. Starting with Windows 7 and Windows Server 2008 R2, the use of processor specific registry API for 64 bit platforms is no longer required. On 32 bit systems, both the generic registry API and the 32 bit registry API will succeed.
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"
key
- - Windows registry keysubKey
- - Widows registry subKey
boolean
value oftrue
if registry key exists
false
otherwise public static java.lang.String getWinDir()
public static boolean waitForFileOrRegKey(int timeOut, int interval, java.lang.String path, int key, java.lang.String subKey)
The purpose of this function is to allow synchronization of a deployment accelerator'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 installation routine for a product is complete.
timeOut
- - time to wait in seconds (-1 for infinite timeout)interval
- - a poll time frame interval in secondspath
- - a path for specify file (can be null)key
- - Windows registry keysubKey
- - Windows registry subKey
boolean
value oftrue
if the file is found (created) or the registry key is found (created)
false
otherwisepublic static int getWindowsVersion()
integer
indicating the type of operating system as follows.public static java.lang.String getIssResponseFileValue(java.lang.String responseFileName, java.lang.String section, java.lang.String key)
responseFileName
- - response file namesection
- - section of response file name, can be ""key
- - response file key
public static void setIssResponseFileValue(java.lang.String responseFileName, java.lang.String section, java.lang.String key, java.lang.String keyValue)
responseFileName
- - response file namesection
- - section of response file name, can be ""key
- - response file keykeyValue
- - a new value to replace the current key value.public static boolean doesUserIdExist(java.lang.String userName)
userName
- - a user name
boolean
value oftrue
if user ID is found
false
otherwisepublic static void grantPrivilegesToUser(java.lang.String userName, java.util.List requestedPrivileges)
Constants for some common user privileges follow. See your Microsoft documentation for additional privileges.
Log 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
userName
- - a user namerequestedPrivileges
- - a list of requested privilege for that userpublic static boolean isUserAndPasswordValid(java.lang.String userName, java.lang.String password)
userName
- - a user namepassword
- - a password
boolean
value oftrue
if user and password are valid.
false
otherwisepublic static java.lang.String getAdministratorsGroupName()
public static void stopServices(java.util.List requestedServices)
requestedServices
- - list of the services that need to be stopped.public static void startServices(java.util.List requestedServices)
requestedServices
- - list of the services that need to be startedpublic static void setServiceTypeManualStart(java.util.List requestedServices)
requestedServices
- - List of services to be started manuallypublic static void setServiceTypeAutoStart(java.util.List requestedServices)
requestedServices
- - List of services to be started automaticallypublic static java.lang.String getWindowsShortPath(java.lang.String path)
null
.
path
- - a file or directory name path
public static java.lang.String getWindowsTempDirectoryPath()
A slash will be appended to the path.
String
indicating the path for the temporary folderpublic static java.lang.String[] getRegistrySubkeys(int key, java.lang.String subKey)
String[]
of the names of the subkeys
under a given registry key. The names are unqualified.
Separate 32 bit and 64 bit registry API must be used on 64 bit versions of Windows Server 2008, Windows Vista, Windows Server 2003, and Windows XP. Starting with Windows 7 and Windows Server 2008 R2, the use of processor specific registry API for 64 bit platforms is no longer required. On 32 bit systems, both the generic registry API and the 32 bit registry API will succeed.
If no subkeys are present, null
is returned.
key
- - The full key path under the hive (parent key)subKey
- - the subKey path
You must use double backslashes ("\\") as subkey delimiters.
Example:
"SOFTWARE\\IBM\\DB2\\DB2 Workgroup Edition\\CurrentVersion"
String[]
listing of subkeys.public static java.lang.String[] getRegistrySubkeys32(int key, java.lang.String subKey)
String[]
of the names of the subkeys
under a given registry key. The names are unqualified.
Separate 32 bit and 64 bit registry API must be used on 64 bit versions of Windows Server 2008, Windows Vista, Windows Server 2003, and Windows XP. Starting with Windows 7 and Windows Server 2008 R2, the use of processor specific registry API for 64 bit platforms is no longer required. On 32 bit systems, both the generic registry API and the 32 bit registry API will succeed.
If no subkeys are present, null
is returned.
key
- - The full key path under the hive (parent key)subKey
- - the subKey path
You must use double backslashes ("\\") as subkey delimiters.
Example:
"SOFTWARE\\IBM\\DB2\\DB2 Workgroup Edition\\CurrentVersion"
String[]
listing of subkeys.public static java.lang.String[] getRegistrySubkeys64(int key, java.lang.String subKey)
String[]
of the names of the subkeys
under a given registry key. The names are unqualified.
Separate 32 bit and 64 bit registry API must be used on 64 bit versions of Windows Server 2008, Windows Vista, Windows Server 2003, and Windows XP. Starting with Windows 7 and Windows Server 2008 R2, the use of processor specific registry API for 64 bit platforms is no longer required. On 32 bit systems, both the generic registry API and the 32 bit registry API will succeed.
If no subkeys are present, null
is returned.
key
- - The full key path under the hive (parent key)subKey
- - the subKey path
You must use double backslashes ("\\") as subkey delimiters.
Example:
"SOFTWARE\\IBM\\DB2\\DB2 Workgroup Edition\\CurrentVersion"
String[]
listing of subkeys.public static boolean isNTFSDrive(java.lang.String windowsDrive)
The specified drive must be a letter appended with a colon and, optionally, a backslash. For example: "C:" or "C:\".
windowsDrive
- - Windows drive name.
boolean
true
if window drive is NTFS formatted volume.
false
otherwisepublic static java.util.List getWindowsDrives(java.lang.String compareVersion)
If this method is called on IBM Installation Agents with
specifications prior to 2.1.1.0, an empty
List
is returned.
compareVersion
- - the product version to be compared to the current version
List
of Windows drivespublic static int createWindowsUser(java.lang.String userName, java.lang.String password)
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
userName
- - a user namepassword
- - user password
int
return code.public static boolean isNTFSDirectory(java.lang.String directory)
directory
- - a drive directory
boolean
value oftrue
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 public static int runAsWindowsSystemUser(java.lang.String localAdminUser, java.lang.String localAdminPassword, java.lang.String command)
code
- String The user ID that belongs to the local Administrators groupcode
- String passwordcode
- String command
int
the return code of the command.public static int runAsWindowsSystemUser(java.lang.String localAdminUser, java.lang.String localAdminPassword, java.lang.String command, boolean shouldLogOutput)
code
- String The user ID that belongs to the local Administrators groupcode
- String passwordcode
- String commandcode
- boolean turn command output logging on/off
int
the return code of the command.public static boolean isWindows_64()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |