com.denova.JExpress.Installer
Class CustomInstaller

java.lang.Object
  |
  +--com.denova.JExpress.Installer.CustomInstaller
All Implemented Interfaces:
com.denova.JExpress.Installer.InstallerConstants, InstallPropertyNames, com.denova.JExpress.JExpressConstants

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

Provides access to the installer from custom installer classes.

Author:
DeNova Copyright © 1997-2008 DeNova All rights reserved worldwide.

Field Summary
 
Fields inherited from interface com.denova.JExpress.JExpressConstants
AdvancedEdition, AppDirVariable, AppNameVariable, AutoRunInfFilename, BasedirPlaceHolder, BasePathArgument, BatchFileExtension, BuildDirArgumentNew, BuildDirArgumentOld, BuildPackage, ClassFileExtension, Classpath, ConfigDirectory, ControlUrlPatchableString, CopyFileCommand, Copyright, CopyrightSuffix, CreatedFilename, CrossPlatformExecName, CrossPlatformName, CurrentProjectFilename, CustomClassesCommand, CustomInstallClassesDir, CustomLoaderPrefix, CustomLookAndFeel, CustomUninstallClassesDir, CustomUninstallDir, CustomUpdateClassesDir, DefaultBrowser, DefaultJpegInstallerImage, DefaultJpegUpdaterImage, DefaultLookAndFeel, DefaultOptionsFilename, DefaultProjectFilename, DefaultTempDirectory, DefaultThemePack, DefaultUninstallerIcon, DefaultUpdaterIcon, DefaultUseTooltips, DelDirIfEmptyCommand, DelFileCommand, DelManifestCommand, DelTreeCommand, EditionEnds, EditionStarts, ExampleProject, ExitIconName, ExitLabel, ExtraParametersFlag, FilesList, GzipFileExtension, GzipListFilename, HtmlFileExtension, InstallerDirectory, InstallerMainClass, InstallerPackage, InstallersSubdir, InstallerUrlPatchableString, InstallOptionsFilename, JarFileExtension, JarFileSuffix, JavaAppArguments, JavaAppExecutable, JavaAppProgramName, JavaAppPropertiesAltDir, JavaAppPropertiesFilename, JavaAppStandardArguments, JavaAppStartDir, JavaDirectory, JavaHomeVariable, JExpressAdvancedApp, JExpressApp, JExpressCustomClassName, JExpressInstallerClassName, JExpressJpegLogoFilename, JExpressUninstallerClassName, JExpressUpdaterClassName, JExpressWizardApp, KdePngIconExtension, KdeXpmIconExtension, KeystoreDbFilename, LoaderDirectory, LoaderIsInPackage, LoaderPackage, LoaderPrefixControl, LocalBuildProperty, MacInstallerCommandFilename, MacOsXIconExtension, MetalLookAndFeel, ModernThemePack, NativeInstallerLog, NativeLookAndFeel, NativePropertiesFilename, NativeStartDirFilename, OverwriteFileCommand, PlatformOptionsFilename, PlatformsDirectory, PlatformsParentDir, PlatformVariable, ProgFilesDirVariable, ProjectFileSuffix, ProjectsSubdir, PropertiesFlag, RawLoaderFilename, RecentJexProjects, RegistrationFilename, RenFileCommand, SearchEverywhereForJvm, SearchIconName, SearchNowhereForJvm, SearchPathForJvm, SelectedNativePlatformsNoJvm, SelectedNativePlatformsWithJvm, SilentInstallFlag, SingleFileGroup, SkinLFPackage, SkinPLAF, StandaloneDirectory, StandalonePureJavaPrefix, StandardJvmExtraParameters, StandardUserClasspath, StartWinAppFilename, SystemChangesFilename, TellUserHowToStart, TempDirectory, ThemePackArgument, ThemePackFilename, TitleCommand, UninstallerDirectory, UninstallerPackage, UninstallerSubdir, UninstallInstructions, UpdateManifestDirectory, UpdateManifestFilename, UpdateMenuPrefix, UpdaterDirectory, UpdaterPackage, UpdateScriptName, UpdatesDirectory, UserHomeVariable, UserInstallerDirectory, UserInterface, UserJExpressDirectory, UserUpdatePropertiesFilename, VersionArgument, VersionFilename, VersionVariable, WebDirectory, WebPagesDirectory, WindowsDirectory, WindowsDirVariable, WindowsIconExtension, WizardEdition, ZipFileExtension, ZipSkipPatchableString
 
Fields inherited from interface com.denova.JExpress.Installer.InstallPropertyNames
AdminMenus, ApplicationDirectory, ApplicationDirectoryTarget, Author, AutoupdateEveryStartup, AutoupdateNever, AutoupdateOnDemand, BasePath, CheckGuiRunningCommand, ConfigureWinRegistry, ControlUrl, CreatedMenuDirs, CustomAfterDirectoryWizardPanelClass, CustomAfterFilesInstalledWizardPanelClass, CustomAfterInstallWizardPanelClass, CustomAfterLicenseWizardPanelClass, CustomAfterMenusWizardPanelClass, CustomAfterMultipleInstallsWizardPanelClass, CustomAfterReadMeWizardPanelClass, CustomAfterWelcomeWizardPanelClass, CustomBeforeInstallWizardPanelClass, DefaultApplicationDirectory, DesktopShortcuts, DownloadUrl, ExtraParameters, FileGroupsFolders, FileGroupsTypes, InstallButtonsPosition, InstallerDefaultLanguage, InstallerExecutable, InstallerExtraFiles, InstallImageFilename, InstallImagePosition, InstallJvmParameters, InstallLicenseFilename, InstallPasswordDigest, InstallReadmeFilename, InstallSuccessful, InstallType, InstallUserClasspath, IsServlet, JvmClasspathSwitch, JvmCommandName, JvmExtraParameters, JvmHomeDir, JvmMaxVersion, JvmMinVersion, JvmName, JvmRequiredVersion, JvmSelfExtractor, JvmVersion, LoaderClasspath, LoaderJavaCommand, MainClassname, MenuArguments, MenuAssociatedInstallType, MenuCommandLineArguments, MenuExecutableFile, MenuIconName, MenuLongName, MenusAttributeName, MenuShortName, MenuUseJavaCommandPrefix, MenuUseJavaConsole, MenuUseSwing, MultipleComponents, MultipleFileGroups, MultipleInstallTypes, NativeJvmHomeDir, NativeJvmInstalled, NativeJvmInstalledInTemp, NextInstallTypes, OldApplicationDirectory, PackageCopyright, PackageCreated, PackageName, PackageVersion, PredefinedJvmInstallDir, RelativeFileMap, SafePackageName, SearchForJvm, SelectedInstallTypes, SilentConfigFilename, SilentInstall, SingleInstallType, StartDirectory, StartGuiCommand, StartupScripts, Submenu, SystemSecurityPolicyFilename, TextFileExtensions, TotalBytesNeeded, UninstallerArgs, UninstallerPathname, UnzipExecutable, 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 com.denova.ui.LocaleTranslator getCurrentLocale()
          Returns the current locale.
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.
static com.denova.ui.Marquee getMarquee()
          Gets the marquee window.
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.lang.String getUserClasspath()
          Returns the classpath the installer uses to configure the user's classpath.
static boolean launchApp(java.lang.String appName, java.awt.Container parent)
           
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)
          Log a message to installer.log, if it exists.
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 void repackWindow()
          Repack the window.
static void setInstallerVisible(boolean visible)
          Set installer visible if true.
static void setPanelsBackground(java.awt.Color color)
          Change the background color of the installer's panels.
static void setVisible(boolean visible)
          Set installer's panel visible if true.
static void updateMarquee(com.denova.ui.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.

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.

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.


getMarquee

public static com.denova.ui.Marquee getMarquee()
Gets the marquee window.

Returns:
marquee window

updateMarquee

public static void updateMarquee(com.denova.ui.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.

setPanelsBackground

public static void setPanelsBackground(java.awt.Color color)
Change the background color of the installer's panels.

Parameters:
color - new panels background

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.

logToInstaller

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

msg: message to record

See the manual about diagnostic logs (Manual/Diagnostics/inslogs.html).

Parameters:
msg -

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.

msg: message to record
t: the exception

See the manual about diagnostic logs (Manual/Diagnostics/inslogs.html).

Parameters:
msg -
t -

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

getCurrentLocale

public static com.denova.ui.LocaleTranslator getCurrentLocale()
Returns the current locale.

Returns:
current locale

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.

launchApp

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

exit

public static void exit()
Exit the installer.