49.1 Application Object Macros

An Application object macro is defined on the Application object's Macros page and can only be used with that Application object. The macro is simply a variable that has a value associated with it, as shown in the following two examples:

Variable

Value

SOURCE_PATH

\\server1\sys\public\zen\word

TARGET_PATH

c:\program files\word

In the examples, SOURCE_PATH defines the network location from which Novell Application Launcher™ distributes the application to the user's workstation, and TARGET_PATH defines the workstation location to which Application Launcher copies the files.

You can also create a macro that prompts the user to accept a default value you've assigned or to enter a different value. For example, you could use a macro that prompts the user with a default installation drive (such as c:) but lets the user change it to another drive (such as d:).

The following sections provide information about nesting other macros in Application object macros and instructions to help you define Application object macros:

49.1.1 Nesting Macros

When defining an Application object macro, you can embed other macros in the definition. In the following example, a special Windows macro, *WINDISK, is used when defining the TARGET_PATH macro:

%*WINDISK%\Program Files

Any time you use the TARGET_PATH macro in an Application object property field, Application Launcher substitutes the current workstation's Windows drive letter for %*WINDISK% (for example, c:\temp).

When embedding another macro in the string, you must enclose the macro in % characters, as shown in the above example. You can embed special Windows macros, eDirectory attribute macros, environment variable macros, login script macros, and other Application object macros.

49.1.2 Defining an Application Object Macro

  1. In ConsoleOne, right-click the Application object for which you want to define the macro, then click Properties.

  2. Click the Common tab > Macros to display the Macros page.

  3. To define a macro consisting of a variable name and a value (a String Value macro), continue with Defining a String Value (Non-Prompted) Macro.

    or

    To define a macro that prompts the user to accept a default value or enter a different value, skip to Defining a Prompted Macro.

Defining a String Value (Non-Prompted) Macro

  1. On the Macros page, click Add > String value to display the Edit String Value dialog box.

  2. In the Value Name box, type a name for the macro variable (for example, TARGET_PATH). Do not use spaces in the name.

  3. In the Value Data box, type the value for the macro variable (for example, c:\program files\word).

  4. Click OK to add the macro to the Macros list.

For information about using the macro in a valid Application object property, see Section 49.8, Application Object Properties Where Macros Can Be Used.

Defining a Prompted Macro

Prompted macros do not apply to MSI applications. With all applications other than MSI applications, Application Launcher controls the installation process and can therefore supply the prompt. With MSI applications, Windows Installer, not Application Launcher, installs the applications; Application Launcher has no opportunity to supply the prompt.

  1. On the Macros page, click Add > Prompted > Drive to create a macro that prompts the user for a drive or click Add > Prompted > String to create a macro that prompts the user for text input.

  2. Fill in the following fields:

    Macro name Specify any name that describes the macro. Do not use spaces in the name.

    Prompt text: Specify the text you want presented to the user. For example, if you are prompting for an installation drive you could enter the following: “This application will be installed to your C: drive. Enter a different drive letter if desired.”

    Default value: For a prompted drive macro, select the drive to display as the default drive. For a prompted string macro, specify the text to display as the default text.

    Minimum disk space in MB: Specify the minimum amount of free disk space required. The user cannot install to any drive that does not meet the minimum disk space requirement.

    Maximum string length in chars (prompted string macro only): Specify the maximum number of characters the user can enter as a response to a prompted string macro.

  3. Click OK to add the macro to the Macros list.

For information about using the macro in a valid Application object property, see Section 49.8, Application Object Properties Where Macros Can Be Used.