From 978af1cb11641c1bdad0914d7657ec3d3ac978aa Mon Sep 17 00:00:00 2001 From: idk Date: Sun, 8 May 2022 13:02:59 -0400 Subject: [PATCH] move more scripted prerequisites to separate files --- src/win/copy-config-profile.bat | 11 +++++++++++ src/win/copy-profile.bat | 11 +++++++++++ src/win/i2pbrowser-private.bat | 20 +++----------------- src/win/i2pbrowser.bat | 20 +++----------------- src/win/i2pconfig.bat | 11 +---------- src/win/launchi2p.bat | 7 +++++++ 6 files changed, 36 insertions(+), 44 deletions(-) create mode 100644 src/win/copy-config-profile.bat create mode 100644 src/win/copy-profile.bat create mode 100644 src/win/launchi2p.bat diff --git a/src/win/copy-config-profile.bat b/src/win/copy-config-profile.bat new file mode 100644 index 0000000..ed77bc2 --- /dev/null +++ b/src/win/copy-config-profile.bat @@ -0,0 +1,11 @@ + +if exist "%LOCALAPPDATA%\I2PBrowser-Launcher\firefox.profile.config.i2p\" ( + echo "profile is configured" + xcopy /s /i /y "%I2PPath%\I2PBrowser-Launcher\firefox.profile.config.i2p\extensions" "%LOCALAPPDATA%\I2PBrowser-Launcher\firefox.profile.config.i2p\extensions" +) else ( + echo "configuring profile" + xcopy /s /i /y "%I2PPath%\I2PBrowser-Launcher\firefox.profile.config.i2p" "%LOCALAPPDATA%\I2PBrowser-Launcher\firefox.profile.config.i2p" +) + +xcopy /s /i /y "%I2PPath%\I2PBrowser-Launcher\firefox.profile.config.i2p\user.js" "%LOCALAPPDATA%\I2PBrowser-Launcher\firefox.profile.config.i2p\user.js" +xcopy /s /i /y "%I2PPath%\I2PBrowser-Launcher\firefox.profile.config.i2p\prefs.js" "%LOCALAPPDATA%\I2PBrowser-Launcher\firefox.profile.config.i2p\prefs.js" diff --git a/src/win/copy-profile.bat b/src/win/copy-profile.bat new file mode 100644 index 0000000..67533e1 --- /dev/null +++ b/src/win/copy-profile.bat @@ -0,0 +1,11 @@ + +if exist "%LOCALAPPDATA%\I2PBrowser-Launcher\firefox.profile.i2p\" ( + echo "profile is configured, updating extensions" + xcopy /s /i /y "%I2PPath%\I2PBrowser-Launcher\firefox.profile.i2p\extensions" "%LOCALAPPDATA%\I2PBrowser-Launcher\firefox.profile.i2p\extensions" +) else ( + echo "configuring profile" + xcopy /s /i /y "%I2PPath%\I2PBrowser-Launcher\firefox.profile.i2p" "%LOCALAPPDATA%\I2PBrowser-Launcher\firefox.profile.i2p" +) + +xcopy /s /i /y "%I2PPath%\I2PBrowser-Launcher\firefox.profile.i2p\user.js" "%LOCALAPPDATA%\I2PBrowser-Launcher\firefox.profile.i2p\user.js" +xcopy /s /i /y "%I2PPath%\I2PBrowser-Launcher\firefox.profile.i2p\prefs.js" "%LOCALAPPDATA%\I2PBrowser-Launcher\firefox.profile.i2p\prefs.js" diff --git a/src/win/i2pbrowser-private.bat b/src/win/i2pbrowser-private.bat index 0be615e..630a1df 100644 --- a/src/win/i2pbrowser-private.bat +++ b/src/win/i2pbrowser-private.bat @@ -4,26 +4,12 @@ SET MYPATH=%~dp0 call %MYPATH%common.bat -if exist "%I2PPath%\jpackaged" ( - cd "%LOCALAPPDATA%\I2P" - start "i2p" /D "%LOCALAPPDATA%\I2P" "%I2PPath%\i2p.exe" -) else ( - start "i2p" "%I2PPath%\i2p.exe" -) +call %MYPATH%launchi2p.bat + +call %MYPATH%copy-profile.bat timeout /t 3 -if exist "%LOCALAPPDATA%\I2PBrowser-Launcher\firefox.profile.i2p\" ( - echo "profile is configured, updating extensions" - xcopy /s /i /y "%I2PPath%\I2PBrowser-Launcher\firefox.profile.i2p\extensions" "%LOCALAPPDATA%\I2PBrowser-Launcher\firefox.profile.i2p\extensions" -) else ( - echo "configuring profile" - xcopy /s /i /y "%I2PPath%\I2PBrowser-Launcher\firefox.profile.i2p" "%LOCALAPPDATA%\I2PBrowser-Launcher\firefox.profile.i2p" -) - -xcopy /s /i /y "%I2PPath%\I2PBrowser-Launcher\firefox.profile.i2p\user.js" "%LOCALAPPDATA%\I2PBrowser-Launcher\firefox.profile.i2p\user.js" -xcopy /s /i /y "%I2PPath%\I2PBrowser-Launcher\firefox.profile.i2p\prefs.js" "%LOCALAPPDATA%\I2PBrowser-Launcher\firefox.profile.i2p\prefs.js" - if exist "%USERPROFILE%/Desktop/Tor Browser/Browser/firefox.exe" ( start "i2pbrowser" "%USERPROFILE%/Desktop/Tor Browser/Browser/firefox.exe" -no-remote -profile "%LOCALAPPDATA%\I2PBrowser-Launcher\firefox.profile.i2p" -private-window about:blank exit diff --git a/src/win/i2pbrowser.bat b/src/win/i2pbrowser.bat index 6ba2ce7..4cfb2f1 100644 --- a/src/win/i2pbrowser.bat +++ b/src/win/i2pbrowser.bat @@ -4,26 +4,12 @@ SET MYPATH=%~dp0 call %MYPATH%common.bat -if exist "%I2PPath%\jpackaged" ( - cd "%LOCALAPPDATA%\I2P" - start "i2p" /D "%LOCALAPPDATA%\I2P" "%I2PPath%\i2p.exe" -) else ( - start "i2p" "%I2PPath%\i2p.exe" -) +call %MYPATH%launchi2p.bat + +call %MYPATH%copy-profile.bat timeout /t 3 -if exist "%LOCALAPPDATA%\I2PBrowser-Launcher\firefox.profile.i2p\" ( - echo "profile is configured, updating extensions" - xcopy /s /i /y "%I2PPath%\I2PBrowser-Launcher\firefox.profile.i2p\extensions" "%LOCALAPPDATA%\I2PBrowser-Launcher\firefox.profile.i2p\extensions" -) else ( - echo "configuring profile" - xcopy /s /i /y "%I2PPath%\I2PBrowser-Launcher\firefox.profile.i2p" "%LOCALAPPDATA%\I2PBrowser-Launcher\firefox.profile.i2p" -) - -xcopy /s /i /y "%I2PPath%\I2PBrowser-Launcher\firefox.profile.i2p\user.js" "%LOCALAPPDATA%\I2PBrowser-Launcher\firefox.profile.i2p\user.js" -xcopy /s /i /y "%I2PPath%\I2PBrowser-Launcher\firefox.profile.i2p\prefs.js" "%LOCALAPPDATA%\I2PBrowser-Launcher\firefox.profile.i2p\prefs.js" - if exist "%USERPROFILE%/Desktop/Tor Browser/Browser/firefox.exe" ( start "i2pbrowser" "%USERPROFILE%/Desktop/Tor Browser/Browser/firefox.exe" -no-remote -profile "%LOCALAPPDATA%\I2PBrowser-Launcher\firefox.profile.i2p" -url %1 exit diff --git a/src/win/i2pconfig.bat b/src/win/i2pconfig.bat index b31deeb..16af397 100644 --- a/src/win/i2pconfig.bat +++ b/src/win/i2pconfig.bat @@ -4,16 +4,7 @@ SET MYPATH=%~dp0 call %MYPATH%common.bat -if exist "%LOCALAPPDATA%\I2PBrowser-Launcher\firefox.profile.config.i2p\" ( - echo "profile is configured" - xcopy /s /i /y "%I2PPath%\I2PBrowser-Launcher\firefox.profile.config.i2p\extensions" "%LOCALAPPDATA%\I2PBrowser-Launcher\firefox.profile.config.i2p\extensions" -) else ( - echo "configuring profile" - xcopy /s /i /y "%I2PPath%\I2PBrowser-Launcher\firefox.profile.config.i2p" "%LOCALAPPDATA%\I2PBrowser-Launcher\firefox.profile.config.i2p" -) - -xcopy /s /i /y "%I2PPath%\I2PBrowser-Launcher\firefox.profile.config.i2p\user.js" "%LOCALAPPDATA%\I2PBrowser-Launcher\firefox.profile.config.i2p\user.js" -xcopy /s /i /y "%I2PPath%\I2PBrowser-Launcher\firefox.profile.config.i2p\prefs.js" "%LOCALAPPDATA%\I2PBrowser-Launcher\firefox.profile.config.i2p\prefs.js" +call %MYPATH%copy-config-profile.bat if exist "%ProgramFiles%\Mozilla Firefox\firefox.exe" ( start "i2pbrowser" "%ProgramFiles%\Mozilla Firefox\firefox.exe" -no-remote -profile "%LOCALAPPDATA%\I2PBrowser-Launcher\firefox.profile.config.i2p" -url %1 diff --git a/src/win/launchi2p.bat b/src/win/launchi2p.bat new file mode 100644 index 0000000..0126afb --- /dev/null +++ b/src/win/launchi2p.bat @@ -0,0 +1,7 @@ + +if exist "%I2PPath%\jpackaged" ( + cd "%LOCALAPPDATA%\I2P" + start "i2p" /D "%LOCALAPPDATA%\I2P" "%I2PPath%\i2p.exe" +) else ( + start "i2p" "%I2PPath%\i2p.exe" +)