Installer: Add support for IzPack 5 (ticket #1864)

fix typo in postinstall.sh
This commit is contained in:
zzz
2018-07-10 11:19:41 +00:00
parent 2664c417e3
commit 307a68aa5a
5 changed files with 437 additions and 11 deletions

View File

@@ -30,10 +30,12 @@ sloccount.report.file=sloccount.sc
# Building EXEs in x64 Linux requires that 32bit libraries are installed. In Debian,
# for example, installing the libc6-i386 package will satisfy this requirement.
# Uncomment the next line to prevent building EXEs (changing it to false will have no impact)
#noExe=true
# IzPack 5.1.x install dir
#izpack5.home=/PATH/TO/IzPack
# Change this to false if you don't have gettext or you want to prevent it from running during the build
require.gettext=true

View File

@@ -1762,18 +1762,36 @@
<ant dir="installer/java" target="build" />
</target>
<!-- IzPack 4 -->
<target name="installer" depends="preppkg, buildProperties, util-list-changes, izpack-patches, buildUtilityJar" >
<!--
Force 1.5 pack200 output
Doesnt work!
http://jira.codehaus.org/browse/IZPACK-404
http://forums.sun.com/thread.jspa?threadID=773439
http://bfo.co.uk/blog/2010/05/13/combining_ant_jar_signatures_and_pack200.html
<property name="com.sun.java.util.jar.pack.package.majver" value="150" />
<property name="com.sun.java.util.jar.pack.package.minver" value="7" />
-->
<izpack input="${basedir}/installer/install.xml" output="${basedir}/install.jar" installerType="standard" basedir="${basedir}" />
<ant target="installerexe" />
</target>
<!-- IzPack 5 -->
<target name="ensureIzpack5" >
<!-- set if unset -->
<property name="izpack5.home" value="${user.home}/IzPack" />
<condition property="izpack5.available" >
<available file="${izpack5.home}" type="dir" />
</condition>
<fail message="Error - IzPack 5.1.x must be installed at ${izpack5.home}, or set izpack5.home=/PATH/TO/IzPack in override.properties, or download from http://izpack.org/downloads/ and install" >
<condition>
<not>
<isset property="izpack5.available" />
</not>
</condition>
</fail>
<path id="izpack5.lib.path">
<fileset dir="${izpack5.home}/lib" includes="*.jar"/>
</path>
<taskdef name="izpack5"
classpathref="izpack5.lib.path"
classname="com.izforge.izpack.ant.IzPackTask" />
</target>
<target name="installer5" depends="ensureIzpack5, preppkg, buildProperties, util-list-changes, buildUtilityJar" >
<izpack5 input="${basedir}/installer/install5.xml" output="${basedir}/install.jar" installerType="standard" basedir="${basedir}" />
<ant target="installerexe" />
</target>
@@ -1845,6 +1863,7 @@
<delete dir="pkg-temp" includes="eepget i2prouter INSTALL-headless.txt osid postinstall.sh runplain.sh" />
</target>
<!-- IzPack 4 -->
<target name="installer-windows" depends="clean, preppkg-windows-only, util-list-changes, izpack-patches, buildUtilityJar" >
<fixcrlf srcdir="pkg-temp" includes="*.config *.bat *.cmd **/*.xml **/*.properties **/*.txt scripts/*" encoding="utf8" eol="crlf"/>
<izpack input="${basedir}/installer/install.xml" output="${basedir}/install.jar" installerType="standard" basedir="${basedir}" />
@@ -1853,6 +1872,15 @@
<move file="${basedir}/i2pinstall.exe" tofile="${basedir}/i2pinstall_${full.version}_windows.exe" />
</target>
<!-- IzPack 5 -->
<target name="installer5-windows" depends="ensureIzpack5, clean, 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="installerexe" />
<delete file="${basedir}/install.jar" />
<move file="${basedir}/i2pinstall.exe" tofile="${basedir}/i2pinstall_${full.version}_windows.exe" />
</target>
<!-- this is broken as installer-xxx targets may delete (or not delete) things in pkg-temp -->
<target name="installer-all" depends="installer-freebsd, installer-linux, installer-osx, installer-windows, installer-nowindows, installer" >
</target>

395
installer/install5.xml Normal file
View File

@@ -0,0 +1,395 @@
<?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?>
<!--
This is for izpack 5.
See install.xml for izpack 4.
-->
<izpack:installation version="5.0"
xmlns:izpack="http://izpack.org/schema/installation"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://izpack.org/schema/installation http://izpack.org/schema/5.0/izpack-installation-5.0.xsd">
<info>
<appname>i2p</appname>
<appversion>0.9.35</appversion>
<authors>
<author name="I2P" email="https://geti2p.net/"/>
</authors>
<url>https://geti2p.net/</url>
<javaversion>1.7</javaversion>
<!-- adding this element will make the installer attempt to launch itself with administrator permissions,
but see http://www.nabble.com/Classpath-security-issues-on-Vista-td22456230.html
which says it isn't sufficient:
Just to let you know that I managed to identify and resolve the problem (in
case anyone else has it). The default installation directory for Vista is
under "Program Files" which is a "special" directory which can only be
written to (create sub-directories) by administrators. However, stupid
Vista downgrades an administrator to a normal user when the program is run
via the application shortcut menu. As you suggested, I added a script which
runs ICACLS which resolved the problem, i.e.
icacls %1 /grant Users:F /T > priv.log
The command needs to be run as a Process rather than as an executable tag in
order to pass $INSTALL_PATH as a parameter.
-->
<run-privileged condition="izpack.windowsinstall.vista|izpack.windowsinstall.7"/>
</info>
<guiprefs width="590" height="356" resizable="yes">
<!--
Not in 5.1.2, pick another one
https://izpack.atlassian.net/wiki/spaces/IZPACK/pages/491730/GUI+Preferences
<laf name="liquid">
<os family="unix"/>
</laf>
-->
<!-- full names, not iso3 codes -->
<modifier key="langDisplayType" value="native" />
</guiprefs>
<locale>
<langpack iso3="eng"/>
<langpack iso3="bra"/>
<langpack iso3="cat"/>
<langpack iso3="ces"/>
<langpack iso3="chn"/>
<langpack iso3="dan"/>
<langpack iso3="deu"/>
<langpack iso3="ell"/>
<langpack iso3="fin"/>
<langpack iso3="fra"/>
<langpack iso3="hun"/>
<langpack iso3="idn"/>
<langpack iso3="ita"/>
<langpack iso3="jpn"/>
<langpack iso3="kor"/>
<langpack iso3="msa"/>
<langpack iso3="nld"/>
<langpack iso3="nor"/>
<langpack iso3="pol"/>
<langpack iso3="prt"/>
<langpack iso3="ron"/>
<langpack iso3="rus"/>
<langpack iso3="slk"/>
<langpack iso3="spa"/>
<langpack iso3="srp"/>
<langpack iso3="swe"/>
<langpack iso3="tur"/>
<langpack iso3="twn"/>
<langpack iso3="ukr"/>
<!--
"WARNING: No locale for:"
<langpack iso3="eus"/>
<langpack iso3="fa"/>
<langpack iso3="glg"/>
-->
</locale>
<!--
The <os> tag can be used to restrict the inclusion into the uninstaller
to a specific operating system family, architecture or version.
The inclusion into the installer will be always done.
Here's a sample :
<native type="izpack" name="ShellLink.dll">
<os family="windows"/>
</native>
This doesn't appear to be necessary, the dlls don't get put in Uninstaller/uninstaller.jar on linux
-->
<natives>
<native type="izpack" name="ShellLink.dll" />
<native type="izpack" name="ShellLink_x64.dll" />
<!--
https://izpack.atlassian.net/wiki/spaces/IZPACK/pages/491532/Advanced+Features
<native type="izpack" name="WinSetupAPI.dll" />
<native type="izpack" name="WinSetupAPI_x64.dll" />
https://izpack.atlassian.net/wiki/spaces/IZPACK/pages/491676/RegistryInstallerListener+RegistryUninstallerListener
<native type="3rdparty" name="COIOSHelper.dll" />
<native type="3rdparty" name="COIOSHelper_x64.dll" />
-->
</natives>
<resources>
<res id="Installer.image" src="installer/resources/i2plogo.png" />
<res id="InfoPanel.info" src="installer/resources/readme.license.txt"/>
<!-- <res id="ProcessPanel.Spec.xml" src="installer/resources/ProcessPanel.Spec.xml"/> -->
<res id="shortcutSpec.xml" src="installer/resources/shortcutSpec.xml" />
<res id="XInfoPanel.info" src="installer/resources/start-i2p.txt" />
</resources>
<variables>
<!-- desktop shortcuts enabled by default in ShortcutPanel -->
<variable name="DesktopShortcutCheckboxEnabled" value="true" />
</variables>
<conditions>
<condition type="variable" id="is64bit">
<name>SYSTEM[sun.arch.data.model]</name>
<value>64</value>
</condition>
</conditions>
<panels>
<panel classname="HelloPanel"/>
<panel classname="InfoPanel"/>
<panel classname="TargetPanel"/>
<!-- In 5.1.2, PacksPanel will NPE at install time if before TargetPanel -->
<panel classname="PacksPanel"><os family="windows" /></panel>
<panel classname="InstallPanel"/>
<!-- In 5.1.2, ShortcutPanel must be after InstallPanel, so the .ico files will be there,
unless <lateShortcutInstall/> is set in shorcutSpec.xml.
If you don't do this right, the shortcuts won't have our icons.
-->
<panel classname="ShortcutPanel"><os family="windows" /></panel>
<!--
Using the condition this way, the panel is shown on everything *but* Windows.
Fails in console mode: Installer says:
No console mode helper found for class com.izforge.izpack.panels.xinfo.XInfoPanel, panel type will be skipped in console mode installation
No automation helper found for class com.izforge.izpack.panels.xinfo.XInfoPanel, panel type will be skipped in automated installation
But isn't actually skipped when installing with -console:
SEVERE: com.izforge.izpack.api.exception.IzPackException: Console implementation not found for panel: com.izforge.izpack.panels.xinfo.XInfoPanel
-->
<panel classname="XInfoPanel" condition="!izpack.windowsinstall" />
<panel classname="SimpleFinishPanel"/>
</panels>
<packs>
<pack name="Base" required="yes">
<description>Base installation files</description>
<!-- non-jars -->
<fileset dir="pkg-temp" excludes="**/*.jar" targetdir="$INSTALL_PATH"/>
<!-- pack200 jars -->
<fileset dir="pkg-temp" includes="**/*.jar"
excludes="lib/commons-logging.jar lib/jasper-compiler.jar lib/jetty-java5-threadpool.jar lib/jetty-sslengine.jar lib/jbigi.jar"
targetdir="$INSTALL_PATH">
<pack200/>
</fileset>
<!-- non-pack200 jars -->
<fileset dir="pkg-temp"
includes="lib/commons-logging.jar lib/jasper-compiler.jar lib/jetty-java5-threadpool.jar lib/jetty-sslengine.jar lib/jbigi.jar"
targetdir="$INSTALL_PATH">
</fileset>
<!--
Do variable substitution in these files. See:
http://www.javalobby.org/forums/thread.jspa?threadID=15967&tstart=0
and the izpack docs for some guidance.
-->
<parsable targetfile="$INSTALL_PATH/wrapper.config" type="plain" />
<parsable targetfile="$INSTALL_PATH/scripts/home.i2p.i2prouter" type="plain"> <os family="unix" /> </parsable>
<parsable targetfile="$INSTALL_PATH/i2prouter" type="shell"> <os family="unix" /> </parsable>
<parsable targetfile="$INSTALL_PATH/eepget" type="shell"> <os family="unix" /> </parsable>
<parsable targetfile="$INSTALL_PATH/eepget.bat" type="shell"><os family="windows" /></parsable>
<parsable targetfile="$INSTALL_PATH/runplain.sh" type="shell"> <os family="unix" /> </parsable>
<parsable targetfile="$INSTALL_PATH/Start I2P Router.app/Contents/MacOS/i2prouter" type="shell"><os family="mac" /></parsable>
<!-- postinstall stuff for windows -->
<!-- Wrapper for 32bit Windows JVM -->
<executable targetfile="$INSTALL_PATH/utility.jar"
type="jar"
class="net.i2p.installer.Main"
stage="postinstall"
keep="true"
failure="warn"
condition="!is64bit">
<os family="windows" />
<args>
<arg value="copy" />
<arg value="$INSTALL_PATH\lib\wrapper\win32\I2Psvc.exe" />
<arg value="$INSTALL_PATH" />
</args>
</executable>
<executable targetfile="$INSTALL_PATH/utility.jar"
type="jar"
class="net.i2p.installer.Main"
stage="postinstall"
keep="true"
failure="warn"
condition="!is64bit">
<os family="windows" />
<args>
<arg value="copy" />
<arg value="$INSTALL_PATH\lib\wrapper\win32\wrapper.dll" />
<arg value="$INSTALL_PATH\lib" />
</args>
</executable>
<!-- wrapper for 64bit Windows JVM -->
<executable targetfile="$INSTALL_PATH/utility.jar"
type="jar"
class="net.i2p.installer.Main"
stage="postinstall"
keep="true"
failure="warn"
condition="is64bit">
<os family="windows" />
<args>
<arg value="copy" />
<arg value="$INSTALL_PATH\lib\wrapper\win64\I2Psvc.exe" />
<arg value="$INSTALL_PATH" />
</args>
</executable>
<executable targetfile="$INSTALL_PATH/utility.jar"
type="jar"
class="net.i2p.installer.Main"
stage="postinstall"
keep="true"
failure="warn"
condition="is64bit">
<os family="windows" />
<args>
<arg value="copy" />
<arg value="$INSTALL_PATH\lib\wrapper\win64\wrapper.dll" />
<arg value="$INSTALL_PATH\lib" />
</args>
</executable>
<!--
We still copy the 32 bit version of wrapper.dll (even with a
64bit jvm) so that if a 32 bit jvm is installed in the future,
nothing breaks.
-->
<executable targetfile="$INSTALL_PATH/utility.jar"
type="jar"
class="net.i2p.installer.Main"
stage="postinstall"
keep="true"
failure="warn"
condition="is64bit">
<os family="windows" />
<args>
<arg value="copy" />
<arg value="$INSTALL_PATH\lib\wrapper\win32\wrapper.dll" />
<arg value="$INSTALL_PATH\lib\wrapper-windows-x86-32.dll" />
</args>
</executable>
<!-- workaround for bad default path for wrapper.log in Windows. -->
<executable targetfile="$INSTALL_PATH/utility.jar"
type="jar"
class="net.i2p.installer.Main"
stage="postinstall" keep="true">
<os family="windows" />
<args>
<arg value="fixwinpaths" />
<arg value="$INSTALL_PATH\wrapper.config" />
</args>
</executable>
<!-- Now we'll get rid of the UNIX-only stuff -->
<executable targetfile="$INSTALL_PATH/utility.jar"
type="jar"
class="net.i2p.installer.Main"
stage="postinstall" keep="true" failure="warn">
<os family="windows" />
<args>
<arg value="delete" />
<arg value="$INSTALL_PATH\i2prouter" />
<arg value="$INSTALL_PATH\install_i2p_service_unix" />
<arg value="$INSTALL_PATH\install-headless.txt" />
<arg value="$INSTALL_PATH\runplain.sh" />
<arg value="$INSTALL_PATH\osid" />
<arg value="$INSTALL_PATH\postinstall.sh" />
<arg value="$INSTALL_PATH\uninstall_i2p_service_unix" />
<arg value="$INSTALL_PATH\lib\wrapper" />
<arg value="$INSTALL_PATH\eepget" />
<arg value="$INSTALL_PATH/Start I2P Router.app" />
<arg value="$INSTALL_PATH/net.i2p.router.plist.template" />
<arg value="$INSTALL_PATH/install_i2p_service_osx.command" />
<arg value="$INSTALL_PATH/uninstall_i2p_service_osx.command" />
<arg value="$INSTALL_PATH/man" />
<arg value="$INSTALL_PATH/locale" />
<!-- Placeholder for an OSX 'shortcut' to the router console
<arg value="$INSTALL_PATH/I2P Router Console.webloc" />
-->
</args>
</executable>
<!-- workaround for vista permission problems - see comments above -->
<executable targetfile="$INSTALL_PATH/fixperms.bat" type="bin" stage="postinstall" keep="true" failure="warn"
condition="!izpack.windowsinstall.xp+!izpack.windowsinstall.2003" >
<os family="windows" />
<args>
<arg value="$INSTALL_PATH" />
</args>
</executable>
<!-- else delete it -->
<executable targetfile="$INSTALL_PATH/utility.jar"
type="jar"
class="net.i2p.installer.Main"
stage="postinstall" keep="true" failure="warn" condition="izpack.windowsinstall.xp|izpack.windowsinstall.2003">
<os family="windows" />
<args>
<arg value="delete" />
<arg value="$INSTALL_PATH\fixperms.bat" />
</args>
</executable>
<!--
<executable targetfile="$INSTALL_PATH/utility.jar"
type="jar"
class="net.i2p.installer.Main"
stage="postinstall" keep="true" failure="warn">
<os family="windows" />
<args>
<arg value="exec" />
<arg value="$INSTALL_PATH" />
<arg value="$INSTALL_PATH\I2Psvc.exe" />
<arg value="-c" />
<arg value="$INSTALL_PATH\wrapper.config" />
</args>
</executable>
-->
<!--
and now we delete the installer utility jar.
I moved this out of installer/ because the directory
couldn't be deleted while the jar was active and would
remain on the system.
This, however, works fine.
-->
<executable targetfile="$INSTALL_PATH/utility.jar"
type="jar"
class="net.i2p.installer.Main"
stage="postinstall" keep="false" failure="warn">
<os family="windows" />
<args>
<arg value="delete" />
<arg value="$INSTALL_PATH/utility.jar" />
</args>
</executable>
<!-- postinstall stuff for *nix -->
<!-- stage=never means chmod a+x -->
<executable targetfile="$INSTALL_PATH/postinstall.sh" type="bin" stage="never" keep="true" failure="warn"><os family="unix" /></executable>
<executable targetfile="$INSTALL_PATH/postinstall.sh" type="bin" stage="postinstall" keep="true" failure="warn"><os family="unix" />
<args><arg value="$INSTALL_PATH" /></args></executable>
<!--
Removal of the I2P service in Windows should be done in the base pack
so that even if a user installed the service manually it will still be
removed when uninstalling.
-->
<executable targetfile="$INSTALL_PATH/uninstall_i2p_service_winnt.bat" stage="uninstall"><os family="windows" /></executable>
</pack>
<!-- to disable by default, add preselected="no" -->
<pack name="Windows Service" required="no" preselected="no">
<description>Automatically start I2P in the background</description>
<os family="windows" />
<executable targetfile="$INSTALL_PATH/set_config_dir_for_nt_service.bat" stage="postinstall" failure="warn" keep="true" />
<executable targetfile="$INSTALL_PATH/install_i2p_service_winnt.bat" stage="postinstall" failure="warn" keep="true" />
<executable targetfile="$INSTALL_PATH/I2Psvc.exe" stage="postinstall" failure="warn" keep="true">
<args>
<arg value="-t" />
<arg value="$INSTALL_PATH\wrapper.config" />
</args>
</executable>
</pack>
</packs>
</izpack:installation>

View File

@@ -106,6 +106,7 @@
6. Change revision in:
- `history.txt`
- `installer/install.xml`
- `installer/install5.xml`
- `core/java/src/net/i2p/CoreVersion.java`
- `router/java/src/net/i2p/router/RouterVersion.java`
- (change to BUILD = 0 and EXTRA = "")

View File

@@ -104,7 +104,7 @@ fi
chmod 755 ./eepget
rm -rf ./icons ./lib/wrapper
rm -f ./lib/*.dll /*.bat ./*.cmd ./*.exe ./utility.jar
rm -f ./lib/*.dll ./*.bat ./*.cmd ./*.exe ./utility.jar
if [ ! `echo $HOST_OS |grep osx` ]; then
rm -rf ./Start\ I2P\ Router.app