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