|
1 | 1 | { |
2 | 2 | "version": "0.7.1", |
3 | | - "description": "An easy to use GUI for dnscrypt-proxy", |
4 | | - "homepage": "https://simplednscrypt.org/", |
5 | | - "license": "MIT", |
| 3 | + "description": "A simple management tool to configure dnscrypt-proxy on windows based systems.", |
| 4 | + "homepage": "https://simplednscrypt.org", |
| 5 | + "license": { |
| 6 | + "identifier": "MIT", |
| 7 | + "url": "https://github.com/bitbeans/SimpleDnsCrypt/blob/HEAD/LICENSE.md" |
| 8 | + }, |
6 | 9 | "suggest": { |
7 | | - "vcredist": "extras/vcredist2022" |
| 10 | + "Microsoft Visual C++ 2015-2022 Redistributable": "extras/vcredist2022" |
8 | 11 | }, |
9 | 12 | "architecture": { |
10 | 13 | "64bit": { |
|
17 | 20 | } |
18 | 21 | }, |
19 | 22 | "pre_install": [ |
20 | | - "if (!(Test-Path \"$env:LOCALAPPDATA\\SimpleDnsCrypt\")) { New-Item \"$env:LOCALAPPDATA\\SimpleDnsCrypt\" -ItemType Directory -Force | Out-Null }", |
21 | | - "'blacklist.txt', 'blocked.log', 'query.log', 'domain-blacklist.txt', 'domain-whitelist.txt' | ForEach-Object {", |
22 | | - " if (!(Test-Path \"$persist_dir\\$_\")) { New-Item \"$dir\\$_\" | Out-Null }", |
| 23 | + "if (Test-Path -Path \"$dir\\APPDIR\" -PathType Container) {", |
| 24 | + " Copy-Item -Path \"$dir\\APPDIR\\*\" -Destination $dir -Force -Recurse", |
| 25 | + " Remove-Item -Path \"$dir\\APPDIR\" -Recurse -Force -ErrorAction SilentlyContinue", |
| 26 | + "}", |
| 27 | + "'*.log', '*.txt' | ForEach-Object {", |
| 28 | + " if (Test-Path -Path \"$persist_dir\\$_\" -PathType Leaf) {", |
| 29 | + " Copy-Item -Path \"$persist_dir\\$_\" -Destination \"$dir\\dnscrypt-proxy\" -Force", |
| 30 | + " }", |
23 | 31 | "}" |
24 | 32 | ], |
25 | 33 | "shortcuts": [ |
|
28 | 36 | "Simple DnsCrypt" |
29 | 37 | ] |
30 | 38 | ], |
31 | | - "bin": "SimpleDnsCrypt.exe", |
32 | | - "persist": [ |
33 | | - "dnscrypt-proxy\\dnscrypt-proxy.toml", |
34 | | - "dnscrypt-proxy\\blacklist.txt", |
35 | | - "dnscrypt-proxy\\blocked.log", |
36 | | - "dnscrypt-proxy\\query.log", |
37 | | - "dnscrypt-proxy\\domain-blacklist.txt", |
38 | | - "dnscrypt-proxy\\domain-whitelist.txt" |
39 | | - ], |
| 39 | + "persist": "dnscrypt-proxy\\dnscrypt-proxy.toml", |
40 | 40 | "pre_uninstall": [ |
41 | | - "if (!(is_admin)) { error \"$app requires admin rights to $cmd\"; break }", |
42 | | - "", |
43 | | - "Start-Process -Wait \"$dir\\Uninstall.exe\" | Out-Null", |
44 | | - "if (Get-Process -Name 'SimpleDnsCrypt' -ErrorAction SilentlyContinue) { Stop-Process -Name 'SimpleDnsCrypt' | Out-Null }", |
45 | | - "$service = Get-Service -Name 'dnscrypt-proxy' -ErrorAction SilentlyContinue", |
46 | | - "if (($service) -and ($service.Status -ne 'Stopped')) {", |
47 | | - " if (!(is_admin)) { error 'Admin rights are required to stop dnscrypt-proxy service'; break }", |
48 | | - " Stop-Service -Name 'dnscrypt-proxy' | Out-Null", |
49 | | - "}", |
50 | | - "if (($service) -and ($cmd -eq 'uninstall')) {", |
51 | | - " if (!(is_admin)) { error 'Admin rights are required to remove dnscrypt-proxy service'; break }", |
52 | | - " Remove-Service -Name 'dnscrypt-proxy' | Out-Null", |
| 41 | + "'*.log', '*.txt' | ForEach-Object {", |
| 42 | + " if (Test-Path -Path \"$dir\\dnscrypt-proxy\\$_\" -PathType Leaf) {", |
| 43 | + " Copy-Item -Path \"$dir\\dnscrypt-proxy\\$_\" -Destination $persist_dir -Force", |
| 44 | + " }", |
53 | 45 | "}" |
54 | 46 | ], |
| 47 | + "uninstaller": { |
| 48 | + "script": [ |
| 49 | + "$base_service_name = 'dnscrypt-proxy'", |
| 50 | + "$path_regex = [regex]::Escape((Split-Path -Path $dir -Parent))", |
| 51 | + "Stop-Process -Name 'SimpleDnsCrypt' -Force -ErrorAction SilentlyContinue", |
| 52 | + "if ($PSVersionTable.PSVersion -ge [version]::new(6, 0)) {", |
| 53 | + " $services = Get-Service -Name \"*$base_service_name*\" -ErrorAction SilentlyContinue", |
| 54 | + "} else {", |
| 55 | + " $name_filter = \"Name like '%$base_service_name%'\"", |
| 56 | + " $services = Get-CimInstance -ClassName Win32_Service -Filter $name_filter -ErrorAction SilentlyContinue |", |
| 57 | + " Select-Object -Property *, @{ Name = 'BinaryPathName'; Expression = { $_.PathName } }", |
| 58 | + "}", |
| 59 | + "$service = $services | Where-Object { $_.BinaryPathName -match $path_regex }", |
| 60 | + "if ($null -ne $service) {", |
| 61 | + " if (-not (is_admin)) { abort \"`n[ERROR] $app requires admin rights to $cmd.\" }", |
| 62 | + " Stop-Service -Name $service.Name -Force -ErrorAction SilentlyContinue", |
| 63 | + " Stop-Process -Name 'dnscrypt-proxy' -Force -ErrorAction SilentlyContinue", |
| 64 | + " Start-Sleep -Milliseconds 1500", |
| 65 | + " if ($cmd -ne 'uninstall') { return }", |
| 66 | + " if ($PSVersionTable.PSVersion -ge [version]::new(6, 0)) {", |
| 67 | + " Remove-Service -Name 'dnscrypt-proxy' -ErrorAction SilentlyContinue", |
| 68 | + " } else {", |
| 69 | + " Start-Process -FilePath 'sc.exe' -ArgumentList @('delete', 'dnscrypt-proxy') -NoNewWindow -Wait", |
| 70 | + " }", |
| 71 | + "}" |
| 72 | + ] |
| 73 | + }, |
55 | 74 | "checkver": { |
56 | 75 | "github": "https://github.com/bitbeans/SimpleDnsCrypt" |
57 | 76 | }, |
|
0 commit comments