Hi,
Yes we have created an installer with standalone bootstrap.jar and embedded OpenJDK using Inno Setup. It can also create a desktop icon and a Start menu entry like a full fledged windows app.
We simply make the installer available via the downloadpage. If we want to update the JRE - which doesn’t happen very often - a new installer is made and can be run without uninstalling the old one.
Inno Setup uses a config file (.iss) that allows for easy parametrizing and can also be used in scripting. We use scripting because we need to build installers for every unique bootstrap.jar (each customer has its own).
Our config looks like this:
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppName "Stb CRM"
#define MyAppVersion "8.0"
#define MyAppPublisher "Eudonet Stb"
#define MyAppURL "https://www.stb.nl"
#define MyAppExeName "stbCRM.exe"
#define MyAppIcoName "stbCRM-8.ico"
#define MyJarName "bootstrap.jar"
#define MyJREDir "jdk8u275-b01-jre"
[Setup]
; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{F99ECF46-E5FC-4AF2-A561-A4ABEB6D94B7}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={autopf}\{#MyAppName}
DefaultGroupName={#MyAppName}
AllowNoIcons=yes
PrivilegesRequired=admin
PrivilegesRequiredOverridesAllowed=dialog
OutputDir=output
OutputBaseFilename=stbCRM-install-{#MyJREDir}
SetupIconFile=stbCRM-8.ico
Compression=lzma
SolidCompression=yes
WizardStyle=modern
WizardImageFile=stb-logo.bmp
WizardImageStretch=false
WizardSmallImageFile=stbCRM-55x55.bmp,stbCRM-64x64.bmp
VersionInfoVersion=1.2
[InstallDelete]
Type: filesandordirs; Name: "{app}\runtime\*.*"
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
Name: "dutch"; MessagesFile: "compiler:Languages\Dutch.isl"
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}";
[Files]
Source: "app\*"; DestDir: "{app}\app"; Flags: ignoreversion
Source: "runtime\{#MyJREDir}\*"; DestDir: "{app}\runtime\{#MyJREDir}"; Flags: ignoreversion recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[Icons]
Name: "{autodesktop}\{#MyAppName}"; \
IconFilename: "{app}\app\{#MyAppIcoName}"; \
Filename: "{app}\runtime\{#MyJREDir}\bin\javaw.exe"; Parameters: " -Xms768m -Xmx768m -jar {#MyJarName}"; \
WorkingDir: "{app}\app\"; \
Tasks: desktopicon
Name: "{autostartmenu}\{#MyAppName}"; \
IconFilename: "{app}\app\{#MyAppIcoName}"; \
Filename: "{app}\runtime\{#MyJREDir}\bin\javaw.exe"; Parameters: "-Xms768m -Xmx768m -jar {#MyJarName}"; \
WorkingDir: "{app}\app\"; \
[Run]
Filename: "{app}\runtime\{#MyJREDir}\bin\javaw.exe"; Parameters: "-Xms768m -Xmx768m -jar {#MyJarName}"; \
WorkingDir: "{app}\app\"; \
Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; \
Flags: nowait postinstall skipifsilent
It relies on 2 subdirectories in the same directory where the .iss is:
- app - contains bootstrap.jar and .ico
- runtime - contains the jre director