2017-01-23 18:08:31 +03:00
|
|
|
|
@echo off
|
2017-03-14 15:03:30 +03:00
|
|
|
|
|
2024-01-02 18:05:20 +00:00
|
|
|
|
REM Copyright (c) 2013-2024, The PurpleI2P Project
|
2017-03-14 15:03:30 +03:00
|
|
|
|
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
|
|
|
|
|
|
2017-01-23 18:08:31 +03:00
|
|
|
|
setlocal enableextensions
|
|
|
|
|
|
|
|
|
|
set CURL=%~dp0curl.exe
|
2025-01-12 14:01:44 +01:00
|
|
|
|
set FFversion=115.19.0esr
|
|
|
|
|
set I2Pdversion=2.55.0
|
2017-01-23 18:08:31 +03:00
|
|
|
|
call :GET_LOCALE
|
|
|
|
|
call :GET_PROXY
|
|
|
|
|
call :GET_ARCH
|
|
|
|
|
|
2018-01-23 09:17:02 +03:00
|
|
|
|
if "%locale%"=="ru" (
|
2024-04-26 22:52:42 +03:00
|
|
|
|
echo <20><><EFBFBD>ઠ I2Pd Browser Portable
|
|
|
|
|
echo <20><><EFBFBD><EFBFBD> <20><><EFBFBD>㧥<EFBFBD><E3A7A5>: %locale%, <20><><EFBFBD><EFBFBD>⥪<EFBFBD><E2A5AA><EFBFBD><EFBFBD>: %xOS%
|
2017-02-15 06:27:42 +03:00
|
|
|
|
echo.
|
2024-04-26 22:52:42 +03:00
|
|
|
|
echo <20><><EFBFBD><EFBFBD>㧪<EFBFBD> <20><>⠭<EFBFBD><E2A0AD>騪<EFBFBD> Firefox ESR
|
2017-02-15 06:27:42 +03:00
|
|
|
|
) else (
|
|
|
|
|
echo Building I2Pd Browser Portable
|
2018-01-23 09:17:02 +03:00
|
|
|
|
echo Browser locale: %locale%, architecture: %xOS%
|
2017-02-15 06:27:42 +03:00
|
|
|
|
echo.
|
2018-06-15 03:31:27 +03:00
|
|
|
|
echo Downloading Firefox ESR installer
|
2017-02-15 06:27:42 +03:00
|
|
|
|
)
|
2017-01-23 18:08:31 +03:00
|
|
|
|
|
2022-06-20 01:02:18 +03:00
|
|
|
|
"%CURL%" -L -f -# -o firefox.exe https://ftp.mozilla.org/pub/firefox/releases/%FFversion%/%xOS%/%locale%/Firefox%%20Setup%%20%FFversion%.exe %$X%
|
2017-01-30 04:30:54 +03:00
|
|
|
|
if errorlevel 1 (
|
|
|
|
|
echo ERROR:%ErrorLevel%
|
|
|
|
|
pause
|
2017-02-15 06:27:42 +03:00
|
|
|
|
exit
|
2017-01-30 04:30:54 +03:00
|
|
|
|
) else (echo OK!)
|
2017-01-23 18:08:31 +03:00
|
|
|
|
|
|
|
|
|
echo.
|
2018-01-23 09:17:02 +03:00
|
|
|
|
if "%locale%"=="ru" (
|
2024-04-26 22:52:42 +03:00
|
|
|
|
echo <20><>ᯠ<EFBFBD><E1AFA0><EFBFBD><EFBFBD><EFBFBD> <20><>⠭<EFBFBD><E2A0AD>騪<EFBFBD> <20> 㤠<><E3A4A0><EFBFBD><EFBFBD><EFBFBD> <20><> <20>㦭<EFBFBD><E3A6AD> 䠩<><E4A0A9><EFBFBD>
|
2017-02-15 06:27:42 +03:00
|
|
|
|
) else (
|
2017-11-17 05:45:44 +03:00
|
|
|
|
echo Unpacking the installer and deleting unnecessary files
|
2017-02-15 06:27:42 +03:00
|
|
|
|
)
|
2017-01-23 18:08:31 +03:00
|
|
|
|
|
2018-01-23 09:17:02 +03:00
|
|
|
|
7z x -y -o..\Firefox\App firefox.exe > nul
|
|
|
|
|
del /Q firefox.exe
|
|
|
|
|
ren ..\Firefox\App\core Firefox
|
|
|
|
|
del /Q ..\Firefox\App\setup.exe
|
|
|
|
|
del /Q ..\Firefox\App\Firefox\browser\crashreporter-override.ini
|
2021-06-01 23:10:07 +03:00
|
|
|
|
rmdir /S /Q ..\Firefox\App\Firefox\browser\features
|
2019-04-13 12:42:24 +03:00
|
|
|
|
rmdir /S /Q ..\Firefox\App\Firefox\gmp-clearkey
|
|
|
|
|
rmdir /S /Q ..\Firefox\App\Firefox\uninstall
|
|
|
|
|
del /Q ..\Firefox\App\Firefox\Accessible*.*
|
2021-06-01 23:10:07 +03:00
|
|
|
|
del /Q ..\Firefox\App\Firefox\application.ini
|
2018-01-23 09:17:02 +03:00
|
|
|
|
del /Q ..\Firefox\App\Firefox\crashreporter.*
|
2019-04-13 12:42:24 +03:00
|
|
|
|
del /Q ..\Firefox\App\Firefox\*.sig
|
2018-01-23 09:17:02 +03:00
|
|
|
|
del /Q ..\Firefox\App\Firefox\maintenanceservice*.*
|
2019-04-13 12:42:24 +03:00
|
|
|
|
del /Q ..\Firefox\App\Firefox\minidump-analyzer.exe
|
2021-06-01 23:10:07 +03:00
|
|
|
|
del /Q ..\Firefox\App\Firefox\precomplete
|
|
|
|
|
del /Q ..\Firefox\App\Firefox\removed-files
|
2019-04-13 12:42:24 +03:00
|
|
|
|
del /Q ..\Firefox\App\Firefox\ucrtbase.dll
|
2018-01-23 09:17:02 +03:00
|
|
|
|
del /Q ..\Firefox\App\Firefox\update*.*
|
|
|
|
|
|
2021-06-01 23:10:07 +03:00
|
|
|
|
mkdir ..\Firefox\App\Firefox\browser\extensions > nul
|
|
|
|
|
echo OK!
|
|
|
|
|
|
|
|
|
|
echo.
|
2018-01-23 09:17:02 +03:00
|
|
|
|
if "%locale%"=="ru" (
|
2024-04-26 22:52:42 +03:00
|
|
|
|
echo <20><><EFBFBD>稬 <20><><EFBFBD><EFBFBD>७<EFBFBD><E0A5AD><EFBFBD> 䠩<><E4A0A9> <20><><EFBFBD>㧥<EFBFBD><E3A7A5> <20><><EFBFBD> <20>⪫<EFBFBD>祭<EFBFBD><E7A5AD> <20><><EFBFBD><EFBFBD><EFBFBD>稢<EFBFBD><E7A8A2> <20><><EFBFBD><EFBFBD><EFBFBD>ᮢ
|
2017-02-15 06:27:42 +03:00
|
|
|
|
) else (
|
2021-06-01 23:10:07 +03:00
|
|
|
|
echo Patching browser internal files to disable annoying external requests
|
2017-02-15 06:27:42 +03:00
|
|
|
|
)
|
2018-01-23 09:17:02 +03:00
|
|
|
|
|
2021-06-01 23:10:07 +03:00
|
|
|
|
7z -bso0 -y x ..\Firefox\App\Firefox\omni.ja -o..\Firefox\App\tmp > nul 2>&1
|
|
|
|
|
|
|
|
|
|
REM Patching them
|
2024-01-02 18:05:20 +00:00
|
|
|
|
sed -i "s/https\:\/\/firefox\.settings\.services\.mozilla\.com\/v1/http\:\/\/127\.0\.0\.1/" ..\Firefox\App\tmp\modules\SearchUtils.sys.mjs
|
2022-09-19 20:15:08 +03:00
|
|
|
|
if errorlevel 1 ( echo ERROR:%ErrorLevel% && pause && exit ) else (echo Patched 1/2)
|
2024-01-02 18:05:20 +00:00
|
|
|
|
sed -i "s/\"https\:\/\/firefox\.settings\.services\.mozilla\.com\/v1\",$/\"\",/" ..\Firefox\App\tmp\modules\AppConstants.sys.mjs
|
2022-09-19 20:15:08 +03:00
|
|
|
|
if errorlevel 1 ( echo ERROR:%ErrorLevel% && pause && exit ) else (echo Patched 2/2)
|
2021-06-01 23:10:07 +03:00
|
|
|
|
|
|
|
|
|
REM Backing up old omni.ja
|
|
|
|
|
ren ..\Firefox\App\Firefox\omni.ja omni.ja.bak
|
|
|
|
|
|
|
|
|
|
REM Repacking patched files
|
|
|
|
|
7z a -mx0 -tzip ..\Firefox\App\Firefox\omni.ja -r ..\Firefox\App\tmp\* > nul
|
|
|
|
|
|
|
|
|
|
REM Removing temporary files
|
|
|
|
|
rmdir /S /Q ..\Firefox\App\tmp
|
2022-03-24 03:30:23 +03:00
|
|
|
|
del ..\Firefox\App\Firefox\omni.ja.bak
|
2021-06-01 23:10:07 +03:00
|
|
|
|
echo OK!
|
|
|
|
|
|
|
|
|
|
echo.
|
2018-01-23 11:50:18 +03:00
|
|
|
|
if "%locale%"=="ru" (
|
2024-04-26 22:52:42 +03:00
|
|
|
|
echo <20><><EFBFBD><EFBFBD>㧪<EFBFBD> <20><>몮<EFBFBD><EBAAAE><EFBFBD> <20><><EFBFBD><EFBFBD>⮢
|
2018-01-23 11:50:18 +03:00
|
|
|
|
) else (
|
|
|
|
|
echo Downloading language packs
|
|
|
|
|
)
|
2024-01-02 18:05:20 +00:00
|
|
|
|
"%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
|
2018-01-23 11:50:18 +03:00
|
|
|
|
if errorlevel 1 ( echo ERROR:%ErrorLevel% && pause && exit ) else (echo OK!)
|
2024-01-02 18:05:20 +00:00
|
|
|
|
"%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
|
2021-06-01 23:10:07 +03:00
|
|
|
|
if errorlevel 1 ( echo ERROR:%ErrorLevel% && pause && exit ) else (echo OK!)
|
2024-01-02 18:05:20 +00:00
|
|
|
|
"%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
|
2021-06-01 23:10:07 +03:00
|
|
|
|
if errorlevel 1 ( echo ERROR:%ErrorLevel% && pause && exit ) else (echo OK!)
|
2024-01-02 18:05:20 +00:00
|
|
|
|
"%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
|
2018-01-23 11:50:18 +03:00
|
|
|
|
if errorlevel 1 ( echo ERROR:%ErrorLevel% && pause && exit ) else (echo OK!)
|
|
|
|
|
|
|
|
|
|
echo.
|
2018-01-23 09:17:02 +03:00
|
|
|
|
if "%locale%"=="ru" (
|
2024-04-26 22:52:42 +03:00
|
|
|
|
echo <20><><EFBFBD><EFBFBD>㧪<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> NoScript
|
2017-01-23 18:08:31 +03:00
|
|
|
|
) else (
|
2017-02-15 06:27:42 +03:00
|
|
|
|
echo Downloading NoScript extension
|
2017-01-23 18:08:31 +03:00
|
|
|
|
)
|
2025-01-12 14:01:44 +01:00
|
|
|
|
"%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
|
2017-02-15 06:27:42 +03:00
|
|
|
|
if errorlevel 1 ( echo ERROR:%ErrorLevel% && pause && exit ) else (echo OK!)
|
|
|
|
|
|
2017-01-30 04:30:54 +03:00
|
|
|
|
echo.
|
2018-01-23 09:17:02 +03:00
|
|
|
|
if "%locale%"=="ru" (
|
2024-04-26 22:52:42 +03:00
|
|
|
|
echo <20><><EFBFBD><EFBFBD><EFBFBD><E0AEA2><EFBFBD><EFBFBD> 䠩<><E4A0A9><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD> Firefox
|
2017-02-15 06:27:42 +03:00
|
|
|
|
) else (
|
2018-01-23 09:17:02 +03:00
|
|
|
|
echo Copying Firefox launcher and settings
|
2017-02-15 06:27:42 +03:00
|
|
|
|
)
|
2018-01-23 09:17:02 +03:00
|
|
|
|
mkdir ..\Firefox\App\DefaultData\profile\ > nul
|
2022-07-25 01:19:09 +03:00
|
|
|
|
xcopy /E /Y profile\* ..\Firefox\App\DefaultData\profile\ > nul
|
2021-06-01 23:10:07 +03:00
|
|
|
|
if "%locale%"=="ru" (
|
|
|
|
|
copy /Y profile-ru\* ..\Firefox\App\DefaultData\profile\ > nul
|
|
|
|
|
) else (
|
|
|
|
|
copy /Y profile-en\* ..\Firefox\App\DefaultData\profile\ > nul
|
|
|
|
|
)
|
2018-01-23 09:17:02 +03:00
|
|
|
|
copy /Y firefox-portable\* ..\Firefox\ > nul
|
2018-06-15 03:31:27 +03:00
|
|
|
|
xcopy /E /Y preferences\* ..\Firefox\App\Firefox\ > nul
|
2021-06-01 23:10:07 +03:00
|
|
|
|
echo OK!
|
2017-04-25 17:32:18 +03:00
|
|
|
|
|
2021-06-01 23:10:07 +03:00
|
|
|
|
echo.
|
2018-01-23 09:17:02 +03:00
|
|
|
|
if "%locale%"=="ru" (
|
2024-04-26 22:52:42 +03:00
|
|
|
|
echo <20><><EFBFBD><EFBFBD>㧪<EFBFBD> I2Pd
|
2017-02-15 06:27:42 +03:00
|
|
|
|
) else (
|
|
|
|
|
echo Downloading I2Pd
|
|
|
|
|
)
|
2018-06-30 14:52:31 +03:00
|
|
|
|
"%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
|
|
|
|
|
del /Q i2pd_%I2Pdversion%_%xOS%_mingw.zip
|
|
|
|
|
|
2017-01-23 19:32:31 +03:00
|
|
|
|
xcopy /E /I /Y i2pd ..\i2pd > nul
|
2017-01-23 18:08:31 +03:00
|
|
|
|
|
2017-01-30 04:30:54 +03:00
|
|
|
|
echo.
|
2018-01-23 09:17:02 +03:00
|
|
|
|
if "%locale%"=="ru" (
|
2024-04-26 22:52:42 +03:00
|
|
|
|
echo I2Pd Browser Portable <20><>⮢ <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!
|
2017-02-15 06:27:42 +03:00
|
|
|
|
) else (
|
2017-11-17 05:45:44 +03:00
|
|
|
|
echo I2Pd Browser Portable is ready to start!
|
2017-02-15 06:27:42 +03:00
|
|
|
|
)
|
2017-01-23 18:08:31 +03:00
|
|
|
|
pause
|
|
|
|
|
exit
|
|
|
|
|
|
|
|
|
|
:GET_LOCALE
|
|
|
|
|
for /f "tokens=3" %%a in ('reg query "HKEY_USERS\.DEFAULT\Keyboard Layout\Preload"^|find "REG_SZ"') do (
|
2018-01-23 09:17:02 +03:00
|
|
|
|
if %%a==00000419 (set locale=ru) else (set locale=en-US)
|
2017-01-30 04:30:54 +03:00
|
|
|
|
goto :eof
|
2017-01-23 18:08:31 +03:00
|
|
|
|
)
|
|
|
|
|
goto :eof
|
|
|
|
|
|
|
|
|
|
:GET_PROXY
|
2017-01-30 04:30:54 +03:00
|
|
|
|
set $X=&set $R=HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings
|
|
|
|
|
for /F "Tokens=1,3" %%i in ('reg query "%$R%"^|find "Proxy"') do set %%i=%%j
|
|
|
|
|
if %ProxyEnable%==0x1 set $X=-x %ProxyServer%
|
2017-01-23 18:08:31 +03:00
|
|
|
|
goto :eof
|
|
|
|
|
|
|
|
|
|
:GET_ARCH
|
2018-01-23 09:17:02 +03:00
|
|
|
|
set xOS=win32
|
2022-11-10 17:56:42 +03:00
|
|
|
|
if defined PROCESSOR_ARCHITEW6432 (set xOS=win64) else if "%PROCESSOR_ARCHITECTURE%" neq "x86" (set xOS=win64)
|
2017-01-23 18:08:31 +03:00
|
|
|
|
goto :eof
|
|
|
|
|
|
2017-11-21 17:14:20 +01:00
|
|
|
|
:eof
|