Launch4j 中的异常
我的 build.xml 中有以下说明,但出现以下异常。
launch4j: net.sf.launch4j.ExecException: 执行失败 (1): C:\Program 文件\Launch4j\bin\windres.exe --preprocessor=type -J rc -O coff -F pe-i386 C:\Windows\TEMP\launch4j2603642297702639520rc C:\Windows\TEMP\launch4j1179691608441365102o
这是我的构建脚本:
<project basedir="." default="build" name="Bienvenue">
<!-- Crée le fichier d'installation BienvenueSetup.exe -->
<target name="build">
<!-- Création du dossier classes -->
<mkdir dir="classes"/>
<!-- Compilation des classes du programme -->
<javac srcdir="src" destdir="classes" />
<!-- Création du dossier install/lib -->
<mkdir dir="install/lib"/>
<!-- Création du fichier Bienvenue.jar -->
<jar destfile="install/lib/Bienvenue.jar" basedir="classes"/>
<!-- Suppression du dossier classes -->
<delete dir="classes"/>
<!-- Copie du JRE dans le dossier install/jre6 en excluant les fichiers
inutiles mentionnés dans le fichier README.TXT du JRE
(attention il faut garder le fichier bin/javaw.exe du JRE) -->
<copy todir="install/jre6">
<fileset dir="C:\Program Files\Java\jre6">
<include name="*"/>
<include name="bin/**"/>
<include name="lib/**"/>
<exclude name="lib/charsets.jar"/>
<exclude name="lib/ext/sunjce_provider.jar"/>
<exclude name="bin/rmid.exe"/>
<exclude name="bin/rmiregistry.exe"/>
<exclude name="bin/tnameserv.exe"/>
<exclude name="bin/keytool.exe"/>
<exclude name="bin/kinit.exe"/>
<exclude name="bin/klist.exe"/>
<exclude name="bin/ktab.exe"/>
<exclude name="bin/policytool.exe"/>
<exclude name="bin/orbd.exe"/>
<exclude name="bin/servertool.exe"/>
<exclude name="bin/java.exe"/>
<exclude name="bin/javaws.exe"/>
<exclude name="bin/javacpl.exe"/>
<exclude name="bin/jucheck.exe"/>
<exclude name="bin/jusched.exe"/>
<exclude name="bin/wsdetect.dll"/>
<exclude name="bin/npjava*.dll"/>
<exclude name="bin/npoji610.dll"/>
<exclude name="bin/regutils.dll"/>
<exclude name="bin/axbridge.dll"/>
<exclude name="bin/deploy.dll"/>
<exclude name="bin/jpicom.dll"/>
<exclude name="bin/javacpl.cpl"/>
<exclude name="bin/jpiexp.dll"/>
<exclude name="bin/jpinscp.dll"/>
<exclude name="bin/jpioji.dll"/>
<exclude name="bin/jpishare.dll"/>
<exclude name="lib/deploy.jar"/>
<exclude name="lib/plugin.jar"/>
<exclude name="lib/deploy/messages*.properties"/>
<exclude name="lib/deploy/splash.jpg"/>
</fileset>
</copy >
<!-- Création du fichier Bienvenue.exe avec Launch4j -->
<exec executable="C:\Program Files\Launch4j\launch4jc.exe">
<arg value="${basedir}\installerLaunch4j.xml"/>
</exec >
<!-- Création du fichier BienvenueSetup.exe avec Inno Setup -->
<exec executable="C:\Program Files\Inno Setup 5\ISCC.exe">
<arg value="${basedir}\installerInnoSetup.iss"/>
</exec >
<!-- Suppression du dossier install -->
<delete dir="install/"/>
<echo message="BienvenueSetup.exe ready"/>
</target >
</project >
任何人都可以帮我弄清楚我做错了什么吗?
I have the following instructions in my build.xml, and I am getting the following exception.
launch4j: net.sf.launch4j.ExecException: Exec failed (1): C:\Program
Files\Launch4j\bin\windres.exe --preprocessor=type -J rc -O coff -F
pe-i386 C:\Windows\TEMP\launch4j2603642297702639520rc
C:\Windows\TEMP\launch4j1179691608441365102o
This is my build script:
<project basedir="." default="build" name="Bienvenue">
<!-- Crée le fichier d'installation BienvenueSetup.exe -->
<target name="build">
<!-- Création du dossier classes -->
<mkdir dir="classes"/>
<!-- Compilation des classes du programme -->
<javac srcdir="src" destdir="classes" />
<!-- Création du dossier install/lib -->
<mkdir dir="install/lib"/>
<!-- Création du fichier Bienvenue.jar -->
<jar destfile="install/lib/Bienvenue.jar" basedir="classes"/>
<!-- Suppression du dossier classes -->
<delete dir="classes"/>
<!-- Copie du JRE dans le dossier install/jre6 en excluant les fichiers
inutiles mentionnés dans le fichier README.TXT du JRE
(attention il faut garder le fichier bin/javaw.exe du JRE) -->
<copy todir="install/jre6">
<fileset dir="C:\Program Files\Java\jre6">
<include name="*"/>
<include name="bin/**"/>
<include name="lib/**"/>
<exclude name="lib/charsets.jar"/>
<exclude name="lib/ext/sunjce_provider.jar"/>
<exclude name="bin/rmid.exe"/>
<exclude name="bin/rmiregistry.exe"/>
<exclude name="bin/tnameserv.exe"/>
<exclude name="bin/keytool.exe"/>
<exclude name="bin/kinit.exe"/>
<exclude name="bin/klist.exe"/>
<exclude name="bin/ktab.exe"/>
<exclude name="bin/policytool.exe"/>
<exclude name="bin/orbd.exe"/>
<exclude name="bin/servertool.exe"/>
<exclude name="bin/java.exe"/>
<exclude name="bin/javaws.exe"/>
<exclude name="bin/javacpl.exe"/>
<exclude name="bin/jucheck.exe"/>
<exclude name="bin/jusched.exe"/>
<exclude name="bin/wsdetect.dll"/>
<exclude name="bin/npjava*.dll"/>
<exclude name="bin/npoji610.dll"/>
<exclude name="bin/regutils.dll"/>
<exclude name="bin/axbridge.dll"/>
<exclude name="bin/deploy.dll"/>
<exclude name="bin/jpicom.dll"/>
<exclude name="bin/javacpl.cpl"/>
<exclude name="bin/jpiexp.dll"/>
<exclude name="bin/jpinscp.dll"/>
<exclude name="bin/jpioji.dll"/>
<exclude name="bin/jpishare.dll"/>
<exclude name="lib/deploy.jar"/>
<exclude name="lib/plugin.jar"/>
<exclude name="lib/deploy/messages*.properties"/>
<exclude name="lib/deploy/splash.jpg"/>
</fileset>
</copy >
<!-- Création du fichier Bienvenue.exe avec Launch4j -->
<exec executable="C:\Program Files\Launch4j\launch4jc.exe">
<arg value="${basedir}\installerLaunch4j.xml"/>
</exec >
<!-- Création du fichier BienvenueSetup.exe avec Inno Setup -->
<exec executable="C:\Program Files\Inno Setup 5\ISCC.exe">
<arg value="${basedir}\installerInnoSetup.iss"/>
</exec >
<!-- Suppression du dossier install -->
<delete dir="install/"/>
<echo message="BienvenueSetup.exe ready"/>
</target >
</project >
Can anyone help me figure out what I am doing wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
请显示您的
installerLaunch4j.xml
配置。我的案例问题是图标格式错误(我使用png
而不是ico
)。Show your
installerLaunch4j.xml
config please. I my case problem was in wrong icon format (I was usedpng
insteadico
).Launch4j的文档说要这样做:
我已经使用这种方法多年了没问题。 FWIW,我的路径包括带有空格的“程序文件”,这没有造成任何问题。
The documentation for Launch4j says to do it this way:
I have used this method for years with no trouble. FWIW, my path includes "Program Files" with a space, which has created no problems.
当路径中有空格时,我在运行此类工具时遇到问题。您可以尝试从没有空格的路径运行所有内容吗?
I've had problems running such tools when there were spaces in the paths. Can you try running everything from paths that have no spaces in them?
当我尝试使用 Launch4j 的 Ant 任务时,我也报告了相同的异常。虽然使用外部 XML 配置文件调用它可以完美地工作,但使用元素调用它却不起作用。
我根据外部 Launch4j 配置文件在 Ant 构建 XML 中创建了整个配置,使用反复试验来确定应将哪些内容指定为属性以及将哪些内容指定为 Ant 任务的元素层次结构。在执行此操作时,我还指定了 XML 中的所有空字符串值,例如
errTitle=""
和cmdLine=""
属性。不要这样做。只需省略那些即可。基于我的工作项目的示例:
I had the same exception being reported, when I tried to use the Ant task for Launch4j. While invoking it with an external XML config file worked flawlessly, invoking it using the
<config>
element did not work.I created the entire configuration inside my Ant build XML based on the external Launch4j config file, used trial and error to determine what should be specified as an attribute and what as an element hierarchy to the Ant task. While doing this, I also specified all empty string values from the XML, such as
errTitle=""
andcmdLine=""
attributes. DO NOT DO THIS. Simply omit those.An example based on my working project: