|
1 | 1 | { |
2 | 2 | "version": "8.16.2", |
3 | | - "description": "Powerful and easy to use e-book manager", |
| 3 | + "description": "Powerful and easy to use e-book manager.", |
4 | 4 | "homepage": "https://calibre-ebook.com", |
5 | 5 | "license": { |
6 | | - "identifier": "GPL-3.0-only", |
7 | | - "url": "https://github.com/kovidgoyal/calibre/blob/master/LICENSE" |
| 6 | + "identifier": "GPL-3.0-or-later", |
| 7 | + "url": "https://github.com/kovidgoyal/calibre/blob/HEAD/LICENSE" |
8 | 8 | }, |
| 9 | + "notes": [ |
| 10 | + "To register the URL protocol handler, please execute the following command:", |
| 11 | + "- `reg import \"$dir\\register-url-handler.reg\"`" |
| 12 | + ], |
9 | 13 | "architecture": { |
10 | 14 | "64bit": { |
11 | | - "url": "https://download.calibre-ebook.com/8.16.2/calibre-portable-installer-8.16.2.exe", |
12 | | - "hash": "sha512:010ee58b53ecb9c208f7229b73e86c1b98a67e3b3ee7691a1e19c277fd34c0d434acbe367aab9389ad916b4d373adf34eb07a9ec35f14b1b3e69fa982de83073" |
| 15 | + "url": "https://download.calibre-ebook.com/8.16.2/calibre-64bit-8.16.2.msi#/dl.msi_", |
| 16 | + "hash": "sha512:e028a251b382dc91f34f7979cece2c48e65fb03c7d75a51d83afa37ce416d87c724f83d68e709cbe71c632dd5323925ddd553dba482282e200ce5c1b9327ad93" |
13 | 17 | } |
14 | 18 | }, |
| 19 | + "pre_install": [ |
| 20 | + "@('.tmp', '.cache', 'Calibre Settings').ForEach({ ensure \"$persist_dir\\$_\" | Out-Null })", |
| 21 | + "if ((Test-Path \"$persist_dir\\Calibre Settings\\*\") `", |
| 22 | + " -or ($env:CALIBRE_CONFIG_DIRECTORY -eq \"$persist_dir\\Calibre Settings\")) { return }", |
| 23 | + "if ($null -ne $env:CALIBRE_CONFIG_DIRECTORY -and (Test-Path \"$env:CALIBRE_CONFIG_DIRECTORY\\*\")) {", |
| 24 | + " Write-Host \"`nINFO Migrating Calibre Configurations to \"$persist_dir\\Calibre Settings\"...\" -ForegroundColor darkgray", |
| 25 | + " Copy-Item -Path \"$env:CALIBRE_CONFIG_DIRECTORY\\*\" -Destination \"$persist_dir\\Calibre Settings\" -Force -Recurse", |
| 26 | + " return", |
| 27 | + "}", |
| 28 | + "if (Test-Path \"$env:APPDATA\\calibre\\*\") {", |
| 29 | + " Write-Host \"`nINFO Migrating Calibre Configurations to \"$persist_dir\\Calibre Settings\"...\" -ForegroundColor darkgray", |
| 30 | + " Copy-Item -Path \"$env:APPDATA\\calibre\\*\" -Destination \"$persist_dir\\Calibre Settings\" -Force -Recurse", |
| 31 | + "}" |
| 32 | + ], |
15 | 33 | "installer": { |
16 | 34 | "script": [ |
17 | | - "Start-Process -FilePath \"$dir\\$fname\" -ArgumentList @($env:PUBLIC) -Wait", |
18 | | - "Move-Item -Path \"$env:PUBLIC\\Calibre Portable\\*\" -Destination $dir -Force", |
19 | | - "Remove-Item -Path \"$dir\\$fname\", \"$env:PUBLIC\\Calibre Portable\" -Recurse -Force -ErrorAction SilentlyContinue", |
20 | | - "Icacls $dir /t /c /reset | Out-Null" |
| 35 | + "$default_dir = \"$env:APPDATA\\calibre\"", |
| 36 | + "$ErrorActionPreference = 'SilentlyContinue'", |
| 37 | + "$configuration_dir = \"$persist_dir\\Calibre Settings\"", |
| 38 | + "$config_link_target_dir = (Get-Item -Path $default_dir).Target", |
| 39 | + "$is_different = $config_link_target_dir -ne $configuration_dir", |
| 40 | + "$link_target_dir = @($config_link_target_dir) * $is_different", |
| 41 | + "$is_different = $env:CALIBRE_CONFIG_DIRECTORY -ne $configuration_dir", |
| 42 | + "$extra_config_dir = @($env:CALIBRE_CONFIG_DIRECTORY) * $is_different", |
| 43 | + "@($default_dir) + $link_target_dir + $extra_config_dir | Remove-Item -Force -Recurse", |
| 44 | + "Expand-MsiArchive -Path \"$dir\\$fname\" -DestinationPath \"$dir\\Calibre\" -ExtractDir 'PFiles64\\Calibre2' -Removal" |
21 | 45 | ] |
22 | 46 | }, |
| 47 | + "post_install": [ |
| 48 | + "$calibre_path = (Join-Path -Path $dir -ChildPath 'Calibre') -replace '\\\\', '\\\\'", |
| 49 | + "Get-ChildItem -Path \"$bucketsdir\\extras\\scripts\\$app\" -Filter '*.reg' -File | ForEach-Object {", |
| 50 | + " $content = Get-Content -Path $_.FullName -Encoding utf8", |
| 51 | + " if ($_.Name -ne 'unregister-file-associations.reg' `", |
| 52 | + " -and $global) { $content = $content -replace 'HKEY_CURRENT_USER', 'HKEY_LOCAL_MACHINE' }", |
| 53 | + " $content -replace '{{calibre_dir}}', $calibre_path | Set-Content -Path \"$dir\\$($_.Name)\" -Encoding utf8", |
| 54 | + "}", |
| 55 | + "if (-not (Test-Path \"$persist_dir\\Calibre Settings\\global.py.json\")) {", |
| 56 | + " New-Item -Path \"$persist_dir\\Calibre Settings\\global.py.json\" -ItemType File -Force | Out-Null", |
| 57 | + " $cfg = @{ 'library_path'= \"$persist_dir\\Calibre Library\" } | ConvertTo-Json", |
| 58 | + " Set-Content -Path \"$persist_dir\\Calibre Settings\\global.py.json\" -Value $cfg -Encoding utf8", |
| 59 | + "} else {", |
| 60 | + " $cfg = Get-Content -Path \"$persist_dir\\Calibre Settings\\global.py.json\" -Encoding utf8 | ConvertFrom-Json", |
| 61 | + " if ($cfg.library_path -eq \"$persist_dir\\Calibre Library\") { return }", |
| 62 | + " if (-not (Test-Path \"$persist_dir\\Calibre Library\\*\") -and (Test-Path \"$($cfg.library_path)\\*\")) {", |
| 63 | + " Write-Host \"`nINFO Migrating Calibre Library to \"$persist_dir\\Calibre Library\"...\" -ForegroundColor darkgray", |
| 64 | + " Copy-Item -Path \"$($cfg.library_path)\\*\" -Destination \"$persist_dir\\Calibre Library\" -Force -Recurse", |
| 65 | + " }", |
| 66 | + " Remove-Item -Path $cfg.library_path -Force -Recurse -ErrorAction SilentlyContinue", |
| 67 | + " $cfg.library_path = \"$persist_dir\\Calibre Library\"", |
| 68 | + " $cfg | ConvertTo-Json | Set-Content -Path \"$persist_dir\\Calibre Settings\\global.py.json\" -Encoding utf8", |
| 69 | + "}" |
| 70 | + ], |
| 71 | + "env_set": { |
| 72 | + "CALIBRE_TEMP_DIR": "$persist_dir\\.tmp", |
| 73 | + "CALIBRE_CACHE_DIRECTORY": "$persist_dir\\.cache", |
| 74 | + "CALIBRE_CONFIG_DIRECTORY": "$persist_dir\\Calibre Settings" |
| 75 | + }, |
23 | 76 | "bin": [ |
24 | | - [ |
25 | | - "calibre-portable.exe", |
26 | | - "calibre" |
27 | | - ], |
28 | | - "calibre-portable.exe", |
29 | | - "Calibre\\calibre-complete.exe", |
| 77 | + "Calibre\\calibre.exe", |
30 | 78 | "Calibre\\calibre-customize.exe", |
31 | | - "Calibre\\calibredb.exe", |
32 | 79 | "Calibre\\calibre-debug.exe", |
33 | | - "Calibre\\calibre-parallel.exe", |
34 | 80 | "Calibre\\calibre-server.exe", |
35 | 81 | "Calibre\\calibre-smtp.exe", |
| 82 | + "Calibre\\calibredb.exe", |
36 | 83 | "Calibre\\ebook-convert.exe", |
37 | 84 | "Calibre\\ebook-device.exe", |
38 | 85 | "Calibre\\ebook-edit.exe", |
|
41 | 88 | "Calibre\\ebook-viewer.exe", |
42 | 89 | "Calibre\\fetch-ebook-metadata.exe", |
43 | 90 | "Calibre\\lrf2lrs.exe", |
44 | | - "Calibre\\lrs2lrf.exe", |
45 | 91 | "Calibre\\lrfviewer.exe", |
| 92 | + "Calibre\\lrs2lrf.exe", |
46 | 93 | "Calibre\\markdown-calibre.exe", |
47 | 94 | "Calibre\\web2disk.exe" |
48 | 95 | ], |
49 | 96 | "shortcuts": [ |
50 | 97 | [ |
51 | | - "calibre-portable.exe", |
52 | | - "Calibre" |
| 98 | + "Calibre\\calibre.exe", |
| 99 | + "Calibre - E-book Management\\Calibre - E-book Management" |
53 | 100 | ], |
54 | 101 | [ |
55 | 102 | "Calibre\\ebook-edit.exe", |
56 | | - "Calibre E-Book Editor" |
| 103 | + "Calibre - E-book Management\\E-Book Editor" |
57 | 104 | ], |
58 | 105 | [ |
59 | 106 | "Calibre\\ebook-viewer.exe", |
60 | | - "Calibre E-Book Viewer" |
| 107 | + "Calibre - E-book Management\\E-Book Viewer" |
61 | 108 | ], |
62 | 109 | [ |
63 | 110 | "Calibre\\lrfviewer.exe", |
64 | | - "Calibre LRF Viewer" |
| 111 | + "Calibre - E-book Management\\LRF Viewer" |
65 | 112 | ] |
66 | 113 | ], |
67 | 114 | "persist": [ |
68 | 115 | "Calibre Library", |
69 | 116 | "Calibre Settings" |
70 | 117 | ], |
| 118 | + "uninstaller": { |
| 119 | + "script": [ |
| 120 | + "if ($cmd -eq 'uninstall') {", |
| 121 | + " reg import \"$dir\\unregister-url-handler.reg\"", |
| 122 | + " reg import \"$dir\\unregister-file-associations.reg\"", |
| 123 | + "}" |
| 124 | + ] |
| 125 | + }, |
71 | 126 | "checkver": { |
72 | 127 | "github": "https://github.com/kovidgoyal/calibre" |
73 | 128 | }, |
74 | 129 | "autoupdate": { |
75 | 130 | "architecture": { |
76 | 131 | "64bit": { |
77 | | - "url": "https://download.calibre-ebook.com/$version/calibre-portable-installer-$version.exe", |
| 132 | + "url": "https://download.calibre-ebook.com/$version/calibre-64bit-$version.msi#/dl.msi_", |
78 | 133 | "hash": { |
79 | 134 | "url": "https://calibre-ebook.com/signatures/$basename.sha512" |
80 | 135 | } |
|
0 commit comments