Commit Graph

372 Commits

Author SHA1 Message Date
Hsiao-nan Cheung
cdba268b47 fix(install): Don't show manifest while updating (#4581) 2021-12-16 18:41:36 +08:00
Joris
992e99358a feat(install): Show manifest on installation (#4155)
* show manifest on installation

* Inline function

* Update install.ps1

Co-authored-by: Rashil Gandhi <46838874+rashil2000@users.noreply.github.com>
2021-12-08 14:37:28 +05:30
Rashil Gandhi
ef4349bee4 feat(shim): Rework shimming logic (#4543)
Co-authored-by: Hsiao-nan Cheung <niheaven@gmail.com>
2021-12-02 21:23:36 +08:00
Hsiao-nan Cheung
5a1cdcb93d fix(install): 'env_add_path' doesn't append '.' (#4550) 2021-12-01 16:18:22 +08:00
Rashil Gandhi
1d5e81d2dc Use newer function - fixes #4534 2021-11-24 10:46:43 +05:30
Retia
baa20aef55 fix(install): Fix aria2's resume download feature (#3292)
Co-authored-by: Hsiao-nan Cheung <niheaven@gmail.com>
2021-11-14 21:00:55 +08:00
Hsiao-nan Cheung
e35ff313a5 fix(decompress): Check .zst first
And also trim `\` in `-DestinationPath`
2021-11-10 11:11:45 +08:00
worldyun
af7a6f6d0e feat(decompress): Support Zstandard archive (#4372)
Co-authored-by: WorldYun <worldyun@qq.com>
Co-authored-by: Hsiao-nan Cheung <niheaven@gmail.com>
2021-11-10 09:40:11 +08:00
Derrick Liu
818162fe82 Restrict url() scope to avoid conflict with global aliases 2021-10-30 15:44:07 -07:00
Jakub Čábera
22a59866c7 fix(install): Aria2 inline progress negative values (#4053) 2020-07-01 10:56:39 +02:00
Jakub Čábera
33a357241d feat(aria2): Inline progress (#3987) 2020-05-17 12:41:24 +02:00
Richard Kuhnt
573e0933cf Merge branch 'master' into develop 2020-05-14 19:39:49 +02:00
Richard Kuhnt
96de9c14bb hotfix(download): Progress bar on small files
Closes #3923
2020-05-14 19:39:35 +02:00
Hsiao-nan Cheung
7995f99dc1 fix(install): [Array]::Reverse error (#3976) 2020-05-12 21:08:43 +02:00
Hsiao-nan Cheung
f91968cb16 fix(install): let pathes in 'env_add_path' be added ascendantly (#3788)
Co-Authored-By: Chawye Hsu <chawyehsu@hotmail.com>
2020-05-11 19:05:33 +02:00
NilsonPark
48f121e466 core(install): Readd "Don't send referer to portableapps.com" (#3961)
PortableApps still get hosted on download3.portableapps.com
Reverts #2401
2020-05-05 12:31:39 +02:00
Samuel Lorétan
e6b355eae0 feat(install): Follow HTTP redirections when downloading a file (#3902)
Co-Authored-By: Jakub Čábera <cabera.jakub@gmail.com>
2020-04-20 15:26:27 +02:00
Hsiao-nan Cheung
4eba120897 fix(install): fix 'failed' function (#3867) 2020-03-01 12:49:20 +01:00
Hsiao-nan Cheung
fe01ed52d5 fix(install): fix wrong output of 'install/failed' (#3784) 2020-02-29 14:24:08 +01:00
Jakub Čábera
9c04608c48 fix(install): Use Join-Path instead of string gluing. (#3566) 2019-10-04 21:22:31 +02:00
Edgard Lorraine Messias
e37e4ca666 feat(install): Use 7zip when available for faster zip file extraction (#3460) 2019-09-01 13:58:55 +02:00
Hsiao-nan Cheung
c7d72d21b9 feat(install): Add arch support to env_add_path and env_set (#3503) 2019-08-26 14:58:55 +02:00
Hsiao-nan Cheung
96fef5827d fix(install): Allow $version to be used in uninstaller scripts (#3592) 2019-08-16 17:13:40 +02:00
Niklas H
0550605de1 fix(comspec): Escape variables when calling COMSPEC commands (#3538)
COMSPEC commands fail when called with unescaped directory arguments which contain white spaces (typically a compound user name).

- Closes lukesampson/scoop-extras#1781
- Closes lukesampson/scoop-extras#2389
- Closes #2801

Signed-off-by: Niklas H. <Typhoon.CommanderCool@gmail.com>
2019-07-02 15:46:43 +02:00
Hsiao-nan Cheung
2fafcb880a feature(decompress): Add 'ExtractDir' to 'Expand-...' functions (#3466)
* feature(decompress): Add 'ExtractDir' to 'Expand-...' functions

* Fix 'TrimEnd' and nested 7z
2019-06-24 14:26:35 +02:00
Hsiao-nan Cheung
61d1c1c41a refactor(core): Add more generic 'Invoke-ExternalCommand' instead of 'run' (#3432) 2019-06-24 14:26:35 +02:00
Richard Kuhnt
010546cf26 refactor(core): Combine helpers to Get-HelperPath and Test-HelperInstalled 2019-05-01 14:17:49 +02:00
Richard Kuhnt
42e4505089 refactor(core): Rename aria2 helper functions
aria2_path > Get-Aria2Path
aria2_installed > Test-Aria2Installed
aria2_enabled > Test-Aria2Enabled
2019-05-01 14:17:49 +02:00
Richard Kuhnt
501d4b4d35 refactor(decompress): Change function name casing
7zip_path -> Get-7zipPath
7zip_installed -> Test-7zipInstalled
Expand-7ZipArchive -> Expand-7zipArchive
Test-7ZipRequirement -> Test-7zipRequirement
Expand-MSIArchive -> Expand-MsiArchive
Test-LessMSIRequirement -> Test-LessmsiRequirement
2019-05-01 14:17:49 +02:00
HenriqueB
70d6d9cab7 install: Fix bug with Start-Process -Wait, exclusive to PowerShell Core on Windows 7 (#3415)
Close: https://github.com/lukesampson/scoop/issues/2580
See: https://github.com/PowerShell/PowerShell/issues/6561
2019-04-29 17:24:27 +02:00
Hsiao-nan Cheung
a757dea15e refactor(cmd_available/Get-Command): Add Test-CommandAvailable function (#3314) 2019-04-28 18:53:00 +02:00
Hsiao-nan Cheung
72730e0d73 decompress.ps1: Refactor extraction handling functions (#3204)
* Refactored functions:
  * requires_7zip > Test-7ZipRequirement
  * requires_lessmsi > Test-LessMSIRequirement
  * extract_7zip > Expand-7ZipArchive
  * extract_msi/extract_lessmsi > Expand-MSIArchive
  * unpack_inno > Expand-InnoArchive
  * extract_zip/unzip_old > Expand-ZipArchive
* Fix 7zip failed when .tar and .tgz have diff names
* Add tools to CI
* Add test cases for Expand-7ZipArchive
* Add test cases for Expand-InnoArchive
* Add test cases for Expand-MSIArchive
* Add config `7ZIPEXTRACT_USE_EXTERNAL`
* Change '$recurse' to '$removal'
2019-04-26 18:35:59 +02:00
Richard Kuhnt
9eed3d8914 refactor(install): rename locate() to Find-Manifest()
See https://github.com/lukesampson/scoop/issues/3339#issuecomment-485242390
2019-04-22 12:44:07 +02:00
Edgard Lorraine Messias
79d7af971f install.ps1: Fixed cache copy with aria2 (#3318) 2019-04-10 14:20:23 +02:00
Jakub Čábera
ad01bff667 Add bin\checkhashes.ps1 (#2766)
- Checks if all URLs inside manifest have correct hashes
2019-03-11 10:39:37 +01:00
Ross Smith II
8b7f3fc218 install.ps1: Allow persist dirs to have trailing slash (#3203) 2019-03-10 12:47:23 +01:00
Hsiao-nan Cheung
5f91682a79 decompress.ps1: Refactored (w/ install.ps1, core.ps1) (edited) (#3169)
* decompress.ps1: Refactored (w/ install.ps1, core.ps1)

* fix install.ps1
2019-03-07 22:14:06 +01:00
Richard Kuhnt
9ce2fda854 install.ps1: show aria2 output as error instead of debug 2019-02-03 17:05:33 +01:00
Richard Kuhnt
39136fc6fe core.ps1: Rename unzip() to extract_zip() 2019-02-03 13:07:02 +01:00
Chawye Hsu
e5addb9487 Refactor: Tweak SecurityProtocol usage (#3065)
reopen #3051 
Now the code logic: if `SecurityProtocol` is `SystemDefault`, don't change, else change it to `Tls1.2,Tls1.1,Tls1.0`,  never support `Ssl3` anymore.
2019-02-01 18:17:40 +01:00
Chawye Hsu
945a0c64c4 fix(persist): fix the target didn't be created (#3008)
fix(persist): fix the target didn't be created
2019-01-18 05:51:48 +01:00
Chawye Hsu
d23552a5a5 Rewritten data persisting feature (#2897)
**Data matters, please review**

This is a rework of #2891 #2890 and #2882 . This will also fix #2724 and fix #2900 , close #2779 

**Introduction**

I add a function called `unlink_persist_data($dir)`, which recursively unlink all junction/hard link in the given directory. This affects some sub-commands which have interaction with junction/hard link:

- `scoop-install`: the persisting logic has been improved as follow:
  1. if there are data in the `persist` folder, also in app(`source`) folder, rename that one located in app folder (e.g. app's default setting files) with a `original` suffix, then create link from `persist` to  app
  2. if there are data in the `persist` folder, but no in app(`source`) folder, just create link from `persist` to  app
  3. if there is no data in the `persist` folder (e.g. fresh install), but there are data in app(`source`) folder (e.g. app's default setting files), we will just use that default setting files as the first-time persisting. So move that files from app folder to `persist` folder, then create link from `persist` to  app
  4. But what if if there is neither data in the `persist` folder (e.g. fresh install), nor in the app(`source`) folder (e.g. setting files will be created after first startup, like `Everthing.db`). We need to create empty persisting target in the `persist` folder. But by default we can't know if a persisting target is a file or a directory (e.g. `conf.d`). So we create a directory by default, and to avoid this, manifest maintainers should use `pre_install` to manually create the source file before persisting.
- `scoop-reset`: `reset` command uses the logic of `install`, but there is a problem: before re-persisting data, there have been `junction/hard link` in the app(`source`) folder. It will throw an exception of file exists #2724 . To fix this, we should unlink all old link before re-persisting, using `unlink_persist_data`.
- `scoop-uninstall`: `Remove-Item` can not remove `NTFS junction`, we need to unlink all persistting data, before uninstalling/deleting an app, but keeping persisting data.
- `scoop-cleanup`: like `uninstall`, `Remove-Item` can not remove `NTFS junction`, we need to unlink all persistting data, before deleting old versions of an app. Before PR #2882 , it use `fsutil.exe` to unlink junction, which is not friendly to restricted users (#2832 and #2881 ).

Beyond the logic improvement, there is a new feature now: it supports sub-folder data persisting, like:

```json
{
    "homepage": "https://scoop.sh",
    "description": "A dummy manifest for scoop tests.",
    "license": "Freeware",
    "version": "1.1.0",
    "url": "https://get.scoop.sh",
    "pre_install": [
        "if (!(test-path \"$dir\\dummy.txt\")) { new-item -force \"$dir\\dummy.txt\" -itemtype file | out-null }",
        "if (!(test-path \"$dir\\dummydir\")) { new-item \"$dir\\dummydir\" -itemtype directory | out-null }",
        "if (!(test-path \"$dir\\subdir\")) { new-item \"$dir\\subdir\" -itemtype directory | out-null }",
        "if (!(test-path \"$dir\\subdir\\subdummydir\")) { new-item \"$dir\\subdir\\subdummydir\" -itemtype directory | out-null }",
        "if (!(test-path \"$dir\\subdir\\subdummy.txt\")) { new-item -force \"$dir\\subdir\\subdummy.txt\" -itemtype file | out-null }",
    ],
    "persist": [
        "dummy.txt",
        "dummydir",
        "subdir\\subdummydir",
        "subdir\\subdummy.txt"
    ]
}
```
So no need to strip directories of source for target anymore.

To participate in the code review and tests, go visit https://github.com/h404bi/scoop-persist-test for test cases.
2019-01-17 18:00:29 +01:00
Pakorn Vongseela
f284dba5d7 install.ps1: Fix persisting bug with already existing folder (#2732)
closes https://github.com/lukesampson/scoop-extras/issues/1300
closes https://github.com/lukesampson/scoop-extras/issues/1370
closes #2724
closes #2671
2018-11-12 10:26:16 +01:00
Richard Kuhnt
803525a866 install: fix fosshub downloads with aria2c 2018-09-23 13:19:48 +02:00
yukihane
5f0ca5df6a install: ignore url fragment for PowerShell Core 6.1.0 (#2602) 2018-09-17 00:11:55 +02:00
Richard Kuhnt
19373f4b9b Add metalink support for aria2c (#2560)
This should fix #2480 and fix https://github.com/lukesampson/scoop-extras/issues/1126
2018-09-06 11:57:09 +02:00
Richard Kuhnt
f374924ab6 install/core: add function for extracting magic bytes 2018-09-04 14:34:29 +02:00
Grigory
f46131a798 Fix PowerShell core crash due to '-Encoding byte' being replaced with '-AsByteStream' (#2554) 2018-09-02 12:27:21 +02:00
Richard Kuhnt
1a2598bc30 Fix condition for persist_permission() again 2018-08-27 14:15:58 +02:00
Richard Kuhnt
eb7b7cbf4f Fix condition for persist_permission() 2018-08-27 11:26:05 +02:00