-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.bat
53 lines (40 loc) · 1.45 KB
/
setup.bat
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
@echo off
setlocal disabledelayedexpansion
rem # Firefox user.js by Denis G.
rem # https://github.com/denis-g/firefox-user.js
rem # config
title Personal Firefox settings
set root=%~dp0
set root=%root:~0,-1%
set config=%root%\config.ini
setlocal enabledelayedexpansion
for /f "tokens=*" %%A in (%config%) do set %%A
if %FIREFOX_PROFILE% == "" (
echo Error: Variable FIREFOX_PROFILE is empty or wrong
echo Please check FIREFOX_PROFILE variable on config.ini file
pause
exit /b
)
if not exist %FIREFOX_PROFILE% (
echo Error: Firefox profile directory does not exists
echo Please check FIREFOX_PROFILE variable on config.ini file
pause
exit /b
)
rem # cleaner
rd /s /q "%FIREFOX_PROFILE%\chrome\" >nul 2>&1
powershell -c "Invoke-WebRequest 'https://raw.githubusercontent.com/arkenfox/user.js/master/updater.bat' -OutFile '%FIREFOX_PROFILE%\updater.bat'"
rem # copy prefs
xcopy /i "%root%\user-overrides.js" "%FIREFOX_PROFILE%\user-overrides.js" >nul
rem # generate user.js
cd %FIREFOX_PROFILE% && call updater.bat >nul
rem # copy styles
xcopy /i /e "%root%\chrome\" "%FIREFOX_PROFILE%\chrome\" >nul
powershell -c "Invoke-WebRequest 'https://raw.githubusercontent.com/arkenfox/user.js/master/prefsCleaner.bat' -OutFile '%FIREFOX_PROFILE%\prefsCleaner.bat'"
rem # clean prefs.js
cd %FIREFOX_PROFILE% && call prefsCleaner.bat >nul
rem # remove user-overrides.js
rd /s /q "%FIREFOX_PROFILE%\user-overrides.js" >nul 2>&1
echo Completed!
pause
exit /b