Make it possible to optionally generate jpackage which can be added to a Linux tar.gzipped firefox profile+script. If a Firefox is added to this .tar.gz in a directory called ./firefox/, and that Firefox is configured to be portable and avoid the disk, the launching script will favor the local Firefox and it *should* never need to touch anything outside the directory it's unpacked in, making it usable from a flash drive without touching the disk on a host, for instance. More generally, forming the basis of a TBB-like package
This commit is contained in:
2
Makefile
2
Makefile
@@ -56,6 +56,7 @@ profile: build/profile/user.js build/profile/prefs.js build/profile/bookmarks.ht
|
|||||||
profile.tgz: profile
|
profile.tgz: profile
|
||||||
$(eval PROFILE_VERSION := $(shell cat src/profile/version.txt))
|
$(eval PROFILE_VERSION := $(shell cat src/profile/version.txt))
|
||||||
@echo "building profile tarball $(PROFILE_VERSION)"
|
@echo "building profile tarball $(PROFILE_VERSION)"
|
||||||
|
bash -c 'ls I2P && cp -rv I2P build/app-profile/I2P'; true
|
||||||
install -m755 src/unix/i2pbrowser.sh build/profile/i2pbrowser.sh
|
install -m755 src/unix/i2pbrowser.sh build/profile/i2pbrowser.sh
|
||||||
cd build && tar -czf profile-$(PROFILE_VERSION).tgz profile && cp profile-$(PROFILE_VERSION).tgz ../
|
cd build && tar -czf profile-$(PROFILE_VERSION).tgz profile && cp profile-$(PROFILE_VERSION).tgz ../
|
||||||
|
|
||||||
@@ -81,6 +82,7 @@ app-profile: build/app-profile/user.js build/app-profile/prefs.js build/app-prof
|
|||||||
app-profile.tgz: app-profile
|
app-profile.tgz: app-profile
|
||||||
$(eval PROFILE_VERSION := $(shell cat src/app-profile/version.txt))
|
$(eval PROFILE_VERSION := $(shell cat src/app-profile/version.txt))
|
||||||
@echo "building app-profile tarball $(PROFILE_VERSION)"
|
@echo "building app-profile tarball $(PROFILE_VERSION)"
|
||||||
|
bash -c 'ls I2P && cp -rv I2P build/app-profile/I2P'; true
|
||||||
install -m755 src/unix/i2pconfig.sh build/app-profile/i2pconfig.sh
|
install -m755 src/unix/i2pconfig.sh build/app-profile/i2pconfig.sh
|
||||||
cd build && tar -czf app-profile-$(PROFILE_VERSION).tgz app-profile && cp app-profile-$(PROFILE_VERSION).tgz ../
|
cd build && tar -czf app-profile-$(PROFILE_VERSION).tgz app-profile && cp app-profile-$(PROFILE_VERSION).tgz ../
|
||||||
|
|
||||||
|
|||||||
@@ -120,6 +120,9 @@ build process for non-Windows users.
|
|||||||
End-to-End Windows build process using WSL
|
End-to-End Windows build process using WSL
|
||||||
------------------------------------------
|
------------------------------------------
|
||||||
|
|
||||||
|
**If you've already done this once, you can just use:** `./build.sh && wsl make`
|
||||||
|
**in `git bash`** to automatically build an installer.
|
||||||
|
|
||||||
**Prerequisites:** You need to have OpenJDK 14 or greater installed and configured
|
**Prerequisites:** You need to have OpenJDK 14 or greater installed and configured
|
||||||
with your `%JAVA_HOME%` environment variable configured and `%JAVA_HOME%/bin` on
|
with your `%JAVA_HOME%` environment variable configured and `%JAVA_HOME%/bin` on
|
||||||
your `%PATH%`. You need to have Apache Ant installed and configured with `%ANT_HOME%`
|
your `%PATH%`. You need to have Apache Ant installed and configured with `%ANT_HOME%`
|
||||||
|
|||||||
4
build.sh
4
build.sh
@@ -3,13 +3,13 @@ set -e
|
|||||||
|
|
||||||
. i2pversion
|
. i2pversion
|
||||||
|
|
||||||
JAVA=$(java --version | tr -d 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\n' | cut -d ' ' -f 2 | cut -d '.' -f 1 | tr -d '\n\t ')
|
JAVA=$(java --version | tr -d 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\n' | cut -d ' ' -f 2 | cut -d '.' -f 1 | tr -d '\n\t\- ')
|
||||||
|
|
||||||
if [ "$JAVA" -lt "14" ]; then
|
if [ "$JAVA" -lt "14" ]; then
|
||||||
echo "Java 14+ must be used to compile with jpackage, java is $JAVA"
|
echo "Java 14+ must be used to compile with jpackage, java is $JAVA"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
sleep 2s
|
||||||
|
|
||||||
if [ -z "${JAVA_HOME}" ]; then
|
if [ -z "${JAVA_HOME}" ]; then
|
||||||
JAVA_HOME=`type -p java|xargs readlink -f|xargs dirname|xargs dirname`
|
JAVA_HOME=`type -p java|xargs readlink -f|xargs dirname|xargs dirname`
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package net.i2p.router;
|
|||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import net.i2p.router.RouterLaunch;
|
import net.i2p.router.RouterLaunch;
|
||||||
|
import net.i2p.util.SystemVersion;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Launches a router from %PROGRAMFILES%/I2P using configuration data in
|
* Launches a router from %PROGRAMFILES%/I2P using configuration data in
|
||||||
@@ -48,18 +49,30 @@ public class WinLauncher {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static File selectHome() throws Exception {
|
private static File selectHome() throws Exception {
|
||||||
File home = new File(System.getProperty("user.home"));
|
if (SystemVersion.isWindows()) {
|
||||||
File i2p;
|
File home = new File(System.getProperty("user.home"));
|
||||||
File appData = new File(home, "AppData");
|
File i2p;
|
||||||
File local = new File(appData, "Local");
|
File appData = new File(home, "AppData");
|
||||||
i2p = new File(local, "I2P");
|
File local = new File(appData, "Local");
|
||||||
return i2p.getAbsoluteFile();
|
i2p = new File(local, "I2P");
|
||||||
|
return i2p.getAbsoluteFile();
|
||||||
|
} else {
|
||||||
|
File jrehome = new File(System.getProperty("java.home"));
|
||||||
|
File programs = new File(jrehome.getParentFile().getParentFile(), ".i2p");
|
||||||
|
return programs.getAbsoluteFile();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static File selectProgramFile() throws Exception {
|
private static File selectProgramFile() throws Exception {
|
||||||
File jrehome = new File(System.getProperty("java.home"));
|
if (SystemVersion.isWindows()) {
|
||||||
File programs = jrehome.getParentFile();
|
File jrehome = new File(System.getProperty("java.home"));
|
||||||
return programs.getAbsoluteFile();
|
File programs = jrehome.getParentFile();
|
||||||
|
return programs.getAbsoluteFile();
|
||||||
|
} else {
|
||||||
|
File jrehome = new File(System.getProperty("java.home"));
|
||||||
|
File programs = new File(jrehome.getParentFile().getParentFile(), "i2p");
|
||||||
|
return programs.getAbsoluteFile();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,10 @@ fi
|
|||||||
|
|
||||||
if [ ! -z $I2PROUTER ]; then
|
if [ ! -z $I2PROUTER ]; then
|
||||||
echo "$I2PROUTER" "$I2PCOMMAND"
|
echo "$I2PROUTER" "$I2PCOMMAND"
|
||||||
"$I2PROUTER" "$I2PCOMMAND"
|
http_proxy=http://127.0.0.1:4444 curl http://proxy.i2p || "$I2PROUTER" "$I2PCOMMAND"
|
||||||
|
else if [ -d "I2P/bin" ]; then
|
||||||
|
http_proxy=http://127.0.0.1:4444 curl http://proxy.i2p || ./I2P/bin/I2P; \
|
||||||
|
echo "running the jpackaged I2P router since we can't find another one to use."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z $BROWSING_PROFILE ]; then
|
if [ -z $BROWSING_PROFILE ]; then
|
||||||
|
|||||||
@@ -6,7 +6,11 @@ fi
|
|||||||
|
|
||||||
if [ ! -z $I2PROUTER ]; then
|
if [ ! -z $I2PROUTER ]; then
|
||||||
echo "$I2PROUTER" "$I2PCOMMAND"
|
echo "$I2PROUTER" "$I2PCOMMAND"
|
||||||
"$I2PROUTER" "$I2PCOMMAND"
|
http_proxy=http://127.0.0.1:4444 curl http://proxy.i2p || "$I2PROUTER" "$I2PCOMMAND"
|
||||||
|
else if [ -d "I2P/bin" ]; then
|
||||||
|
http_proxy=http://127.0.0.1:4444 curl http://proxy.i2p || ./I2P/bin/I2P; \
|
||||||
|
echo "running the jpackaged I2P router since we can't find another one to use."
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f "$HOME/.i2p/router.config" ]; then
|
if [ -f "$HOME/.i2p/router.config" ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user