PDA

View Full Version : Rollback in installanywhere 8



ramalaks
10-29-2008, 01:31 PM
Have anyone done a successfull rollback when install is failed? if so, pl explain how?.

qqqqqq
11-02-2008, 10:39 AM
:( no idea.. searching for the same :(
Tell me if you find any way

jgatti
11-11-2008, 12:48 PM
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 {
}
}

ramalaks
11-26-2008, 10:59 AM
when does the code go to roll back handler?
Is it when pressing cancel? I want to rollback if the any failure occurs during my install/postinstall actions..how do i handle that.?

ramalaks
04-14-2009, 10:20 AM
even after rollback using rollbackHandler, i see the product in add/remove programs and in zero G registry. how do we handle this.