Search code examples
install4jportable-executable

install4j: Extract application JARs from a Windows installer


We are looking for an approach to extract our application JARs and resources from an EXE installer built with install4j. We are trying to automate installers testing though without actual installation - we want to run our application main JAR unpacked from an installer.

With help of PE file format parser https://github.com/kichik/pecoff4j I've found the major part of content is placed in some kind of preamble of an image. The same entry with the same size is shown when I opened the installer in 7-Zip: z-Zip But the format of the entry is unknown to 7-Zip and I can't to go deeper. When I opened the entry in a hex editor I found some of the application resources content, classes names, etc.

The question is - what is a format of the entry and how can I parse it?

P.S.: It seems there should be no issues with DMG for Apple and SH for Linux - as they are regular archives and I hope I can read them in my Java code.


Solution

  • This is not a documented format, it is internal to the installer. You could build an additional Windows ZIP archive media file and extract that. It will have the same contents as the installer.