Nov 11, 2008
11:48 AM
I've been able to do a rollback under most cases when the install fails. There are some caveats however. I added custom code in the pre-install phase. The handler gets called in the pre-install and install phases but does not seem to get called during the post-install phase. Code sample below. Not that the real work of the rollback handler is in the class YourRollbackHandler. package com.install.installanywhere; import com.zerog.ia.api.pub.CustomCodeAction; import com.zerog.ia.api.pub.InstallException; import com.zerog.ia.api.pub.InstallerProxy; import com.zerog.ia.api.pub.RollbackRegister; import com.zerog.ia.api.pub.UninstallerProxy; public class CancelAction extends CustomCodeAction { public void install(InstallerProxy proxy) throws InstallException { RollbackRegister register = (RollbackRegister) proxy .getService(RollbackRegister.class); register.addHandler(new YourRollbackHandler()); } @Override public String getInstallStatusMessage() { return null; } @Override public String getUninstallStatusMessage() { } @Override public void uninstall(UninstallerProxy proxy) throws InstallException { } }
... View more
Latest posts by jgatti
Subject | Views | Posted |
---|---|---|
918 | Nov 11, 2008 11:48 AM |