Summary
There are two ways to include custom code: as a plug-in or an action.
Synopsis
This article provides information on how to include custom code.
Discussion
Using InstallAnywhere, there are two ways to include custom code: as a plug-in or an action.
To package a custom code as a plug-in
1. Package the custom code and all of its resources in a JAR (just like for regular custom code).
2. Create a properties file called customCode.properties. This properties file needs to contain all of the information that InstallAnywhere needs to integrate the plug-in with the Advanced Designer. Place the properties file in the JAR with no stored path information (at the root level of the JAR).
3. Include the following properties in the properties file:
plugin.main.class=<classname>- This property defines the class that implements the proper member of the InstallAnywhere API for a custom code action, panel, or console (such as a class that implementscom.zerog.ia.api.pub.CustomCodeAction).plugin.name=<plug-in name>- This property identifies the name that InstallAnywhere uses for the plug-in on the Plug-Ins tab of the Advanced Designer's Choose an Action dialog box.plugin.type=<action | panel | console>- This property identifies when the plug-in can be used and which icon to use to represent it in the Advanced Designer.
Optionally include one or more of the following properties:
property.<propertname>=<propertydefault>- This property tells the plug-in to populate the action's customizer with a property named <propertyname> and set to the default value of <propertydefault>.plugin.icon.path=<relative path to .png or .jpg file in JAR>- This property sets a custom 32x32 icon for the custom code plug-in of the Advanced Designer.plugin.available=<preinstall | install | postinstall | preuninstall | postuninstall>- This property identifies a comma-separated value list that defines the sequences in which the plug-in should be available.
The following is an example of a properties file for a plug-in:
plugin.main.class=com.zerog.ia.customcode.util.fileutils.ExtractToFile
plugin.name=Extract to File
plugin.type=action
plugin.icon.path=myicon.gif
plugin.available=preinstall,install,postinstall
property.ExtractToFile_Source=path/to/file/in.zip
property.ExtractToFile_Destination=$USER_INSTALL_DIR$$/$myfile.txt
4. Additionally, plug-ins can offer help to InstallAnywhere users on how to properly use the plug-in. Help is displayed in HTML, and is launched by the user pressing a button on the plug-ins customizer. InstallAnywhere displays the Help button if a help file is provided in the plug-in. To include installer help for your plug-in:
- Create a file called help.htm, and instructions to this file.
- Package it in the plug-in JAR (without stored path information).
5. Place the properly packaged JAR (with the custom code, its resources, and the properties file) in IA_HOME/plugins.
The next time that you launch InstallAnywhere, the plug-in will be visible in the InstallAnywhere Choose an Action dialog box.
To include a custom code module as an action:
- Load your module or download the desired custom code file from:
www.flexera.com/products/installation/installanywhere-files-utilities.html - Unzip the custom code file.
- Read the readme.html (sometimes named after the custom code Java class, i.e. DeleteFile.html) to find out the name of the Java class.
- Add an Execute Custom Code Action (panel, console, rule, or action) to your project.
- Click the "Choose JAR or ZIP" button,
- Input the path to the custom code archive.
- Enter the custom code fully qualified Java class name, which includes the Java package name.
- Make any changes to the custom code to meet your requirements (adding rules, modifying, and re-compiling the Java code, etc.).
- Build your project.
To create a Custom Code Action, create your main class file and package it. This file is the file that you need specify in the Class field in the InstallAnywhere IDE in the Advanced Designer mode. Your custom code Java class must extend the abstract class com.zerog.ia.api.pub.CustomCodeAction, if the custom code Java class defines a Custom Code Action. A Custom Code Panel should extend the com.zerog.ia.api.pub.CustomCodePanel class. A Custom Console Action should extend the com.zerog.ia.api.pub.CustomCodeConsoleAction class. A Custom Code Rule should extend the com.zerog.ia.api.pub.CustomCodeRule class. Those classes provide the interfaces through which the user interacts with the InstallAnywhere Runtime.
Related Articles
InstallAnywhere Custom Code Panels 8Number of Views Attaching Eclipse Debugger To InstallAnywhere Installer/Uninstaller That Includes Custom Code For InstallAnywhere 2011 And… 9Number of Views Using a Custom Code Action/Panel in an Installer with InstallAnywhere 11Number of Views Enumerating InstallAnywhere Variables at Run Time Using Custom Code Action 6Number of Views How to Write Custom Messages in the DEBUG log using lc_log? 472Number of Views
Hi, I am Reva - Ask me anything.
No new updates
Thanks for the feedback!
Your feedback has been saved.Rate this response:
Add Additional feedback ( Optional )
Are you sure you want to cancel
the case creation?
Are you sure you want to cancel the case creation?
Are you sure you want to close this case
| Products | Region | Phone Numbers |
|---|---|---|
| FlexNet Operations FlexNet Embedded FlexNet Publisher FlexNet Connect FlexNet Code Insight InstallAnywhere InstallShield |
North America * |
+1 630-332-2513 (toll) +1 877-279-2853 (toll-free in North America) |
| Europe * |
+44 1925 944367 (toll) +44 800 047 8642 (toll-free in Europe) |
|
| Japan * | +81 3-4540-5335 (select option 2) | |
| Australia * |
+61 3 9895 2177 +61 1800 560 603 (toll-free in Australia) |
|
|
Usage Intelligence (formerly
Revulytics) Compliance Intelligence |
Please use the Case Portal to submit your support ticket or reach out to your Revenera contact. | |
Case id: 00001065
Activity: Status change: 2 hours ago