I2P JPackage

** This is work in progress. Even this readme may change rapidly. **

** Work on this project has largely been moved to platform-specific repositories **

Find them:

If you just want to get an experimental jpackaged router on Windows or Mac OSX, just visit this Informational page.

If you want to use a jpackaged router on Linux you can use this repository, but there is no guarantee of support. There are at least a couple of things about the approach used here that are arguably more complicated than they need to be, and the configuration it uses is not ideal. You’re probably much better off with a .deb package or a JVM and a jar install.

This project aims to contain scripts and code necessary to build all-in-one installers for Windows, Mac, and Linux using the JPackage tool.

Requirements

You need JDK 14 or newer installed on your system. On Windows you also need the Wix tool and a bash-like environment like Cygwin or GitBash.

Building

  1. Set the JAVA_HOME variable to point to the installation of the JDK
  2. Clone the i2p.i2p module as a sibling to this module.
  3. Build it using ant clean pkg
  4. Run build.sh

How does it work

The I2P router expects to find some resources in specific places. The legacy I2P installer deployes those resources where they are exxpected to be. However with installers built with JPackage, and more specifically with Mac AppBundles it is not possible to execute arbitrary code during installation. The way to get around this is:

  1. Create a .jar file containing the following resources
  2. Enumerate these resources and generate a file called resources.csv. The format is CSV file where the first entry is the path that the classloader will use to locate the file, the second entry is the path under the preferences directory where the resource should be copied, and the third entry indicates whether to overwrite any existing files (true|false). Add this file in the .jar built in step 1.
  3. Use a custom main class net.i2p.router.PackageLauncher which reads the above list and copies each resource to the appropriate path under the current user’s preferences directory, which is OS-dependent.
  4. The custom main class will also set any system properties necessary for I2P to work, then invoke the “real” main class net.i2p.router.RouterLaunch.
  5. The compiled custom main class gets added to the .jar as well.

JPackage gets invoked and pointed to the custom main class. It’s operation can be customized by setting the following environment variables:

Variable Purpose Example
JPACKAGE_OPTS Options to pass to jpackage, usualy OS-dependent --mac-sign
I2P_VERSION Overrides the version from the router.jar file 1.2.3

git repository: ./i2p-jpackage

Git Summary


 project  : i2p-jpackage
 repo age : vor 11 Monaten
 active   : 6 days
 commits  : 31
 files    : 6
 authors  : 
cd2a820 2021-04-04 Update the README.md
f06a8b1 2021-04-03 make the build.sh script a little nicer, also apparently windows requires classpath jars to be absolute, or at least I had to make them that to make them work
87f8dbf 2021-03-22 Quote JAVA_VERSION on line 67
e958561 2021-03-22 use mkdir -p so I can sometimes skip the clean step
98d8693 2021-03-22 Detect OS on jpackage command
4107436 2021-03-22 quote some things for git bash
863588d 2021-03-22 quote some things that need quoted
00899b6 2021-03-20 add ability to pass custom options and override the version
ee74696 2021-03-20 add icon on Mac OS
2f11311 2021-03-20 pass license file
ab0fd76 2021-03-20 pass version to jpackage
b365f01 2021-03-20 sed -i works differently on Mac OS.  -i[extension] works on both GNU/Linux and Mac OS
4dcb626 2021-03-20 more items
82e4cbc 2021-03-20 TODO list
395611a 2021-03-20 Merge branch 'master' into 'master'
f92af02 2021-03-19 fix indentation
0110bd9 2021-03-19 Fix other merge conflict, automatically find the JAVA_HOME
8045d2e 2021-03-19 resolve merge conflict
faf2f76 2021-03-19 Add some essentials to the gitignore
74a3080 2021-03-19 clean using clean.sh
1663005 2021-03-19 add hosts.txt
cf3a585 2021-03-19 use portable/configs instead of the small configs
2c36fdc 2021-03-18 bundle webapp resources and application configs
52dbe4c 2021-03-19 add ability to not overwrite some resources like config files
981f8e0 2021-03-18 fix merge conflict
28c845c 2021-03-18 Try a way of doing a Linux build
446b87d 2021-03-19 proper copy command
a2e1d0a 2021-03-19 correct class name
bc4c601 2021-03-18 working jpackage build
ac6f02e 2021-03-18 wip on instructions
c48b5d7 2021-03-18 Initial commit```

## Files

.gitignore README.md TODO.md build.sh clean.sh java/net/i2p/router/PackageLauncher.java


## Branches

## Tags

## Remotes

origin https://github.com/i2p/i2p-jpackage (fetch) origin https://github.com/i2p/i2p-jpackage (push) ```