-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.bat
90 lines (77 loc) · 2.79 KB
/
install.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
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
@echo off
color 17
mode con: cols=90 lines=25
::Windows XP doesn't have UAC so skip
for /f "tokens=3*" %%i in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName ^| Find "ProductName"') do set WINVER=%%i %%j
echo %WINVER% | find "XP" > nul && goto commands
::prompt for elevation (uac)
if "%1" == "UAC" goto elevation
(
echo Set objShell = CreateObject^("Shell.Application"^)
echo Set objFSO = CreateObject^("Scripting.FileSystemObject"^)
echo strPath = objFSO.GetParentFolderName^(WScript.ScriptFullName^)
echo If objFSO.FileExists^("%~0"^) Then
echo objShell.ShellExecute "cmd.exe", "/c """"%~0"" UAC ""%~dp0""""", "", "runas", 1
echo Else
echo MsgBox "Script file not found"
echo End If
) > "%TEMP%\UAC.vbs"
cscript //nologo "%TEMP%\UAC.vbs"
goto :eof
:elevation
del /q "%TEMP%\UAC.vbs"
:commands
::navigate back to this script's home folder
%~d2
cd "%~p2"
::
:: Main script executed after elevation
::
echo -----------------------------------------------------------------------------------------
echo.
echo --------------------------- Solarized UI Theme for IntelliJ -----------------------------
echo.
echo -----------------------------------------------------------------------------------------
set searchDirectory="C:\Program Files\"
set searchFile=idea.jar
echo.
echo Searching for your IntelliJ installation.
echo Default search directory is: %searchDirectory%?
echo.
set /p choice="> Would you like to change the search location? Type [Y]es or [N]o: "
if /i "%choice:~0,1%"=="Y" (
echo.
set /p searchDirectory="> Enter the path to your IntelliJ installation: "
)
echo.
echo -----------------------------------------------------------------------------------------
:: search the default JetBrains directory for the idea.jar file - there can be multiple
for /d /r %searchDirectory% %%v in (%searchFile%) do if exist "%%~fv" (
call :install "%%~fv"
)
echo.
echo -----------------------------------------------------------------------------------------
echo.
echo -----------------------------------------------------------------------------------------
echo.
echo Installation completed! Your IntelliJ is now solarized.
pause
exit 0
:install
echo.
echo Would you like to install the solarized UI theme for the following version?
echo.
echo %1
echo.
set /p choice="> Type [Y]es or [N]o: "
if /i "%choice:~0,1%"=="Y" (
echo.
echo Patching your idea.jar. A backup is created next to the patched file.
echo.
copy %1 %1.bak >nul
jar -ufv %1 com/intellij/ide/ui/laf/darcula/darcula.properties
jar -ufv %1 com/intellij/ide/ui/laf/intellijlaf.properties
)
echo.
echo -----------------------------------------------------------------------------------------
goto :eof