Project Automation APIs for Maintenance Mode and Instance Management

InstallAnywhere 2017

Note • If you are using a node-locked license of InstallAnywhere, the licensing libraries must be loaded while using the project automation API. This is typically done by configuring an IDE setting or by passing the following parameter through the command line when running the Java class:

-Djava.library.path=IA_HOME\resource\fnp\libraries

If the library path includes spaces, ensure that you enclose the library path within quotes:

-Djava.library.path="IA_HOME\resource\fnp\libraries"

InstallAnywhere provides API support to perform project automation for configuring maintenance mode and instance management behavior.

Project Automation APIs for Maintenance Mode Behavior

Maintenance mode methods begin with the getMaintModeConfigs() accessor.

Enabling/Disabling Maintenance Mode (setMaintModeSupportEnabled)

To enable or disable maintenance mode, use the following method:

project.getMaintModeConfigs().setMaintModeSupportEnabled(<Boolean value>);

In this method, the <Boolean value> will be either true or false.

Choosing Maintenance Mode Options

To choose a maintenance mode option, use the following methods:

Methods to Choose Maintenance Mode Options

Option

Method

Uninstall Product

project.getMaintModeConfigs().setUninstProductEnabled (<Boolean value>);

Remove Features

project.getMaintModeConfigs().setRemoveFeaturesEnabled (<Boolean value>);

Add Features

project.getMaintModeConfigs().setAddFeaturesEnabled (<Boolean value>);

Repair Product

project.getMaintModeConfigs().setRepairInstallsEnabled (<Boolean value>);

In these methods, the <Boolean value> will be either true or false.

Project Automation APIs for Instance Management Behavior

Instance management methods begin with the getInstanceDefinition() accessor.

Enabling/Disabling Instance Management (setEnableInstanceManagement)

To enable or disable instance management, use the following method:

project.getInstanceDefinition().setEnableInstanceManagement (<Boolean value>);

In this method, the <Boolean value> will be either true or false.

Specifying Instance Management Type (setInstanceType)

To specify the type of instance management to implement, use the following method:

project.getInstanceDefinition().setInstanceType(value);

In this method, the value identifies the instance management option that is being selected:

Values for the setInstanceType Method

Value

Option

1

Restrict to a Single Instance

2

Do Not Limit Instances

3

Restrict to Number of Instances

Specifying Number of Permitted Instances (setNumInstances)

If the setInstanceType above is set to 3 (Restrict to Number of Instances), the limit for the number of instances can be set using the setNumInstances method:

project.getInstanceDefinition().setNumInstances(value);

In this method, the value identifies the number of instances that will be permitted.

Setting Instance Definition (setInstanceDefinitionBy)

You can specify how to identify an instance of a product by using the setInstanceDefinitionBy method:

project.getInstanceDefinition().setInstanceDefinitionBy(value);

In this method, the value identifies the instance definition that is being selected:

Values for the setInstanceType Method

Value

Option

10

Define by Installation Location Only

11

Define by Installation Location and Version

Set Instance Definition By Version (setVersionPartIdentifiesInstance)

If you specify 11 (Define by Installation Location and Version) for the setInstanceDefinitionBy method, the version number can be set using the setVersionPartIdentifiesInstance method:

project.getInstanceDefinition().setVersionPartIdentifiesInstance(value);

In this method, the value identifies the version field level that is being selected:

Values for the setVersionPartIdentifiesInstance Method

Value

Option

20

Major

21

Minor

22

Revision

23

Sub-Revision

Versions are conventionally represented in the following format: [Major].[Minor].[Revision].[Subrevision], such as: 1.0.2.1047.

Enable Instance Overwrite Warning (setEnableOvertopCheck)

To enable or disable the Enable Instance Overwrite Warning functionality, use the following method:

project.getInstanceDefinition().setEnableOvertopCheck(<Boolean Value>);

In this method, the <Boolean value> will be either true or false.

Set Overwrite Behavior (setOvertopBehaviour)

If you specify true for the setEnableOvertopCheck method, the overwrite behavior can be set using the setOvertopBehaviour method:

project.getInstanceDefinition().setOvertopBehaviour(value);

In this method, the value identifies whether the user will be permitted to overwrite the instance:

Values for the setOvertopBehaviour Method

Value

Option

30

Allow user to continue with overwrite

31

Do not allow user to overwrite

Associating Check Running Mode Rules to Individual Actions

To make sure that individual actions in any of the views in the Sequences view (Install, Pre-Install, Post-Install, Uninstall, Pre-Uninstall, Post-Uninstall) work with maintenance mode, you can associate the Check Running Mode rule using the following methods:

CheckRunningModeRule crmAdd=new CheckRunningModeRule();

crmAdd.setRunningMode((short)value);

In this method, the value identifies the selected mode:

Values for the setRunningMode Method

Value

Mode

1

Add

2

Remove

3

Repair

4

Normal Uninstall

0

Normal Install

Note • To add a rule to the an action, append the above CheckRunningModeRule method to the vector of rules associated with the action.