Scoop icon indicating copy to clipboard operation
Scoop copied to clipboard

[Bug] Cannot install 7zip and git

Open gsantovena opened this issue 2 years ago • 19 comments

Bug Report

Current Behavior

When installing git, scoop is trying to install 7zip but fails because git is needed.

Expected Behavior

Install 7zip and git via scoop without issues.

Additional context/output

PS C:\Windows\system32> sudo scoop install 7zip git --global
Installing '7zip' (21.07) [64bit]
Loading 7z2107-x64.msi from cache
Checking hash of 7z2107-x64.msi ... ok.
Extracting 7z2107-x64.msi ... ERROR Exit code was 1603!
git : The term 'git' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try
again.
At line:1 char:1
+ git config --get remote.origin.url
+ ~~~
    + CategoryInfo          : ObjectNotFound: (git:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

Failed to extract files from C:\ProgramData\scoop\apps\7zip\21.07\7z2107-x64.msi.
Log file:
  C:\ProgramData\scoop\apps\7zip\21.07\msi.log

Please try again or create a new issue by using the following link and paste your console output:
https:////

Possible Solution

System details

Windows version: 10

OS architecture: 64bit

PowerShell version: 5.1.14393.4583

Additional software: [(optional) e.g. ConEmu, Git]

Scoop Configuration

PS C:\Windows\System32\config\systemprofile\.config\scoop> cat .\config.json
{
    "lastupdate":  "2022-02-12T05:16:05.5201691+00:00",
    "7ZIPEXTRACT_USE_EXTERNAL":  false
}```

gsantovena avatar Feb 12 '22 05:02 gsantovena

Paste the contents of log file

rashil2000 avatar Feb 12 '22 05:02 rashil2000

Paste the contents of log file

PS C:\> cat C:\Windows\system32\config\systemprofile\scoop\apps\7zip\21.07\msi.log
=== Logging started: 2/12/2022  5:55:32 ===
The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2103. The arguments are: 26, ,
=== Logging stopped: 2/12/2022  5:55:33 ===

gsantovena avatar Feb 12 '22 05:02 gsantovena

Can you try doing a local (non-global) install?

rashil2000 avatar Feb 12 '22 06:02 rashil2000

Same error:

PS C:\> scoop install 7zip
Installing '7zip' (21.07) [64bit]
Loading 7z2107-x64.msi from cache
Checking hash of 7z2107-x64.msi ... ok.
Extracting 7z2107-x64.msi ... ERROR Exit code was 1603!
git : The term 'git' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try
again.
At line:1 char:1
+ git config --get remote.origin.url
+ ~~~
    + CategoryInfo          : ObjectNotFound: (git:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

Failed to extract files from C:\Windows\system32\config\systemprofile\scoop\apps\7zip\21.07\7z2107-x64.msi.
Log file:
  ~\scoop\apps\7zip\21.07\msi.log

Please try again or create a new issue by using the following link and paste your console output:
https:////
PS C:\> cat C:\Windows\system32\config\systemprofile\scoop\apps\7zip\21.07\msi.log
=== Logging started: 2/12/2022  6:00:41 ===
The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2103. The arguments are: 26, ,
=== Logging stopped: 2/12/2022  6:00:41 ===

gsantovena avatar Feb 12 '22 06:02 gsantovena

Basically, the issue is that git requires 7zip, and 7zip uses git...

gsantovena avatar Feb 12 '22 06:02 gsantovena

7zip does not use git. There is something else going on here.

rashil2000 avatar Feb 12 '22 06:02 rashil2000

Why is your user home folder C:\Windows\system32\config\systemprofile?

rashil2000 avatar Feb 12 '22 06:02 rashil2000

I'm trying to use scoop in a Windows EC2 instance and installing it via console. This console is open with SSM.

On Sat, Feb 12, 2022, 00:12 Rashil Gandhi @.***> wrote:

Why is your user home folder C:\Windows\system32\config\systemprofile?

— Reply to this email directly, view it on GitHub https://github.com/ScoopInstaller/Scoop/issues/4735#issuecomment-1037012496, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAOM247XQWSPH6VWIJ6D22LU2X25HANCNFSM5OGHNDIQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.***>

gsantovena avatar Feb 12 '22 06:02 gsantovena

Can you try this: scoop install [email protected]

rashil2000 avatar Feb 12 '22 06:02 rashil2000

Which steps have you tried?

rashil2000 avatar Feb 12 '22 10:02 rashil2000

scoop config MSIEXTRACT_USE_LESSMSI true and try again.

It seems like you are using Scoop from a system account, and MSI extraction procedure in scoop is per-user, so msiexec got 2103 error. Ref: https://www.itninja.com/question/help-with-msi-2103

niheaven avatar Feb 12 '22 12:02 niheaven

scoop config MSIEXTRACT_USE_LESSMSI true and try again.

It seems like you are using Scoop from a system account, and MSI extraction procedure in scoop is per-user, so msiexec got 2103 error. Ref: https://www.itninja.com/question/help-with-msi-2103

PS C:\Windows\system32> scoop config MSIEXTRACT_USE_LESSMSI true
'MSIEXTRACT_USE_LESSMSI' has been set to 'true'
PS C:\Windows\system32> scoop install 7zip
Scoop uses Git to update itself. Run 'scoop install git' and try again.
Installing 'lessmsi' (1.10.0) [64bit]
lessmsi-v1.10.0.zip (497.3 KB) [========================================================================================================================================================================] 100%
Checking hash of lessmsi-v1.10.0.zip ... ok.
Extracting lessmsi-v1.10.0.zip ... done.
Linking ~\scoop\apps\lessmsi\current => ~\scoop\apps\lessmsi\1.10.0
Creating shim for 'lessmsi'.
Creating shortcut for Less MSIérables (lessmsi-gui.exe)
'lessmsi' (1.10.0) was installed successfully!
Installing '7zip' (21.07) [64bit]
Loading 7z2107-x64.msi from cache
Checking hash of 7z2107-x64.msi ... ok.
Extracting 7z2107-x64.msi ... ERROR Exit code was -2146232576!
git : The term 'git' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try
again.
At line:1 char:1
+ git config --get remote.origin.url
+ ~~~
    + CategoryInfo          : ObjectNotFound: (git:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

Failed to extract files from C:\Windows\system32\config\systemprofile\scoop\apps\7zip\21.07\7z2107-x64.msi.
Log file:
  ~\scoop\apps\7zip\21.07\msi.log

Please try again or create a new issue by using the following link and paste your console output:
https:////

gsantovena avatar Feb 12 '22 23:02 gsantovena

Can you try this: scoop install [email protected]

this did not work either :(

gsantovena avatar Feb 12 '22 23:02 gsantovena

I have the same problem. Trying to install git tries to install 7zip, which fails due to missing git...

itpropro avatar Feb 14 '22 11:02 itpropro

It's an error concerning MSI extraction, the reported git : The term 'git' is not recognized as the name of a cmdlet, function, script file, or operable program. is from scoop's error reporting system.

Have you guys just installed scoop and 7zip is the first app you installed by scoop? The error seems to be permission error, but I cannot reproduce locally.

niheaven avatar Feb 14 '22 11:02 niheaven

Just tested on a fresh Windows 11 install:

Screenshot 2022-02-14 235525

rashil2000 avatar Feb 14 '22 18:02 rashil2000

scoop config MSIEXTRACT_USE_LESSMSI true and try again.

It seems like you are using Scoop from a system account, and MSI extraction procedure in scoop is per-user, so msiexec got 2103 error. Ref: https://www.itninja.com/question/help-with-msi-2103

It seems that I have the same problem on windows server 2022 (21H2), ERROR Exit code was 1603!

Microsoft Windows [版本 10.0.20348.681]
(c) Microsoft Corporation。保留所有权利。

C:\Users\yuangezhizao>scoop install curl
WARN  Purging previous failed installation of 7zip.
ERROR '7zip' isn't installed correctly.
Removing older version (21.07).
'7zip' was uninstalled.
Installing '7zip' (21.07) [64bit]
Loading 7z2107-x64.msi from cache
Checking hash of 7z2107-x64.msi ... ok.
Extracting 7z2107-x64.msi ... ERROR Exit code was 1603!
Failed to extract files from C:\Users\yuangezhizao\scoop\apps\7zip\21.07\7z2107-x64.msi.
Log file:
  ~\scoop\apps\7zip\21.07\msi.log

Please try again or create a new issue by using the following link and paste your console output:
https:////

Specific version will cause a new error code, ERROR Exit code was 1620!

C:\Users\yuangezhizao>scoop install [email protected]
WARN  Given version (19.00) does not match manifest (21.07)
WARN  Attempting to generate manifest for '7zip' (19.00)
Autoupdating 7zip
Downloading 7z1900.msi to compute hashes!
Downloading https://7-zip.org/a/7z1900.msi (-1 B)...

Computed hash: a8e7f58e974f33d607795fc8c4bde86d9419a319aa11716220907936fb66a39f
Downloading 7z1900-x64.msi to compute hashes!
Downloading https://7-zip.org/a/7z1900-x64.msi (-1 B)...

Computed hash: c4c421b0b14c239f62184d9519724cb6fc08830bd8df384cb136062f3bd0edc3
Writing updated 7zip manifest
WARN  Purging previous failed installation of 7zip.
ERROR '7zip' isn't installed correctly.
Removing older version (21.07).
'7zip' was uninstalled.
Installing '7zip' (19.00) [64bit]
Loading 7z1900-x64.msi from cache
Checking hash of 7z1900-x64.msi ... ok.
Extracting 7z1900-x64.msi ... ERROR Exit code was 1620!
Failed to extract files from C:\Users\yuangezhizao\scoop\apps\7zip\19.00\7z1900-x64.msi.
Log file:
  ~\scoop\apps\7zip\19.00\msi.log

Please try again or create a new issue by using the following link and paste your console output:
https:////

Finally by setting MSIEXTRACT_USE_LESSMSI flag, successfully installed.

C:\Users\yuangezhizao>scoop config MSIEXTRACT_USE_LESSMSI true
'MSIEXTRACT_USE_LESSMSI' has been set to 'true'

C:\Users\yuangezhizao>scoop install curl
WARN  Purging previous failed installation of 7zip.
ERROR '7zip' isn't installed correctly.
Removing older version (19.00).
'7zip' was uninstalled.
Installing 'lessmsi' (1.10.0) [64bit]
lessmsi-v1.10.0.zip (497.3 KB) [==============================================================================] 100%
Checking hash of lessmsi-v1.10.0.zip ... ok.
Extracting lessmsi-v1.10.0.zip ... done.
Linking ~\scoop\apps\lessmsi\current => ~\scoop\apps\lessmsi\1.10.0
Creating shim for 'lessmsi'.
Creating shortcut for Less MSIérables (lessmsi-gui.exe)
'lessmsi' (1.10.0) was installed successfully!
Installing '7zip' (21.07) [64bit]
Loading 7z2107-x64.msi from cache
Checking hash of 7z2107-x64.msi ... ok.
Extracting 7z2107-x64.msi ... done.
Linking ~\scoop\apps\7zip\current => ~\scoop\apps\7zip\21.07
Creating shim for '7z'.
Creating shortcut for 7-Zip (7zFM.exe)
Persisting Codecs
Persisting Formats
Running post-install script...
'7zip' (21.07) was installed successfully!
Notes
-----
Add 7-Zip as a context menu option by running: "C:\Users\yuangezhizao\scoop\apps\7zip\current\install-context.reg"
Installing 'curl' (7.83.1_1) [64bit]
curl-7.83.1_1-win64-mingw.tar.xz (2.6 MB) [===================================================================] 100%
Checking hash of curl-7.83.1_1-win64-mingw.tar.xz ... ok.
Extracting curl-7.83.1_1-win64-mingw.tar.xz ... done.
Linking ~\scoop\apps\curl\current => ~\scoop\apps\curl\7.83.1_1
Creating shim for 'curl'.
'curl' (7.83.1_1) was installed successfully!

C:\Users\yuangezhizao>

The fact is that I like using the admin level account on the server environment. While convenient, it can have other unintended effects.

C:\Users\yuangezhizao>whoami
cn-tx-bj3-w2d\yuangezhizao

C:\Users\yuangezhizao>net user yuangezhizao
用户名                 yuangezhizao
全名                   远哥制造
注释                   远哥制造
用户的注释
国家/地区代码          000 (系统默认值)
帐户启用               Yes
帐户到期               从不

上次设置密码           2022/5/21 18:26:39
密码到期               从不
密码可更改             2022/5/21 18:26:39
需要密码               Yes
用户可以更改密码       Yes

允许的工作站           All
登录脚本
用户配置文件
主目录
上次登录               2022/5/21 20:54:46

可允许的登录小时数     All

本地组成员             *Administrators       *Remote Desktop Users
全局组成员             *None
命令成功完成。


C:\Users\yuangezhizao>

yuangezhizao avatar May 21 '22 13:05 yuangezhizao

windows11

scoop checkup
No problems identified!

 scoop status

Name          Installed Version    Latest Version       Missing Dependencies Info
----          -----------------    --------------       -------------------- ----
git                                                                          Install failed
idea-ultimate 2022.2.3-222.4345.14 2022.3.2-223.8617.56
maven         3.8.6                3.9.0
temurin8-jdk  8.0.345-1            8.0.362-9
wechat        3.7.6.44             3.9.0.28                                  Install failed
wiztree       4.11                 4.12

 scoop install git
WARN  Purging previous failed installation of git.
ERROR 'git' isn't installed correctly.
Removing older version (2.39.2.windows.1).
'git' was uninstalled.
Installing 'git' (2.39.2.windows.1) [64bit] from main bucket
The parameter is Null or null. Provide a non-null or Null parameter and try the command again.
URL https://github.com/git-for-windows/git/releases/download/v2.39.2.windows.1/PortableGit-2.39.2-64-bit.7z.exe#/dl.7z is not valid


scoop config proxy none


PS C:\Users\morty> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.22621.963
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.22621.963
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

PS C:\Users\morty> scoop list
Installed apps:

Name            Version              Source Updated             Info
----            -------              ------ -------             ----
7zip            22.01                main   2022-11-01 13:38:48

Could you help me, please? i can't install git

ChewJ404 avatar Mar 05 '23 13:03 ChewJ404

UPDATE: nevermind - my config was wrong. Proper config worked:

scoop config:

last_update       : 2023-10-26T22:49:49.9037506-07:00
use_external_7zip : True
scoop_branch      : develop
scoop_repo        : https://github.com/ScoopInstaller/Scoop
I had an incorrect config for use_external_7zip

What's strange here is that the git installer is not respecting the use_external_7zip config. I'm on Windows 10 Version 10.0.19045 Build 19045 running in Powershell. I have to use an external 7zip as I can't download it from https://www.7-zip.org

scoop config:

last_update  : 2023-10-26T22:49:49.9037506-07:00
get          : use_external_7zip
set          : use_external_7zip
scoop_branch : develop
scoop_repo   : https://github.com/ScoopInstaller/Scoop

(gcm 7zip).Path returns the path and I can call 7zip just fine:

C:\Users\ben\bin\7zip.exe

But scoop install git returns this:

WARN  Purging previous failed installation of 7zip.
ERROR '7zip' isn't installed correctly.
Removing older version (23.01).
'7zip' was uninstalled.
Installing '7zip' (23.01) [64bit] from main bucket
The remote server returned an error: (503) Server Unavailable.
URL https://www.7-zip.org/a/7z2301-x64.msi is not valid

jcrben avatar Oct 27 '23 07:10 jcrben