Michael Beck
Michael Beck

Reputation: 120

install4j Extract JAR file exception

For the uninstaller of our application, i need to get a version from one of our JAR files. So i created a ExtractZipFileAction with the following options:

Property mode: 644
Property destinationDirectory: .
Property destinationRoot: Installation directory
Property dirMode: 755
Property fileFilter: 
Property showProgress: false
Property zipFile: OurJarFile-1.0-SNAPSHOT-plugin.jar
Property zipRoot: Installation directory
Property rollbackSupported: true

But the execution cancels immediately with a ClassCastException (stack trace from the error log):

[ERROR] com.install4j.runtime.beans.actions.files.ExtractZipFileAction [ID 541]: java.lang.ClassCastException: com.install4j.runtime.installer.helper.comm.impl.UninstallerHelperContextImpl cannot be cast to com.install4j.api.context.InstallerContext
java.lang.ClassCastException: com.install4j.runtime.installer.helper.comm.impl.UninstallerHelperContextImpl cannot be cast to com.install4j.api.context.InstallerContext
    at com.install4j.runtime.beans.actions.files.AbstractZipFileAction.zipActions(AbstractZipFileAction.java:89)
    at com.install4j.runtime.beans.actions.files.AbstractZipFileAction.execute(AbstractZipFileAction.java:79)
    at com.install4j.runtime.beans.actions.SystemInstallOrUninstallAction.uninstall(SystemInstallOrUninstallAction.java:35)
    at com.install4j.runtime.installer.ContextImpl$7.executeAction(ContextImpl.java:1670)
    at com.install4j.runtime.installer.ContextImpl$7.fetchValue(ContextImpl.java:1659)
    at com.install4j.runtime.installer.ContextImpl$7.fetchValue(ContextImpl.java:1656)
    at com.install4j.runtime.installer.helper.comm.actions.FetchObjectAction.execute(FetchObjectAction.java:14)
    at com.install4j.runtime.installer.helper.comm.HelperCommunication.executeActionWrapper(HelperCommunication.java:367)
    at com.install4j.runtime.installer.helper.comm.HelperCommunication.access$200(HelperCommunication.java:33)
    at com.install4j.runtime.installer.helper.comm.HelperCommunication$1.run(HelperCommunication.java:98)`

Note that we're in the uninstaller, not the installer, but the exception complains about casting an UninstallerHelperContextImpl to an InstallerContext. Could it be a problem with the JAR file?

I also set the action elevation type to Elevate to maximum available privileges since i want to extract the files in the installation directory in the programs-folder.

Upvotes: 1

Views: 470

Answers (1)

Ingo Kegel
Ingo Kegel

Reputation: 48105

This is a bug and will be fixed in 6.1.5. Please contact [email protected] to get a build where this fixed.

Upvotes: 1

Related Questions