public class InstalledConfig extends EncodableObject
Modifier and Type | Class and Description |
---|---|
static interface |
InstalledConfig.InstalledDirectories |
Modifier and Type | Field and Description |
---|---|
String |
allUsersDataDirectory
The global data directory for the application.
|
String |
desktopDirectory |
PropertyList |
extraProperties |
long |
installationTime
The time and date the installation was done.
|
String |
installDirectory
The directory where the program files were installed.
|
boolean |
installedForUserOnly
This is set true if the application was installed for a single user only.
|
InstallerConfig |
installerConfig
The text encoded configuration that was used to install the application.
|
long |
migrationTime
The time and date the migration was done (if any).
|
static String |
RegistryEntryUserDataDirectory |
String |
savedDataFiles
This is a list of files in the format:
"
|
String |
savedProgramFiles
This is a list of files in the format:
"
|
String |
savedRegistryKeys
Registry keys that were successfully written by the installer.
|
static String |
StandardSavedName |
String |
startMenuProgramsDirectory |
Constructor and Description |
---|
InstalledConfig() |
Modifier and Type | Method and Description |
---|---|
File |
getAllUserDataDirectory()
Attempt to determine and return the directory to be used for user data when the application was installed.
|
static InstalledConfig.InstalledDirectories |
getInstalledDirectories(String defaultDataDirectory)
Get the InstalledDirectories for this application, given a defaultDataDirectory if the application has
not been installed.
|
static InstalledConfig.InstalledDirectories |
getInstalledDirectories(String defaultDataDirectory,
String defaultProgramDirectory)
Get the InstalledDirectories for this application, given a defaultDataDirectory if the application has
not been installed.
|
static String[] |
getInstalledDirectoryNames(String defaultDataDirectory,
String defaultProgramDirectory)
Return the installed directories as an array of two strings.
|
static String |
getLocalMachineRegistryEntryFor(String forData) |
static InstalledConfig |
load()
Load a new InstalledConfig object from the InstalledConfig.dat file that would have been
placed in the installation directory.
|
void |
load(File from)
Load this InstalledConfig object from a file that exists.
|
void |
load(InputStream in) |
void |
save(File to)
Save this InstalledConfig object to a File.
|
void |
save(OutputStream to) |
static File |
tryGetInstalledDirectory(boolean dataDirectory)
Attempt to get either the program install directory or the all users data directory, only if valid InstalledConfig data is present.
|
decode, decoded, decoded, decodeFields, decodeFields, encode, encoded, encoded, encodeFields, encodeFields, textDecode, textEncode
_getFieldType, _getSetField, cache, compareTo, copied, copyFrom, equals, getCopy, getDeclaredField, getDeclaredFieldValue, getMyFieldList, getNew
public PropertyList extraProperties
public String allUsersDataDirectory
public String installDirectory
public String savedRegistryKeys
public String savedProgramFiles
public String savedDataFiles
public String desktopDirectory
public String startMenuProgramsDirectory
public long installationTime
public long migrationTime
public InstallerConfig installerConfig
public boolean installedForUserOnly
public static final String StandardSavedName
public static final String RegistryEntryUserDataDirectory
public void save(File to) throws IOException
to
- the destination File.IOException
public void save(OutputStream to) throws IOException
IOException
public void load(InputStream in) throws IOException
IOException
public void load(File from) throws IOException
from
- the file to load from.IOException
public static InstalledConfig load() throws IOException
IOException
- if the InstalledConfig.dat file exists but there was an error reading it.public static String getLocalMachineRegistryEntryFor(String forData)
public File getAllUserDataDirectory()
public static File tryGetInstalledDirectory(boolean dataDirectory)
dataDirectory
- true to get the all users data directory, false to get the program files install directory.public static String[] getInstalledDirectoryNames(String defaultDataDirectory, String defaultProgramDirectory)
defaultDataDirectory
- defaultProgramDirectory
- public static InstalledConfig.InstalledDirectories getInstalledDirectories(String defaultDataDirectory)
defaultDataDirectory
- the default directory if the application has not been installed.public static InstalledConfig.InstalledDirectories getInstalledDirectories(String defaultDataDirectory, String defaultProgramDirectory)
defaultDataDirectory
- the default directory if the application has not been installed.defaultProgramDirectory
- the default directory for the program files if the application has not been installed.
If this is null the program directory will default to the location reported by File.getProgramDirectory().