Magic Folders

InstallAnywhere uses Magic Folders to define installation locations. These Magic Folders are a way of keeping track of installation locations. InstallAnywhere can install to any Magic Folder or subfolder of a Magic Folder. Magic Folders represent a specific location, such as the user-selected installation folder, the desktop, or the location for library files. At install time, the installer determines which operating system it is running on and sets the Magic Folders to the correct absolute paths. Many Magic Folders are platform-specific, and many are predefined by InstallAnywhere. You can install to nearly any standard location on any supported platform. InstallAnywhere also provides user-controlled Magic Folders, which can be set as the developer needs them.

NOTE

Not all Magic Folders are available in every edition.


Magic Folder Examples

InstallAnywhere uses Magic Folders to define most installation locations. They can represent either a fixed or variable path and can be used to place a single file in the appropriate location on different target platforms. Many Magic Folders are predefined by InstallAnywhere and in Enterprise Edition allow you to install to nearly all standard locations across our supported platforms (see Table 4.1).

Table 4.1. Magic Folder Examples
Folder NameInstallAnywhere VariableDestination
User Installation Directory$USER_INSTALL_DIR$This is the installation folder, as specified by the end-user. You can specify a default value for this variable in the Project Info screen in the advanced designer by choosing a location in the Default Install Folder area of the screen.
Programs Folder (platform default)$PROGRAMS_DIR$This is the default application directory on the destination system (the Program Files folder on Windows, the Applications folder on Mac OS, and the logged-in end-user's home account on UNIX).

“End-User Installation Directory” ($USER_INSTALL_DIR$) resolves to the folder the end-user selects as the desired installation directory when the installer is running.

“Programs Folder” ($PROGRAMS_DIR$) resolves to the default application folder for the target platform's operating system. If a particular Magic Folder does not make sense on a target platform, actions that create files (Install File or Create Alias, Link, Shortcut) will not install them. Actions that do not install files, such as Execute Command, are not affected and will run normally.

In the Properties section of each Install File and Create Folder action is a list from which to select that item's destination, such as its Magic Folder. Some user-environment Magic Folders now resolve on Linux. They will detect which GUI environment is being run (either KDE or Gnome) and resolve it appropriately.

Variables and Magic Folders

Every Magic Folder has an associated InstallAnywhere variable. These variables are first initialized when the installer starts up. Changing the value of a Magic Folder variable will change the installation destination for the Magic Folder. This technique can be used for any of the folders. For example, changing the value of $USER_INSTALL_DIR$ through InstallAnywhere will change where all the files inside the install folder that Magic Folder will install. With three exceptions, these variables are initialized at install time and will not change, except through using custom code or the Set InstallAnywhere Variable action. The exceptions are as follows:

  • $USER_INSTALL_DIR$: This variable is initialized to the default value determined in the Project task in the advanced designer. If the end-user selects a different folder, then its value can change at the Choose Install Folder step.

  • $USER_SHORTCUTS$: This variable is initialized to the default value determined by the Platforms task in Advanced mode. If the end-user selects a different location, then its value can change at the Choose Alias, Link, Shortcut Folder installation step.

  • $JAVA_HOME$: This variable is initialized to the default value determined by the Platforms task in Advanced mode. If the end-user selects a different location, then its value can change at the Choose Alias, Link, Shortcut Folder install step.

    Installer without JVM: This defaults to the value of the Java property java.home. If the end-user selects a JVM, then its value can change at the Choose Java Virtual Machine step.

    Installer with JVM: This defaults to the value $USER_INSTALL_DIR$/jre. If the end-user selects a JVM already on his machine, then it can change when the $USER_INSTALL_DIR$ changes or at the Choose Java Virtual Machine step.

NOTE

Variables can't be set to themselves. For example, if you wanted to append /test to USER_MAGIC_FOLDER_1, you can't set USER_MAGIC_FOLDER_1 = $USER_MAGIC_ FOLDER_1$$/$test. You can't have either direct or indirect recursion with InstallAnywhere variables as this will cause an infinite loop.


..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.142.166.55