![]() ![]() You will be asked if you want to save the script, choose “Yes” if you think that you’ll need it later.Īfter quite a few minutes of waiting the script will create the installer file for you in the target directory: Go with the default setting on the next window.Ĭlick “Finish” to finalize the compiler script.Ĭlick “Yes” to start the script that will create the installer. You can also set the installer filename and icon here. In my case I choose the parent directory of my project. Skip the documentation options for now, but you will have to deal with these when you become a professional developer. On the next page click the bottom-most option to support previous windows version if you want to. When a window pops up if you want to add files in subfolders too, select yes. Select the main executable file and add the project folder with the “Add folder” button. Just click next to go with the default installation location. ![]() Launch the Inno Setup Compiler and choose “Create a new script file using the Script Wizard” option.įill out the required fields to add some info about your program. This is why we will create an installer in the next step to package everything together. Unfortunately sending this exe to your peers will not work as it also requires the “bin” folder to be present for the runtime environment. Try double clicking it to see if it launches your program. If everything worked out, now you should have an exe in the project folder. You can put this file into the same folder as the project. Select the location where Launch4j will save the project configuration. On the “JRE” tab set the Bundled JRE path to “bin/jre”.Ĭlick on the cog icon to build the wrapper. On the “Classpath” tab, select the main jar file of your project. Select your jar and ico file and set the name of the exe to be exported. For me, it broke the command line runnability of my jar file, but that can be easily fixed with setting the correct PATH variables in Windows. You might have to install an older version of Java to run Launch4j, but that shouldn’t be a problem as multiple versions can be present on your system at the same time. If you check the contents of “C:\Projects\DvdAnimate\bin\jre”, you should see the following contents: In my case the original folder name was “jdk-14”. You will probably find it under “C:\Program Files\Java\”. In the example this folder will be located at “C:\Projects\DvdAnimate”.Ĭreate a sub-folder named “bin” and copy the JRE installation inside from wherever it is installed in your system. exe and the JRE into an installer.Ĭreate a new folder for your project and place your jar and ico files inside. Launch4j will be used to convert your.Two pieces of software need to be installed on your system: Download the example jar and ico files here. jar file was created with Java SE 11, that is the minimum version that you need to run the file or create the installer. If you just want to try the process, you can use my DvdAnimate project that will show the bouncing DVD logo on the screen. You will also need an icon for your program in the Windows ICO format. If you can run the jar file from the command line with the java -jar command, you will probably be able to create the installer too. You need JRE installed on your Windows machine and a working. In this article, we will create an installer for your Java project for Windows, so it can be easily distributed as any other software on the platform. You will have to learn eventually how to do it anyway. Now this works for me because I have prepared my signature store in such a way that the command line can get the signature and I have only one code sign signature so I will not need to name it, your parameters may be different than mine are, and that's okay as long as in the end, your setup works and your code gets signed.If your friend is tech-savvy, he might be able to deal with the dependencies, but it is better if you do it yourself. When you look at the generated EXE you will see the digital signature This line, tells the compiler to use code signing, it will use the variable I've called MsSign, and will sign the output generated by the setup. In the script, you now add the following code to the setup segment You should now have this, and note that I have added the path to signtool.exe in my path variables and that I am using DigiCert's time server to time-stamp my signature. Note the $p at the end, Inno Setup needs this. ![]()
0 Comments
Leave a Reply. |