Question

When wrapping my izpack installer in a launch4j-generated EXE, everything works fine apart from the uninstaller information. With the JAR installer, the "uninstaller.jar" is being filled as soon as I hit "Quit" in the installer, taking a few seconds before the window actually closes. However, when using the wrapped EXE installer, the window closes immediately and the "uninstaller.jar" file remains at 2KB size and is invalid.

Has anyone had any experience on this? Thanks for your suggestions and best regards

Pascal

PS: Here my full POM:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>ch.diction</groupId>
    <artifactId>dataexchange-viewer</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>Diction data exchange viewer</name>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <java.version>1.7</java.version>
        <java.minimum_version>1.7.0</java.minimum_version>
        <swixml.version>2.5.20110919</swixml.version>
        <swingx.version>1.6.1</swingx.version>
        <izpack.plugin.version>5.0.0-beta11</izpack.plugin.version>
        <izpack.compiler.version>5.0.0-beta11</izpack.compiler.version>
    </properties>

    <build>
        <sourceDirectory>src/main/java</sourceDirectory>
        <testSourceDirectory>src/test/java</testSourceDirectory>
        <outputDirectory>target/main</outputDirectory>
        <testOutputDirectory>target/test</testOutputDirectory>
        <resources>
            <resource>
                <targetPath>ch/diction/dataexchange/viewer/resources</targetPath>
                <directory>src/main/resources</directory>
                <excludes>
                    <exclude>izpack/*</exclude>
                </excludes>
            </resource>
        </resources>
        <testResources>
            <testResource>
                <targetPath>ch/diction/dataexchange/viewer/resources</targetPath>
                <directory>src/test/resources</directory>
            </testResource>
        </testResources>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.0</version>
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <configuration>
                    <archive>
                        <manifest>
                            <mainClass>ch.diction.dataexchange.viewer.system.Runner</mainClass>
                        </manifest>
                    </archive>
                    <descriptorRefs>
                        <descriptorRef>jar-with-dependencies</descriptorRef>
                    </descriptorRefs>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.bluestemsoftware.open.maven.plugin</groupId>
                <artifactId>launch4j-plugin</artifactId>
                <version>1.5.0.0</version>
                <executions>
                    <execution>
                        <id>l4j-gui</id>
                        <phase>package</phase>
                        <goals>
                            <goal>launch4j</goal>
                        </goals>
                        <configuration>
                            <headerType>gui</headerType>
                            <outfile>target/${project.artifactId}.exe</outfile>
                            <jar>target/${project.artifactId}-${project.version}-jar-with-dependencies.jar</jar>
                            <classPath>
                                <mainClass>ch.diction.dataexchange.viewer.system.Runner</mainClass>
                            </classPath>
                            <icon>src/main/resources/img/diction-favicon.ico</icon>
                            <jre>
                                <minVersion>${java.minimum_version}</minVersion>
                            </jre>
                        </configuration>
                    </execution>
                    <execution>
                        <id>l4j-installer</id>
                        <phase>install</phase>
                        <goals>
                            <goal>launch4j</goal>
                        </goals>
                        <configuration>
                            <headerType>gui</headerType>
                            <outfile>target/${project.artifactId}-setup.exe</outfile>
                            <jar>target/${project.artifactId}-${project.version}.jar</jar>
                            <classPath>
                                <mainClass>com.izforge.izpack.installer.bootstrap.Installer</mainClass>
                            </classPath>
                            <icon>src/main/resources/img/diction-favicon.ico</icon>
                            <jre>
                                <minVersion>${java.minimum_version}</minVersion>
                            </jre>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.izpack</groupId>
                <artifactId>izpack-maven-plugin</artifactId>
                <version>${izpack.plugin.version}</version>
                <configuration>
                    <baseDir>target</baseDir>
                    <installFile>src/main/resources/izpack/install.xml</installFile>
                </configuration>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>izpack</goal>
                        </goals>
                    </execution>
                </executions>
                <dependencies>
                    <dependency>
                        <groupId>org.codehaus.izpack</groupId>
                        <artifactId>izpack-compiler</artifactId>
                        <version>${izpack.compiler.version}</version>
                    </dependency>
                </dependencies>
            </plugin>
        </plugins>
    </build>

    <repositories>
        <repository>
            <id>google-swixml2</id>
            <url>http://swixml2.googlecode.com/svn/mavenrepo</url>
        </repository>
    </repositories>

    <dependencies>
        <dependency>
            <groupId>ch.diction</groupId>
            <artifactId>dataexchange-base</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.swixml</groupId>
            <artifactId>swixml</artifactId>
            <version>${swixml.version}</version>
        </dependency>
        <dependency>
            <groupId>org.swinglabs</groupId>
            <artifactId>swingx</artifactId>
            <version>${swingx.version}</version>
        </dependency>
        <dependency>
            <groupId>org.codehaus.izpack</groupId>
            <artifactId>izpack-compiler</artifactId>
            <version>${izpack.compiler.version}</version>
            <type>pom</type>
        </dependency>
    </dependencies>
</project>

And my izpack install.xml:

<izpack:installation version="5.0" xmlns:izpack="http://izpack.org/schema/installation" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://izpack.org/schema/installation http://izpack.org/schema/5.0/izpack-installation-5.0.xsd">
    <info>
        <appname>Diction Data Exchange Viewer</appname>
        <appversion>0.0.1</appversion>
        <appsubpath>Diction/data-exchange-viewer</appsubpath>
        <javaversion>1.7</javaversion>
    </info>

    <guiprefs width="800" height="600" resizable="no">
        <modifier key="useHeadingPanel" value="yes" />
        <splash>../src/main/resources/izpack/diction_logo_rgb.jpg</splash>
    </guiprefs>

    <locale>
        <langpack iso3="eng" />
    </locale>

    <resources>
        <res src="../src/main/resources/izpack/registry-spec.xml" id="RegistrySpec.xml" />
    </resources>

    <listeners>
        <listener classname="RegistryInstallerListener" stage="install" />
        <listener classname="RegistryUninstallerListener" stage="uninstall" />
    </listeners>

    <panels>
        <panel classname="TargetPanel" />
        <panel classname="InstallPanel" />
    </panels>

    <packs>
        <pack name="Diction Data Exchange" required="yes">
            <description>Diction Data Exchange</description>
            <file src="dataexchange-viewer.exe" targetdir="$INSTALL_PATH" override="true" />
        </pack>
    </packs>

    <natives>
        <native name="COIOSHelper.dll" type="3rdparty" stage="both" />
    </natives>

</izpack:installation>
Was it helpful?

Solution

I created a working uninstaller using izpack 5.0.0-rc1. So this bug is fixed now in izPack.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top