浏览代码

Create installers for Linux and Windows

Toni Helenius 2 周之前
父节点
当前提交
62f6350b30

+ 2 - 0
.gitignore

@@ -27,3 +27,5 @@ ant-jme/dist
 dist/
 /.nb-gradle/
 jdks/downloads/
+installers/downloads/
+installers/nbpackage/

+ 93 - 0
installers/build-installers.sh

@@ -0,0 +1,93 @@
+#!/bin/bash
+#(c) jmonkeyengine.org
+
+# Uses NBPackage to create installers for different platforms.
+# Prequisites for running this script:
+# - The SDK ZIP build must already exist
+# - JDKs must already been downloaded
+# Some quirks exist with the different platform installers:
+# - Linux DEPs are only created with current architecture
+# - Windows installer requires Inno Setup, this seems like an easy thing to break in this chain
+
+set -e # Quit on Error
+
+nbpackage_version="1.0-beta6"
+nbpackage_url="https://archive.apache.org/dist/netbeans/netbeans-nbpackage/$nbpackage_version/nbpackage-$nbpackage_version-bin.zip"
+inno_setup_url="https://files.jrsoftware.org/is/6/innosetup-6.5.1.exe"
+
+function download_nbpackage {
+    echo "> Downloading the nbpackage"
+
+
+    if [ -f "downloads/nbpackage.zip" ];
+    then
+        echo "< Already existing, SKIPPING."
+    else
+        mkdir -p downloads
+        
+        curl -# -o downloads/nbpackage.zip -L $nbpackage_url
+        echo "< OK!"
+    fi
+}
+
+function prepare_nbpackage {
+    echo "> Extracting the nbpackage"
+
+
+    if [ -d "nbpackage" ];
+    then
+        echo "< Already existing, SKIPPING."
+    else
+        unzip -qq downloads/nbpackage.zip -d nbpackage
+        echo "< OK!"
+    fi
+}
+
+function build_linux_deb {
+    echo "> Building the Linux DEB"
+
+    ./nbpackage/nbpackage-$nbpackage_version/bin/nbpackage --input ../dist/jmonkeyplatform.zip --config linux-x64/jmonkeyengine-x64-deb.properties --output ../dist/ -Ppackage.version=3.8.0
+
+    echo "< OK!"
+}
+
+function build_windows_installer {
+    echo "> Building the Windows installer"
+    
+    setup_inno_setup
+
+    ./nbpackage/nbpackage-$nbpackage_version/bin/nbpackage --input ../dist/jmonkeyplatform.zip --config windows-x64/jmonkeyengine-windows-x64.properties --output ../dist/ -Ppackage.version=3.8.0
+
+    echo "< OK!"
+}
+
+function setup_inno_setup {
+    echo ">> Setting up Inno Setup"
+    
+    download_inno_setup
+    
+    # Needs Wine!!!
+    wine downloads/innosetup.exe /VERYSILENT
+
+    echo "<< OK!"
+}
+
+function download_inno_setup {
+    echo ">>> Downloading Inno Setup"
+
+
+    if [ -f "downloads/innosetup.exe" ];
+    then
+        echo "<<< Already existing, SKIPPING."
+    else
+        mkdir -p downloads
+        
+        curl -# -o downloads/innosetup.exe -L $inno_setup_url
+        echo "<<< OK!"
+    fi
+}
+
+download_nbpackage
+prepare_nbpackage
+build_linux_deb
+build_windows_installer

+ 30 - 0
installers/linux-x64/jmonkeyengine-x64-deb.properties

@@ -0,0 +1,30 @@
+# Application name (required).
+package.name=jMonkeyEngine SDK
+# Packaging type.
+package.type=linux-deb
+# Path to Java runtime to include in the package (default none).
+package.runtime=${CONFIG}/jdk-x64_linux.tar.gz
+# A single-line description of the package. Not all packagers will display this.
+package.description=A complete 3D game development suite written purely in Java.
+# Application publisher. Not all packagers will display this.
+package.publisher=${package.name}
+# Link to application / publisher website. Not all packagers will display this.
+package.url=https://jmonkeyengine.org
+# Path to 48x48 png icon as required by xdg specification. Defaults to Apache NetBeans logo.
+package.deb.icon=${CONFIG}/jmonkeyplatform.png
+# Path to SVG icon. Will only be used if package.deb.icon also set. Defaults to Apache NetBeans logo.
+package.deb.svg-icon=
+# Optional name for .desktop file (without suffix). Defaults to sanitized package name.
+package.deb.desktop-filename=jmonkeyengine-sdk-${package.version}
+# StartupWMClass to set in .desktop file. Should match the WMClass of the main application window.
+package.deb.wmclass=${package.name} ${package.version}
+# Application category (or categories) to use in the .desktop file.
+package.deb.category=Development;Java;IDE;3D;
+# Maintainer information as name and email. Mandated in Debian Control file.
+package.deb.maintainer=jMonkeyEngine <[email protected]>
+# Optional path to custom Debian Control file template.
+package.deb.control-template=
+# Optional path to custom .desktop file template.
+package.deb.desktop-template=
+# Optional path to custom launcher script template.
+package.deb.launcher-template=

二进制
installers/linux-x64/jmonkeyplatform.png


+ 2 - 0
installers/windows-x64/issc.sh

@@ -0,0 +1,2 @@
+#!/bin/sh
+wine C:\\Program\ Files\\Inno\ Setup\ 6\\ISCC.exe $1

+ 22 - 0
installers/windows-x64/jmonkeyengine-windows-x64.properties

@@ -0,0 +1,22 @@
+# Application name (required).
+package.name=jMonkeyEngine SDK
+# Packaging type.
+package.type=windows-innosetup
+# Path to Java runtime to include in the package (default none).
+package.runtime=${CONFIG}/jdk-x64_windows.zip
+# A single-line description of the package. Not all packagers will display this.
+package.description=A complete 3D game development suite written purely in Java.
+# Application publisher. Not all packagers will display this.
+package.publisher=${package.name}
+# Link to application / publisher website. Not all packagers will display this.
+package.url=https://jmonkeyengine.org
+# Path to an InnoSetup compiler - can be downloaded from https://jrsoftware.org/isinfo.php (or Linux shell script to invoke via wine).
+package.innosetup.tool=${CONFIG}/issc.sh
+# ID to uniquely identify application. Defaults to package name.
+package.innosetup.appid=
+# Path to an icon (*.ico) file for shortcut and installer.
+package.innosetup.icon=${CONFIG}/jmonkeyplatform.ico
+# Optional path to a license file to be shown during installation (*.txt or *.rtf).
+package.innosetup.license=${CONFIG}/licenses-sdk.txt
+# Optional path to an alternative InnoSetup (*.iss) file template.
+package.innosetup.template=

二进制
installers/windows-x64/jmonkeyplatform.ico


+ 0 - 0
licenses-sdk.txt → installers/windows-x64/licenses-sdk.txt