ScoopInstaller / Scoop

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

[Bug] Shims break START /WAIT behaviour for executables #6215

Open regystro opened 1 month ago

regystro commented 1 month ago

Bug Report

I'm opening this report here instead of the "extras" package because I think it's not package specific, but generic shim behaviour.

Current Behavior

When calling the executable without full path (therefore shim is used), it doesn't respect START /WAIT command.

Both WizTree and Everything support START /WAIT in order to force waiting until the execution is finished. Useful in batch files if you need to perform sequential commands and expect the exe to finish before. Example:

START /WAIT "Indexing..." WizTree64.exe "C:" /export="C.csv"
echo DONE

In this example, it doesn't wait for WizTree to finish indexing and immediately executes the next batch line.

Expected Behavior

The shim should pass the correct "context" to the executable, in order to wait until the task is done,

Additional context/output

The same happens with Everyting package, so it seems shim related.

Possible Solution

As of now, the only solution I've found is to bypass the shim and directly call the package executable, this way:

rem get WizTree.exe path
for /f "usebackq delims=" %%p in (`powershell -Command "& {scoop which wiztree} | Convert-Path"`) do set wiztreepath=%%p
START /WAIT "Indexing..." %wiztreepath% "C:" /export="C.csv"
echo DONE

System details

Windows version: 10. Also tested in 11

OS architecture: 64bit

PowerShell version:

Major  Minor  Build  Revision
-----  -----  -----  --------
5      1      19041  5007

Scoop Configuration

{
    "last_update":  "2024-10-30T10:41:29.4524387+01:00",
    "scoop_branch":  "master",
    "scoop_repo":  "https://github.com/lukesampson/scoop"
}
FreeHarry commented 3 weeks ago

I think this is similar to #6225

skaravos commented 1 week ago

This is indeed quite annoying.

I noticed that the other available shim.exe bundled with scoop doesn't seem to have this problem. So as a temporary workaround you could do:

scoop config shim 71
scoop reset *