2

I am creating a setup using Javafx native bundle.

I have to perform some actions while installing the application.

I am able to add batch file in installation folder using this code.

<fx:resources>
                <fx:fileset dir="${basedir}/${dist.dir}"
                            includes="*.jar"/>
                <fx:fileset dir="${basedir}/${dist.dir}"
                            includes="lib/*.jar"/>
                <fx:fileset dir="${basedir}"
                            includes="preference/*.*"/>
            </fx:resources>

But, my question is how can I execute the same file during installation?

As I know javafx uses Inno setup for the same.

So,I took a look at the Executing installed batch file in Inno Setup. But how can I add run entry using Javafx native build.

Hiren
  • 1,427
  • 1
  • 18
  • 35
  • I see nothing in [the Ant task reference](https://docs.oracle.com/javase/8/docs/technotes/guides/deploy/javafx_ant_task_reference.html) that indicates you can execute your own code upon installation. Perhaps you can defer running your batch file until the first time the application runs? – VGR Jul 14 '17 at 14:58
  • Thank you. But, If i run the batch file at the time of running application it asks for permission. So it appears every time I open my application. So i chose to execute at while setup process. – Hiren Jul 14 '17 at 15:00

1 Answers1

2

The javapackager is looking for a special file within the provided files (deploy/windows/{yourproject-appname}.iss). When having verbose set to true, you will get some message about some installer-files being put below your %TEMP%-folder. That file contains the special installer-creation files coresponding to your project. You will have to store that file with your project, as the temporary file folder is not used by the javapackager anymore.

To execute your batch-file after installation was succesfully, just modify your .iss-file you put into your project by adding the corresponding [RUN]-block.

For more information about that [RUN]-block just look at another SO-answer or at the software documentation of Inno Setup

FibreFoX
  • 2,858
  • 1
  • 19
  • 41