-
Notifications
You must be signed in to change notification settings - Fork 1
/
amadeusy-bat.json
55 lines (55 loc) · 2.49 KB
/
amadeusy-bat.json
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
{
"version": "1.0",
"description": "AmadeuSY synth.bat",
"homepage": "https://airesearcher113.wixsite.com/amadeusy",
"license": [
{
"identifier": "Proprietary",
"url": "https://drive.google.com/file/d/1bcEjB04yYDPC5ojOE1ekaObjKV0ojE5t/view?usp=sharing"
}
],
"url": "https://airesearcher113.wixsite.com/amadeusy",
"hash": "39890d7f3e78b8acbf5803f325f30d8d5785a7ab9e5be62bee2219073c3c3067",
"installer": {
"script": [
"$id = \"17BxdRE66N22OIvwu7E3Bx9TvXDwT4z2Y\"",
"$filename = \"synth.bat\"",
"$hash =\"e7bbad115949512c07d8c798876423ebb910d252e4931ce21b9dc60155575389\"",
"$file = $cachedir + \"\\\" + $filename",
"if(Test-Path -Path $file -PathType Leaf){",
" Write-Host \"Checking hash of $file ... \" -NoNewline",
" $filehash = (Get-FileHash -Path $file -Algorithm SHA256 | Select-Object -ExpandProperty Hash).ToLower()",
" if([string]::IsNullOrEmpty($hash)){",
" Write-Host \"skip\" -ForegroundColor Yellow",
" Write-Warning \"No hash in manifest. SHA256 for '${filename}' is:\"",
" Write-Host \" $filehash\" -ForegroundColor Yellow",
" }else{",
" if($hash -eq $filehash){",
" Write-Host \"ok\" -ForegroundColor Green",
" }else{",
" Write-Host \"error\" -ForegroundColor Red",
" Write-Warning \"Cache file corrupted for '${filename}'\"",
" Remove-Item -Path $file -Force",
" }",
" }",
"}",
"if(-not(Test-Path -Path $file -PathType Leaf)){",
" Write-Host Download file $id from Google Drive",
" $response = Invoke-WebRequest -Uri \"https://drive.google.com/uc?export=download&id=${id}\"",
" if($response -match 'id=\"downloadForm\" action=\"([^\"]+)\" method=\"post\"'){",
" $url = $matches[1].Replace(\"&\",\"&\")",
" $web = New-Object net.webclient",
" $web.Downloadfile($url, \"${file}.tmp\")",
" Rename-Item -Path \"${file}.tmp\" -NewName $filename",
" if([string]::IsNullOrEmpty($hash)){",
" $filehash = (Get-FileHash -Path $file -Algorithm SHA256 | Select-Object -ExpandProperty Hash).ToLower()",
" Write-Warning \"No hash in manifest. SHA256 for '${filename}' is:\"",
" Write-Host \" $filehash\" -ForegroundColor Yellow",
" }",
" }",
"}",
"Copy-Item -Force -Recurse -Path $file -Destination $dir"
],
"bin": "synth.bat"
}
}