cancel
Showing results for 
Search instead for 
Did you mean: 
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
5 Replies
Flexera Flexera_Ian
Flexera

Re: How can I abort Installation if any step fails

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

Highlighted
rakesh_dama
Active participant

Re: How can I abort Installation if any step fails

Thanks Ian. That helps.

Flexera Flexera_Ian
Flexera

Re: How can I abort Installation if any step fails

You're welcome, Rakesh. Happy to help.

0 Kudos
rakesh_dama
Active participant

Re: How can I abort Installation if any step fails

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
Flexera Flexera_Ian
Flexera

Re: How can I abort Installation if any step fails

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