cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Project Automation API InstallDirectory

Project Automation API InstallDirectory

Summary

This article discusses about using the Project Automation API InstallDirectory

Synopsis

This article discusses using the Project Automation API InstallDirectory Java class.

Discussion

The InstallDirectory Java class adds the given directory to the installer project to be later installed by the installer. It is similar to adding a directory using the Add File... or adding a Create Folder action button via InstallAnywhere IDE. It also allows the definition of some file attributes, like UNIX permissions and destination name.

Constructor for Install Directory

public InstallDirectory()


Method Summary for InstallDirectory

Modifier and TypeMethod and Description
Vector<OSHostable>getChildren()
The children files to be installed.
boolean getRemoveRecursively()
Whether to recursively delete all contents of this folder during uninstall.
voidsetRemoveRecursively(boolean removeRecursively)
Whether to recursively delete all contents of this folder during uninstall.
Methods inherited from class com.zerog.ia.auto.project.actions.FileAction
getDestinationName, getFileOverwriteBehavior, getOverrideUnixPermissions, getShouldUninstall, getSourceFile,
getUnixPermissions, setDestinationName, setFileOverwriteBehavior, setOverrideUnixPermissions,
setShouldUninstall, setSourceFile, setUnixPermissions
Methods inherited from class com.zerog.ia.auto.project.InstallableObject
getBelongsToUninstallPhase, getRollbackEnabledCancel, getRollbackEnabledError, getRuleExpression, getRules,
getRulesLogicalOperation, getTagsInInstallPiece, setBelongsToUninstallPhase, setRollbackEnabledCancel,
setRollbackEnabledError, setRuleExpression, setRulesLogicalOperation, setTagsInInstallPiece
Methods inherited from class com.zerog.ia.auto.project.ProjectObject
equals, getReferenceID, hashCode, setReferenceID
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait

Sample custom code
The following is an example of Java code that adds an install directory to the first directory in the Install Sequence. When this sample code is executed on the attached sample project a new folder is created under User Install Folder in the Install Sequence.
package com.company.ProjectAuto;

import com.zerog.ia.auto.project.actions.InstallDirectory;
import com.zerog.ia.auto.project.*;

public class ProjectInstallAuto

    {
        public static void main(String[] args )
        {
            ProjectAutomation.setIALocation("Path it InstallAnywhere installation directory");

            // change to point to your project file
            Project iap = ProjectAutomation.loadProject("Path to project file");


            //Get the First Installation Folder in the tree in install-sequence      
            OSHostDestinationFolder destinationFolder = iap.getOSHost().getFolders().get(0);
            
            //Add a new directory to the Installation Folder   
            InstallDirectory InstDirect = new InstallDirectory();
            destinationFolder.getChildren().add(InstDirect);

            //save and close the project
            ProjectAutomation.saveProject(iap);
            System.exit(0);
        }
    }


Additional Information

For more information on the Project Automation API, click here.
Was this article helpful? Yes No
No ratings
Version history
Revision #:
1 of 1
Last update:
‎Nov 12, 2018 05:07 PM
Updated by: