Oliver-Loeffler / Java-Toolkit-for-Windows

Template to compile an Innosetup project wich provides some Java related tooling (JDKs, Eclipse, Git, Wixtoolset etc.). Download scripts included.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Customized Installer for a Java Developers Setup on Windows 10

It can be quite time consuming to setup and prepare a new developer PC - especially in restricted environments. This experiment uses InnoSetup to create an installable bundle providing all necessary tooling:

  • The installation does not require elevated privileges, everything works per user.
  • Eclipse IDE for Java Developers (2022-03)
  • Adoptium / Temurin LTS JDKs: 11, 17
  • Most recent Adoptium / Temurin JDK: 18
  • Zulu8 JDK with JavaFX - sometimes one still needs Java8
  • GraalVM 22.1 Community Edition with Java 17 support
  • OpenJFX 18 together with SceneBuilder 18
  • Gradle.org Build Tool 7.4.2
  • Apache Maven 3.8.5 Build Tool
  • WIX Toolset 3.11.2 (is required by JPackage on Windows)
  • GIT-SCM 2.36.1 for Windows

All components are collected by a download script. Then, all packages are unzipped and arranged so, that InnoSetup can consume all packages. Gradle will by default use the provided Java 17 as runtime. At this point, Maven still looks for JAVA_HOME but configuring this is not mandatory. Gradle, Maven and Git Bash are configured with scrips inside scripts directory. These scripts are Java classes with main methods and these are called by InnoSetup.

On Windows Commandline and on Git-Bash for Windows, one can use the jdks command to list all JDKs which have been installed. By calling jdk8, jdk11,jdk17,jdk18 or graal17 one can switch between the various JDKs on command line and Git Bash.

The installation for all these components works without admin provileges, those are not needed. All files are installed in C:\Users\<username>\AppData\Local\Programs\java (which is %LOCALAPPDATA%\Programs\java).

Following files are modified during installation:

  • %USERPROFILE%\.gradle\gradle.properties
  • %USERPROFILE%\.bashrc
  • %LOCALAPPDATA%\Programs\java\gradle-7.4.2\bin\{gradle|gradle.bat}

Prepare the InnoSetup Build - collect all materials

  1. Clone the repository
> git clone https://github.com/Oliver-Loeffler/Java-Toolkit-for-Windows.git
  1. Download all components
> cd Java-Toolkit-for-Windows
Java-Toolkit-for-Windows> download-all

Curl is used to perform all necessary downloads. All files will be placed in downloads. The InnoSetup script then requires all files unzipped and placed in a specific folder structure.

  1. Unzip all components and create required folders
Java-Toolkit-for-Windows> unzip-all
  1. Open the file Java-Toolkit.iss using the InnoSetup 6.2.1 IDE and run the package compile.

After a successful package compile, there should be an installer Java-Development-Tools.exe (approx. 1.43 GiB) inside the build directory.

Installation Package

Helpful stuff

If you completed the InnoSetup packaging and also installed the full package on your system, you can test the installation success on Windows Commandline. The jdks command will provide an overview about what is available.

> jdks
===============================================
 Available JDKs:
===============================================
C:\Users\Username\AppData\Local\Programs\java\zulu8.62.0.19-ca-fx-jdk8.0.332-win_x64
C:\Users\Username\AppData\Local\Programs\java\jdk-11.0.15+10
C:\Users\Username\AppData\Local\Programs\java\jdk-17.0.3+7
C:\Users\Username\AppData\Local\Programs\java\jdk-18.0.1+10
C:\Users\Username\AppData\Local\Programs\java\graalvm-ce-java17-22.1.0
C:\Users\Username\AppData\Local\Programs\java\jdk-18.0.1+10 (current JDK)

Well, if JDK18 is not suitable anymore, by entering jdk8 one could activate the Zulu8 JDK.

>jdk8
===============================================
 Switched to JDK 1.8 (Zulu 8 with JavaFX)
===============================================
JAVA_HOME=C:\Users\Username\AppData\Local\Programs\java\zulu8.62.0.19-ca-fx-jdk8.0.332-win_x64
openjdk version "1.8.0_332"
OpenJDK Runtime Environment (Zulu 8.62.0.19-CA-win64) (build 1.8.0_332-b09)
OpenJDK 64-Bit Server VM (Zulu 8.62.0.19-CA-win64) (build 25.332-b09, mixed mode)

Installer Images

Welcome Dialog Component Selection Dialog Additional Tasks Dialog Ready To Install Dialog Setup Completed Dialog

Interesting notes

About

Template to compile an Innosetup project wich provides some Java related tooling (JDKs, Eclipse, Git, Wixtoolset etc.). Download scripts included.

License:MIT License


Languages

Language:Inno Setup 42.0%Language:Java 35.2%Language:Batchfile 15.8%Language:Shell 7.0%