-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(autoupdate): add multiple URL/hash/extract_dir... support for autoupdate #3518
Conversation
Works with the above manifest: Test results
It also works with a hacked kitty.json:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Passed two test cases (irfanview & kitty) locally.
Ready to review and merge. Will not add functions to this PR. Test ResultsD:\Scoop\buckets\main [master ↓3 +1 ~1 -0 !]
λ .\bin\checkver mongodb -f
mongodb: 4.0.10 (scoop version is 4.0.10)
Forcing autoupdate!
Autoupdating mongodb
Searching hash for mongodb-win32-x86_64-2008plus-ssl-4.0.10-signed.msi in https://fastdl.mongodb.org/win32/mongodb-win32-x86_64-2008plus-ssl-4.0.10-signed.msi.sha256
D:\Scoop\buckets\main [master ↓3 +1 ~1 -0 !]
λ .\bin\checkver mongodb -f
mongodb: 4.0.10 (scoop version is 4.0.10)
Forcing autoupdate!
Autoupdating mongodb
Searching hash for mongodb-win32-x86_64-2008plus-ssl-4.0.10-signed.msi in https://fastdl.mongodb.org/win32/mongodb-win32-x86_64-2008plus-ssl-4.0.10-signed.msi.sha256
Found: d1ddac7ba6e2fbdfaaa0a787b83c165d4ad61795c051dc0f3142717a0b6a3707 using Extract Mode
No updates for mongodb
D:\Scoop\buckets\main [master ↓3 +1 ~1 -0 !]
λ .\bin\checkver 7zip -f
7zip: 19.00 (scoop version is 19.00)
Forcing autoupdate!
Autoupdating 7zip
Downloading 7z1900.msi to compute hashes!
7z1900.msi (1.3 MB) [===============================================================================================================================] 100%
Computed hash: b49d55a52bc0eab14947c8982c413d9be141c337da1368a24aa0484cbb5e89cd
Downloading 7z1900-x64.msi to compute hashes!
7z1900-x64.msi (1.7 MB) [===========================================================================================================================] 100%
Computed hash: a7803233eedb6a4b59b3024ccf9292a6fffb94507dc998aa67c5b745d197a5dc
No updates for 7zip
D:\Scoop\buckets\main [master ↓3 +1 ~1 -0 !]
λ cd ..\extras
D:\Scoop\buckets\extras [master ↓3 +2 ~2 -0 !]
λ .\bin\checkver irfanview -f
irfanview: 4.53 (scoop version is 4.53)
Forcing autoupdate!
Autoupdating irfanview
Searching hash for iview453.zip in https://www.irfanview.com/main_download_engl.htm
Found: 89c0d29424299f9b0d36248884059baf815f0b5d4adc9c3b426f61fe68f1444a using Extract Mode
Searching hash for iview453_plugins.zip in https://www.irfanview.com/plugins.htm
Found: 1ec241d26a0f061aa5499c606967690de8979c82fdce4a5724b4e18daa099de3 using Extract Mode
Searching hash for iview453_x64.zip in https://www.irfanview.com/64bit.htm
Found: 941056da4f50df44eeef46ca875255bd3d09c3aaf1bdfffad5f65de0a515ff02 using Extract Mode
Searching hash for iview453_plugins_x64.zip in https://www.irfanview.com/64bit.htm
Found: d5e8ae1734264287e7b442fc062899c206c54bbd423304e125c4b1d1c58d28b1 using Extract Mode
No updates for irfanview PS: Yes, if nothing changed, |
Removed JSON example```json "autoupdateArch": { "type": "object", "properties": { "url": { "$ref": "#/definitions/autoupdateUriOrArrayOfAutoupdateUris" }, "hash": { "$ref": "#/definitions/hashExtractionOrArrayOfHashExtractions" }, "extract_dir": { "$ref": "#/definitions/stringOrArrayOfStrings" }, "extract_to": { "$ref": "#/definitions/stringOrArrayOfStrings" }, "env_add_path": { "$ref": "#/definitions/stringOrArrayOfStrings" }, "env_set": { "type": "object" }, "bin": { "$ref": "#/definitions/stringOrArrayOfStringsOrAnArrayOfArrayOfStrings" }, "shortcuts": { "$ref": "#/definitions/shortcutsArray" }, "installer": { "$ref": "#/definitions/installer" }, "post_install": { "$ref": "#/definitions/stringOrArrayOfStrings" }, "pre_install": { "$ref": "#/definitions/stringOrArrayOfStrings" }, "uninstaller": { "$ref": "#/definitions/uninstaller" } } }, "autoupdate": { "type": "object", "allOf": [ { "$ref": "#/definitions/autoupdateArch" }, { "properties": { "note": { "$ref": "#/definitions/stringOrArrayOfStrings" }, "architecture": { "type": "object", "additionalProperties": false, "properties": { "32bit": { "$ref": "#/definitions/autoupdateArch" }, "64bit": { "$ref": "#/definitions/autoupdateArch" } } } } } ] }, ``` |
I've fix it, but I found something else may be broken by some commits... I need to do a more deeper review... |
Are you sure you want to have installer scripts in autoupdate? It will introduce more messy manifests. I really do not see valid use case for them. |
I updated kitty.json and updated it, and installed without issue: Test results>powershell -file checkver.ps1 -Dir . kitty -u
kitty: 0.71.0.6 (scoop version is 0.71.0.5) autoupdate available
Autoupdating kitty
Downloading genpass.exe to compute hashes!
genpass.exe (42.9 KB) [===========================================================================================================================================================================================================================] 100%
Computed hash: 13673f67164c1d0431ffdb8da93c97e64e18f0458eb7d30ebd52ee18f72ef94e
Downloading kittygen.exe to compute hashes!
kittygen.exe (454.5 KB) [=========================================================================================================================================================================================================================] 100%
Computed hash: 4e3ccf07081cf3118669fdce720b6a2766b784dec23c3e8ee902d898d6b1c951
Downloading kageant.exe to compute hashes!
kageant.exe (364.0 KB) [==========================================================================================================================================================================================================================] 100%
Computed hash: 83019314f8f925990ac2f7ff041683acdc29a23bf370c0dd40e40b2ea6514f8b
Downloading kitty.exe to compute hashes!
kitty.exe (649.0 KB) [============================================================================================================================================================================================================================] 100%
Computed hash: 770fb13def6fab82fcaacede07181c9307bd790978a3286c256d6b1c8f80ccc7
Downloading klink.exe to compute hashes!
klink.exe (281.0 KB) [============================================================================================================================================================================================================================] 100%
Computed hash: 4c2260ea2347346ada6c120f9371f1870610dda30feabe56dd92378f8f02a0c4
Downloading kscp.exe to compute hashes!
kscp.exe (781.0 KB) [=============================================================================================================================================================================================================================] 100%
Computed hash: 49a6de18c88f9864a97bc08b4072531c693c73beda1f7f9243b10fc845c1e8a1
Downloading ksftp.exe to compute hashes!
ksftp.exe (791.5 KB) [============================================================================================================================================================================================================================] 100%
Computed hash: b0e0602d308a135a7cd626172f05ce5bf8b1f9e05b792317f4bcb05ae3af3afe
Writing updated kitty manifest
>call scoop.cmd install kitty.json
Installing 'kitty' (0.71.0.6) [64bit]
Loading genpass.exe from cache
Checking hash of genpass.exe ... ok.
Loading kittygen.exe from cache
Checking hash of kittygen.exe ... ok.
Loading kageant.exe from cache
Checking hash of kageant.exe ... ok.
Loading kitty.exe from cache
Checking hash of kitty.exe ... ok.
Loading klink.exe from cache
Checking hash of klink.exe ... ok.
Loading kscp.exe from cache
Checking hash of kscp.exe ... ok.
Loading ksftp.exe from cache
Checking hash of ksftp.exe ... ok.
Running pre-install script...
Linking C:\scoop\apps\kitty\current => C:\scoop\apps\kitty\0.71.0.6
Creating shim for 'genpass'.
Creating shim for 'kittygen'.
Creating shim for 'kageant'.
Creating shim for 'kitty'.
Creating shim for 'klink'.
Creating shim for 'kscp'.
Creating shim for 'ksftp'.
Creating shortcut for KiTTY (kitty.exe)
Persisting Sessions
Persisting kitty.ini
'kitty' (0.71.0.6) was installed successfully!
</details> |
Closes #2390. Generated via ScoopInstaller/Scoop#3518
* kitty: Update to 0.71.0.6 (manually) Closes #2390. Generated via ScoopInstaller/Scoop#3518 * Add description, fix pre_install Per #2493 (review) * Remove autoupdate to pass tests
1c2d713
to
d03ff5c
Compare
@r15ch13 @Ash258 Current
"persist": [
[
"config-5.3.lua",
"config.lua"
]
],
"autoupdate": {
"persist": [
[
"config-$majorVersion.$minorVersion.lua",
"config.lua"
]
]
} And you could use all Internal Substitutable Variables in PS. Autoupdated properties are just defined in |
Maybe this is a use case? ScoopInstaller/Extras#2480 (comment) |
Noone talked about persist. I talked about scripts. I do not agree. This will result really junk manifest when you have tons of duplicated code for just one line of variable substitution. @linsui No it is not. Completely easy use case for gci. There is no need to use substitution of internal variables. Because then you need to have all that installer script in autoupdate. Which is completely nonsense. |
Look at this mess a3ca2c3. Completely non intuitive, ugly, non extendable manifest. Because user cannot write powershell scripts. |
You could just substitute only some line, e.g. first one or two lines. We can delete |
Remove all scripts from autoupdate. It is really not good idea to have them. For installer there could be only |
|
You are missing use case when url: https://path.com/to/archive.zip # This will be extracted
installer:
file: installerWithVersion1.3.5.exe # $fname is archive.zip, not installer....exe Now you need to do pre_install with |
Ping @r15ch13 |
Does this PR have been forgotten? |
I'll check it again and wait for @r15ch13 |
@rasa @rashil2000 I've tested it with following manifests and it works fine. irfanview{
"version": "4.58",
"license": {
"identifier": "Freeware",
"url": "https://www.irfanview.com/eula.htm"
},
"homepage": "https://www.irfanview.com/",
"architecture": {
"64bit": {
"url": [
"https://www.irfanview.info/files/iview458_x64.zip",
"https://www.irfanview.info/files/iview458_plugins_x64.zip"
],
"hash": [
"0c4e17336d800b1e072d8a0cb94957d673df11d1b526c6ce1f17aebc71f6dd76",
"92d7c18a6113e744f75249bd7f146d0afcb27183410a5d533f29286beaf5686e"
],
"shortcuts": [
[
"i_view64.exe",
"IrfanView"
]
],
"bin": [
[
"i_view64.exe",
"irfanview"
]
]
},
"32bit": {
"url": [
"https://www.irfanview.info/files/iview458.zip",
"https://www.irfanview.info/files/iview458_plugins.zip"
],
"hash": [
"e2d78f4d9b6ba7869dd5eb22e924655720474563ef78813929a54652ac59e28d",
"af67bb885578e91ce30f905cf68639d1c3a930ea980c78ebe4ef287094db5721"
],
"shortcuts": [
[
"i_view32.exe",
"IrfanView"
]
],
"bin": [
[
"i_view32.exe",
"irfanview"
]
]
}
},
"pre_install": [
"if (!(Test-Path(\"$dir/i_view64.ini\"))) {",
" New-Item \"$dir/i_view64.ini\" | Out-Null",
"}",
"if (!(Test-Path(\"$dir/i_view32.ini\"))) {",
" New-Item \"$dir/i_view32.ini\" | Out-Null",
"}"
],
"persist": [
"i_view64.ini",
"i_view32.ini",
"Languages"
],
"extract_to": [
"",
"Plugins"
],
"checkver": {
"url": "https://www.irfanview.com/",
"re": ">\\s*version\\s+([\\d.-]+)\\s*<"
},
"autoupdate": {
"architecture": {
"64bit": {
"url": [
"https://www.irfanview.info/files/iview$cleanVersion_x64.zip",
"https://www.irfanview.info/files/iview$cleanVersion_plugins_x64.zip"
],
"hash": {
"url": "https://www.irfanview.com/64bit.htm",
"regex": "(?sm)$basename.*?$sha256"
}
},
"32bit": {
"url": [
"https://www.irfanview.info/files/iview$cleanVersion.zip",
"https://www.irfanview.info/files/iview$cleanVersion_plugins.zip"
],
"hash": [
{
"url": "https://www.irfanview.com/main_download_engl.htm",
"regex": "(?sm)$basename.*?$sha256"
},
{
"url": "https://www.irfanview.com/plugins.htm",
"regex": "(?sm)$basename.*?$sha256"
}
]
}
}
}
} yori{
"version": "1.60",
"description": "CMD replacement shell that supports backquotes, job control, improves tab completion, file matching, aliases, command history, and more.",
"homepage": "http://www.malsmith.net/yori/",
"license": "MIT",
"architecture": {
"64bit": {
"url": [
"http://www.malsmith.net/download/?obj=yori/1.60/yori-ypm-amd64.cab#/ypm.7z",
"http://www.malsmith.net/download/?obj=yori/1.60/yori-core-amd64.cab#/core.7z",
"http://www.malsmith.net/download/?obj=yori/1.60/yori-typical-amd64.cab#/typical.7z",
"http://www.malsmith.net/download/?obj=yori/1.60/yori-extra-amd64.cab#/extra.7z",
"http://www.malsmith.net/download/?obj=yori/1.60/yori-completion-noarch.cab#/completion.7z"
],
"hash": [
"74f52c745998596ad50dcc3b51867b2c3cb9db52a898ad8b072e0050aba58071",
"4b7df7df443bf64759ef6ce422da2f83bbf5ffec77a72b2acbb4a53543299940",
"f9eaaacf9affc8285b79819d977697e73198f82a8d344428ac436d5a5c5e257b",
"2a83f5a92576d93a301fa6a38c628703324b3a8af56100d48cdbd44c93917041",
"8a6c75796d1f482f07c4b73f5243d7e3e52c67ca5b3b07ee62376abcfd82011f"
]
},
"32bit": {
"url": [
"http://www.malsmith.net/download/?obj=yori/1.60/yori-ypm-win32.cab#/ypm.7z",
"http://www.malsmith.net/download/?obj=yori/1.60/yori-core-win32.cab#/core.7z",
"http://www.malsmith.net/download/?obj=yori/1.60/yori-typical-win32.cab#/typical.7z",
"http://www.malsmith.net/download/?obj=yori/1.60/yori-extra-win32.cab#/extra.7z",
"http://www.malsmith.net/download/?obj=yori/1.60/yori-completion-noarch.cab#/completion.7z"
],
"hash": [
"54fff9392774bb29685503626d4f8a2610c07fdc36ac13ac67bc44f7ccc9b0fd",
"065d485d621362f98419857a58648373c7c283b320c0237d37cf082d5096cf35",
"e72fa905b3f75eaccb4bf67a891cddfa1e2f5a6ff1398f5e435d2aeffac4bbb8",
"73350e264d145ed8fc22bb885f096cae2d7de28e5060b76bc2e79cd23abe8792",
"8a6c75796d1f482f07c4b73f5243d7e3e52c67ca5b3b07ee62376abcfd82011f"
]
}
},
"bin": "yori.exe",
"persist": "YoriInit.d",
"shortcuts": [
[
"yori.exe",
"Yori"
]
],
"checkver": {
"url": "http://www.malsmith.net/yori/changelog/",
"regex": "<P>([\\d.]+)"
},
"autoupdate": {
"architecture": {
"64bit": {
"url": [
"http://www.malsmith.net/download/?obj=yori/$version/yori-ypm-amd64.cab#/ypm.7z",
"http://www.malsmith.net/download/?obj=yori/$version/yori-core-amd64.cab#/core.7z",
"http://www.malsmith.net/download/?obj=yori/$version/yori-typical-amd64.cab#/typical.7z",
"http://www.malsmith.net/download/?obj=yori/$version/yori-extra-amd64.cab#/extra.7z",
"http://www.malsmith.net/download/?obj=yori/$version/yori-completion-noarch.cab#/completion.7z"
]
},
"32bit": {
"url": [
"http://www.malsmith.net/download/?obj=yori/$version/yori-ypm-win32.cab#/ypm.7z",
"http://www.malsmith.net/download/?obj=yori/$version/yori-core-win32.cab#/core.7z",
"http://www.malsmith.net/download/?obj=yori/$version/yori-typical-win32.cab#/typical.7z",
"http://www.malsmith.net/download/?obj=yori/$version/yori-extra-win32.cab#/extra.7z",
"http://www.malsmith.net/download/?obj=yori/$version/yori-completion-noarch.cab#/completion.7z"
]
}
}
}
} Please merge it into |
I'm assuming it's backward compatible too, right? |
Yes, of course, just update the AU part. |
waiting for @rasa to merge it to |
@niheaven Please go ahead and merge this |
Add VirtualBox extension pack to autoupdate URLs, to prevent mismatch between base installer and extension pack versions. Scoop supports autoupdate URL collections with: [ScoopInstaller/Scoop#3518](ScoopInstaller/Scoop#3518). Closes TheRandomLabs#238.
Add VirtualBox extension pack to autoupdate URLs, to prevent mismatch between base installer and extension pack versions. Scoop supports autoupdate URL collections with: [ScoopInstaller/Scoop#3518](ScoopInstaller/Scoop#3518). Related to TheRandomLabs#238.
Add VirtualBox extension pack to autoupdate URLs, to prevent mismatch between base installer and extension pack versions. Scoop supports autoupdate URL collections with: [ScoopInstaller/Scoop#3518](ScoopInstaller/Scoop#3518). Related to TheRandomLabs#238.
Add VirtualBox extension pack to autoupdate URLs, to prevent mismatch between base installer and extension pack versions. Scoop supports autoupdate URL collections with: [ScoopInstaller/Scoop#3518](ScoopInstaller/Scoop#3518). Related to TheRandomLabs#238.
Inherit #2803
If hash extraction is different for urls, use array of objects. If hash extraction array's length is less then autoupdate.url's length, latest hash item is reused for the rest.
Example Manifest (irfanview)
Please review, and CI test cases will be added soon.