InstallAnywhere6.1高级使用方法

类别:Java 点击:0 评论:0 推荐:
From the first frame of the Project Wizard, select Advanced Designer.

Create New Project

Launch InstallAnywhere.

On the first screen, the Create New Project option should already be selected.

Select the Basic Project Template.

This template should already be selected.

Click Save As to save and name the project.

The Save New Project As dialog box appears. InstallAnywhere will use this name as the name of the product in the installer project.

Select the Advanced Designer button.

This selection will open the newly created project file in the InstallAnywhere Advanced Designer. Advanced Designer will open to the Project | Info task. This task sets the basic installer options such as the name of the product, the installer title, and the installer name. The installer name will be the name of the executable file InstallAnywhere creates. This tab also sets the location to build the installer and the settings for the generation of installation logs.

Complete the Installer Title and Product Name fields.

For now, we will skip the Installer UI, Organization,andFiles tasks.

Pre–Install Actions

Select the PreInstall task.

The Pre–Install task sets the panels and action that occur prior to the installation of files. By default, a new InstallAnywhere project contains the following panels:

Introduction:This panel allows developers to introduce the product or installation process.

Choose Install Folder: This panel will allows end-user to choose the installation location for the product.

Choose Alias, Link Shortcut Folder: This panel allows end-user to specify the location for any Mac OS Aliases, Windows Shortcuts, and Unix Symlinks (used as shortcuts) that will be installed.

Pre-Install Summary: This panel provides end-user with a summary of various installation settings prior to the installation of files.

Actions in the Pre-Install task will occur in the order set in the task list. In a default project an Introduction Panel will be followed by a Choose Install Folder Panel, followed by a Choose Alias, Link or Shortcut panel, and so on. The order of panels and actions can be manipulated using the Arrow buttons in the middle right of the Advanced Designer screen.

The behavior and content of panels can be modified by highlighting each panel. The dialog along the bottom half of the Advanced Designer will change to reflect the panel selected. In InstallAnywhere’s vocabulary, this is known as a customizer, and is available for each action and panel in the installer.

Define the installation tasks

Select the Files task from the far left side of the Advanced Designer.

The Files task defines the files to install, the folder location to install those files and the order of the tasks that need to happen as the files are being installed.

By default, the InstallAnywhere Files task has a folder called Uninstall $PRODUCT_NAME$, which contains any InstallAnywhere uninstaller actions, and a comment action with instructions pertaining to the uninstaller.

Actions (including, but not limited to, the installation of files) in the Files task list occur in order with actions at the top of the installation occurring first.

HINT: The Advanced Designer implements a Drag-and-Drop interface in many tabs and tasks. In the Install Task, actions and files can be moved by selecting and dragging them. A dark underline appears in the location where the file or action will be placed.

TIP: Leave the Uninstaller creation in its default place in the installation (although the folder structure can be changed). For organizational purposes, it’s generally best to have the uninstaller creation action first.

Since the advanced tutorial mainly replicates the tasks for the Office Suite installer from the Project Wizard, those same files will be added.

Add Files

Use the File Chooser to browse to the Office Suite Source Files folder found in the InstallAnywhere Installation Directory. The folder can also be drag and dropped into the Files task.

Add the OfficeSuite2000 folder and its contents.

After adding the files, the files will be displayed in the file installation tree in the Advanced Designer window.

File trees may be expanded or contracted within the InstallAnywhere Advanced Designer Install Task by clicking on the "+" or "" boxes at the apex of the tree braches. Objects may be moved up and down or into and out of subfolders in the file tree by highlighting the object, and using the right, left, up, and down arrows found in the middle right of the Files task screen.

Add a LaunchAnywhere Executable to the Files task

Select the Add Launcher button.

A LaunchAnywhere Executable (LAX) is a unique native executable, created by InstallAnywhere, that is used to launch a Java application. While the InstallAnywhere Wizard specifically asks to select a main class and automatically creates a single launcher, the Advanced Designer allows developers to add as many launchers as they would like.

There are two ways to add a LaunchAnywhere Launcher to an InstallAnywhere Project file. The Create LaunchAnywhere for Java Application option may be selected from the AddAction palette, or can be added by clicking the Add Launcher button on the middle control bar in the Advanced Designer.

Highlight the User Install Folder in the Advanced Designer, and click the Add Launcher button.

Click OK.

When adding a launcher, InstallAnywhere will automatically introspect into the added files (including introspecting into JAR and or ZIP files) to find class files with Main Methods specified.

Choose the com.acme.OfficeSuite as main class for the application.

Since OfficeSuite is a simple project, we’re presented with only the com.acme.OfficeSuite class.

Click OK to continue.

NOTE: The Add Launcher button has not only added the launcher to the file structure, but also created a Shortcut, Link, or Alias action in the Shortcuts’ Destination Folder Magic Folder. This location is variable and will be specified by the Choose Alias, Link, and Shortcut panel in the pre-install section.

Customize the Launcher

The appearance the launcher will have as a shortcut can now be customized. Highlight the launcher. The customizer along the lower portion of the Advanced Designer screen will change to reflect the options for the Create LaunchAnywhere for Java Application action.

In the lower middle right of the customizer (below the arguments field) are a set of buttons that control the icon associated with the launcher. The default icon is a teal tile with a coffee cup, and a rocket ship icon.

Click Change to alter the icon. In the Choose Icondialog, click Choose GIF File. Select a GIF or JPG file to use as an icon. For this tutorial, use the OfficeSuiteIcon in the Images and Docs folder within the OfficeSuiteSourceFiles folder.

NOTES

Interlaced GIF files cannot be used with InstallAnywhere. The conversion process does not support these files and their use can result in blank icons.

For Mac OS X, provide an ICNS file (created with iconbuilder – part of the Mac OS X Developer Tools).

Set the InstallAnywhere Classpath

InstallAnywhere maintains a general classpath that is used to create launchers for the Java Application.

In the InstallAnywhere Advanced Designer, click the Set Classpath button.

A blue CP icon will appear on folders and archives that the process has added to the classpath.

Select the Project | Java tab along the left side of the Advanced Designer window to view the Classpath as determined by the Set Classpath action.

Since Office Suite is a simple product, we’ll have only the main "OfficeSuite2000" folder (which contains loose class files). If our example project contained JAR or ZIP files containing classes, they would also have been added. If a file is added mistakenly on the Classpath, it can be removed at this point or by highlighting that file in the installation tree and un-checking the In Classpath option box in the Customizer for that file.

Post–Install Actions

The Post-Install Task list specifies actions and panels to occur after the installation of files. Like Pre-Install, the Post-Install step is ordered with the top actions occurring first.

By default, InstallAnywhere has added two actions to the InstallAnywhere project. These actions are:

Panel: Install Complete

This panel appears when the installation has completed successfully. This action is determined by the status of the $INSTALL_SUCCESS$ variable. This panel will display only if the $INSTALL_SUCCESS$ does not contain any error condition.

Restart Windows

This action restarts a Windows system if the installer determines that it is necessary.

InstallAnywhere installations are controlled primarily by InstallAnywhere Rules. As an example of an InstallAnywhere Rule, highlight the Restart Windows action in the Office Suite Project. In the customizer in the lower portion of the screen, select the Rules tab.

The InstallAnywhere Rules customizer will appear in the lower portion of the Advanced Designer. The rules set on the Restart Windows action are simple rules set to compare InstallAnywhere Variables. InstallAnywhere Rules are Boolean and allow the file, panel, or action to be installed, displayed, or run only if the rule resolves to True.

Click the Add Action button to open the Action Palette.

The Action Palette is divided by tabs that vary based on the task that is active at the time the palette is called.

Select Execute Target File found under the General tab.

The Execute Target File action is used to execute files that are included as part of the installation, and consequently it is available only in the Install, and Post-install portion of the installation. (The Execute Target File is not available in "Pre-Install" because files cannot be executed that are not installed yet!)

Click Add, or double click on the action to add it.

The Palette will remain open so additional actions could be added.

Add a name for the action in the customizer in the lower portion of the screen, add a name for the action.

Naming the action will help identify the action when looking at the visual tree.

To select the target. Click the Choose Target button.

The Choose an Action dialog represents the file installation tree specified in the Files task. File(s) can be executed in this stage. To execute the just installed office suite application, choose the launcher for that application.

NOTE: Choose the actual Office Suite Launcher, and not the shortcut (which should share the same Icon). Shortcuts, especially on Windows and Mac OS systems, are pointers and are not inherently executable. InstallAnywhere will not execute a shortcut.

Customizer Options

By using the Command Line field modifications can be made to the command line used to execute the file, such as adding a handler, or an argument to the execution.

NOTE: Do not remove or modify the $EXECUTE_FILE_TARGET$ entry, as this represents the file to execute. To specify a handler, prepend an executable path, to specify an argument, append a file path. These paths MUST be absolute, however the paths can include InstallAnywhere variables.

The user experience for this action can be tailored by using the Options Fields:
The option to suspend the installation until the process is complete. This is particularly useful in cases where a later step in the installation is dependant on the execution. There is also a sub–task that allows developers to specify an indeterminate progress bar with a message. This task can be used if the execution may take some time (for example, an execute that installs another product, or configures a database or other application).

The Show Please Wait panel option will display a message panel to the user while the execution is occurring.

The Suppress First Window option allows developers to suppress the first window on Microsoft Windows platforms. This option is particularly useful in suppressing the appearance of the cmd.exe window when executing batch files, or command line executables.

NOTE: If the execute action panel was added at a location other than the bottom of the Post-Install task, move it now. Either utilize the up and down arrows, or drag the action to the bottom of the task list.

Build Installer

The InstallAnywhere Build Task allows the options that will be used to build the installer(s) to be set. In this task platforms for the build can be set, configuration options for bundled virtual machines, and platform optimization and installer type.

HINT: For early testing, build only for the development platform. Each additional platform adds to the time required to build, cycling through run-rebuild-run-rebuild stages. A faster build will makes the development process easier.

On the Build Targets tab in the Build task, select the platform(s). Selecting With VM, will "bundle" the installer with a VM. With VM is only selectable for platforms which have a VM pack. VM packs should be placed in the [InstallAnywhere]/resource /installer_vms folder, and InstallAnywhere should be restarted to refresh the available VM packs.

The Build task also includes the Distribution and Build Log tabs.

The Distribution tab allows developers to set options for the type of installers to build, and the optimization options for each installer. As the installer being built in this tutorial doesn’t contain any platform specific files, it will not need to be optimized at this point. However, if the installer did include platform specific files, these files would be optimized based on the application of the Check Platform rules.

TheBuild Log tab displays the XML log of previous builds.

Click Build Project to build the office suite installer.

The Build information dialog will appear.

Click the blue arrow on the lower left of that dialog to see the build details console.

When the build is complete, there will be a notification (in this case, the Build should take a minute or less).

Test

After the Build process is complete, try the installer by selecting either the Try Web Install or Try Installer button. In this case, use the Try Web Install button to launch our browser and the InstallAnywhere Web Install Page generated by the build process.

Click Try Web Install. The Web Install Page will load, and should request a security access.

Grant this access to allow the Web Install Applet to run the InstallAnywhere installer.

The web installer can now be launched with just one click.

Click the Start Installer for Windows button below the image.

The applet will check for sufficient disk space, "download" the installer, and execute the installer.

Run the installer.

After the Install Complete Panel, the installer should launch Office Suite. The Office Suite Icon can now be selected from the Windows Start Menu to run the installed product.

本文地址:http://com.8s8s.com/it/it14977.htm