cancel
Showing results for 
Search instead for 
Did you mean: 

How to Cast $SKIP_UNINSTALL$ InstallAnywhere Variable To String Or Boolean Data Type

No ratings

How to Cast $SKIP_UNINSTALL$ InstallAnywhere Variable To String Or Boolean Data Type

Summary

This article discusses how to cast the $SKIP_UNINSTALL$ InstallAnywhere variable to a string or boolean data type for use in Custom Code.

Synopsis

This article discusses how to cast the $SKIP_UNINSTALL$ InstallAnywhere variable to a string or boolean data type for use in Custom Code.

The $SKIP_UNINSTALL$ InstallAnywhere variable determines whether the uninstaller will run actions in the Uninstall Sequence (for more information, see below in the Discussion section).

Discussion

Here is more information about the $SKIP_UNINSTALL$ variable:

Tells the uninstaller whether to perform the uninstall step. To cause the uninstaller to skip the uninstall step, set $SKIP_UNINSTALL$ to true. To allow the uninstall step to occur, set $SKIP_UNINSTALL$ to false. ($SKIP_UNINSTALL$ is false by default.) If the installer skips the uninstall step, it sets $UNINSTALL_SUCCESS$ to SKIPPED.

Note: The Uninstall Complete panel tests the value of $UNINSTALL_SUCCESS$ variable and provides controls for you to customize the message the panel shows in the event that the uninstall step was intentionally skipped.

As for casting the variable to a different data type, namely to a string or boolean, here is sample custom code for a custom code action:

package com.zerog.ia.cca;

import javax.swing.JOptionPane;

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.UninstallerProxy;

public class SkipUninstallTest extends CustomCodeAction
{
@Override
public void install(InstallerProxy ip) throws InstallException
{
// TODO Auto-generated method stub
}
@Override
public void uninstall(UninstallerProxy up) throws InstallException
{
String sSkipUninstall = up.substitute("$SKIP_UNINSTALL$");

boolean bSkipUninstall = false;

bSkipUninstall = Boolean.valueOf(sSkipUninstall);

if(bSkipUninstall==true)
{
JOptionPane.showMessageDialog(null, "$SKIP_UNINSTALL$=" + sSkipUninstall);
}
else if(bSkipUninstall==false)
{
JOptionPane.showMessageDialog(null, "$SKIP_UNINSTALL is false");
}
}

@Override
public String getInstallStatusMessage()
{
// TODO Auto-generated method stub
return null;
}

@Override
public String getUninstallStatusMessage()
{
// TODO Auto-generated method stub
return null;
}
}

Additional Information

For more information about the $SKIP_UNINSTALL$ variable and other standard InstallAnywhere variables, click here.

For more information about including Custom Code Actions in your project using an Execute Custom Code Action, click here.
Was this article helpful? Yes No