generated from ScoopInstaller/BucketTemplate
-
Notifications
You must be signed in to change notification settings - Fork 33
Expand file tree
/
Copy pathjava.pre_install.ps1
More file actions
28 lines (25 loc) · 764 Bytes
/
java.pre_install.ps1
File metadata and controls
28 lines (25 loc) · 764 Bytes
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
#include unzip.ps1
$target = "$dir\jdk-8u65-windows-x64.exe"
unzip $target $dir
@('Tools.zip', 'installerexe') | % { unzip "$dir\$_" $dir }
while (1) {
try {
Write-Host "Listing *.pack files"
[array] $files = dir -Recurse "$dir\*.pack" | Select -Expand FullName
if ($files.Length -gt 0) {
$files | % {
$fp = $_
$o = [IO.Path]::ChangeExtension($fp, 'jar')
Write-Host "Unpacking $fp"
& "$dir\bin\unpack200.exe" $fp $o
Remove-Item $fp
}
}
break
} catch {
# It seems listing the *.pack files will get `Access denied` error initially, but will succeed after a while
$interval = 5
Write-Warning "$($_.Exception.Message), retrying in $interval seconds"
Start-Sleep -seconds $interval
}
}