forked from I2P_Developers/i2p.i2p
Installer: Fix -console install for izpack 5 (ticket #2492)
Switch to izpack 5 for non-windows release installer
This commit is contained in:
@ -36,6 +36,8 @@ sloccount.report.file=sloccount.sc
|
||||
# IzPack 5.1.x install dir
|
||||
# Default is $HOME/IzPack
|
||||
#izpack5.home=/PATH/TO/IzPack
|
||||
# Default is 5.1.3
|
||||
#izpack5.version=5.1.3
|
||||
|
||||
# Change this to false if you don't have gettext or you want to prevent it from running during the build
|
||||
require.gettext=true
|
||||
|
20
build.xml
20
build.xml
@ -1050,6 +1050,7 @@
|
||||
<delete dir="./build" />
|
||||
<delete dir="./reports" />
|
||||
<delete file="installer/lib/izpack/patches.jar" failonerror="false" quiet="true" />
|
||||
<ant dir="installer/lib/izpack5/patches/java/" target="clean" />
|
||||
<delete file="syndie-standalone.zip" failonerror="false" quiet="true" />
|
||||
<delete file="i2psnark-standalone.zip" failonerror="false" quiet="true" />
|
||||
<delete file="BOB-one.jar" failonerror="false" quiet="true" />
|
||||
@ -1091,6 +1092,7 @@
|
||||
<delete dir="core/c/jcpuid/lib" />
|
||||
<ant dir="installer/resources/locale" target="distclean" />
|
||||
<ant dir="installer/tools/java" target="distclean" />
|
||||
<ant dir="installer/lib/izpack5/patches/java/" target="distclean" />
|
||||
<!--
|
||||
NOTE! We need to turn off the default excludes for these
|
||||
patterns to work.
|
||||
@ -1798,7 +1800,11 @@
|
||||
classname="com.izforge.izpack.ant.IzPackTask" />
|
||||
</target>
|
||||
|
||||
<target name="installer5" depends="ensureIzpack5, preppkg, buildProperties, util-list-changes, buildUtilityJar" >
|
||||
<target name="izpack5-patches" depends="ensureIzpack5, buildProperties" >
|
||||
<ant dir="installer/lib/izpack5/patches/java/" target="jar" />
|
||||
</target>
|
||||
|
||||
<target name="installer5" depends="izpack5-patches, preppkg, buildProperties, util-list-changes, buildUtilityJar" >
|
||||
<izpack5 input="${basedir}/installer/install5.xml" output="${basedir}/install.jar" installerType="standard" basedir="${basedir}" />
|
||||
<ant target="installer5exe" />
|
||||
</target>
|
||||
@ -1855,7 +1861,7 @@
|
||||
</target>
|
||||
|
||||
<!-- IzPack 5 -->
|
||||
<target name="installer5-nowindows" depends="ensureIzpack5, clean, preppkg-nowindows" >
|
||||
<target name="installer5-nowindows" depends="clean, izpack5-patches, preppkg-nowindows" >
|
||||
<fixcrlf srcdir="pkg-temp" includes="*.config **/*.xml **/*.properties **/*.txt scripts/*" encoding="utf8" eol="lf" />
|
||||
<izpack5 input="${basedir}/installer/install5.xml" output="${basedir}/i2pinstall_${full.version}.jar" installerType="standard" basedir="${basedir}" />
|
||||
</target>
|
||||
@ -1873,7 +1879,7 @@
|
||||
</target>
|
||||
|
||||
<!-- IzPack 5 -->
|
||||
<target name="installer5-linux" depends="ensureIzpack5, clean, preppkg-linux-only" >
|
||||
<target name="installer5-linux" depends="clean, izpack5-patches, preppkg-linux-only" >
|
||||
<fixcrlf srcdir="pkg-temp" includes="*.config **/*.xml **/*.properties **/*.txt scripts/*" encoding="utf8" eol="lf" />
|
||||
<izpack5 input="${basedir}/installer/install5.xml" output="${basedir}/i2pinstall_${full.version}_linux-only.jar" installerType="standard" basedir="${basedir}" />
|
||||
</target>
|
||||
@ -1931,7 +1937,7 @@
|
||||
</target>
|
||||
|
||||
<!-- IzPack 5 -->
|
||||
<target name="installer5-windows" depends="ensureIzpack5, clean, preppkg-windows-only, util-list-changes, buildUtilityJar" >
|
||||
<target name="installer5-windows" depends="clean, izpack5-patches, preppkg-windows-only, util-list-changes, buildUtilityJar" >
|
||||
<fixcrlf srcdir="pkg-temp" includes="*.config *.bat *.cmd **/*.xml **/*.properties **/*.txt scripts/*" encoding="utf8" eol="crlf"/>
|
||||
<izpack5 input="${basedir}/installer/install5.xml" output="${basedir}/install.jar" installerType="standard" basedir="${basedir}" />
|
||||
<ant target="installer5exe" />
|
||||
@ -2152,10 +2158,10 @@
|
||||
<!-- this is the same dependency as pkg, but with updater200 in the middle,
|
||||
since preppkg puts too much stuff in pkg-temp -->
|
||||
<!--
|
||||
<target name="release" depends="verifyReleaseBuildNumbers, -pre-release, distclean, testscripts, updaterWithJettyAndJbigiRepack, updater200WithJettyAndJbigi, delete-j6-update, installer-nowindows, delete-nonwindows, installer5-windows">
|
||||
<target name="release" depends="verifyReleaseBuildNumbers, -pre-release, distclean, testscripts, updaterWithJettyRepack, updater200WithJetty, delete-j6-update, installer-nowindows, delete-nonwindows, installer5-windows">
|
||||
<target name="release" depends="verifyReleaseBuildNumbers, -pre-release, distclean, testscripts, updaterWithJettyAndJbigiRepack, updater200WithJettyAndJbigi, delete-j6-update, installer5-nowindows, delete-nonwindows, installer5-windows">
|
||||
<target name="release" depends="verifyReleaseBuildNumbers, -pre-release, distclean, testscripts, updaterWithJettyRepack, updater200WithJetty, delete-j6-update, installer5-nowindows, delete-nonwindows, installer5-windows">
|
||||
-->
|
||||
<target name="release" depends="verifyReleaseBuildNumbers, -pre-release, distclean, testscripts, updaterWithJettyAndGeoIPRepack, updater200WithJettyAndGeoIP, delete-j6-update, installer-nowindows, delete-nonwindows, installer5-windows">
|
||||
<target name="release" depends="verifyReleaseBuildNumbers, -pre-release, distclean, testscripts, updaterWithJettyAndGeoIPRepack, updater200WithJettyAndGeoIP, delete-j6-update, installer5-nowindows, delete-nonwindows, installer5-windows">
|
||||
<echo message="New version number is ${release.number}" />
|
||||
<copy file="i2pupdate.zip" tofile="i2pupdate_${release.number}.zip" />
|
||||
<copy file="i2pinstall_${full.version}.jar" tofile="i2pinstall_${release.number}.jar" />
|
||||
|
@ -136,6 +136,9 @@ https://izpack.atlassian.net/wiki/spaces/IZPACK/pages/491730/GUI+Preferences
|
||||
</condition>
|
||||
</conditions>
|
||||
|
||||
<!-- XInfoConsolePanel -->
|
||||
<jar src="installer/lib/izpack5/patches/java/build/izpack-i2p.jar" />
|
||||
|
||||
<panels>
|
||||
<panel classname="HelloPanel"/>
|
||||
<panel classname="InfoPanel"/>
|
||||
|
65
installer/lib/izpack5/patches/java/build.xml
Normal file
65
installer/lib/izpack5/patches/java/build.xml
Normal file
@ -0,0 +1,65 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project basedir="." default="all" name="tooljar">
|
||||
<target name="all" depends="clean, build" />
|
||||
<target name="build" depends="builddep, jar" />
|
||||
<target name="builddep">
|
||||
<!-- noop -->
|
||||
</target>
|
||||
<condition property="depend.available">
|
||||
<typefound name="depend" />
|
||||
</condition>
|
||||
<target name="depend" if="depend.available">
|
||||
<depend
|
||||
cache="../../../build"
|
||||
srcdir="./src"
|
||||
destdir="./build/obj" >
|
||||
</depend>
|
||||
</target>
|
||||
|
||||
<!-- only used if not set by a higher build.xml -->
|
||||
<property name="javac.compilerargs" value="" />
|
||||
<property name="javac.classpath" value="" />
|
||||
<property name="javac.version" value="1.7" />
|
||||
<property name="izpack5.version" value="5.1.3" />
|
||||
|
||||
<property name="izpack.lib" value="${izpack5.home}/lib" />
|
||||
|
||||
<target name="compile" depends="depend">
|
||||
<mkdir dir="./build" />
|
||||
<mkdir dir="./build/obj" />
|
||||
<javac srcdir="./src" debug="true" source="${javac.version}" target="${javac.version}" deprecation="on"
|
||||
includeAntRuntime="false"
|
||||
destdir="./build/obj" >
|
||||
<compilerarg line="${javac.compilerargs}" />
|
||||
<classpath>
|
||||
<pathelement location="${javac.classpath}" />
|
||||
<pathelement location="${izpack.lib}/izpack-api-${izpack5.version}.jar" />
|
||||
<pathelement location="${izpack.lib}/izpack-core-${zpack.ver}.jar" />
|
||||
<pathelement location="${izpack.lib}/izpack-installer-${izpack5.version}.jar" />
|
||||
<pathelement location="${izpack.lib}/izpack-panel-${izpack5.version}.jar" />
|
||||
<pathelement location="${izpack.lib}/izpack-util-${izpack5.version}.jar" />
|
||||
</classpath>
|
||||
</javac>
|
||||
</target>
|
||||
|
||||
<target name="jar" depends="compile">
|
||||
<jar destfile="build/izpack-i2p.jar">
|
||||
<fileset dir="./build/obj" includes="**" />
|
||||
<manifest>
|
||||
<attribute name="Built-By" value="${build.built-by}" />
|
||||
<attribute name="Build-Date" value="${build.timestamp}" />
|
||||
<attribute name="Base-Revision" value="${workspace.version}" />
|
||||
<attribute name="X-Compile-Source-JDK" value="${javac.version}" />
|
||||
<attribute name="X-Compile-Target-JDK" value="${javac.version}" />
|
||||
</manifest>
|
||||
</jar>
|
||||
</target>
|
||||
|
||||
<target name="clean">
|
||||
<delete dir="./build" />
|
||||
</target>
|
||||
<target name="cleandep" depends="clean">
|
||||
</target>
|
||||
<target name="distclean" depends="clean">
|
||||
</target>
|
||||
</project>
|
@ -0,0 +1,109 @@
|
||||
/*
|
||||
* IzPack - Copyright 2001-2008 Julien Ponge, All Rights Reserved.
|
||||
*
|
||||
* http://izpack.org/
|
||||
* http://izpack.codehaus.org/
|
||||
*
|
||||
* Copyright 2002 Jan Blok
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.izforge.izpack.panels.xinfo;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
import com.izforge.izpack.api.data.InstallData;
|
||||
import com.izforge.izpack.api.resource.Resources;
|
||||
import com.izforge.izpack.installer.console.AbstractConsolePanel;
|
||||
import com.izforge.izpack.installer.console.ConsolePanel;
|
||||
import com.izforge.izpack.installer.panel.PanelView;
|
||||
import com.izforge.izpack.util.Console;
|
||||
|
||||
/**
|
||||
* Modified from HelloConsolePanel and XInfoPanel
|
||||
*
|
||||
* https://trac.i2p2.de/ticket/2492
|
||||
* https://izpack.atlassian.net/browse/IZPACK-1631
|
||||
*/
|
||||
public class XInfoConsolePanel extends AbstractConsolePanel
|
||||
{
|
||||
private final Resources resources;
|
||||
|
||||
/**
|
||||
* The info to display.
|
||||
*/
|
||||
private String info;
|
||||
|
||||
/**
|
||||
* Constructs an {@code XInfoConsolePanel}.
|
||||
*
|
||||
* @param panel the parent panel/view. May be {@code null}
|
||||
*/
|
||||
public XInfoConsolePanel(Resources resources, PanelView<ConsolePanel> panel)
|
||||
{
|
||||
super(panel);
|
||||
this.resources = resources;
|
||||
}
|
||||
|
||||
public boolean run(InstallData installData, Properties properties)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Runs the panel using the specified console.
|
||||
*
|
||||
* @param installData the installation data
|
||||
* @param console the console
|
||||
* @return <tt>true</tt> if the panel ran successfully, otherwise <tt>false</tt>
|
||||
*/
|
||||
@Override
|
||||
public boolean run(InstallData installData, Console console)
|
||||
{
|
||||
display(installData, console);
|
||||
return promptEndPanel(installData, console);
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads the info text.
|
||||
*/
|
||||
private void loadInfo()
|
||||
{
|
||||
info = resources.getString("XInfoPanel.info", null, "Error : could not load the info text !");
|
||||
}
|
||||
|
||||
/**
|
||||
* Parses the text for special variables.
|
||||
*/
|
||||
private void parseText(InstallData installData)
|
||||
{
|
||||
// Parses the info text
|
||||
info = installData.getVariables().replace(info);
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays the panel.
|
||||
*
|
||||
* @param installData the installation data
|
||||
* @param console the console
|
||||
*/
|
||||
protected void display(InstallData installData, Console console)
|
||||
{
|
||||
// Text handling
|
||||
loadInfo();
|
||||
parseText(installData);
|
||||
// UI handling
|
||||
console.println(info);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user