- Revenera Community
- :
- InstallAnywhere
- :
- InstallAnywhere Forum
- :
- Re: How can I abort Installation if any step fails
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
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/pub/package-summary.html
Thanks,
Ian
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Thanks Ian. That helps.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
You're welcome, Rakesh. Happy to help.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
@Revenera_Ian : In this case, how can I abort installation with non-zero return code ? or some status that I can capture ?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
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".
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
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.
![](/skins/images/A5EADE085F77DE82FB3B14D6B307AE6A/responsive_peak/images/icon_anonymous_message.png)