我们使用Apache Ant从Java二进制文件构建Windows应用程序。它生成Windows安装程序二进制文件。运行该安装后,它已成功部署,并且到目前为止所有操作都看起来不错。但是,安装的文件夹名称是“ unknown”,而不是我们解决方案的名称“ myApp”。我在Windows 10中安装了该安装程序。如何将文件夹名称固定为解决方案的名称?
提前考虑
以下是我的build.xml。
<?xml version="1.0" encoding="UTF-8"?>
<project
name="myApp-win32"
default="do-deploy"
basedir="."
xmlns:fx="javafx:com.sun.javafx.tools.ant">
<property name="version" value="2.0.4" />
<property name="java.myhome" value="C:\Program Files (x86)\Java\jdk1.8.0_171\bin" />
<target name="init-fx-tasks">
<path id="fxant">
<filelist>
<file name="${java.myhome}/../lib/ant-javafx.jar" />
<file name="${java.myhome}../jre/lib/ext/jfxrt.jar" />
<file name="${basedir}" />
</filelist>
</path>
<taskdef resource="com/sun/javafx/tools/ant/antlib.xml" uri="javafx:com.sun.javafx.tools.ant" classpathref="fxant" />
</target>
<target name="do-deploy" depends="init-fx-tasks">
<delete dir="deploy" />
<delete dir="dist" />
<mkdir dir="dist" />
<mkdir dir="dist/libs" />
<mkdir dir="deploy" />
<copy todir="dist">
<fx:fileset dir="${basedir}/../bin" includes="*" excludes="*.jar" />
</copy>
<copy todir="dist/libs">
<fx:fileset dir="${basedir}/../bin" includes="*.jar" />
</copy>
<fx:resources id="appRes">
<fx:fileset dir="dist" includes="libs/**"/>
<fx:fileset dir="dist" includes="myApp.jar"/>
</fx:resources>
<fx:jar destfile="dist/myApp.jar">
<fx:application
id="myApp"
name="myApp"
mainClass="com.xxxx.myApp.myApp"
version="${version}"
/>
<fx:fileset dir="${basedir}/../bin" includes="jspWin.*"/>
<fx:resources refid="appRes" />
<manifest>
<attribute name="Implementation-Vendor" value="xxxx Ltd" />
<attribute name="Implementation-Title" value="myApp-win32" />
<attribute name="Implementation-Version" value="${version}" />
<attribute name="JavaFX-Feature-Proxy" value="None" />
</manifest>
</fx:jar>
<fx:deploy embedJNLP="false"
extension="false"
includeDT="false"
offlineAllowed="true"
outdir="${basedir}/deploy"
nativeBundles="all"
updatemode="background"
verbose="true"
>
<fx:platform basedir="${java.myhome}/../"/>
<fx:resources>
<fx:fileset dir="dist" includes="**" excludes="*.log"/>
</fx:resources>
<fx:application
name="FastGPS"
mainClass="com.myApp.myApp"
version="win32-${version}-installer"
/>
<!--fx:info title="myApp">
<fx:icon href="tr.ico" kind="shortcut"
width="32" height="32" depth="8"/>
</fx:info-->
</fx:deploy>
</target>
</project>
答案 0 :(得分:0)
通过将此语法添加到build.xml中解决了该问题
<fx:info title="myApp" vendor="myVendor"/>
它将生成具有相同名称“ myVendor”的文件夹,并将您的myApp复制到该文件夹中