ScoopInstaller / Scoop

A command-line installer for Windows.
https://scoop.sh
Other
21.22k stars 1.41k forks source link

[Bug] scoop reset failed for global installed apps #4819

Closed ooooo84 closed 2 years ago

ooooo84 commented 2 years ago

Bug Report

Current Behavior

Here are some JDKs installed globally by scoop: 图片

when i use scoop reset temurin11-jdk, it saids ERROR 'temurin11-jdk' isn't installed

Expected Behavior

Successfully reset shims and environment variables

Additional context/output

Possible Solution

System details

Windows version: 10

OS architecture: 64bit

PowerShell version: 5.1.19041.1320

Scoop Configuration

{
    "lastupdate":  "2022-03-17T08:04:45.0044426+08:00",
    "SCOOP_REPO":  "http://github.com/ScoopInstaller/Scoop",
    "SCOOP_BRANCH":  "master",
    "aria2-enabled":  false,
    "aria2-config":  false,
    "proxy":  "127.0.0.1:10809"
}
milsav92 commented 2 years ago

It seems that the function installed from lib/core.ps1 has the following definition:

function installed($app, $global)

but in libexec/scoop-reset.ps1 it is used as:

    if(!(installed $app)) {
        error "'$app' isn't installed"
        return
    }

Temporary solution seems to be to change libexec/scoop-reset.ps1 to use:

    if(!(installed $app $global)) {
        error "'$app' isn't installed"
        return
    }
ooooo84 commented 2 years ago

It seems that the function installed from lib/core.ps1 has the following definition:

function installed($app, $global)

but in libexec/scoop-reset.ps1 it is used as:

    if(!(installed $app)) {
        error "'$app' isn't installed"
        return
    }

Temporary solution seems to be to change libexec/scoop-reset.ps1 to use:

    if(!(installed $app $global)) {
        error "'$app' isn't installed"
        return
    }

it works, thank you

rashil2000 commented 2 years ago

Hey @milsav92, can you make a PR for the fix?

niheaven commented 2 years ago

This has been fixed in #4798

image

hgkamath commented 2 years ago

I had penned a comment in Pull https://github.com/ScoopInstaller/Scoop/pull/4798#issuecomment-1074855060 I just realized it was penned under a code review and not a bug report.

hgkamath commented 2 years ago

Just confirming #4796 As @wisdomtooth mentioned, these runtime dependencies have been installed as global -g and it is preferable that way.

PS C:\vol\scoop_01\scoop\buckets\extras> scoop status
Scoop is up to date.
Missing runtime dependencies:
    'android-sdk' requires 'adb'
    'scrcpy' requires 'adb'
    'sndcpy' requires 'adb', 'extras/vlc'