Compare commits

...

18 Commits

10 changed files with 60 additions and 102 deletions

View File

@ -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
- 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"

View File

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

View File

@ -16,7 +16,8 @@ TORSOCKS=$(which torsocks)
if [ -f "${TORSOCKS}" ]; then
. "${TORSOCKS}" on
fi
#"$SCRIPT_DIR"/src/win/torbrowser-windows.sh
which wsl && wsl ../src/win/torbrowser-windows.sh
which wsl || "$SCRIPT_DIR"/src/win/torbrowser-windows.sh
version="$(curl -s https://aus1.torproject.org/torbrowser/update_3/release/downloads.json | jq -r ".version")"
. "${TORSOCKS}" off
locale="en-US" # mention your locale. default = en-US

View File

@ -2,8 +2,8 @@
JNA_VERSION=5.12.1
export JNA_VERSION=5.12.1
I2PFIREFOX_VERSION=1.4.7
export I2PFIREFOX_VERSION=1.4.7
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

View File

@ -26,63 +26,12 @@ import net.i2p.util.Log;
*/
public class WinLauncher extends WindowsAppUtil {
private final CopyConfigDir copyConfigDir;
WindowsUpdatePostProcessor wupp = null;
WinUpdatePostProcessor wupp = null;
private Router i2pRouter;
private final Log logger;
public WinLauncher() {
i2pRouter = new Router(routerConfig(), System.getProperties());
copyConfigDir = new CopyConfigDir(i2pRouter.getContext());
logger = i2pRouter.getContext().logManager().getLog(WinLauncher.class);
}
public static void main(String[] args) {
var launcher = new WinLauncher();
launcher.setupLauncher();
int proxyTimeoutTime = 200;
ArrayList<String> newArgsList = new ArrayList<String>();
if (args != null) {
if (args.length > 0) {
for (String arg : args) {
if (arg.equals("-private")) {
launcher.logger.info(
"Private browsing is true, profile will be discarded at end of session.");
} else if (arg.equals("-chromium")) {
launcher.logger.info("Chromium will be selected before Firefox.");
} else if (arg.equals("-usability")) {
launcher.logger.info(
"Usability mode is true, using alternate extensions loadout.");
} else if (arg.equals("-noproxycheck")) {
proxyTimeoutTime = 0;
launcher.logger.info("Proxy timeout time set to zero");
} else {
// make an effort to not let people launch into sites if the proxy
// isn't quite ready yet, but also disable the proxy timeout if
// they're reaching a router console
if (arg.startsWith("http://localhost:76")) {
newArgsList.add(arg);
proxyTimeoutTime = 0;
} else if (arg.startsWith("http://127.0.0.1:76")) {
newArgsList.add(arg);
proxyTimeoutTime = 0;
} else if (arg.startsWith("https://localhost:76")) {
newArgsList.add(arg);
proxyTimeoutTime = 0;
} else if (arg.startsWith("https://127.0.0.1:76")) {
newArgsList.add(arg);
proxyTimeoutTime = 0;
} else if (proxyTimeoutTime > 0) {
newArgsList.add(arg);
} else if (!launcher.isAvailable(4444)) {
newArgsList.add(arg);
}
}
}
}
}
File programs = launcher.programFile();
File home = launcher.homeDir();
File programs = programFile();
File home = homeDir();
System.setProperty(
"i2p.dir.base",
@ -97,6 +46,17 @@ public class WinLauncher extends WindowsAppUtil {
* to find the JVM and Runtime bundle. This broke Windows 11 installs.
*/
System.setProperty("user.dir", programs.getAbsolutePath());
i2pRouter = new Router(routerConfig(), System.getProperties());
copyConfigDir = new CopyConfigDir(i2pRouter.getContext());
logger = i2pRouter.getContext().logManager().getLog(WinLauncher.class);
}
public static void main(String[] args) {
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"));
@ -121,12 +81,7 @@ public class WinLauncher extends WindowsAppUtil {
}
if (!launcher.isInstalled("i2p")) {
if (launcher.i2pRouter.saveConfig("routerconsole.browser", null)) {
launcher.logger.info("removed routerconsole.browser config");
}
if (launcher.i2pRouter.saveConfig("routerconsole.browser",
launcher.appImageExe() +
" -noproxycheck")) {
if (launcher.i2pRouter.saveConfig("routerconsole.browser", "NUL")) {
launcher.logger.info("updated routerconsole.browser config " +
launcher.appImageExe());
}
@ -201,7 +156,7 @@ public class WinLauncher extends WindowsAppUtil {
null) {
sleep(1000);
}
WindowsUpdatePostProcessor wupp = new WindowsUpdatePostProcessor(ctx);
WinUpdatePostProcessor wupp = new WinUpdatePostProcessor(ctx);
um.register(wupp, UpdateType.ROUTER_SIGNED_SU3, SU3File.TYPE_EXE);
um.register(wupp, UpdateType.ROUTER_DEV_SU3, SU3File.TYPE_EXE);
};

View File

@ -16,7 +16,7 @@ import net.i2p.update.UpdateType;
import net.i2p.util.Log;
import net.i2p.util.SystemVersion;
public class WindowsUpdatePostProcessor implements UpdatePostProcessor {
public class WinUpdatePostProcessor implements UpdatePostProcessor {
private final Log _log;
private final RouterContext ctx;
private final AtomicBoolean hook = new AtomicBoolean();
@ -26,9 +26,9 @@ public class WindowsUpdatePostProcessor implements UpdatePostProcessor {
private volatile File positionedFile = null;
WindowsUpdatePostProcessor(RouterContext ctx) {
WinUpdatePostProcessor(RouterContext ctx) {
this.ctx = ctx;
this._log = ctx.logManager().getLog(WindowsUpdatePostProcessor.class);
this._log = ctx.logManager().getLog(WinUpdatePostProcessor.class);
}
public String getVersion() { return version; }

View File

@ -4,33 +4,32 @@ import java.io.File;
import net.i2p.util.Log;
public class WindowsAppUtil extends WindowsServiceUtil {
protected File selectHome() { // throws Exception {
String path_override = System.getenv("I2P_CONFIG");
private File checkPathEnvironmentVariable(String name) {
String path_override = System.getenv(name);
if (path_override != null) {
File path = new File(path_override);
if (path != null && path.exists()) {
if (path.isDirectory())
return path.getAbsoluteFile();
else
throw new RuntimeException("I2P_CONFIG is not a directory: " + path);
throw new RuntimeException(name + " is not a directory: " + path);
}
}
File i2p = appImageHome();
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() {
String path_override = System.getenv("I2P");
if (path_override != null) {
File path = new File(path_override);
if (path.exists()) {
if (path.isDirectory())
return path.getAbsoluteFile();
else
throw new RuntimeException("I2P is not a directory: " + path);
}
}
File i2p = appImageHome();
File i2p = checkPathEnvironmentVariable("I2P");
if (i2p == null)
i2p = appImageHome();
return i2p;
}

View File

@ -181,11 +181,13 @@ Function installerFunction
SetOutPath "$INSTDIR"
createDirectory "$SMPROGRAMS\${APPNAME}"
CreateShortCut "$SMPROGRAMS\${APPNAME}\Browse I2P.lnk" "$INSTDIR\I2P.exe" "" "$INSTDIR\ui2pbrowser_icon.ico"
CreateShortCut "$SMPROGRAMS\${APPNAME}\Browse I2P - Temporary Identity.lnk" "$INSTDIR\I2P.exe -private" "" "$INSTDIR\ui2pbrowser_icon.ico"
Delete "$SMPROGRAMS\${APPNAME}\Browse I2P - Temporary Identity.lnk"
CreateShortCut "$DESKTOP\Browse I2P.lnk" "$INSTDIR\I2P.exe" "" "$INSTDIR\ui2pbrowser_icon.ico"
CreateShortCut "$DESKTOP\Browse I2P - Temporary Identity.lnk" "$INSTDIR\I2P.exe -private" "" "$INSTDIR\ui2pbrowser_icon.ico"
Delete "$DESKTOP\Browse I2P - Temporary Identity.lnk"
CreateShortCut "$SMPROGRAMS\${APPNAME}\Uninstall I2P Easy-Install Bundle.lnk" "$INSTDIR\uninstall-i2pbrowser.exe" "" "$INSTDIR\ui2pbrowser_icon.ico"
SetOutPath "$INSTDIR"

View File

@ -18,21 +18,11 @@ if [ ! -f ./tor.keyring ]; then
fi
if [ ! -f "tor-browser-linux64-${version}_${locale}.exe" ]; then
wget -cv "https://www.torproject.org/dist/torbrowser/${version}/torbrowser-install-win64-${version}_${locale}.exe"
wget -cv "https://www.torproject.org/dist/torbrowser/${version}/torbrowser-install-win64-${version}_${locale}.exe.asc"
wget -cv "https://dist.torproject.org/torbrowser/${version}/tor-browser-windows-x86_64-portable-${version}.exe"
wget -cv "https://dist.torproject.org/torbrowser/${version}/tor-browser-windows-x86_64-portable-${version}.exe.asc"
fi
gpgv --keyring ./tor.keyring "torbrowser-install-win64-${version}_${locale}.exe.asc" "torbrowser-install-win64-${version}_${locale}.exe"
gpgv --keyring ./tor.keyring "tor-browser-windows-x86_64-portable-${version}.exe.asc" "tor-browser-windows-x86_64-portable-${version}.exe"
#tar xvJf "torbrowser-install-win64-${version}_${locale}.exe"
#for n in `seq 1 2000`; do echo $n; dd ibs=256 if="torbrowser-install-win64-${version}_${locale}.exe" count=2 skip=$n | file - ; done 2>/dev/null |less
#zip -FF "torbrowser-install-win64-${version}_${locale}.exe" --out extracted.zip
WINE=$(which wine)
if [ -z "$WINE" ]; then
"./torbrowser-install-win64-${version}_${locale}.exe" /S #/D .
cp -vr "$HOME/Desktop/Tor Browser/" "Tor Browser"
else
export WINEPREFIX=$(pwd)/../tmp
$WINE "torbrowser-install-win64-${version}_${locale}.exe" /S #/D .
cp -vr "$WINEPREFIX/drive_c/users/idk/Desktop/Tor Browser/" "Tor Browser"
fi
7z x "tor-browser-windows-x86_64-portable-${version}.exe" -o"Tor Browser"
#7z --help