rakesh_dama
Active participant

How can I abort Installation if any step fails

Hi,

I have my installer with many steps, and using some available plugins like copy files, InstallSpeedFolder etc.

In my case, installspeedfolder with option "install the folder and folder's contents" is failing with partial copy. Let's assume I have a folder with some subfolders and files in it. It is copying subfolder but not copying files sometimes.

1) How can I get the status of one action in installanywhere

2) how to mark installation as failed and exit, if any action fails

 

Thanks,

Rakesh.

 

 

0 Kudos
8 Replies
Revenera_Ian
Revenera
Revenera

Hi Rakesh.,

Thank you for your post.

1) You could try checking the value of the $INSTALL_SUCCESS$ InstallAnywhere variable. I believe that variable may get updated every time the installer's status changes, which may include action status changes.
2) You could try writing and implementing a custom code action that calls the abortInstallation method off of an InstallerProxy object reference. As long as the $INSTALL_SUCCESS$ variable is updated as I believe it may be, you could try using the variable in a Compare InstallAnywhere Variables Rule on your custom code action, after you have the variable value that you are checking for.

Here is a link to our InstallAnywhere Custom Code Java-Based API:

https://helpnet.flexerasoftware.com/InstallAnywhereAPI/IA2015/javadoc/index.html?com/zerog/ia/api/pu...

Thanks,

Ian

Thanks Ian. That helps.

You're welcome, Rakesh. Happy to help.

0 Kudos

My concern was: 

If I execute a shell script or any script that exits with non zero return code up on failure, $INSTALL_SUCCESS$ should also be marked as FATAL/NONFATAL/WARNING. 

But, irrespective of script status, IA is always marking  $INSTALL_SUCCESS$ as SUCCESS.

I could not set/update this variable as it is read-only.

0 Kudos

Hi Rakesh,

Thank you for your post.

Yes, you are correct--That is expected behavior. The installer built with InstallAnywhere does not assume that a nonzero exit code returned by a shell script, for example, executed by an Execute Script/Batch file Action, is due to an error. So yes, $INSTALL_SUCCESS$ would still be SUCCESS.

Thanks,

Ian

0 Kudos

@Revenera_Ian : In this case, how can I abort installation with non-zero return code ? or some status that I can capture ?

0 Kudos
wtuckerhcl
Occasional contributor

Shouldn't it at least be assuming install failure when we call abortInstallation on the proxy? We're having a problem where we abort early due to preinstall issues, and we are passing a nonzero value to abortInstallation(), yet the log file still mentions that the install was a "success".

0 Kudos

That's the problem. There is no proper way to abort installation in Install Anywhere.

Abort Install plugin at least should give flexibility for user to define return code, to exit with.

 

0 Kudos