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.
Related Articles
How to Set an InstallAnywhere Variable Based on the Install Mode Type 4Number of Views Business adapters fail to retrieve data from SOAP API with error: Unable to cast object of type 'System.Net.HttpWebRequest… 4Number of Views Not Able to Set InstallAnywhere Variable 7Number of Views Setting an InstallAnywhere Variable from within Custom Code 7Number of Views Output InstallAnywhere Variables 5Number of Views
Hi, I am Reva - Ask me anything.
No new updates
Thanks for the feedback!
Your feedback has been saved.Rate this response:
Add Additional feedback ( Optional )
Are you sure you want to cancel
the case creation?
Are you sure you want to cancel the case creation?
Are you sure you want to close this case
| Products | Region | Phone Numbers |
|---|---|---|
| FlexNet Operations FlexNet Embedded FlexNet Publisher FlexNet Connect FlexNet Code Insight InstallAnywhere InstallShield |
North America * |
+1 630-332-2513 (toll) +1 877-279-2853 (toll-free in North America) |
| Europe * |
+44 1925 944367 (toll) +44 800 047 8642 (toll-free in Europe) |
|
| Japan * | +81 3-4540-5335 (select option 2) | |
| Australia * |
+61 3 9895 2177 +61 1800 560 603 (toll-free in Australia) |
|
|
Usage Intelligence (formerly
Revulytics) Compliance Intelligence |
Please use the Case Portal to submit your support ticket or reach out to your Revenera contact. | |
Case id: 00001065
Activity: Status change: 2 hours ago