How to Write Custom Errors in the Installation Log

Custom actions, panels, and consoles can log errors in the installation using the CustomError classes.

The CustomError object is obtained through the InstallerProxy, CustomCodePanelProxy, and CustomCodeConsoleProxy objects by a request for the CustomError class, as follows:

Given an instance of CustomCodePanelProxy proxy,

CustomError error =
(CustomError)proxy.getService(CustomError.class);
error.appendError("the file was not found", CustomError.ERROR);
error.setLogDescription("File Mover: ");
error.setRemedialText("Blank file was not found. Create a new text
file and place it in the TEMP directory.");
error.log();

The code above will log the following text in the installation log.

Summary ...

Get InstallAnywhere Tutorial and Reference Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.