Interface UninstallerContext
- All Superinterfaces:
Context
The context provided by the uninstaller.
In addition to the methods in the
Context interface, this extended context offers methods that are specific
to the uninstaller.-
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns whether the uninstaller is running as part of an upgrade.Methods inherited from interface Context
addInstallerEventListener, addToClassPath, cancel, finish, getActionById, getActions, getActions, getAddOnApplicationId, getAllUsersDefaultInstallationDirectory, getApplicationId, getApplicationName, getBooleanVariable, getCompilerVariable, getContentDirectory, getDefaultInstallationDirectory, getDestinationFile, getDestinationFile, getDestinationFileInfo, getExternalFile, getExternalFile, getExtraCommandLineArguments, getFileSetById, getFileSetByName, getFileSets, getFirstAction, getFirstScreen, getId, getId, getInstallationComponentById, getInstallationComponents, getInstallationDirectory, getLanguageId, getLauncherById, getLaunchers, getMediaFileId, getMessage, getMessage, getProgressInterface, getResourceDirectory, getScreenById, getScreens, getScreens, getUserWritableDefaultInstallationDirectory, getVariable, getVariableNames, getVersion, getWizardContext, goBack, goBackInHistory, goBackInHistory, goForward, gotoScreen, gotoScreen, handleCriticalException, hasBeenElevated, initializeLazilyCreatedScreens, isArchive, isCancelling, isConsole, isErrorOccurred, isGui, isRebootRequired, isUnattended, registerHiddenVariable, registerResponseFileComment, registerResponseFileVariable, removeInstallerEventListener, runElevated, runScript, runUnelevated, runWithSuspendedActions, setErrorOccurred, setVariable, triggerReboot, unregisterResponseFileVariableModifier and TypeMethodDescriptionvoidAdd a listener to receive installer events.voidaddToClassPath(File file) Add a JAR file or a classpath directory root to the classpath of the installer application.voidcancel()Cancel the installer application without asking any questions.voidfinish(int exitCode) Quits the process in an ordered manner.getActionById(String id) Get a particular action with the specified ID.Action[]getActions(Screen screen) Get all registered actions for a specified screen.Action[]getActions(Class<? extends Action> actionClass, Screen screen) Get all registered actions for a specified screen and a given action class.Returns the add-on application id if this project generates add-on installers.Retrieves the default installation directory for all users.Returns the application id of this project.Returns the name of the application.booleangetBooleanVariable(String variableName) Convenience method to get an installer variable with a type ofjava.lang.Boolean.getCompilerVariable(String variableName) Gets the value of a compiler variable as it was defined for this media file at compile time.Retrieves the directory mapped to the "Installation directory" in the distribution tree.Retrieves the default installation directory configured in the install4j IDE and resolved as suitable for the current privilege level.getDestinationFile(File archiveFile) Get the location where the installer will install a file in the distribution tree.getDestinationFile(String archivePath) Same asgetDestinationFile, only with a path argument.getDestinationFileInfo(String archivePath) Analyze a path in the distribution tree.getExternalFile(ExternalFile externalFile, boolean installedLocation) Get the location of an external file that was packaged with the installer.getExternalFile(LocalizedExternalFile localizedExternalFile, boolean installedLocation) Get the location of a localized external file that was packaged with the installer.String[]Returns an array with the command line arguments that were not recognized by install4j.getFileSetById(String id) Returns the file set for a specified ID.getFileSetByName(String name) Returns one file set with the specified name.Returns all additional files sets contained in this installer.getFirstAction(Class<? extends Action> actionClass, Screen screen) Get the registered action for a specified screen and a given action class.getFirstScreen(Class<?> screenClass) Get the registered screen for a given screen class.Get the ID that the framework associates with an action.Get the ID that the framework associates with a screen.Returns the installation component for a specified ID.Returns all installation components for this installer.Retrieves the installation directory selected by the user, or the default installation directory if the user has not yet made a selection.Return the ISO code for the language that the installer is running with.Returns the launcher for a specified ID.Returns all launchers for this installer.Returns the ID of the media file that was used to create this installer.getMessage(String key) Get a message for a localization key.getMessage(String key, Object... arguments) Get a message for a localization key.Get the current progress interface.Retrieves the directory where the resource files are present that have been configured on the "Installer->Custom Code & Resources" tab.getScreenById(String id) Get a particular screen with the specified ID.Screen[]Get all registered screens.Screen[]getScreens(Class<?> screenClass) Get all registered screens for a given screen class.Retrieves the default installation directory in a user-writable directory.getVariable(String variableName) Get an installer variable.Get the names of all defined installer variables.Returns the version of the installer.Get the wizard context if the installer or uninstaller is running in GUI mode.voidgoBack(int numberOfScreens) Go backwards in the screen sequence.voidgoBackInHistory(int numberOfScreens) Go backwards in the screen history.voidgoBackInHistory(Screen targetScreen) Go backwards in the screen history to the target screen.voidgoForward(int numberOfScreens, boolean checkCondition, boolean executeActions) Go forward in the screen sequence.voidgotoScreen(Screen screen) Programmatically switch to another screen in the installer without checking the condition of the target screen or executing any actions.voidgotoScreen(Screen screen, boolean checkCondition, boolean executeActions) Programmatically switch to another screen in the installer.voidIf you encounter an exception in your code that cannot be handled, you can use this method to invoke the default exception handling of the install4j runtime.booleanReturns if the code is running in the elevated helper process started by the "Request privileges" action.voidInitialize all lazily created screens.booleanReturns whether the media set was an archive as opposed to an installer.booleanReturns whether the user has canceled the installation or not.booleanReturns whether the installer or uninstaller is running in console mode.booleanDetermine if an error has occurred for any of the previous actions.booleanisGui()Returns whether the installer or uninstaller is running in GUI mode.booleanReturns whether a reboot is required on Windows.booleanReturns whether the installer or uninstaller is running in unattended mode.voidregisterHiddenVariable(String variableName) Register a variable whose values should not be written to the installation log file.voidregisterResponseFileComment(String variableName, String comment) Register a comment for a variable that is written to the response file.voidregisterResponseFileVariable(String variableName) Register a variable that should be written to the response file when the installation is finished.voidRemove a listener added withaddInstallerEventListener.runElevated(RemoteCallable remoteCallable, boolean alwaysExecute) Execute a remoteCallable with full admin rights if possible.runScript(ScriptProperty scriptProperty, Bean bean, Object... parameters) Run a script.runUnelevated(RemoteCallable remoteCallable) Execute a remoteCallable with the rights of the original user that started the installer.voidrunWithSuspendedActions(Runnable runnable) Execute some code while any running actions are suspended.voidsetErrorOccurred(boolean errorOccurred) Clear or set the error flag that is described forisErrorOccurred.voidsetVariable(String variableName, Object value) Set an installer variable.voidtriggerReboot(boolean askUser) Triggers a reboot at the end of installation or uninstallation on Windows.voidunregisterResponseFileVariable(String variableName) Reverses the action ofContext.registerResponseFileVariable(String).
-
Method Details
-
isUninstallForUpgrade
boolean isUninstallForUpgrade()Returns whether the uninstaller is running as part of an upgrade. This method returnstruewhen the uninstaller is run by the "Execute previous uninstaller" action of another installer performing an upgrade into the same directory.- Returns:
trueorfalse.
-