For rollback, you get to mention a couple of things:
- recover files you copied over "file", "singlefile", "fileset"
- recover system files you somehow touched by a script from the installation
(for instance using patching on system config files)
- re-register or unregister system services (Unix + Windows)
- recover registry entries (Windows)
- recover a database which might be also elsewhere on another server
It is important to know what in particular you want to recover and what your
application requires to give a more concrete answer.
With the current release, you can for instance add an Ant installation
listener and implement this with an additional Ant script given as resource to
the installation. If you know a little bit of Ant, this should be easy and you
should be able to to any combination of the above variants. In this case, you
might try start your executable from the Ant script with order afterpacks or
afterpack, putting it into a try-catch (antcontrib) block and do the rollback
actions in the catch part.
There is also an BSF scripting installer and uninstaller listener which you
can use to include rollback scripts.
See http://izpack.org/documentation/custom-actions.html
In future, for IzPack 5.0 there will be an additional possibility to
automatically rename files according to a globmapper pattern with the
"renameTo" attribute for the "file", "singlefile" and "fileset" elements,
which you can give a certain prefix or suffix. This will it make easier to
recover actually overwritten files. But this is still in incubation phase.
Rene
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
<
packs><pack>.....<executable os="windows" keep="true" stage="postinstall" failure="abort" targetfile="$INSTALL_PATH/install.bat"> <args> <argvalue="$INSTALL_PATH" /> </args> </executable>
</pack></packs>
- In install.bat file I am actually running java file which connects to database server and registers my application to it ,but if error will come while inserting into database the installer gives popup like "Installation not complete" and after clicking on Ok is goes to next panel ,it's not aborting installer even if I've given failure="abort".
- so whenever error will come I want to abort the installation and remove copied files,folders.
- I am attaching install.xml with this mail.
1. Rollback of changes on a failure
Here you have to implement something in a script.
In your case, you have to check the return code of some commands in
install.bat and make some decisions based on it, rolling back directly in
install.bat using system commands. IMHO, at the moment there's no way to
launch something additionally on failure.
Personally, I would prefer to implement an Ant listener for your custom
actions instead of install.bat, which gives you a better control, and which is
more "near" to Java.
2. Installer not aborting on failure
The failing abort is given by your install.bat, which probably exits with
%errorlevel%==0 due to some reason. Please check it for instance by running it
from a terminal and checking the errorlevel manually. For being able to
recognize failures in a batch script it's necessary to have a return code not
equal to 0.
- actually I m not able to decide which error code its returning.
- after this error i want to abort installation and remove copied files and folders to installation path.
Thanks in advance.
regards,
Jyo.
On Wednesday 14 April 2010 11:04:25 you wrote:
> - In install.bat file I am actually running java file which connects to
> database server and registers my application to it ,but if error will come
> while inserting into database the installer gives popup like "Installation
> not complete" and after clicking on Ok is goes to next panel ,it's not
> aborting installer even if I've given failure="abort".
I made a code review and there is in fact an issue with the installer on
failure="abort". There is only called emitError, which means informing the
user but not blocking the <Next> button. It should emit an error and block the
next button, instead.
Can you file an issue with a short description on the Jira bugtracker, please?
We will solve this hopefully in the next release. I f you want to solve it by
yourself in the code, just poke me and I'll tell you where :-)
René
--
http://izpack.org/
http://jpz-log.info/
http://julien.ponge.info/