Skip to content

Commit a7e3eee

Browse files
authored
Add v1.0
Add v1.0
1 parent 72068fd commit a7e3eee

File tree

1 file changed

+341
-0
lines changed

1 file changed

+341
-0
lines changed

browser_installation.bat

Lines changed: 341 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,341 @@
1+
@echo off
2+
:: BatchGotAdmin
3+
:-------------------------------------
4+
REM --> Check for permissions
5+
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
6+
7+
REM --> If error flag set, we do not have admin.
8+
if '%errorlevel%' NEQ '0' (
9+
echo Requesting administrative privileges...
10+
goto UACPrompt
11+
) else ( goto gotAdmin )
12+
13+
:UACPrompt
14+
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
15+
echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"
16+
17+
"%temp%\getadmin.vbs"
18+
exit /B
19+
20+
:gotAdmin
21+
if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" )
22+
pushd "%CD%"
23+
CD /D "%~dp0"
24+
:--------------------------------------
25+
setlocal enabledelayedexpansion
26+
title Browser Installation Menu
27+
28+
:checkagain
29+
cls
30+
title Initializing...
31+
MODE 45,15
32+
33+
echo.
34+
echo ======================================
35+
echo Browser Installation Script v1.0
36+
echo Made by craeckor
37+
echo ======================================
38+
echo.
39+
40+
echo Network connection test...
41+
set check=0
42+
43+
REM Repeat the ping check 5 times
44+
for /l %%i in (1,1,5) do (
45+
timeout 1 /nobreak > nul
46+
ping 1.1.1.1 -n 1 -w 1000 > nul
47+
if !errorlevel! equ 0 (
48+
REM internet working
49+
) else (
50+
set /a check+=1
51+
)
52+
)
53+
54+
REM Check the value of check variable
55+
if %check% geq 1 (
56+
echo "There is no internet. Please connect your pc or laptop to the internet via usb to smartphone (usb tethering) or with a network cable (wired connection)."
57+
echo "After you connected your Laptop or PC to the internet, wait a few seconds and then press any key to retry."
58+
pause > nul
59+
goto checkagain
60+
) else (
61+
REM internet working
62+
)
63+
64+
echo Initialize variables...
65+
set "download_url_duckduckgo="
66+
set "version_tag_duckduckgo="
67+
set header=-H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/118.0" -H "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8" -H "Accept-Language: en-US,en;q=0.5" -H "Connection: keep-alive" -H "Upgrade-Insecure-Requests: 1" -H "Sec-Fetch-Dest: document" -H "Sec-Fetch-Mode: navigate" -H "Sec-Fetch-Site: none" -H "Sec-Fetch-User: ?1" -H "Pragma: no-cache" -H "Cache-Control: no-cache" -H "TE: trailers"
68+
set "query="
69+
set "min="
70+
set "minpath="
71+
set "min-path-version="
72+
73+
echo Fetch browserdata...
74+
for /f "tokens=6 delims=/" %%i in ('curl -s !header! "https://download.mozilla.org/?product=firefox-latest-ssl&os=win64&lang=en-US"') do (
75+
set "firefoxversion=%%i"
76+
)
77+
78+
for /f "tokens=7 delims=/" %%i in ('curl -s !header! -I "https://github.com/brave/brave-browser/releases/latest" 2^>^&1 ^| findstr "Location:"') do (
79+
set brave_tag=%%i
80+
)
81+
82+
for /f "tokens=2 delims=^=^"^" %%i in ('curl -s !header! "https://staticcdn.duckduckgo.com/windows-desktop-browser/DuckDuckGo.appinstaller" ^| findstr "Uri="') do (
83+
set download_url_duckduckgo=%%i
84+
)
85+
set "download_url_duckduckgo=!download_url_duckduckgo:"=!"
86+
set "download_url_duckduckgo=!download_url_duckduckgo:/>=!"
87+
88+
for /f "tokens=2 delims=^=^"^" %%i in ('curl -s !header! "https://staticcdn.duckduckgo.com/windows-desktop-browser/DuckDuckGo.appinstaller" ^| findstr "Version="') do (
89+
set version_tag_duckduckgo=%%i
90+
)
91+
set "version_tag_duckduckgo=!version_tag_duckduckgo:"=!"
92+
93+
for /f "tokens=4 delims=/" %%i in ('curl !header! "https://mullvad.net/en/download/browser/win64/latest" -v 2^>^&1 ^| findstr "location:"') do (
94+
set mullvad_version=%%i
95+
)
96+
97+
for /f "tokens=7 delims=/" %%i in ('curl -s !header! -I "https://github.com/minbrowser/min/releases/latest" 2^>^&1 ^| findstr "Location:"') do (
98+
set min_tag=%%i
99+
)
100+
101+
echo Check for Min...
102+
103+
for /f "tokens=2 delims=-" %%i in ('dir /b /s "C:\Program Files\Min" ^| findstr "Min-v"') do (
104+
set min-path-version=%%i
105+
)
106+
if "!min-path-version!" == "" (
107+
set min-path-version=0
108+
)
109+
110+
if exist "C:\Program Files\Min\Min.exe" (
111+
set min=yes
112+
set minpath="C:\Program Files\Min\Min.exe"
113+
) else (
114+
set min=no
115+
)
116+
117+
if exist "%localappdata%\min\min.exe" (
118+
set min=yes
119+
set minpath="%localappdata%\min\min.exe"
120+
) else (
121+
set min=no
122+
)
123+
124+
if NOT "!min-path-version!" == "0" (
125+
set min=yes
126+
set minpath="C:\Program Files\Min\!min-path-version!\Min.exe"
127+
)
128+
129+
:menu
130+
MODE 150,45
131+
title Browser Installation Script v1.0
132+
cls
133+
echo.
134+
echo _ _
135+
echo _^| ^|_ ______ ______ ______ ______ ______ ______ ______ ______ ______ ______ ______ ______ ______ ______ ______ ______ ______ ______ _^| ^|_
136+
echo ^|_ _^|______^|______^|______^|______^|______^|______^|______^|______^|______^|______^|______^|______^|______^|______^|______^|______^|______^|______^|_ _^|
137+
echo ^|_^| ____ _____ _ _ _ _ _ __ __ ^|_^|
138+
echo ^| ^| ^| _ \ ^|_ _^| ^| ^| ^| ^| ^| ^| ^| (_) ^| \/ ^| ^| ^|
139+
echo ^| ^| ^| ^|_) ^|_ __ _____ _____ ___ _ __ ^| ^| _ __ ___^| ^|_ __ _^| ^| ^| __ _^| ^|_ _ ___ _ __ ^| \ / ^| ___ _ __ _ _ ^| ^|
140+
echo ^| ^| ^| _ ^<^| '__/ _ \ \ /\ / / __^|/ _ \ '__^| ^| ^| ^| '_ \/ __^| __/ _` ^| ^| ^|/ _` ^| __^| ^|/ _ \^| '_ \ ^| ^|\/^| ^|/ _ \ '_ \^| ^| ^| ^| ^| ^|
141+
echo ^| ^| ^| ^|_) ^| ^| ^| (_) \ V V /\__ \ __/ ^| _^| ^|_^| ^| ^| \__ \ ^|^| (_^| ^| ^| ^| (_^| ^| ^|_^| ^| (_) ^| ^| ^| ^| ^| ^| ^| ^| __/ ^| ^| ^| ^|_^| ^| ^| ^|
142+
echo ^| ^| ^|____/^|_^| \___/ \_/\_/ ^|___/\___^|_^| ^|_____^|_^| ^|_^|___/\__\__,_^|_^|_^|\__,_^|\__^|_^|\___/^|_^| ^|_^| ^|_^| ^|_^|\___^|_^| ^|_^|\__,_^| ^| ^|
143+
echo ^| ^| ^| ^|
144+
echo ^|_^| ^|_^|
145+
echo _^| ^|_ ______ ______ ______ ______ ______ ______ ______ ______ ______ ______ ______ ______ ______ ______ ______ ______ ______ ______ _^| ^|_
146+
echo ^|_ _^|______^|______^|______^|______^|______^|______^|______^|______^|______^|______^|______^|______^|______^|______^|______^|______^|______^|______^|_ _^|
147+
echo ^|_^| ^|_^|
148+
echo.
149+
echo ================================
150+
echo Which browser do you want?
151+
echo ================================
152+
echo.
153+
echo 1. Firefox (recommended) v!firefoxversion!
154+
echo 2. Brave Browser (recommended, great privacy) !brave_tag!
155+
echo 3. DuckDuckGo Browser (recommended, great privacy) v%version_tag_duckduckgo%
156+
echo 4. Mullvad Browser (recommended, great privacy) v!mullvad_version!
157+
echo 5. Min Browser (recommended, great privacy) !min_tag!
158+
echo 6. Chrome (not recommended, bad privacy - Google) latest Version
159+
echo 7. Opera Browser (not recommended, bad privacy - Chinese Software) latest Version
160+
echo 8. OperaGX Browser (not recommended, bad privacy - Chinese Software) latest Version
161+
if "%min%"=="yes" (
162+
echo 9. Other - Install your favourite Browser manually - Uses Min for search
163+
) else (
164+
echo 9. Other - Install your favourite Browser manually - Uses Min for search - Min is currently not installed
165+
echo --^> If you choose this option the script will download Min temporarly so you can download your favourite Browser with Min.
166+
echo --^> After you close Min it will delete Min permanently.
167+
)
168+
echo.
169+
set /p choice=Select a browser (1-8):
170+
171+
if "%choice%"=="1" goto install_firefox
172+
if "%choice%"=="2" goto install_brave
173+
if "%choice%"=="3" goto install_duckduckgo
174+
if "%choice%"=="4" goto install_mullvad
175+
if "%choice%"=="5" goto install_min
176+
if "%choice%"=="6" goto install_chrome
177+
if "%choice%"=="7" goto install_opera
178+
if "%choice%"=="8" goto install_operagx
179+
if "%min%"=="yes" (
180+
if "%choice%"=="9" goto other
181+
) else (
182+
if "%choice%"=="9" goto otheri
183+
)
184+
185+
echo Invalid choice. Please select a valid option.
186+
timeout /nobreak 1 >NUL
187+
goto menu
188+
189+
:install_firefox
190+
rem Add installation instructions for Firefox here
191+
echo Installing Firefox v!firefoxversion!...
192+
curl !header! -o "%Temp%\firefox.ini" "https://cdn1.craeckor.ch/data/browsers/firefox.ini" -L -s
193+
curl !header! -o "%Temp%\firefox.exe" "https://download.mozilla.org/?product=firefox-latest-ssl&os=win64&lang=en-US" -L -s
194+
start /wait /min "" "%Temp%\firefox.exe" /S /INI=%Temp%\firefox.ini
195+
timeout 10 /nobreak >NUL
196+
del /F /S /Q "%Temp%\firefox.ini" >NUL
197+
del /F /S /Q "%Temp%\firefox.exe" >NUL
198+
set browser=Firefox Browser
199+
goto end
200+
201+
:install_brave
202+
rem Add installation instructions for Brave Browser here
203+
echo Installing Brave Browser %tag%...
204+
curl !header! -o "%Temp%\brave.exe" "https://brave-browser-downloads.s3.brave.com/latest/brave_installer-x64.exe" -L -s
205+
start /wait /min "" "%Temp%\brave.exe" --system-level --silent --install
206+
timeout 10 /nobreak >NUL
207+
del /F /S /Q "%Temp%\brave.exe" >NUL
208+
set browser=Brave Browser
209+
goto end
210+
211+
:install_duckduckgo
212+
rem Add installation instructions for DuckDuckGo Browser here
213+
echo Installing DuckDuckGo Browser v!version_tag_duckduckgo!...
214+
curl !header! -o "%Temp%\duckduckgo.Appx" "!download_url_duckduckgo!" -s -L
215+
Powershell Add-AppProvisionedPackage -Online -PackagePath "%Temp%\duckduckgo.Appx" -SkipLicense
216+
timeout 10 /nobreak >NUL
217+
del /F /S /Q "%Temp%\duckduckgo.Appx" >NUL
218+
set "browser=DuckDuckGo Browser"
219+
goto end
220+
221+
:install_mullvad
222+
rem Add installation instructions for Mullvad Browser here
223+
echo Installing Mullvad Browser v!mullvad_version!...
224+
curl !header! -o "%Temp%\mullvad.exe" "https://mullvad.net/en/download/browser/win64/latest" -L -s
225+
"%Temp%\mullvad.exe" /S
226+
timeout 10 /nobreak >NUL
227+
del /F /S /Q "%Temp%\mullvad.exe" >NUL
228+
set browser=Mullvad Browser
229+
goto end
230+
231+
:install_min
232+
echo Installing Browser !min_tag!
233+
mkdir "%Programfiles%\Min"
234+
curl !header! -o "%Temp%\min-sc.ps1" "https://cdn1.craeckor.ch/data/min/min-sc.ps1" -s -L
235+
curl !header! -o "%USERPROFILE%\Downloads\remove_min.bat" "https://cdn-blog.craeckor.ch/win10ent/rmmin.bat" -s -L
236+
curl !header! -o "%Temp%\min.zip" "https://github.com/minbrowser/min/releases/download/!min_tag!/Min-!min_tag!-windows.zip" -L -s
237+
Powershell Expand-Archive -Path "$ENV:TEMP\min.zip" -DestinationPath "$env:ProgramFiles\Min"
238+
start /wait powershell.exe -ExecutionPolicy Bypass -windowstyle hidden -File "%TEMP%\min-sc.ps1" "!min_tag!"
239+
timeout 10 /nobreak >NUL
240+
del /F /S /Q "%Temp%\min.zip" >NUL
241+
del /F /S /Q "%Temp%\min-sc.ps1" >NUL
242+
set browser=Min Browser
243+
goto end
244+
245+
:install_chrome
246+
rem Add installation instructions for Chrome here
247+
echo Installing Chrome latest Version...
248+
curl !header! -o "%Temp%\chrome.exe" "http://dl.google.com/chrome/install/375.126/chrome_installer.exe" -L -s
249+
start /min /wait "" "%Temp%\chrome.exe" /silent /install
250+
timeout 10 /nobreak >NUL
251+
del /F /S /Q "%Temp%\chrome.exe" >NUL
252+
set browser=Chrome Browser
253+
goto end
254+
255+
:install_opera
256+
rem Add installation instructions for Opera Browser here
257+
echo Installing Opera Browser latest Version...
258+
:shit1
259+
curl !header! -o "%Temp%\opera.exe" "https://net.geo.opera.com/opera/stable/windows" -L -s
260+
if %errorlevel% equ 6 (
261+
goto shit1
262+
)
263+
start /min /wait "" "%Temp%\opera.exe" /silent /allusers=1 /launchopera=0 /setdefaultbrowser=1
264+
timeout 10 /nobreak >NUL
265+
del /F /S /Q "%Temp%\opera.exe" >NUL
266+
set browser=Opera Browser
267+
goto end
268+
269+
:install_operagx
270+
rem Add installation instructions for OperaGX Browser here
271+
echo Installing OperaGX Browser latest Version...
272+
:shit2
273+
curl !header! -o "%Temp%\operagx.exe" "https://net.geo.opera.com/opera_gx/stable/windows" -L -s
274+
if %errorlevel% equ 6 (
275+
goto shit2
276+
)
277+
start /min /wait "" "%Temp%\operagx.exe" /silent /allusers=1 /launchopera=0 /setdefaultbrowser=1
278+
timeout 10 /nobreak >NUL
279+
del /F /S /Q "%Temp%\operagx.exe" >NUL
280+
set browser=OperaGX Browser
281+
goto end
282+
283+
:other
284+
echo Search your favourite Browser - Starts Min with your search query, if no query entered, it just starts Min with DuckDuckGo as Search-Engine
285+
set /p searchquery=DuckDuckGo Search:
286+
if "%searchquery%"=="" (
287+
start "" !minpath! --ignore-certificate-errors "https://duckduckgo.com"
288+
goto otherend
289+
) else (
290+
for %%a in (%searchquery%) do (
291+
set "query=!query!%%a+"
292+
)
293+
rem Remove the trailing plus symbol
294+
set "query=!query:~0,-1!"
295+
start "" !minpath! --ignore-certificate-errors "https://duckduckgo.com/?q=!query!&t=min"
296+
goto otherend
297+
)
298+
:otherend
299+
echo Press any key to Exit...
300+
pause >NUL
301+
endlocal
302+
exit
303+
304+
:otheri
305+
echo Download Min...
306+
curl !header! -o "%TEMP%\min.zip" https://github.com/minbrowser/min/releases/download/!min_tag!/Min-!min_tag!-windows.zip -s -L
307+
echo Extract Min...
308+
Powershell Expand-Archive -Path "$ENV:TEMP\min.zip" -DestinationPath "$ENV:TEMP\min"
309+
echo After you close the Min-Window it will delete Min permanently
310+
echo Search your favourite Browser - Starts Min with your search query, if no query entered, it just starts Min with DuckDuckGo as Search-Engine
311+
set /p searchquery=DuckDuckGo Search:
312+
if "%searchquery%"=="" (
313+
start /wait "" "%Temp%\min\Min-!min_tag!\Min.exe" --ignore-certificate-errors "https://duckduckgo.com"
314+
goto otheriend
315+
) else (
316+
for %%a in (%searchquery%) do (
317+
set "query=!query!%%a+"
318+
)
319+
rem Remove the trailing plus symbol
320+
set "query=!query:~0,-1!"
321+
start /wait "" "%Temp%\min\Min-!min_tag!\Min.exe" --ignore-certificate-errors "https://duckduckgo.com/?q=!query!&t=min"
322+
goto otheriend
323+
)
324+
:otheriend
325+
echo Delete Min...
326+
taskkill /f /im Min.exe >NUL
327+
timeout /nobreak 10 >NUL
328+
rmdir /s /q "%Temp%\min" >NUL
329+
del /f /s /q "%Temp%\min.zip" >NUL
330+
rmdir /s /q "%Appdata%\Min" >NUL
331+
332+
echo Press any key to Exit...
333+
pause >NUL
334+
endlocal
335+
exit
336+
337+
:end
338+
echo Installation complete. Enjoy %browser%!
339+
endlocal
340+
echo Press any key to Exit...
341+
pause >NUL

0 commit comments

Comments
 (0)