|
1 | | -@echo off |
| 1 | +@if /i "%1" NEQ "-verbose" @echo off |
2 | 2 | setlocal |
3 | 3 |
|
4 | 4 | REM #### general config |
5 | | -if not defined programfiles(x86) set programfiles(x86)=%programfiles% |
6 | | -set firefoxdefaultprofile=%programfiles(x86)%\Mozilla Firefox\browser\defaults\Profile |
7 | | - |
| 5 | +set programFilesWithMozilla=%programfiles% |
| 6 | +if not exist "%programFilesWithMozilla%\Mozilla Firefox" set programFilesWithMozilla=%programfiles(x86)% |
| 7 | +if not exist "%programFilesWithMozilla%\Mozilla Firefox" exit /B 1 |
8 | 8 |
|
9 | 9 | REM #### default firefox profile |
10 | | -if not exist "%programfiles(x86)%\Mozilla Firefox" exit /B 1 |
| 10 | +set firefoxdefaultprofile=%programFilesWithMozilla%\Mozilla Firefox\browser\defaults\Profile |
11 | 11 | if not exist "%firefoxdefaultprofile%" mkdir "%firefoxdefaultprofile%" |
12 | 12 | if not exist "%firefoxdefaultprofile%\cert8.db" copy /y "%~dp0db\empty\cert8.db" "%firefoxdefaultprofile%\" >NUL |
13 | 13 | if not exist "%firefoxdefaultprofile%\key3.db" copy /y "%~dp0db\empty\key3.db" "%firefoxdefaultprofile%\" >NUL |
@@ -39,10 +39,13 @@ set certfile=!certpath:%replacepath%=! |
39 | 39 | set certfile=!certfile:.pem=! |
40 | 40 | set certfile=!certfile:.cacert=! |
41 | 41 | set certfile=AddedByUser !certfile! |
42 | | -FOR /D %%P IN ("%%U\AppData\Roaming\Mozilla\Firefox\Profiles\*") DO "%~dp0bin\certutil.exe" -A -n "!certfile!" -i "%%C" -t "cTC,cTC,cTC", -d "%%P" |
| 42 | +FOR /D %%P IN ("%%U\AppData\Roaming\Mozilla\Firefox\Profiles\*") DO ( |
| 43 | + "%~dp0bin\certutil.exe" -A -n "!certfile!" -i "%%C" -t "cTC,cTC,cTC", -d "%%P" |
| 44 | +) |
43 | 45 | )) |
44 | 46 | setlocal DISABLEDELAYEDEXPANSION |
45 | 47 |
|
| 48 | +REM ####Current user |
46 | 49 | setlocal ENABLEDELAYEDEXPANSION |
47 | 50 | set replacepath=%~dp0cacert\ |
48 | 51 | FOR /R "%~dp0" %%C IN (cacert\*.pem) DO ( |
|
0 commit comments