|
34 | 34 |
|
35 | 35 | $ToolsAreRequired =
|
36 | 36 | !(Test-Path -Path $AndroidSDKDirectory) -Or
|
37 |
| - !(Test-Path -Path $AndroidStudioDirectory) -Or |
38 |
| - !(Test-Path -Path $OracleJDKDirectory) |
| 37 | + !(Test-Path -Path $AndroidStudioDirectory) |
39 | 38 |
|
40 | 39 | if ($ToolsAreRequired -And !(Test-Path -Path $aria2Directory))
|
41 | 40 | {
|
@@ -81,81 +80,6 @@ if (!(Test-Path -Path $AndroidStudioDirectory))
|
81 | 80 | & ".\$7zExecutable" 'x' $AndroidStudioArchive '-o*' '-bso0' '-bsp1' '-y'
|
82 | 81 | }
|
83 | 82 |
|
84 |
| -# |
85 |
| -# Download and unpack an Oracle JDK installer without administrative rights. |
86 |
| -# |
87 |
| - |
88 |
| -if (!(Test-Path -Path $OracleJDKDirectory)) |
89 |
| -{ |
90 |
| - if (!(Test-Path -Path $OracleJDKInternalArchive)) |
91 |
| - { |
92 |
| - if (!(Test-Path -Path $OracleJDKInternalCAB)) |
93 |
| - { |
94 |
| - if (!(Test-Path -Path $OracleJDKInstaller)) |
95 |
| - { |
96 |
| - # |
97 |
| - # Download the Oracle JDK installer accepting the |
98 |
| - # |
99 |
| - # `Oracle Binary Code License Agreement for Java SE` |
100 |
| - # |
101 |
| - |
102 |
| - & ".\$aria2Directory\$aria2Executable" --header=$($OracleJDKdlCookie) -c -o $OracleJDKInstaller $OracleJDKURL |
103 |
| - |
104 |
| - } |
105 |
| - |
106 |
| - # |
107 |
| - # Unpack the Oracle JDK installer with 7-Zip. |
108 |
| - # |
109 |
| - |
110 |
| - Write-Output "Unpack JDK installer" |
111 |
| - & ".\$7zDirectory\$7zExecutable" ` |
112 |
| - 'e' $OracleJDKInstaller ` |
113 |
| - "$OracleJDKInternalCABPath\$OracleJDKInternalCAB" ` |
114 |
| - '-y' |
115 |
| - } |
116 |
| - |
117 |
| - # |
118 |
| - # Unpack the Oracle JDK Tools CAB with 7-Zip. |
119 |
| - # |
120 |
| - |
121 |
| - Write-Output "Unpack JDK archive" |
122 |
| - & ".\$7zDirectory\$7zExecutable" ` |
123 |
| - 'e' $OracleJDKInternalCAB ` |
124 |
| - "$OracleJDKInternalArchive" '-y' |
125 |
| - } |
126 |
| - |
127 |
| - Write-Output "Unpack JDK" |
128 |
| - & ".\$7zDirectory\$7zExecutable" 'x' $OracleJDKInternalArchive ` |
129 |
| - "-o$OracleJDKDirectory" '-y' |
130 |
| -} |
131 |
| - |
132 |
| -# |
133 |
| -# Unpack Oracle JDK `.pack` files with the unpack200 |
134 |
| -# utility bundled with the JDK. |
135 |
| -# |
136 |
| - |
137 |
| -Write-Output "Expand JDK files" |
138 |
| -$GetChildItemParameters = @{ |
139 |
| - Path = $OracleJDKDirectory; |
140 |
| - Filter = '*.pack'; |
141 |
| -} |
142 |
| -$PackFiles = |
143 |
| - Get-ChildItem @GetChildItemParameters -Recurse |
144 |
| - |
145 |
| -if ($PackFiles) |
146 |
| -{ |
147 |
| - foreach ($File in $PackFiles) |
148 |
| - { |
149 |
| - $PackFileName = |
150 |
| - $File.FullName |
151 |
| - $JarFileName = |
152 |
| - "$($File.DirectoryName)\$($File.BaseName).jar" |
153 |
| - |
154 |
| - & "$OracleJDKBinariesDirectory\unpack200" '-r' ` |
155 |
| - $PackFileName $JarFileName |
156 |
| - } |
157 |
| -} |
158 |
| - |
159 | 83 | #
|
160 | 84 | # Create a new SDK directory.
|
161 | 85 | #
|
@@ -237,9 +161,7 @@ SET USERPROFILE=%~dp0$PortableHomeDirectory
|
237 | 161 | SET ANDROID_HOME=%~dp0$AndroidSDKDirectory
|
238 | 162 | SET ANDROID_SDK_HOME=%~dp0$PortableHomeDirectory
|
239 | 163 | SET GRADLE_USER_HOME=%~dp0$GradleUserHomeDirectory
|
240 |
| -SET JAVA_HOME=%~dp0$OracleJDKDirectory |
241 | 164 |
|
242 |
| -SET PATH=%~dp0$OracleJDKBinariesDirectory;%PATH% |
243 | 165 | SET PATH=%~dp0$AndroidStudioBinariesDirectory;%PATH%
|
244 | 166 | SET PATH=$AndroidSDKBinariesPaths%PATH%
|
245 | 167 |
|
|
0 commit comments