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