Compare commits

...

19 Commits

Author SHA1 Message Date
601b1db8d5 Update how release notes are posted 2024-03-20 12:02:43 -04:00
c47b7c0f76 use I2P's mktorrent when generating the torrent. use the news.sh script to generate torrent based on the tag. 2024-03-20 00:53:45 -04:00
d4cc7dcfdf Generate news from markdown file 2024-03-19 23:44:01 -04:00
58a7ce4fd4 use latest I2P version if tags aren't available 2024-03-19 22:26:34 -04:00
f8870cd12d use the tag to determine the version to build 2024-03-19 21:41:40 -04:00
aff0563fc3 use the tag to determine the version to build 2024-03-19 21:40:14 -04:00
6d460a9042 WindowsAppUtil and WindowsServiceUtil now do not have references to I2P itself 2024-03-19 20:37:08 -04:00
8809ddaac7 Delete redundant sections from the README.md 2024-03-18 10:30:13 -04:00
958f33db7f Delete ancient sections from when I made this useful as a browser profile launcher for Linux 2024-03-18 10:28:39 -04:00
0bfeaaf841 Give the README.md a canned update about how to use the CI description as the basis for a dev build 2024-03-18 10:27:14 -04:00
134ebeb1d0 sleep 20 minutes for release artifacts 2024-03-12 23:55:40 -04:00
b4a3691aae list outputs non-recursively, only directories, only first 2 levels 2024-03-12 23:20:57 -04:00
03748e0c0e list outputs 2024-03-12 22:54:03 -04:00
d4a40e8c86 Fix 7z command 2024-03-12 22:37:46 -04:00
d38fadc902 get 7z help for version 2024-03-12 22:16:18 -04:00
dbb865603a figure out where install ca-certificates 2024-03-12 21:58:22 -04:00
456b26a860 figure out where wsl keeps 7zip 2024-03-12 21:35:10 -04:00
62284056c3 figure out where wsl keeps 7zip 2024-03-12 21:30:02 -04:00
41c06c821c use 7zip when unpacking TBB into Portable 2024-03-12 21:19:31 -04:00
15 changed files with 273 additions and 164 deletions

View File

@ -31,7 +31,7 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: I2P-Easy-Install-Bundle-unsigned.exe
path: I2P-Easy-Install-Bundle-2.4.0.exe
path: I2P-Easy-Install-Bundle-*.exe
buildjpackagexe:
runs-on: windows-latest
@ -48,7 +48,7 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: I2P-EXE-unsigned.exe
path: I2P-EXE-2.4.0.exe
path: I2P-EXE-*.exe
buildjpackagmsi:
runs-on: windows-latest
@ -65,7 +65,7 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: I2P-MSI-unsigned.msi
path: I2P-MSI-2.4.0.msi
path: I2P-MSI-*.msi
buildzip:
runs-on: windows-latest
@ -81,7 +81,8 @@ jobs:
git config --global user.name "eyedeekay Github CI Build"
- uses: actions/checkout@v4
- run: wsl apt-get update
- run: wsl apt-get install -y nsis nsis-common nsis-pluginapi wget dos2unix curl jq gpg gettext zip 7z
- run: wsl apt-cache search 7zip
- run: wsl apt-get install -y nsis nsis-common nsis-pluginapi wget dos2unix curl jq gpg gettext zip p7zip-full ca-certificates
- run: choco install wget
- name: Set up JDK 21
uses: actions/setup-java@v4
@ -89,7 +90,7 @@ jobs:
java-version: '21'
distribution: 'temurin'
- name: build with script
run: bash -c "./buildscripts/zip.sh; ls *.zip"
run: bash -c "./buildscripts/zip.sh; ls -d * */* "
- name: Upload I2P-windows-portable.zip
uses: actions/upload-artifact@v4
with:

View File

@ -22,6 +22,16 @@ jobs:
sparse-checkout-cone-mode: false
- name: sleep 15 minutes
run: |
echo "sleeping 20 minutes to wait for artifacts"
sleep 1m
echo "sleeping 19 minutes to wait for artifacts"
sleep 1m
echo "sleeping 18 minutes to wait for artifacts"
sleep 1m
echo "sleeping 17 minutes to wait for artifacts"
sleep 1m
echo "sleeping 16 minutes to wait for artifacts"
sleep 1m
echo "sleeping 15 minutes to wait for artifacts"
sleep 1m
echo "sleeping 14 minutes to wait for artifacts"
@ -72,8 +82,9 @@ jobs:
- run: file * | tee -a changelog.txt
- run: echo '```' | tee -a changelog.txt
- run: echo "" | tee -a changelog.txt
- run: cat docs/RELEASE.md changelog.txt > RELEASE.md
- name: Upload artifacts
uses: ncipollo/release-action@v1
with:
artifacts: "*"
bodyFile: "changelog.txt"
bodyFile: "RELEASE.md"

View File

@ -1,5 +1,5 @@
I2P Easy-Install Bundle for Windows(Also/formerly)I2P Browsing Profile for Firefox
==================================================================================
I2P Easy-Install Bundle for Windows, (Formerly)I2P Browsing Profile for Firefox
===============================================================================
Features:
---------
@ -13,6 +13,13 @@ Features:
Build Dependencies:
-------------------
**SHORTCUT:** All the build artifacts can be produced by the description in the `.yaml` files in `.github/workflows`.
These can be run on Github's infrastructure, or on a local(Windows) PC using https://github.com/nektos/act.
Doing things this way deals with all the dependency issues that Windows doesn't really give you a good way to deal with automatically.
It also guarantees that the same base container and environment gets used for every build no matter what machine it runs on.
I highly recommend you use either Github CI or `nektos/act` for dev builds of this software, as it **automates literally every one of the steps**.
CI-based builds follow the `WSL` version of the instructions.
To build this, you will need the following software packages
(all available in Debian and Ubuntu, see WSL section below):
@ -166,8 +173,6 @@ set up and you're using git bash, that is enough to make the scripts compatible
cd i2p.firefox
./buildscripts/unsigned.sh
6. Run `make` to build the installer.
Doing a Release
---------------
@ -180,53 +185,7 @@ bundle is Zlatinb. Standard Windows signing tools are used.
./release.sh
```
produces the binary.
Building a signed update file
-----------------------------
Building a signed update file for automatically updating a Windows I2P router
requires you to either be using linux, or have Go installed in your Cygwin or WSL environment.
On Linux(Where I sign the su3 files), this works:
make su3
to run the signing tool if necessary and then package the installer in a
signed update file.
Docker Support
--------------
**MOVED, DEPRECATION NOTICE:** Most of this functionality has been moved
to http://git.idk.i2p/idk/i2p.plugins.firefox which is more stable,
easier to build and use, and easier to incorporate into other
projects.
- https://git.idk.i2p/idk/i2p.plugins.firefox/-/blob/main/docker.sh
Unix Support
------------
**MOVED. DEPRECATION NOTICE:** Most of this functionality has been moved
to http://git.idk.i2p/idk/i2p.plugins.firefox which is more stable,
easier to build and use, and easier to incorporate into other
projects. It is the better option for nearly every non-Windows case
right now. You can get binary packages from:
- https://github.com/eyedeekay/i2p.plugins.firefox/releases
or look at
- https://i2pgit.org/idk/i2p.plugins.firefox/-/blob/master/PACKAGES.md
for instructions on how to build your own packages. These packages are
unofficial! Although I do dogfood most of them and the `.jar` gets thorough
testing.
**The only remotely interesting Unix functionality that remains in this**
**repository is the construction of a portable. You can use `targz.sh` to**
**generate that. Once generated, `cd I2P && ./lib/torbrowser.sh` to complete**
**setup, and `./bin/I2P` to run it.**
produces the binary and the su3.
Issues
------

View File

@ -125,6 +125,7 @@ cd "$SCRIPT_DIR"/java
net/i2p/router/CopyConfigDir.java \
net/i2p/router/WindowsServiceUtil.java \
net/i2p/router/WindowsAppUtil.java \
net/i2p/router/I2PAppUtil.java \
net/i2p/router/WinUpdatePostProcessor.java \
net/i2p/router/WinLauncher.java \
net/i2p/router/WinUpdateProcess.java \

65
buildscripts/news.sh Executable file
View File

@ -0,0 +1,65 @@
#! /usr/bin/env bash
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P)/..
cd "$SCRIPT_DIR" || exit 1
. "$SCRIPT_DIR/i2pversion"
if [ -f i2pversion_override ]; then
. "$SCRIPT_DIR/i2pversion_override"
fi
. "$SCRIPT_DIR/config.sh"
if [ -f "$SCRIPT_DIR/config_override.sh" ]; then
. "$SCRIPT_DIR/config_override.sh"
fi
if [ -z "$I2P_NEWSXML" ]; then
if [ -d "../i2p.newsxml" ]; then
export I2P_NEWSXML="../i2p.newsxml"
else
echo "i2p.newsxml is not in the parent directory and I2P_NEWSXML is unset"
exit 1
fi
fi
cd "$I2P_NEWSXML" || exit 1
export TITLE="Easy-Install for Windows Release $I2P_VERSION"
echo "$TITLE"
export AUTHOR=idk
echo "$AUTHOR"
export EDITOR=true
echo "canceled manual editor"
export I2P_OS=win
echo "$I2P_OS"
export I2P_BRANCH=beta
echo "$I2P_VERSION"
export SUMMARY_HERE=$(head -n 1 "$SCRIPT_DIR/docs/RELEASE.md" | sed "s|# ||g")
echo "$SUMMARY_HERE"
export CONTENT_HERE=$(tail -n +2 "$SCRIPT_DIR/docs/RELEASE.md" | markdown)
echo "$CONTENT_HERE"
./create_new_entry.sh
export DATE=$(date +%Y-%m-%d)
echo "$DATE"
MAGNET=$(transmission-show -m "$SCRIPT_DIR/i2pwinupdate.su3.torrent" 2>&1 3>&1 | tail -n 1)
TORRENTJSON='['
TORRENTJSON+=' {'
TORRENTJSON+=" \"date\": \"$DATE\","
TORRENTJSON+=" \"version\": \"$I2P_VERSION\","
TORRENTJSON+=" \"minVersion\": \"1.5.0\","
TORRENTJSON+=" \"minJavaVersion\": \"1.8\","
TORRENTJSON+=" \"updates\": {"
TORRENTJSON+=" \"su3\": {"
TORRENTJSON+=" \"torrent\": \"$MAGNET\","
TORRENTJSON+=" \"url\": ["
TORRENTJSON+=" \"http://ekm3fu6fr5pxudhwjmdiea5dovc3jdi66hjgop4c7z7dfaw7spca.b32.i2p/i2pwinupdate.su3\""
TORRENTJSON+=' ]'
TORRENTJSON+=' }'
TORRENTJSON+=' }'
TORRENTJSON+=' }'
TORRENTJSON+=']'
echo "$TORRENTJSON" | jq

View File

@ -31,14 +31,14 @@ cp -v "I2P-Easy-Install-Bundle-$I2P_VERSION.exe" "I2P-Easy-Install-Bundle-$I2P_V
java -cp "$I2P_LIBS/*" net.i2p.crypto.SU3File sign -c ROUTER -f EXE I2P-Easy-Install-Bundle-$I2P_VERSION-signed.exe I2P-Easy-Install-Bundle-$I2P_VERSION-signed.su3 "$HOME/.i2p-plugin-keys/news-su3-keystore.ks" $I2P_VERSION $SIGNER
rm -f i2pwinupdate.su3.torrent
cp -v I2P-Easy-Install-Bundle-$I2P_VERSION-signed.su3 i2pwinupdate.su3
mktorrent \
--announce=http://tracker2.postman.i2p/announce.php \
--announce=http://w7tpbzncbcocrqtwwm3nezhnnsw4ozadvi2hmvzdhrqzfxfum7wa.b32.i2p/a \
--announce=http://mb5ir7klpc2tj6ha3xhmrs3mseqvanauciuoiamx2mmzujvg67uq.b32.i2p/a \
i2pwinupdate.su3
java -cp "$I2P_LIBS/*" "org.klomp.snark.Storage" -a http://tracker2.postman.i2p/announce.php -a http://w7tpbzncbcocrqtwwm3nezhnnsw4ozadvi2hmvzdhrqzfxfum7wa.b32.i2p/a -a http://mb5ir7klpc2tj6ha3xhmrs3mseqvanauciuoiamx2mmzujvg67uq.b32.i2p/a -c "$SIGNER" -m "Official torrent for Windows Easy-Install version $I2P_VERSION" i2pwinupdate.su3
echo "~~~~~~~~~~"
MAGNET=$(transmission-show -m "i2pwinupdate.su3.torrent" 2>&1 3>&1 | tail -n 1)
echo "$MAGNET"
ZIPCHECKSUM=$(sha256sum "i2pwinupdate.su3")
echo github-release upload -R -u "$GITHUB_USERNAME" -r "i2p.firefox" -f "i2pwinupdate.su3" -l "$ZIPCHECKSUM" -t "$I2P_VERSION" -n "i2pwinupdate.su3"
github-release upload -R -u "$GITHUB_USERNAME" -r "i2p.firefox" -f "i2pwinupdate.su3" -l "$ZIPCHECKSUM" -t "$I2P_VERSION" -n "i2pwinupdate.su3"
ZIPCHECKSUM=$(sha256sum "i2pwinupdate.su3.torrent")
echo github-release upload -R -u "$GITHUB_USERNAME" -r "i2p.firefox" -f "i2pwinupdate.su3.torrent" -l "$ZIPCHECKSUM" -t "$I2P_VERSION" -n "i2pwinupdate.su3.torrent"
github-release upload -R -u "$GITHUB_USERNAME" -r "i2p.firefox" -f "i2pwinupdate.su3.torrent" -l "$ZIPCHECKSUM" -t "$I2P_VERSION" -n "i2pwinupdate.su3.torrent"
github-release upload -R -u "$GITHUB_USERNAME" -r "i2p.firefox" -f "i2pwinupdate.su3.torrent" -l "$ZIPCHECKSUM" -t "$I2P_VERSION" -n "i2pwinupdate.su3.torrent"

View File

@ -18,9 +18,9 @@ fi
echo "!define VERSIONMAJOR $VERSIONMAJOR" > "$SCRIPT_DIR"/src/nsis/i2pbrowser-version.nsi
echo "!define VERSIONMINOR $VERSIONMINOR" >> "$SCRIPT_DIR"/src/nsis/i2pbrowser-version.nsi
echo "!define VERSIONBUILD $VERSIONBUILD" >> "$SCRIPT_DIR"/src/nsis/i2pbrowser-version.nsi
echo "!define I2P_VERSION $PROFILE_VERSION" > "$SCRIPT_DIR"/src/nsis/i2pbrowser-jpackage.nsi
echo "!define I2P_VERSION $I2P_VERSION" > "$SCRIPT_DIR"/src/nsis/i2pbrowser-jpackage.nsi
mkdir -p "$SCRIPT_DIR"/build
echo "$PROFILE_VERSION" > "$SCRIPT_DIR"/build/version.txt
echo "$PROFILE_VERSION" > "$SCRIPT_DIR"/build/version.txt
echo "$I2P_VERSION" > "$SCRIPT_DIR"/build/version.txt
echo "$I2P_VERSION" > "$SCRIPT_DIR"/build/version.txt
sed 's|!define VERSION||g' "$SCRIPT_DIR"/src/nsis/i2pbrowser-version.nsi | sed 's| |=|g' > .version

33
docs/RELEASE.md Normal file
View File

@ -0,0 +1,33 @@
# I2P Easy-Install Bundle for Windows 2.4.9
This is a pre-release of the I2P Easy-Install Bundle for Windows.
This changes how the I2P bundle and browser profile manager are installed and integrated with the host system.
The Easy-Install bundle is now a "portable" system that can be moved to different locations within or between Windows file-systems while retaining all built-in functionality.
A shortcut for starting the I2P router is still provided by the installer for convenience, but the shortcuts for starting the I2P Browser are now integrated with the I2P desktop UI.
The browser profile manager itself has been split away from the monolithic I2P router+Java/jpackage, and moved into an I2P plugin managed by the router.
While this was done primarily to reduce how complex the existing code was, this also results in behavior which is closer to the main distribution of I2P for Windows and will lead to a more flexible installer, which can bundle additional default plugins and may be suitable for installation as a Windows service.
I2P Plugins can also be updated independently of the router that hosts them, so it will be possible to update the browser profile manager independently of the router itself.
It also means that the browser profile manager can be un-installed by uninstalling the plugin, and much more importantly that the browser profile manager is now compatible with all Java I2P distributions.
**Why a dev build 3 weeks before the release?**
By further delineating the components of the bundle, these changes also affected how the release process happens.
In particular the build process of each component has been encapsulated in a CI description which can be reproduced on a local PC.
This simplifies and automates the build process by ensuring that up-to-date build tools are installed in a brand-new container for every build.
In effect this should speed up the release process for I2P Easy-Install for Windows considerably.
This release is a test-run of the new process, so I can document what is going on.
It breaks down roughly like this:
- It takes ~22 minutes to compile all the targets for the `i2p.plugins.firefox` and make the resulting artifacts available. During this process, I must insert 1 HSM and enter 1 password. (This part used to be about 30 steps, now it takes 1)
- It takes ~22 minutes to compile all the targets for the `i2p.firefox` project and make the resulting artifacts available. This process produces only unsigned artifacts identified by their hashes, and is non-interactive. (This part used to be around 60 steps the first time, and 40 steps each additional time)
- `i2p.firefox` updates are signed in their `.su3` form. The `NSIS`-powered `.exe` installer is the current updater. The next step is to sign *just this installer* and generate a torrent of the result. (This process used to depend on the previous build process and couldn't be done independently. Now it takes about 30 seconds)
- Generate and sign a newsfeed to notify the users of an update. This process is the only process that is **slower** when containerized, because there are dozens of feeds to be signed in their respective containers. It takes about an hour.
For you the end user, nothing much should change.
You'll get your updates a lot faster, and have more options available for testing.
The same installer is used for the updater, and the process is handled the same way.
However for developers, testers, and maintainers, this release will result in big changes for the better.
This release still embeds a `2.4.0` Java I2P router. No changes have been made to update the embedded router.
Network behavior will be unchanged until the official `2.5.0` release.

View File

@ -4,12 +4,23 @@ JNA_VERSION=5.12.1
export JNA_VERSION=5.12.1
I2PFIREFOX_VERSION=1.4.991
export I2PFIREFOX_VERSION=1.4.991
# Comment this out to build from an alternate branch or
# the tip of the master branch.
VERSIONMAJOR=2
VERSIONMINOR=4
VERSIONBUILD=0
export GITHUB_TAG=$(git describe --tags --abbrev=0 | sed 's|i2p||g' | tr -d [a-z-])
VERSIONMAJOR=$(echo "$GITHUB_TAG" | cut -d . -f 1)
VERSIONMINOR=$(echo "$GITHUB_TAG" | cut -d . -f 2)
VERSIONBUILD=$(echo "$GITHUB_TAG" | cut -d . -f 3)
if [ -z "$VERSIONBUILD" ]; then
VERSIONBUILD=2
fi
if [ -z "$VERSIONMINOR" ]; then
VERSIONMINOR=4
fi
if [ -z "$VERSIONMAJOR" ]; then
VERSIONMAJOR=0
fi
I2P_VERSION="$VERSIONMAJOR.$VERSIONMINOR.$VERSIONBUILD"
export I2P_VERSION="$VERSIONMAJOR.$VERSIONMINOR.$VERSIONBUILD"
# Comment this out to build from an alternate branch or
# the tip of the master branch.
VERSION=i2p-2.4.0
export VERSION=i2p-2.4.0

View File

@ -12,7 +12,7 @@ import java.util.logging.FileHandler;
import java.util.logging.SimpleFormatter;
import net.i2p.util.Log;
public class CopyConfigDir extends WindowsAppUtil {
public class CopyConfigDir extends I2PAppUtil {
final Log logger;
public CopyConfigDir(RouterContext ctx) {
@ -142,7 +142,7 @@ public class CopyConfigDir extends WindowsAppUtil {
* @return
*/
protected File logFile(String p) {
File log = new File(selectProgramFile(), "logs");
File log = new File(selectHome(), "logs");
if (!log.exists())
log.mkdirs();
return new File(log, p);

View File

@ -0,0 +1,106 @@
package net.i2p.router;
import java.io.File;
import java.io.IOException;
import javax.swing.JOptionPane;
public class I2PAppUtil extends WindowsAppUtil {
public String ServiceUpdaterString() {
return "http://tc73n4kivdroccekirco7rhgxdg5f3cjvbaapabupeyzrqwv5guq.b32.i2p/news.su3";
}
public String ServiceBackupUpdaterString() {
return "http://dn3tvalnjz432qkqsvpfdqrwpqkw3ye4n4i2uyfr4jexvo3sp5ka.b32.i2p/news.su3";
}
public String ServiceStaticUpdaterString() {
return "http://echelon.i2p/i2p/i2pupdate.sud,http://stats.i2p/i2p/i2pupdate.sud";
}
public String getProgramFilesInstall() {
String programFiles = System.getenv("PROGRAMFILES");
if (programFiles != null) {
File programFilesI2P = new File(programFiles, "i2p/i2p.exe");
if (programFilesI2P.exists())
return programFilesI2P.getAbsolutePath();
}
String programFiles86 = System.getenv("PROGRAMFILES86");
if (programFiles86 != null) {
File programFiles86I2P = new File(programFiles86, "i2p/i2p.exe");
if (programFiles86I2P.exists())
return programFiles86I2P.getAbsolutePath();
}
return null;
}
public boolean checkProgramFilesInstall() {
String programFiles = System.getenv("PROGRAMFILES");
if (programFiles != null) {
File programFilesI2P = new File(programFiles, "i2p/i2p.exe");
if (programFilesI2P.exists())
return true;
}
String programFiles86 = System.getenv("PROGRAMFILES86");
if (programFiles86 != null) {
File programFiles86I2P = new File(programFiles86, "i2p/i2p.exe");
if (programFiles86I2P.exists())
return true;
}
return false;
}
public boolean promptUserInstallStartIfAvailable() {
if (osName() != "windows") {
return true;
}
if (checkProgramFilesInstall()) {
int a;
String message =
"It appears you have an existing, unbundled I2P rotuer installed.\n";
message +=
"However, it is not running yet. Please start it using the shortcut on the desktop.\n";
message +=
"If you click \"No\", the Easy-Install router will be launched instead.\n";
a = JOptionPane.showConfirmDialog(null, message,
"I2P Service detected not running",
JOptionPane.YES_NO_OPTION);
if (a == JOptionPane.NO_OPTION) {
// Do nothing here, this will continue on to launch a jpackaged router
return true;
} else {
try {
String pfi = getProgramFilesInstall();
if (pfi != null)
Runtime.getRuntime().exec(new String[] {pfi});
} catch (IOException e) {
return false;
}
return true;
}
}
return true;
}
/**
* get the path to the binary of the app-image root by getting the path to
* java.home and the OS, and traversing up to the app-image root based on that
* information, then getting the binary path on a per-platform basis. The path
* returned will be relative to the root.
*
* @return the app-image root
*/
protected String appImageExe() {
File aih = appImageHome();
if (aih != null) {
// get the name of the aih directory itself, which will be the default
// name of the executable as well
String baseName = "I2P";
switch (osName()) {
case "windows":
return baseName + ".exe";
case "mac":
case "linux":
return "./bin/" + baseName;
}
}
return null;
}
}

View File

@ -24,7 +24,7 @@ import net.i2p.util.Log;
* appdata
* router.pid - the pid of the java process.
*/
public class WinLauncher extends WindowsAppUtil {
public class WinLauncher extends I2PAppUtil {
private final CopyConfigDir copyConfigDir;
WinUpdatePostProcessor wupp = null;
private Router i2pRouter;
@ -56,7 +56,7 @@ public class WinLauncher extends WindowsAppUtil {
var launcher = new WinLauncher();
launcher.setupLauncher();
int proxyTimeoutTime = 200;
launcher.logger.info("\t" + System.getProperty("user.dir"));
launcher.logger.info("\t" + System.getProperty("i2p.dir.base"));
launcher.logger.info("\t" + System.getProperty("i2p.dir.config"));
@ -104,7 +104,7 @@ public class WinLauncher extends WindowsAppUtil {
}
private File programFile() {
File programs = selectProgramFile();
File programs = selectHome();
if (!programs.exists())
programs.mkdirs();
else if (!programs.isDirectory()) {

View File

@ -17,17 +17,9 @@ public class WindowsAppUtil extends WindowsServiceUtil {
}
return null;
}
protected File selectHome() { // throws Exception {
File i2p = checkPathEnvironmentVariable("I2P_CONFIG");
String path_override = System.getenv("I2P_CONFIG");
if (i2p == null)
i2p = appImageHome();
return i2p;
}
protected File selectProgramFile() {
File i2p = checkPathEnvironmentVariable("I2P");
protected File selectHome() { // throws Exception {
File i2p = checkPathEnvironmentVariable("JPACKAGE_HOME");
if (i2p == null)
i2p = appImageHome();
return i2p;
@ -90,12 +82,15 @@ public class WindowsAppUtil extends WindowsServiceUtil {
protected String appImageExe() {
File aih = appImageHome();
if (aih != null) {
// get the name of the aih directory itself, which will be the default
// name of the executable as well
String baseName = aih.getName();
switch (osName()) {
case "windows":
return "I2P.exe";
return baseName + ".exe";
case "mac":
case "linux":
return "./bin/I2P";
return "./bin/" + baseName;
}
}
return null;

View File

@ -145,87 +145,13 @@ public class WindowsServiceUtil {
return false;
}
}
return isStart("i2p");
return isStart(serviceName);
}
return true;
}
return true;
}
public String ServiceUpdaterString() {
return "http://tc73n4kivdroccekirco7rhgxdg5f3cjvbaapabupeyzrqwv5guq.b32.i2p/news.su3";
}
public String ServiceBackupUpdaterString() {
return "http://dn3tvalnjz432qkqsvpfdqrwpqkw3ye4n4i2uyfr4jexvo3sp5ka.b32.i2p/news.su3";
}
public String ServiceStaticUpdaterString() {
return "http://echelon.i2p/i2p/i2pupdate.sud,http://stats.i2p/i2p/i2pupdate.sud";
}
public String getProgramFilesInstall() {
String programFiles = System.getenv("PROGRAMFILES");
if (programFiles != null) {
File programFilesI2P = new File(programFiles, "i2p/i2p.exe");
if (programFilesI2P.exists())
return programFilesI2P.getAbsolutePath();
}
String programFiles86 = System.getenv("PROGRAMFILES86");
if (programFiles86 != null) {
File programFiles86I2P = new File(programFiles86, "i2p/i2p.exe");
if (programFiles86I2P.exists())
return programFiles86I2P.getAbsolutePath();
}
return null;
}
public boolean checkProgramFilesInstall() {
String programFiles = System.getenv("PROGRAMFILES");
if (programFiles != null) {
File programFilesI2P = new File(programFiles, "i2p/i2p.exe");
if (programFilesI2P.exists())
return true;
}
String programFiles86 = System.getenv("PROGRAMFILES86");
if (programFiles86 != null) {
File programFiles86I2P = new File(programFiles86, "i2p/i2p.exe");
if (programFiles86I2P.exists())
return true;
}
return false;
}
public boolean promptUserInstallStartIfAvailable() {
if (osName() != "windows") {
return true;
}
if (checkProgramFilesInstall()) {
int a;
String message =
"It appears you have an existing, unbundled I2P rotuer installed.\n";
message +=
"However, it is not running yet. Please start it using the shortcut on the desktop.\n";
message +=
"If you click \"No\", the Easy-Install router will be launched instead.\n";
a = JOptionPane.showConfirmDialog(null, message,
"I2P Service detected not running",
JOptionPane.YES_NO_OPTION);
if (a == JOptionPane.NO_OPTION) {
// Do nothing here, this will continue on to launch a jpackaged router
return true;
} else {
try {
String pfi = getProgramFilesInstall();
if (pfi != null)
Runtime.getRuntime().exec(new String[] {pfi});
} catch (IOException e) {
return false;
}
return true;
}
}
return true;
}
public String getServiceState(String serviceName) {
String stateString = "uninstalled";
int state = getServiceStateInt(serviceName);

View File

@ -24,4 +24,5 @@ fi
gpgv --keyring ./tor.keyring "tor-browser-windows-x86_64-portable-${version}.exe.asc" "tor-browser-windows-x86_64-portable-${version}.exe"
7z x "tor-browser-windows-x86_64-portable-${version}.exe" -o "Tor Browser"
7z x "tor-browser-windows-x86_64-portable-${version}.exe" -o"Tor Browser"
#7z --help