java - izpack 和 launch4j : Invalid uninstaller

标签 java maven izpack launch4j

将我的 izpack 安装程序包装在 launch4j 生成的 EXE 中时,除了卸载程序信息之外,一切正常。使用 JAR 安装程序,当我在安装程序中点击“退出”时,“uninstaller.jar”就会被填充,在窗口实际关闭之前需要几秒钟。但是,当使用打包的 EXE 安装程序时,窗口会立即关闭,并且“uninstaller.jar”文件仍为 2KB 大小且无效。

有人有这方面的经验吗?感谢您的建议和最诚挚的问候

帕斯卡

PS:这是我的完整 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>

还有我的 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>

最佳答案

我使用 izpack 5.0.0-rc1 创建了一个可用的卸载程序。所以这个错误现在已在 izPack 中修复。

关于java - izpack 和 launch4j : Invalid uninstaller,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15432685/

相关文章:

java - H2控制台-通过浏览器查看数据库显示旧数据

java - 无法为应用程序类com.sun.jersey.api.core.WebAppResourceConfig添加Jersey servlet,因为未在其上设置ApplicationPath批注

java - 在 Java 中,您如何调试 JPackage 创建的 exe

gradle - 如何在izpack 5.0.0中使用gradle-izpack插件

java - HIVE:执行错误,从 org.apache.hadoop.hive.ql.exec.FunctionTask 返回代码 [-101](未知错误)

java - 我们可以使用 java 和 selenium webdriver 单击一个与某些图像/按钮重叠的按钮吗?

maven - 我们怎么知道我们可以信任 Maven 中央存储库?

java - maven mac应用程序包插件找不到自定义Info.plist

java - 开发本地时 GAE Blob 消失

java - 使用 JPackage 或 Java 如何删除使用预 JPackage 安装程序创建的文件