import com.install4j.api.*;

// This is an example of an uninstall action.
public class HelloUninstallAction extends UninstallAction {

    // Implementation of abstract method. This method is called when the action should be performed.
    // You can use the progress interface to tell the user how the installation is proceeding.
    // The InstallerWizardContext provides access to all important information and to installation-
    // related services.
    public boolean performAction(Context context, ProgressInterface progressInterface) {
        progressInterface.setStatusMessage("Shutting down the huge hello name database ...");
        for (int i = 0; i < 10; i++) {
            progressInterface.setDetailMessage("phase " + i);
            progressInterface.setPercentCompleted(i * 10);
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
            }
        }
        return true;
    }

    // Implementation of abstract method. Here, you tell install4j how many percent of
    // the status bar you would like to have for your action. Note that you always use the
    // full range of 1-100 in the ProgressInterface, regardless of this setting.
    public int getPercentOfTotalInstallation() {
        return 40;
    }
}
