Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion macos/build/build
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ cd $dir
arch=$(uname -m)
language=$(osascript -e 'user locale of (get system info)' | sed -e 's/_/-/g')
version="115.20.0esr"
i2pdversion="2.56.0"
i2pdversion="2.59.0"

ftpmirror="https://ftp.mozilla.org/pub/firefox/releases/${version}"

Expand Down
77 changes: 61 additions & 16 deletions windows/StartI2PdBrowser.bat
Original file line number Diff line number Diff line change
@@ -1,18 +1,28 @@
@ECHO OFF
REM Copyright (c) 2013-2019, The PurpleI2P Project
REM Copyright (c) 2013-2026, The PurpleI2P Project
REM This file is part of Purple i2pd project and licensed under BSD3
REM See full license text in LICENSE file at top of project tree

title Starting I2Pd Browser
setlocal enableextensions

set $pause=ping.exe 0.0.0.0 -n
set $cd=%CD%
ver| find "6." >nul && set $pause=timeout.exe /t

ver| find "10.">nul && set $pause=timeout.exe /t
set $cd=%~dp0
set CURL=%~dp0build\curl.exe
set fire=firefox.exe
set port=FirefoxPortable.exe
set i2pd=i2pd.exe

if not exist Firefox ( echo Firefox not found... Start building... && pushd build && call build.cmd --skipwait & popd )
:building
cd /d "%$cd%"
call :check_requirements || (
echo Start building...
pushd build
call build.cmd --skipwait
popd
)

taskList|find /i "%port%">nul&&(taskkill /im "%port%" /t>nul)&&(%$pause% 2 >nul)
REM taskList|find /i "%fire%">nul&&(taskkill /im "%fire%" >nul)
Expand All @@ -22,10 +32,30 @@ taskList|find /i "%i2pd%">nul&&(goto runfox)||(goto starti2p)
cd i2pd
start "" "%i2pd%"

echo i2pd Browser starting
echo i2pd Router starting
echo Please wait
echo -------------------------------------
for /L %%B in (0,1,35) do (call :EchoWithoutCrLf "." && %$pause% 2 >nul)
set watchdog=0
:wait_i2pd
rem Checking for code 200 HTTP/OK
"%CURL%" -s -x http://127.0.0.1:4444 -w "%%{http_code}\n" -o nul http://i2pd.i2p/ | find "200" || (
if not exist i2pd.exe (
if "%locale%"=="ru" (
echo ��������, ������ �� � ����� UAC �⮡� �������� i2pd � ����祭�� ���⭨�� Windows
) else (
echo Please, press YES in UAC windows to add i2pd in Windows Defender exclusion
)
call :ADD_DEFENDER_EXCLUSION "%~dp0i2pd\i2pd.exe"
call :WARN_ANTIVIRUS
%$pause% 5
rem We need download i2pd again
goto building
)
call :EchoWithoutCrLf "." && %$pause% 1 >nul
set /a watchdog+=1
rem Maximum 5 minutes wait time
if %watchdog% lss 300 goto wait_i2pd
)
echo .
echo -------------------------------------
echo Welcome to I2P Network
Expand All @@ -35,18 +65,33 @@ cd %$cd%
cd Firefox
start "" "%port%"
cd %$cd%
%$pause% 5
exit /b 0

:check_requirements
if not exist Firefox ( echo Firefox not found... && exit /b 1 )
if not exist i2pd\i2pd.exe ( echo i2pd not found... && exit /b 1 )
exit /b 0

rem �।�०���� � ��������� ����⥫��⢥ ��⨢����
rem �।������ ��� �⪫����, ���� ���� ����஥� Windows Defender
:WARN_ANTIVIRUS
if "%locale%"=="ru" (
echo �訡�� ����᪠ i2pd. ��������, �� Windows Defender �⪫�祭.
) else (
echo Error running i2pd. Make sure Windows Defender is disabled.
)
explorer.exe "WindowsDefender://ThreatSettings"
goto :eof

rem ==========================================================================
rem �������� � �᪫�祭�� WD ��।���� ��㬥�⮬ ��ꥪ� (��뢠�� ���� UAC)
rem %1 : 䠩� ��� ���������� � �᪫�祭�� ���⭨�� Windows
:ADD_DEFENDER_EXCLUSION
powershell start -verb runas powershell -ArgumentList 'Add-MpPreference -Force -ExclusionPath "%~1"'
goto :eof

rem ==========================================================================
rem ��������� EchoWithoutCrLf
rem
rem %1 : ����� ��� ������.
rem ==========================================================================
rem ��楤�� EchoWithoutCrLf
rem %1 : ⥪�� ��� �뢮��.
:EchoWithoutCrLf

<nul set /p strTemp=%~1
exit /b 0
rem ==========================================================================
<nul set /p strTemp=%~1
exit /b 0
106 changes: 81 additions & 25 deletions windows/build/build.cmd
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
@echo off

REM Copyright (c) 2013-2025, The PurpleI2P Project
REM Copyright (c) 2013-2026, The PurpleI2P Project
REM This file is part of Purple i2pd project and licensed under BSD3
REM See full license text in LICENSE file at top of project tree

setlocal enableextensions

set CURL=%~dp0curl.exe
set FFversion=115.20.0esr
set I2Pdversion=2.56.0
set I2Pdversion=2.59.0

call :GET_ARGS %*
call :GET_LOCALE
call :GET_PROXY
Expand All @@ -17,21 +18,27 @@ call :GET_ARCH
if "%locale%"=="ru" (
echo ���ઠ I2Pd Browser Portable
echo ��� ��㧥�: %locale%, ���⥪���: %xOS%
echo.
echo ����㧪� ��⠭��騪� Firefox ESR
) else (
echo Building I2Pd Browser Portable
echo Browser locale: %locale%, architecture: %xOS%
echo.
echo Downloading Firefox ESR installer
)
echo.

"%CURL%" -L -f -# -o firefox.exe https://ftp.mozilla.org/pub/firefox/releases/%FFversion%/%xOS%/%locale%/Firefox%%20Setup%%20%FFversion%.exe %$X%
if errorlevel 1 (
echo ERROR:%ErrorLevel%
pause
exit
) else (echo OK!)
if exist ..\Firefox (
if "%locale%"=="ru" (
echo Firefox 㦥 ᪠砭. �ய�᪠�.
) else (
echo Firefox already downloaded. Skip.
)
goto GET_I2PD
)

if "%locale%"=="ru" (
echo ����㧪� ��⠭��騪� Firefox ESR
) else (
echo Downloading Firefox ESR installer
)
call :DOWNLOAD firefox.exe https://ftp.mozilla.org/pub/firefox/releases/%FFversion%/%xOS%/%locale%/Firefox%%%%20Setup%%%%20%FFversion%.exe

echo.
if "%locale%"=="ru" (
Expand Down Expand Up @@ -94,23 +101,18 @@ if "%locale%"=="ru" (
) else (
echo Downloading language packs
)
"%CURL%" -L -f -# -o ..\Firefox\App\Firefox\browser\extensions\langpack-ru@firefox.mozilla.org.xpi https://addons.mozilla.org/firefox/downloads/file/4144376/russian_ru_language_pack-115.0.20230726.201356.xpi
if errorlevel 1 ( echo ERROR:%ErrorLevel% && pause && exit ) else (echo OK!)
"%CURL%" -L -f -# -o ..\Firefox\App\Firefox\browser\extensions\ruspell-wiktionary@addons.mozilla.org.xpi https://addons.mozilla.org/firefox/downloads/file/4215701/2696307-1.77.xpi
if errorlevel 1 ( echo ERROR:%ErrorLevel% && pause && exit ) else (echo OK!)
"%CURL%" -L -f -# -o ..\Firefox\App\Firefox\browser\extensions\langpack-en-US@firefox.mozilla.org.xpi https://addons.mozilla.org/firefox/downloads/file/4144407/english_us_language_pack-115.0.20230726.201356.xpi
if errorlevel 1 ( echo ERROR:%ErrorLevel% && pause && exit ) else (echo OK!)
"%CURL%" -L -f -# -o ..\Firefox\App\Firefox\browser\extensions\en-US@dictionaries.addons.mozilla.org.xpi https://addons.mozilla.org/firefox/downloads/file/4175230/us_english_dictionary-115.0.xpi
if errorlevel 1 ( echo ERROR:%ErrorLevel% && pause && exit ) else (echo OK!)
call :DOWNLOAD ..\Firefox\App\Firefox\browser\extensions\langpack-ru@firefox.mozilla.org.xpi https://addons.mozilla.org/firefox/downloads/file/4144376/russian_ru_language_pack-115.0.20230726.201356.xpi
call :DOWNLOAD ..\Firefox\App\Firefox\browser\extensions\ruspell-wiktionary@addons.mozilla.org.xpi https://addons.mozilla.org/firefox/downloads/file/4215701/2696307-1.77.xpi
call :DOWNLOAD ..\Firefox\App\Firefox\browser\extensions\langpack-en-US@firefox.mozilla.org.xpi https://addons.mozilla.org/firefox/downloads/file/4144407/english_us_language_pack-115.0.20230726.201356.xpi
call :DOWNLOAD ..\Firefox\App\Firefox\browser\extensions\en-US@dictionaries.addons.mozilla.org.xpi https://addons.mozilla.org/firefox/downloads/file/4175230/us_english_dictionary-115.0.xpi

echo.
if "%locale%"=="ru" (
echo ����㧪� ���������� NoScript
) else (
echo Downloading NoScript extension
)
"%CURL%" -L -f -# -o ..\Firefox\App\Firefox\browser\extensions\{73a6fe31-595d-460b-a920-fcc0f8843232}.xpi https://addons.mozilla.org/firefox/downloads/file/4411102/noscript-12.1.1.xpi
if errorlevel 1 ( echo ERROR:%ErrorLevel% && pause && exit ) else (echo OK!)
call :DOWNLOAD ..\Firefox\App\Firefox\browser\extensions\{73a6fe31-595d-460b-a920-fcc0f8843232}.xpi https://addons.mozilla.org/firefox/downloads/file/4411102/noscript-12.1.1.xpi

echo.
if "%locale%"=="ru" (
Expand All @@ -129,15 +131,30 @@ copy /Y firefox-portable\* ..\Firefox\ > nul
xcopy /E /Y preferences\* ..\Firefox\App\Firefox\ > nul
echo OK!

:GET_I2PD
echo.
mkdir "..\i2pd" 2>nul
for %%i in ("%cd%\..\i2pd") do set i2pd_path=%%~fi\i2pd.exe

if "%locale%"=="ru" (
echo ����㧪� I2Pd
) else (
echo Downloading I2Pd
)
"%CURL%" -L -f -# -O https://github.com/PurpleI2P/i2pd/releases/download/%I2Pdversion%/i2pd_%I2Pdversion%_%xOS%_mingw.zip
if errorlevel 1 ( echo ERROR:%ErrorLevel% && pause && exit ) else (echo OK!)
7z x -y -o..\i2pd i2pd_%I2Pdversion%_%xOS%_mingw.zip i2pd.exe > nul
call :DOWNLOAD i2pd_%I2Pdversion%_%xOS%_mingw.zip https://github.com/PurpleI2P/i2pd/releases/download/%I2Pdversion%/i2pd_%I2Pdversion%_%xOS%_mingw.zip
7z x -y -o..\i2pd i2pd_%I2Pdversion%_%xOS%_mingw.zip i2pd.exe > nul || (
echo ERROR:%ErrorLevel%
if "%locale%"=="ru" (
echo ��������, ������ �� � ����� UAC �⮡� �������� i2pd � ����祭�� ���⭨�� Windows
) else (
echo Please, press YES in UAC windows to add i2pd in Windows Defender exclusion
)
call :ADD_DEFENDER_EXCLUSION "%cd%\i2pd_%I2Pdversion%_%xOS%_mingw.zip"
call :ADD_DEFENDER_EXCLUSION "%i2pd_path%"
call :WARN_ANTIVIRUS
%$pause% 5
goto GET_I2PD
)
del /Q i2pd_%I2Pdversion%_%xOS%_mingw.zip

xcopy /E /I /Y i2pd ..\i2pd > nul
Expand Down Expand Up @@ -176,4 +193,43 @@ for %%a in (%*) do (
)
goto :eof

rem ��楤�� ᪠稢���� 䠩�� � ��᪮���� ����஬ � ��砥 ��㤠�
rem %1 : ���� � 䠩�� ��� ��࠭����
rem %2 : URL ����
:DOWNLOAD
if "%locale%"=="ru" (
echo ����㦠� URL: %2
) else (
echo Downloading URL: %2
)
"%CURL%" -k -L -f -# -o "%1" "%2" %$X% || (
echo ERROR:%ErrorLevel%
if "%locale%"=="ru" (
echo ����⪠ ����୮�� ᪠稢����
) else (
echo Attempt downloading again
)
%$pause% 5
goto DOWNLOAD
)
echo OK!
goto :eof

rem �।�०���� � ��������� ����⥫��⢥ ��⨢����
rem �।������ ��� �⪫����, ���� ���� ����஥� Windows Defender
:WARN_ANTIVIRUS
if "%locale%"=="ru" (
echo �訡�� �ᯠ����� i2pd. ��������, �� Windows Defender �⪫�祭.
) else (
echo Error unpacking i2pd. Make sure Windows Defender is disabled.
)
explorer.exe "WindowsDefender://ThreatSettings"
goto :eof

rem �������� � �᪫�祭�� WD ��।���� ��㬥�⮬ ��ꥪ� (��뢠�� ���� UAC)
rem %1 : 䠩� ��� ���������� � �᪫�祭�� ���⭨�� Windows
:ADD_DEFENDER_EXCLUSION
powershell start -verb runas powershell -ArgumentList 'Add-MpPreference -Force -ExclusionPath "%~1"'
goto :eof

:eof