jwrapper.jwutils
Class JWInstallApp

java.lang.Object
  extended by jwrapper.jwutils.JWInstallApp

public class JWInstallApp
extends java.lang.Object

Can be used by JWrapperPostInstallApp virtual apps


Constructor Summary
JWInstallApp()
           
 
Method Summary
static void addAppShortcut(java.lang.String shortcutName, java.lang.String virtualAppName)
          Add a shortcut to a virtual app in the usual OS-specific place (e.g.
static void addAppShortcut(java.lang.String shortcutName, java.lang.String virtualAppName, java.io.File iconFile, int iconIndex)
          Add a shortcut to a virtual app in the usual OS-specific place (e.g.
static void addAppShortcutInFolder(java.lang.String shortcutName, java.lang.String virtualAppName, java.io.File iconFile, int iconIndex, java.io.File targetFolder)
          Add a shortcut to a virtual app in the specified folder
static void addAppShortcutWithID(java.lang.String shortcutName, java.lang.String virtualAppName, java.io.File iconFile, int iconIndex, java.lang.String appID)
          Add a shortcut to a virtual app in the usual OS-specific place (e.g.
static void addAppShortcutWithIDInFolder(java.lang.String shortcutName, java.lang.String virtualAppName, java.io.File iconFile, int iconIndex, java.lang.String appID, java.io.File targetFolder)
          Add a shortcut to a virtual app in the specified target folder including a Window application ID
static void addUninstallerShortcut(java.lang.String shortcutName)
          Add a shortcut to uninstall the app bundle to the usual OS-specific place (e.g.
static void addUninstallerShortcut(java.lang.String shortcutName, java.io.File iconFile, int iconIndex)
          Add a shortcut to uninstall the app bundle to the specified folder
static void addUninstallerShortcutInFolder(java.lang.String shortcutName, java.io.File targetFolder)
          Add a shortcut to uninstall the app bundle to the specified folder
static void addUninstallerShortcutInFolder(java.lang.String shortcutName, java.io.File iconFile, int iconIndex, java.io.File targetFolder)
          Add a shortcut to uninstall the app bundle to the usual OS-specific place (e.g.
static void addWebShortcut(java.lang.String url, java.lang.String shortcutName)
          Add a shortcut to a URL in the usual OS-specific place (e.g.
static void addWebShortcut(java.lang.String url, java.lang.String shortcutName, java.io.File iconFile, int iconIndex)
          Add a shortcut to a URL in the usual OS-specific place (e.g.
static void exitJvm_ContinueAndPerformStandardSetup()
          Tell the JWrapper installer to continue with installation including performing the standard setup of shortcuts etc
static void exitJvm_ContinueAndSkipStandardSetup()
          Tell the JWrapper installer to continue with installation but skip the standard setup of shortcuts etc
static void exitJvm_QuitInstallAndRollBack()
          Tell the JWrapper installer to quit the installation and roll it back
static java.lang.String getChosenLanguage()
          Get the language chosen by the user (or the default language if only one is supported)
static java.io.File getWindowsOrLinuxShortcutLauncherFile()
          Get the launcher file which corresponds to the default user(s) install menu and desktop shortcuts created in Windows and Linux
static void removeAllStandardShortcuts()
          Remove all the usual shortcuts from a permanent installation of this bundle.
static void removeAppShortcut(java.lang.String shortcutName)
           
static void removeAppShortcut(java.lang.String shortcutName, boolean web)
           
static void setChosenLanguage(java.lang.String code)
          Set the chosen language (typically this will be chosen by the user)
static void setupAllStandardShortcuts(boolean createMacOsApplicationLauncher)
          Set up all the usual shortcuts for a permanent installation of this bundle (shortcuts to all visible apps in the OS specific place such as the start menu on Windows)
static void setupAllStandardShortcutsInFolder(boolean createMacOsApplicationLauncher, java.io.File targetFolder)
          Set up all the usual shortcuts for a permanent installation of this bundle (shortcuts to all visible apps), but instead store the shortcuts in targetFolder.
static void setupAllStandardShortcutsInFolderAndOverrideProperties(boolean createMacOsApplicationLauncher, java.io.File targetFolder, java.util.Properties overridePropertiesOSX)
          Set up all the usual shortcuts for a permanent installation of this bundle (shortcuts to all visible apps), but instead store the shortcuts in targetFolder.
static java.lang.String showLanguageChooser()
          Show the standard JWrapper language chooser to ask the user to choose a language and return their choice.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JWInstallApp

public JWInstallApp()
Method Detail

addAppShortcut

public static void addAppShortcut(java.lang.String shortcutName,
                                  java.lang.String virtualAppName)
                           throws java.io.IOException
Add a shortcut to a virtual app in the usual OS-specific place (e.g. windows start menu)

Parameters:
shortcutName - the name of the shortcut
virtualAppName - the name of the virtual app to launch
Throws:
java.io.IOException

addAppShortcut

public static void addAppShortcut(java.lang.String shortcutName,
                                  java.lang.String virtualAppName,
                                  java.io.File iconFile,
                                  int iconIndex)
                           throws java.io.IOException
Add a shortcut to a virtual app in the usual OS-specific place (e.g. windows start menu)

Parameters:
shortcutName - the name of the shortcut
virtualAppName - the name of the virtual app to launch
iconFile - the Windows icon file (ICO)
iconIndex - the Windows icon file index to use
Throws:
java.io.IOException

addAppShortcutInFolder

public static void addAppShortcutInFolder(java.lang.String shortcutName,
                                          java.lang.String virtualAppName,
                                          java.io.File iconFile,
                                          int iconIndex,
                                          java.io.File targetFolder)
                                   throws java.io.IOException
Add a shortcut to a virtual app in the specified folder

Parameters:
shortcutName - the name of the shortcut
virtualAppName - the name of the virtual app to launch
iconFile - the Windows icon file (ICO)
iconIndex - the Windows icon file index to use
targetFolder - the target folder in which to store the shortcut. If this is null the default OS location will be used.
Throws:
java.io.IOException

addAppShortcutWithID

public static void addAppShortcutWithID(java.lang.String shortcutName,
                                        java.lang.String virtualAppName,
                                        java.io.File iconFile,
                                        int iconIndex,
                                        java.lang.String appID)
                                 throws java.io.IOException
Add a shortcut to a virtual app in the usual OS-specific place (e.g. windows start menu) including a Window application ID

Parameters:
shortcutName - the name of the shortcut
virtualAppName - the name of the virtual app to launch
iconFile - the Windows icon file (ICO)
iconIndex - the Windows icon file index to use
appID - the Windows System.AppUserModel.ID identifier used to identify the application launched by this shortcut
Throws:
java.io.IOException

addAppShortcutWithIDInFolder

public static void addAppShortcutWithIDInFolder(java.lang.String shortcutName,
                                                java.lang.String virtualAppName,
                                                java.io.File iconFile,
                                                int iconIndex,
                                                java.lang.String appID,
                                                java.io.File targetFolder)
                                         throws java.io.IOException
Add a shortcut to a virtual app in the specified target folder including a Window application ID

Parameters:
shortcutName - the name of the shortcut
virtualAppName - the name of the virtual app to launch
iconFile - the Windows icon file (ICO)
iconIndex - the Windows icon file index to use
appID - the Windows System.AppUserModel.ID identifier used to identify the application launched by this shortcut
targetFolder - the target folder in which to store the shortcut. If this is null the default OS location will be used.
Throws:
java.io.IOException

addUninstallerShortcut

public static void addUninstallerShortcut(java.lang.String shortcutName)
                                   throws java.io.IOException
Add a shortcut to uninstall the app bundle to the usual OS-specific place (e.g. windows start menu)

Parameters:
shortcutName - the name of the shortcut (e.g. "Uninstall MyApp")
Throws:
java.io.IOException

addUninstallerShortcut

public static void addUninstallerShortcut(java.lang.String shortcutName,
                                          java.io.File iconFile,
                                          int iconIndex)
                                   throws java.io.IOException
Add a shortcut to uninstall the app bundle to the specified folder

Parameters:
shortcutName - the name of the shortcut (e.g. "Uninstall MyApp")
Throws:
java.io.IOException

addUninstallerShortcutInFolder

public static void addUninstallerShortcutInFolder(java.lang.String shortcutName,
                                                  java.io.File targetFolder)
                                           throws java.io.IOException
Add a shortcut to uninstall the app bundle to the specified folder

Parameters:
shortcutName - the name of the shortcut (e.g. "Uninstall MyApp")
targetFolder - the folder in which to save the shortcut. If null, the OS-specific place.
Throws:
java.io.IOException

addUninstallerShortcutInFolder

public static void addUninstallerShortcutInFolder(java.lang.String shortcutName,
                                                  java.io.File iconFile,
                                                  int iconIndex,
                                                  java.io.File targetFolder)
                                           throws java.io.IOException
Add a shortcut to uninstall the app bundle to the usual OS-specific place (e.g. windows start menu)

Parameters:
shortcutName - the name of the shortcut (e.g. "Uninstall MyApp")
targetFolder - the folder in which to save the shortcut. If null, the OS-specific place.
Throws:
java.io.IOException

addWebShortcut

public static void addWebShortcut(java.lang.String url,
                                  java.lang.String shortcutName)
                           throws java.io.IOException
Add a shortcut to a URL in the usual OS-specific place (e.g. windows start menu)

Parameters:
url - the URL of the website to point to
shortcutName - the name of the shortcut
Throws:
java.io.IOException

addWebShortcut

public static void addWebShortcut(java.lang.String url,
                                  java.lang.String shortcutName,
                                  java.io.File iconFile,
                                  int iconIndex)
                           throws java.io.IOException
Add a shortcut to a URL in the usual OS-specific place (e.g. windows start menu)

Parameters:
url - the URL of the website to point to
shortcutName - the name of the shortcut
iconFile - the Windows icon file (ICO)
iconIndex - the Windows icon file index to use
Throws:
java.io.IOException

exitJvm_ContinueAndPerformStandardSetup

public static void exitJvm_ContinueAndPerformStandardSetup()
Tell the JWrapper installer to continue with installation including performing the standard setup of shortcuts etc


exitJvm_ContinueAndSkipStandardSetup

public static void exitJvm_ContinueAndSkipStandardSetup()
Tell the JWrapper installer to continue with installation but skip the standard setup of shortcuts etc


exitJvm_QuitInstallAndRollBack

public static void exitJvm_QuitInstallAndRollBack()
Tell the JWrapper installer to quit the installation and roll it back


getChosenLanguage

public static java.lang.String getChosenLanguage()
                                          throws java.io.IOException
Get the language chosen by the user (or the default language if only one is supported)

Throws:
java.io.IOException

getWindowsOrLinuxShortcutLauncherFile

public static java.io.File getWindowsOrLinuxShortcutLauncherFile()
Get the launcher file which corresponds to the default user(s) install menu and desktop shortcuts created in Windows and Linux

Returns:

removeAllStandardShortcuts

public static void removeAllStandardShortcuts()
                                       throws java.io.IOException
Remove all the usual shortcuts from a permanent installation of this bundle.

Throws:
java.io.IOException

removeAppShortcut

public static void removeAppShortcut(java.lang.String shortcutName)
                              throws java.io.IOException
Throws:
java.io.IOException

removeAppShortcut

public static void removeAppShortcut(java.lang.String shortcutName,
                                     boolean web)
                              throws java.io.IOException
Throws:
java.io.IOException

setChosenLanguage

public static void setChosenLanguage(java.lang.String code)
                              throws java.io.IOException
Set the chosen language (typically this will be chosen by the user)

Throws:
java.io.IOException

setupAllStandardShortcuts

public static void setupAllStandardShortcuts(boolean createMacOsApplicationLauncher)
                                      throws java.io.IOException
Set up all the usual shortcuts for a permanent installation of this bundle (shortcuts to all visible apps in the OS specific place such as the start menu on Windows)

Parameters:
createMacOsApplicationLauncher - Whether to also create OSX .app launchers for each virtual app in the standard /Applications folder (note that currently each of these will have the same icon - the bundle icon).
Throws:
java.io.IOException

setupAllStandardShortcutsInFolder

public static void setupAllStandardShortcutsInFolder(boolean createMacOsApplicationLauncher,
                                                     java.io.File targetFolder)
                                              throws java.io.IOException
Set up all the usual shortcuts for a permanent installation of this bundle (shortcuts to all visible apps), but instead store the shortcuts in targetFolder.

Parameters:
createMacOsApplicationLauncher - Whether to also create OSX .app launchers for each virtual app.
targetFolder - The target folder in which to store the shortcuts.
Throws:
java.io.IOException

setupAllStandardShortcutsInFolderAndOverrideProperties

public static void setupAllStandardShortcutsInFolderAndOverrideProperties(boolean createMacOsApplicationLauncher,
                                                                          java.io.File targetFolder,
                                                                          java.util.Properties overridePropertiesOSX)
                                                                   throws java.io.IOException
Set up all the usual shortcuts for a permanent installation of this bundle (shortcuts to all visible apps), but instead store the shortcuts in targetFolder. Override any stored OSX launch properties with those provided.

Parameters:
createMacOsApplicationLauncher - Whether to also create OSX .app launchers for each virtual app.
targetFolder - The target folder in which to store the shortcuts.
overridePropertiesOSX - a set of properties that will override any existing shortcut properties.
Throws:
java.io.IOException

showLanguageChooser

public static java.lang.String showLanguageChooser()
Show the standard JWrapper language chooser to ask the user to choose a language and return their choice. Note this does NOT save their choice, you should make a further call to setChosenLanguage()

Returns:
the language code of their choice