This folder contains:


Custom Code Action: EndProcess

 

Classname: com.zerog.ia.customcode.actions.EndProcess

 

Description: This class calls a utility that allows you to run certain tasks on running processes during uninstall.  This custom code action can be used to check if certain processes are running during uninstall and kill them prior to continuing with the uninstall.

 

Input InstallAnywhere Variables:

$EP_EXECUTE_TIME$:  This variable must be set to either “install” or “uninstall” (without quotes).  This will determine when the action is executed.  If you set this variable to “uninstall”, please make sure that you add the action to the Install Task.

$EP_PROCESS$:  This variable should contain the command you would like to execute.

-fk                    force kill PROCESS 

            -c                     close (send WM_CLOSE) to the PROCESS

            -p[nihr]           set priority to "Normal", "Idle", "High", "Real Time"

                [ba]               "Below Normal" and "Above Normal" only on W2K or higher

 

Examples:

                       

                        -fk cmd.exe               execute a force kill on cmd.exe.

                        -fk sleep*                   force kill all processes starting with "sleep"

                        -ph w*.exe                 set priority to hight for all matching processes

                        -c explorer.exe          close explorer process

 

$EP_DISPLAY_DIALOG$: If set to true a dialog will be displayed to the end-user.  The dialog would appear as follows.

$EP_DIALOG_TEXT$:  This is the text that will be display in the dialog displayed if the specified process is running.  By default this will text will be set to the following.

"The following process is currently running. <process> Select "Next" to shutdown this process and continue or select "Cancel" to exit the Uninstall."

 

Output InstallAnywhere Variables: 

$EP_EXIT_CODE$:  This variable will be set with an exit code.  The error levels are as listed below.

0 - process found

1 - process not found

2 - program error

 

General Instructions:

This README explains how to set up and take advantage of the EndProcess custom code action.

To effectively use this action, you will want to add an "Execute Custom Code" action to anywhere in the IA Advanced designer.  Remember that for the action to work correctly you need to add a "Set InstallAnywhere Variable - Multiple" action before the "Execute Custom Code" action to set
$EP_EXECUTE_TIME$ to either “install” or “uninstall”,  and $EP_COMMAND$  to the command you would like to perform (such as –fk cmd.exe).

Once you have added an "Execute Custom Code" action to your project, you will need to select the JAR or ZIP file that contains the desired action. To select the JAR or ZIP file, click on the "Choose JAR or ZIP..." button and select the file in the "Choose Code Archive" dialog that appears.

Next you have to designate the "Class:" that is to be called for the custom code. In this case, you would enter "
com.zerog.ia.customcode.actions.EndProcess" (no quotes).

Thank you,

Zero G Developer Solutions.

Additional Notes

Special thanks to Igor Nys, the creator of the pv utility that this custom code action is based around.

 


1 April 2003