com.denova.JExpress.Installer
Class CustomInstaller

java.lang.Object
  extended by com.denova.JExpress.Installer.CustomInstaller
All Implemented Interfaces:
com.denova.JExpress.Installer.InstallerConstants, InstallPropertyNames

public class CustomInstaller
extends java.lang.Object
implements InstallPropertyNames, com.denova.JExpress.Installer.InstallerConstants

Interface to the installer for custom classes.

Author:
DeNova © 1997-2012 DeNova Last modified: 2012-05-15

Field Summary
 
Fields inherited from interface com.denova.JExpress.Installer.InstallPropertyNames
AbortIfErrorWithDefaultInstallDir, ApplicationDirectory, ApplicationDirectoryTarget, Author, AutoDetectLanguage, AutoupdateEveryStartup, AutoupdateNever, AutoupdateOnDemand, BackgroundColor, BasePath, CheckGuiRunningCommand, CheckLicenseDuringInstall, CheckLicenseDuringUpdate, CheckLicenseFromYourApp, CheckPreVersion, ClickFreeInstaller, ClickFreeUninstaller, ClickFreeUpdater, CompressedFileSize, ConfigureWinRegistry, CreatedMenuDirs, CustomAfterDirectoryWizardPanelClass, CustomAfterFilesInstalledWizardPanelClass, CustomAfterInstallWizardPanelClass, CustomAfterLicenseWizardPanelClass, CustomAfterMenusWizardPanelClass, CustomAfterMultipleInstallsWizardPanelClass, CustomAfterReadMeWizardPanelClass, CustomAfterWelcomeWizardPanelClass, CustomBeforeInstallWizardPanelClass, DefaultApplicationDirectory, DefaultLinuxParentAppDir, DefaultMacParentAppDir, DefaultOtherParentAppDir, DefaultSolarisParentAppDir, DefaultWindowsParentAppDir, DownloadUrl, ExtraParameters, FailIfNoLicenseServer, FileGroupsFolders, FileGroupsTypes, InitialUserName, InstallAsAdmin, InstallationStarted, InstallButtonsPosition, InstallerDefaultLanguage, InstallerExecutable, InstallerExtraFiles, InstallImageFilename, InstallImagePosition, InstallJvmParameters, InstallLicenseFilename, InstallPasswordDigest, InstallReadmeFilename, InstallSuccessful, InstallType, InstallUserClasspath, IsServlet, JavaAppFilesSigned, JvmClasspathSwitch, JvmCommandName, JvmExtraParameters, JvmHomeDir, JvmMaxVersion, JvmMinVersion, JvmName, JvmRequiredVersion, JvmSelfExtractor, JvmVersion, LAFTheme, LicenseAccount, LicenseAppRight, LicenseEndUser, LicenseError, LicenseIdCode, LicenseName, LicensePrimaryContact, LicenseProduct, LicenseRight, LoaderClasspath, LoaderJavaCommand, LookAndFeelInterface, MainClassname, MenuAllUsers, MenuArguments, MenuAssociatedInstallType, MenuAutoStartup, MenuAutoUpdate, MenuCommandLineArguments, MenuDesktopShortcut, MenuExecutableFile, MenuGnome, MenuIconName, MenuInstallAsService, MenuKDE, MenuLongName, MenuMac, MenuRunAsAdmin, MenusAttributeName, MenuShortName, MenuStartAfterInstall, MenuToStart, MenuUnix, MenuUseJavaCommandPrefix, MenuUseJavaConsole, MenuWindows, MenuWorkingDir, MenuXfce, MinimizedImageFilename, MultipleComponents, MultipleFileGroups, MultipleInstallTypes, NativeJvmHomeDir, NativeJvmInstalled, NativeJvmInstalledInTemp, NextInstallTypes, OldApplicationDirectory, OnDemandDesktopShortcut, PackageCopyright, PackageCreated, PackageName, PackageVersion, PackJarFile, PredefinedJvmInstallDir, PreviousApplicationDir, PreviousVersion, ProgressBarColor, PromptForInstallDir, PromptUserBeforeUninstalling, ProxyHost, ProxyPassword, ProxyPort, ProxyUserName, RelativeFileMap, SafePackageName, SaveFilePermissions, SaveInstallEnvironment, SearchForJvm, SecondaryUpdater, SelectedInstallTypes, SetLastModifiedDate, ShowFinalPanel, ShowFrame, ShowWelcomePanel, SilentConfigFilename, SilentInstall, SilentUninstaller, SilentUpdater, SingleInstallType, StartAppName, StartDirectory, StartGuiCommand, Submenu, SystemSecurityPolicyFilename, TestPropertiesFilename, TextColor, TextFileExtensions, TotalBytesNeeded, TotalCompressedFiles, TrackConversions, UncompressedTotalSize, UninstallCommand, UninstallerArgs, UninstallerIconPath, UninstallerPathname, UnzipExecutable, UserRequestedSilentInstall, UserSecurityPolicyFilename, WebSite
 
Fields inherited from interface com.denova.JExpress.Installer.InstallerConstants
NoticeFont, SmallFont, TitleFont
 
Constructor Summary
CustomInstaller()
           
 
Method Summary
static void exit()
          Exit the installer.
static boolean extractFile(java.lang.String filename)
          Extracts a file to the installer's temporary directory.
static void fatalError(java.lang.String errorMessage)
          Show the error message and exit.
static java.awt.Color getBackgroundColor()
          Get the color used for the background of panels, buttons, and dialogs.
static java.lang.String getImageFilename()
          Get the filename for the image displayed in the installer.
static java.lang.String getLanguage()
          Returns the language the installer is using.
static java.lang.String getLocalizedString(java.lang.String key)
          Returns a localized string from the installer's primary resources.
static java.lang.String getLocalizedString(java.lang.String key, java.lang.String variable)
          Returns a localized string from the installer's primary resources.
static java.lang.String getLocalizedString(java.lang.String key, java.lang.String[] variables)
          Returns a localized string from the installer's primary resources.
static javax.swing.JPanel getLogoPanel()
          Returns the panel for the installer's image if the image is not in the background.
static Marquee getMarquee()
          Gets the marquee window.
static java.lang.String getProductUrl()
          Get the URL for the product.
static java.awt.Color getProgressBarColor()
          Get the color used for progress bars.
static boolean getResourceAsFile(java.lang.String filename)
          Looks through the classpath for the filename and saves it to a file in the installer's temporary directory.
static boolean getResourceAsFile(java.lang.String filename, java.lang.String pathname)
          Looks through the classpath for the filename and saves it to the pathname.
static java.io.InputStream getResourceAsStream(java.lang.String name)
          Opens an input stream to the resource.
static java.lang.String getStartDirectory()
          Returns the installer's starting directory.
static java.lang.String getTempDirectory()
          Returns the installer's temporary directory.
static java.awt.Color getTextColor()
          Get the color used for text items.
static java.lang.String getUserClasspath()
          Returns the classpath the installer uses to configure the user's classpath.
static java.lang.String installerCreatedBy()
          Get the program that created the installer.
static boolean isOpaque()
          Report if the background is opaque or not.
static boolean launchApp(java.lang.String appName, java.awt.Container parent)
          Start a launcher.
static void log(java.lang.String msg)
          Log a message to installer.log, if it exists.
static void logError(java.lang.String msg)
          Log an error to the installer's error log.
static void logException(java.lang.String msg, java.lang.Exception t)
          Log an exception to installer.log, if the log exists.
static void logToInstaller(java.lang.String msg)
          Deprecated. use log()
static boolean makeInstallerSilent()
          Make installer silent.
static boolean multipleComponents()
          Returns true if installing multiple install components.
static boolean multipleDirInstall()
          Returns true if installing to multiple directories.
static boolean multipleFileGroups()
          Returns true if installing multiple install types.
static boolean needSeparateDataDir()
          Returns true if need separate data dir.
protected static boolean okToRun()
          Check if it's ok to run with CopyCheq server.
static void repackWindow()
          Repack the window.
static void setInstallerVisible(boolean visible)
          Set installer visible if true.
static void setVisible(boolean visible)
          Set installer's panel visible if true.
static boolean singleInstallType()
          Returns true if installing a single multiple install type installer.
static void updateMarquee(Marquee marquee)
          Update the marquee window.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CustomInstaller

public CustomInstaller()
Method Detail

multipleDirInstall

public static boolean multipleDirInstall()
Returns true if installing to multiple directories.

Returns:
true if this is a multiple directory installer.

multipleFileGroups

public static boolean multipleFileGroups()
Returns true if installing multiple install types.

Returns:
true if this is a multiple install types installer.

multipleComponents

public static boolean multipleComponents()
Returns true if installing multiple install components.

Returns:
true if this is a multiple install components installer.

singleInstallType

public static boolean singleInstallType()
Returns true if installing a single multiple install type installer.


getUserClasspath

public static java.lang.String getUserClasspath()
Returns the classpath the installer uses to configure the user's classpath.

Adjusts the classpath to use the local file separator.

Returns:
user classpath

getLogoPanel

public static javax.swing.JPanel getLogoPanel()
Returns the panel for the installer's image if the image is not in the background.

You can use this method to replace the image and create billboards. Don't forget to empty the container before you add your own image. If your image is a different size, you'll want to revalidate, etc. We strongly recommend that you always use the same size image.

Returns:
logo panel

repackWindow

public static void repackWindow()
Repack the window. Use this method if you change images or anything that will cause the installer's window to be resized.


isOpaque

public static boolean isOpaque()
Report if the background is opaque or not.

Returns:
true if opaque background.

getBackgroundColor

public static java.awt.Color getBackgroundColor()
Get the color used for the background of panels, buttons, and dialogs.

Returns:
background color.

getProgressBarColor

public static java.awt.Color getProgressBarColor()
Get the color used for progress bars.

Returns:
progress bar color.

getTextColor

public static java.awt.Color getTextColor()
Get the color used for text items.

Returns:
text color.

getMarquee

public static Marquee getMarquee()
Gets the marquee window.

Returns:
marquee window

updateMarquee

public static void updateMarquee(Marquee marquee)
Update the marquee window. Use getMarquee() to set the various attributes before calling updateMarquee().

Parameters:
marquee - window

makeInstallerSilent

public static boolean makeInstallerSilent()
Make installer silent.

Returns:
true if successful.

getResourceAsFile

public static boolean getResourceAsFile(java.lang.String filename)
Looks through the classpath for the filename and saves it to a file in the installer's temporary directory.

filename: name of file to get

Returns true if successful.

Parameters:
filename -
Returns:
resource as file

getResourceAsFile

public static boolean getResourceAsFile(java.lang.String filename,
                                        java.lang.String pathname)
Looks through the classpath for the filename and saves it to the pathname.

filename: name of file to get
pathname: full pathname to save file, not just the directory

Returns true if successful.

Parameters:
filename -
pathname -
Returns:
resource as file

getResourceAsStream

public static java.io.InputStream getResourceAsStream(java.lang.String name)
Opens an input stream to the resource.

name: name of the resource

Returns an input stream.

Parameters:
name -
Returns:
resource as stream

extractFile

public static boolean extractFile(java.lang.String filename)
Extracts a file to the installer's temporary directory.

filename: the name of the file to extract

Returns true if successful.

The file is automatically deleted at the end of the installation. If any of your custom panels use other files, such as images or property files, then you must extract them before your custom class needs them.

Parameters:
filename -
Returns:
true if successful.

getImageFilename

public static java.lang.String getImageFilename()
Get the filename for the image displayed in the installer.

Returns:
image filename.

getStartDirectory

public static java.lang.String getStartDirectory()
Returns the installer's starting directory.

You usually don't want to write anything in the starting directory because you don't knoow if the installer started on a write-protected CD ROM.

Returns:
start directory

getTempDirectory

public static java.lang.String getTempDirectory()
Returns the installer's temporary directory.

If the installer is not using a temporary directory, then it returns a blank.

Returns:
temp directory

getLanguage

public static java.lang.String getLanguage()
Returns the language the installer is using.

Returns:
language

getLocalizedString

public static java.lang.String getLocalizedString(java.lang.String key)
Returns a localized string from the installer's primary resources.

key: the attribute for the value

Parameters:
key -
Returns:
localized string

getLocalizedString

public static java.lang.String getLocalizedString(java.lang.String key,
                                                  java.lang.String variable)
Returns a localized string from the installer's primary resources.

key: the attribute for the value variable: a variable used to replace the literal %VARIABLE%

Parameters:
key -
variable -
Returns:
localized string

getLocalizedString

public static java.lang.String getLocalizedString(java.lang.String key,
                                                  java.lang.String[] variables)
Returns a localized string from the installer's primary resources.

key: the attribute for the value variables: list of variables used to replace the literal %VARIABLE%

Parameters:
key -
variables -
Returns:
localized string

setVisible

public static void setVisible(boolean visible)
Set installer's panel visible if true.

Parameters:
visible - if true, panel is made visible; otherwise not.

setInstallerVisible

public static void setInstallerVisible(boolean visible)
Set installer visible if true.

Parameters:
visible - if true, installer is made visible; otherwise not.

installerCreatedBy

public static java.lang.String installerCreatedBy()
Get the program that created the installer.

Returns:
Program's name that created the installer.

launchApp

public static boolean launchApp(java.lang.String appName,
                                java.awt.Container parent)
Start a launcher.


getProductUrl

public static java.lang.String getProductUrl()
Get the URL for the product.

Returns:
url defined in the Website field (if valid) or the download url (if valid); otherwise, null.

needSeparateDataDir

public static boolean needSeparateDataDir()
Returns true if need separate data dir. Windows 7, Windows Vista, and Mac OS if installed in the /Applications directory need a separate data dir.

Returns:
true if OS prefers a separate data dir.

exit

public static void exit()
Exit the installer.


fatalError

public static void fatalError(java.lang.String errorMessage)
Show the error message and exit.

Parameters:
errorMessage - message to display, if not silent error.

logToInstaller

public static void logToInstaller(java.lang.String msg)
Deprecated. use log()

Log a message to installer.log, if it exists.

Parameters:
msg - message to record

log

public static void log(java.lang.String msg)
Log a message to installer.log, if it exists.

Parameters:
msg - message to record See the manual about diagnostic logs (Manual/Diagnostics/inslogs.html).

logError

public static void logError(java.lang.String msg)
Log an error to the installer's error log.

Parameters:
msg - message about error.

logException

public static void logException(java.lang.String msg,
                                java.lang.Exception t)
Log an exception to installer.log, if the log exists.

Parameters:
msg - message to record
t - the exception See the manual about diagnostic logs (Manual/Diagnostics/inslogs.html).

okToRun

protected static boolean okToRun()
Check if it's ok to run with CopyCheq server.