cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
ramalaks
Level 6

Rollback in installanywhere 8

Have anyone done a successfull rollback when install is failed? if so, pl explain how?.
Labels (1)
0 Kudos
4 Replies
qqqqqq
Level 7

😞 no idea.. searching for the same 😞
Tell me if you find any way
0 Kudos
jgatti
Level 2

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 {
}
}
0 Kudos
ramalaks
Level 6

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.?
0 Kudos
ramalaks
Level 6

even after rollback using rollbackHandler, i see the product in add/remove programs and in zero G registry. how do we handle this.
0 Kudos