How to use custom * .ISS with javafx-ant, maven and INNO?

I am trying to create a custom installer for my application using maven, inno and javafx-ant. I looked at this link but it seems I didn't get the results described by Inno and Maven

I have my installer build successfully and my app installs successfully. However, this always applies to the user / AppData / Local /. I changed this in my regular * .iss file as follows:

DefaultDirName={pf}\cashreceipts
UsePreviousAppDir=No
Uninstallable=yes

      

However, this file is not picked up at build time. I added the required application-name.iss file to src / main / deploy / package / windows / application-name.iss but didn't build.

enter image description here

I'm not sure what else to try to get this file being used in my assembly.

Thank!

Below is the maven config for the build step.

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-antrun-plugin</artifactId>
            <version>1.7</version>
            <executions>
                <execution>
                    <phase>package</phase>
                    <configuration>
                        <target>
                            <!-- define the deploy ANT task -->
                            <taskdef name="jfxdeploy"
                                classname="com.sun.javafx.tools.ant.DeployFXTask"
                                classpathref="maven.plugin.classpath" />

                            <!-- define the JarSing ANT task -->
                            <!-- taskdef name="jfxsignjar"
                                classname="com.sun.javafx.tools.ant.FXSignJarTask" 
                                classpathref="maven.plugin.classpath" / -->
                            <jfxdeploy outdir="${project.build.directory}/deploy"
                                outfile="${project.build.finalName}" nativeBundles="all"
                                verbose="true">
                                <info title="${project.name}" />

                                <!-- set the main class of your applcation -->
                                <application name="${project.name}"
                                    mainClass="com.mycompany.myclass" />
                                <resources>
                                    <fileset dir="${project.build.directory}"
                                        includes="*.jar" />
                                    <fileset dir="${project.build.directory}/dependency"
                                        includes="*.jar" />
                                    <fileset dir="${project.build.directory}"
                                        includes="properties/*.properties"/>
                                </resources>

                                <!-- set your jvm args -->
                                <platform>
                                    <jvmarg value="-Xms512m" />
                                    <jvmarg value="-Xmx1024m" />
                                </platform>
                            </jfxdeploy>
                            <!-- you need to generate a key yourself -->
                            <!--jfxsignjar destdir="${project.build.directory}/deploy"
                                keyStore="path/to/your/keystore" storePass="yourPass"
                                alias="yourAlias" keyPass="keyPass">
                                <fileset dir="${project.build.directory}/deploy" 
                                includes="*.jar" /> </jfxsignjar -->
                        </target>
                    </configuration>
                    <goals>
                        <goal>run</goal>
                    </goals>
                </execution>
            </executions>

            <dependencies>
                <dependency>
                    <groupId>com.oracle</groupId>
                    <artifactId>ant-javafx</artifactId>
                    <version>${javafx.version}</version>
                    <systemPath>${java.home}/../lib/ant-javafx.jar</systemPath>
                    <scope>system</scope>
                </dependency>
            </dependencies>
        </plugin>
    </plugins>
    <finalName>cashreceipts</finalName>
</build>

      

+3


source to share


1 answer


I was able to confirm that the ZENJAVA plugin is still working and maintained on github and it can do it. Information here:

JavaFX 8 - How to Create EXE with Maven and INNO

My updated pom.xml looks like this:



<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.mycompany</groupId>
<artifactId>myapp</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>myapp</name>
<url>http://www.mycompany.com</url>

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
    <javafx.version>8.0</javafx.version>
</properties>


<repositories>
    <repository>
        <id>repo</id>
        <url>file://${project.basedir}/lib/repo</url>
    </repository>
</repositories>

<pluginRepositories>
    <pluginRepository>
        <!-- new SNAPSHOT version needed to work with current JavaFX Version -->
        <id>com.zenjava</id>
        <url>file://C:\Users\username\Desktop\maven fx plugin\javafx-maven-plugin-master\javafx-maven-plugin-master\target</url>
    </pluginRepository>
</pluginRepositories>


<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.3</version>

            <configuration>
                <source>${maven.compiler.source}</source>
                <target>${maven.compiler.target}</target>
            </configuration>
        </plugin>

        <plugin>
            <!-- copy all dependencies of your app to target folder -->
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-dependency-plugin</artifactId>
            <version>2.3</version>
            <executions>
                <execution>
                    <id>copy-dependencies</id>
                    <phase>package</phase>
                    <configuration>
                        <overWriteReleases>false</overWriteReleases>
                        <overWriteSnapshots>false</overWriteSnapshots>
                        <overWriteIfNewer>true</overWriteIfNewer>
                    </configuration>
                    <goals>
                        <goal>copy-dependencies</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jar-plugin</artifactId>
            <version>2.6</version>
            <configuration>
                <archive>
                    <manifestEntries>
                        <Main-Class>com.mycompany.app.MyApp</Main-Class>
                        <implementation-version>1.0</implementation-version>
                        <JavaFX-Application-Class>com.mycompany.app.MyApp</JavaFX-Application-Class>
                    </manifestEntries>
                    <manifest>
                        <addClasspath>true</addClasspath>
                    </manifest>
                </archive>
            </configuration>
        </plugin>

        <!-- copy the properties files to the root location -->
        <plugin>
            <artifactId>maven-resources-plugin</artifactId>
            <version>2.6</version>
            <executions>
                <execution>
                    <id>copy-resources-1</id>
                    <phase>validate</phase>
                    <goals>
                        <goal>copy-resources</goal>
                    </goals>
                    <configuration>
                        <outputDirectory>${basedir}/target/additionalResources/properties</outputDirectory>
                        <resources>
                            <resource>
                                <directory>properties</directory>
                                <filtering>true</filtering>
                            </resource>
                        </resources>
                    </configuration>
                </execution>
            </executions>
        </plugin>

        <plugin>
                <groupId>com.zenjava</groupId>
                <artifactId>javafx-maven-plugin</artifactId>
                <version>8.1.3-SNAPSHOT</version>
                <configuration>
                    <mainClass>com.mycompany.app.MyApp</mainClass>
                    <verbose>true</verbose>
                    <bundler>EXE</bundler>
                    <additionalAppResources>${project.build.directory}/additionalResources</additionalAppResources>
                </configuration>
                <executions> 
                 <!-- required before build-native --> 
                 <execution> 
                     <id>create-jfxjar</id> 
                     <phase>package</phase> 
                     <goals> 
                         <goal>build-jar</goal> 
                     </goals> 
                 </execution> 
                 <execution> 
                     <id>create-native</id> 
                     <phase>package</phase> 
                     <goals> 
                         <goal>build-native</goal> 
                     </goals> 
                 </execution> 
             </executions> 

        </plugin>

        </plugins>
    <finalName>myapp</finalName>
</build>

<dependencies>
    <dependency>
        <groupId>org.controlsfx</groupId>
        <artifactId>controlsfx</artifactId>
        <version>8.40.9</version>
    </dependency>

    <dependency>
        <groupId>customjar</groupId>
        <artifactId>mycustomjar</artifactId>
        <version>1.0</version>
    </dependency>
</dependencies>

<organization>
    <name>My Company</name>
    <url>www.mycompany.com</url>
</organization>

      

+1


source







All Articles