Skip to content
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

Error installing Git (issue when 7-zip is expanding) #3417

Closed
fgimian opened this issue Apr 30, 2019 · 13 comments
Closed

Error installing Git (issue when 7-zip is expanding) #3417

fgimian opened this issue Apr 30, 2019 · 13 comments

Comments

@fgimian
Copy link

fgimian commented Apr 30, 2019

Hey guys, love scoop 😄

I'm attempting to install Git at work behind a proxy. The version of Windows 10 here will be a little behind since it's a corporate environment.

This is my PowerShell version info:

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

And here's what I see when attempting to install Git:

Installing 'git' (2.21.0.windows.1) [64bit]
Loading PortableGit-2.21.0-64-bit.7z.exe from cache
Checking hash of PortableGit-2.21.0-64-bit.7z.exe ... ok.
Extracting dl.7z ... Expand-7ZipArchive : The expression after '&' in a pipeline element produced an object that was not valid. It must result in a
command name, a script block, or a CommandInfo object.
At C:\Users\fots\scoop\apps\scoop\current\lib\install.ps1:559 char:13
+             & $extract_fn "$dir\$fname" "$dir\_tmp" -Removal
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [Expand-7ZipArchive], RuntimeException
    + FullyQualifiedErrorId : BadExpression,Expand-7ZipArchive

Any ideas?
Fotis

@fgimian
Copy link
Author

fgimian commented Apr 30, 2019

Seem to have solved this by unisntalling git and 7zip and then installing 7zip first myself, and then git (instead of letting git pull in 7zip as a dependency).

Not sure if this is a real issue, feel free to close if you can't replicate it.

Cheers
Fotis

@marcoandre1
Copy link

Hi! I have the same problem. This is what I do.

scoop install git throws an error because it tries first to install 7zip using git

scoop uninstall 7zip runs successfully

scoop install 7zip throws an error because it tries to install 7zip using git.

Is there another way to install 7zip or git with scoop? Thanks!

@AndrewSav
Copy link

Is this still an issue? The main bucket was moved recently between repos, and that could have created this problem. But right now I can no longer reproduce it, so I beleive it might have been fixed since then.

@fgimian
Copy link
Author

fgimian commented May 20, 2019

I've re-installed scoop several times since and I believe this issue is indeed solved. I'll close the issue 😄

@fgimian fgimian closed this as completed May 20, 2019
@jorgheymans
Copy link
Contributor

jorgheymans commented May 23, 2019

nope still an issue please reopen, just installed scoop on a new machine. Doing the 7zip uninstall/install dance made it work.

C:\>scoop install git
Installing 'git' (2.21.0.windows.1) [64bit]
PortableGit-2.21.0-64-bit.7z.exe (40,5 MB) [================================================================================================] 100%
Checking hash of PortableGit-2.21.0-64-bit.7z.exe ... ok.
Extracting dl.7z ... The expression after '&' in a pipeline element produced an object that was not valid. It must result in a command name, a script block, or a CommandInfo object.
At C:\tools\scoop\apps\scoop\current\lib\decompress.ps1:69 char:11
+         & (Get-HelperPath -Helper 7zip) x "$Path" -o"$DestinationPath ...
+           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : BadExpression

done.
Linking C:\tools\scoop\apps\git\current => C:\tools\scoop\apps\git\2.21.0.windows.1
The system cannot find the path specified.
Creating shim for 'git'.
Can't shim 'cmd\git.exe': File doesn't exist.

@fgimian fgimian reopened this May 23, 2019
@fgimian
Copy link
Author

fgimian commented May 23, 2019

Reopened as requested, apologies 😄

@AndrewSav
Copy link

I don't think this is still an issue. The error that is posted just above you get if you manually delete 7zip.exe from where it is installed. On a clean machine if you run:

$env:SCOOP='C:\tools\scoop'
[environment]::setEnvironmentVariable('SCOOP',$env:SCOOP,'User')
iex (new-object net.webclient).downloadstring('https://get.scoop.sh')
scoop install 7zip
ri C:\tools\scoop\apps\7zip\current\7z.exe
scoop install git

You will get exactly the same error. So just uninstall git and 7zip, reinstall it, then don't mess with it and you'll be fine. I think this issue is pretty much resolved.

You also can run

. C:\tools\scoop\apps\scoop\current\lib\core.ps1
Get-HelperPath -Helper 7zip

To see that it displays C:\tools\scoop\apps\7zip\current\7z.exe and confirm that there is no executable you can access at that path. This if course needs to be done before you resolve the issue.

In order to progress, could you please follow the instruction above and report the result.

@marcoandre1
Copy link

The problem is solved for me. I tried to install scoop 23 days ago at my job with the one line command

iex (new-object net.webclient).downloadstring('https://get.scoop.sh')

It didn’t work. I guess it was due to some permission issues. So I tried the install.ps1 file. I did a copy/paste of the code in a file that I renamed with the same name on my computer. Don’t know why but I was able to install scoop. Only problem is that git didn’t want to [install] (#3417 (comment)). I was able to install git without scoop.

But I see that the install.ps1 file was changed 18 days ago. I tried it and everything works fine. Maybe the problem was fixed.

@zhiweio
Copy link

zhiweio commented Jun 17, 2019

Snipaste_2019-06-17_09-46-19.png

I tried to uninstall git and 7zip, then install 7zip firstly, it looks like working

@hsl727261250
Copy link

hsl727261250 commented Apr 18, 2020

image

the chinese means powershell not recognize git command. it seems like some scoop function strong depende git because when use status scoop is looking for git command.

this is log when install git error
7zip.log

@Alveel
Copy link

Alveel commented Feb 1, 2021

I experienced a very similar issue, although with a different error, about registry access.

7zip msi.log:

=== Logging started: 1-2-2021  10:51:51 ===
Error 1401. Could not create key: Software\Microsoft\Windows\CurrentVersion\Installer\Managed\S-1-5-21-774566788-3539132886-3366072189-22157.  System error 5.  Verify that you have sufficient access to that key, or contact your support personnel.
=== Logging stopped: 1-2-2021  10:51:51 ===

Fortunately I got admin access but I was planning on using scoop without.

@red8888
Copy link

red8888 commented Sep 22, 2022

I can't install git or 7zip with the latest scoop version

@rashil2000
Copy link
Member

See #4735

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants