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

[Bug]: v2rayn-pre installation script fails to hard-link Xray binaries #1936

Open
3 tasks done
stevenlele opened this issue Sep 6, 2024 · 0 comments · May be fixed by #1937
Open
3 tasks done

[Bug]: v2rayn-pre installation script fails to hard-link Xray binaries #1936

stevenlele opened this issue Sep 6, 2024 · 0 comments · May be fixed by #1937
Labels

Comments

@stevenlele
Copy link

Prerequisites

  • I have written a descriptive issue title.
  • I have searched all issues/PRs to ensure it has not already been reported or fixed.
  • I have verified that I am using the latest version of Scoop and corresponding bucket.

Package Name

v2rayn-pre

Expected/Current Behaviour

When installing, the Xray binaries can't be hard-linked because the zip file for v6.57 doesn't contain the empty Xray folder anymore.

Additionally, the uninstallation script is no longer necessary because we already persist the entire guiConfigs folder. It will trigger an error instead.

Steps to Reproduce

PS> scoop install v2rayn-pre
Installing 'v2rayn-pre' (6.57) [64bit] from 'versions' bucket
Loading v2rayN.zip from cache
Checking hash of v2rayN.zip ... ok.
Extracting v2rayN.zip ... done.
Running pre_install script...Creating hardlink for wxray.exe
New-Item : The system cannot find the path specified.
At line:6 char:13
+             New-Item -ItemType HardLink -Path "$dir\bin\Xray" -Name $ ...
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [New-Item], Win32Exception
    + FullyQualifiedErrorId : System.ComponentModel.Win32Exception,Microsoft.PowerShell.Commands.NewItemCommand

Creating hardlink for xray.exe
New-Item : The system cannot find the path specified.
At line:6 char:13
+             New-Item -ItemType HardLink -Path "$dir\bin\Xray" -Name $ ...
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [New-Item], Win32Exception
    + FullyQualifiedErrorId : System.ComponentModel.Win32Exception,Microsoft.PowerShell.Commands.NewItemCommand

Creating hardlink for geoip.dat
New-Item : The system cannot find the path specified.
At line:6 char:13
+             New-Item -ItemType HardLink -Path "$dir\bin\Xray" -Name $ ...
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [New-Item], Win32Exception
    + FullyQualifiedErrorId : System.ComponentModel.Win32Exception,Microsoft.PowerShell.Commands.NewItemCommand

Creating hardlink for geosite.dat
At line:6 char:13
+             New-Item -ItemType HardLink -Path "$dir\bin\Xray" -Name $ ...
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [New-Item], Win32Exception
    + FullyQualifiedErrorId : System.ComponentModel.Win32Exception,Microsoft.PowerShell.Commands.NewItemCommand

done.
Linking ~\scoop\apps\v2rayn-pre\current => ~\scoop\apps\v2rayn-pre\6.57
Creating shim for 'v2rayN'.
Making ~\scoop\shims\v2rayn.exe a GUI binary.
Creating shortcut for v2rayN (v2rayN.exe)
Persisting guiConfigs
'v2rayn-pre' (6.57) was installed successfully!
'v2rayn-pre' suggests installing 'extras/windowsdesktop-runtime-lts'.
'v2rayn-pre' suggests installing 'v2ray'.

################################################################################

PS> scoop uninstall v2rayn-pre
Uninstalling 'v2rayn-pre' (6.57).
Running uninstaller script...Copy-Item : The process cannot access the file '~\scoop\persist\v2rayn-pre\guiConfigs\config.json' becaus
e it is being used by another process.
At line:2 char:5
+     Copy-Item "$dir\guiConfigs\config.json" "$persist_dir\guiConfigs\ ...
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Copy-Item], IOException
    + FullyQualifiedErrorId : System.IO.IOException,Microsoft.PowerShell.Commands.CopyItemCommand

done.
Removing shim 'v2rayN.shim'.
Removing shim 'v2rayN.exe'.
Removing shortcut ~\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Scoop Apps\v2rayN.lnk
Unlinking ~\scoop\apps\v2rayn-pre\current
'v2rayn-pre' was uninstalled.

Possible Solution

For the installation script, create the Xray folder if it's absent.

For the uninstallation script, remove it like ScoopInstaller/Extras#12503.

Scoop and Buckets Version

# Not related

Scoop Config

# Not related

PowerShell Version

# Not related

Additional Softwares

No response

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

Successfully merging a pull request may close this issue.

1 participant