ScoopInstaller / Main

πŸ“¦ The default bucket for Scoop.
https://scoop.sh
The Unlicense
1.54k stars 918 forks source link

[Bug]: the pre_install field of Openssl package can't create symbol link #5901

Open Initsnow opened 2 weeks ago

Initsnow commented 2 weeks ago

Prerequisites

Package Name

openssl

Expected/Current Behaviour

Expected to have the script create a symlink to the lib directory, but it doesn't work. I think it might be due to admin permission. If I execute this command with admin permission it will work WindowsTerminal_FkHVpqcm3H WindowsTerminal_YEeBkRMnCE

Steps to Reproduce

Receive-Job -Wait (Start-Job {
$kernel32 = Add-Type -MemberDefinition '[DllImport("kernel32.dll")] public static extern bool CreateSymbolicLink(string lpSymlinkFileName, string lpTargetFileName, byte dwFlags);' -Name '_' -PassThru
Get-ChildItem "$Using:dir/lib/VC/$Using:arch/MT" | ForEach-Object { $kernel32::CreateSymbolicLink("$Using:dir/lib/$($_.Name)", $_.FullName, 2) }
        })

Possible Solution

use admin permission or hard link or junction link

Scoop and Buckets Version

688ms β—‰ scoop --version
Current Scoop version:
d337bb1f (HEAD -> master, tag: v0.4.2, origin/master, origin/HEAD) chore(release): Bump to version 0.4.2 (#5964)

'main' bucket:
a5eb7aade (HEAD -> master, origin/master, origin/HEAD) zls: Update to version 0.13.0

'extras' bucket:
ab16996f7 (HEAD -> master, origin/master, origin/HEAD) qtemu@2.1: Fix hash (Closes #13431)

'nerd-fonts' bucket:
da97035e (HEAD -> master, origin/master, origin/HEAD) LXGWNeoXiHei: Update to version 1.123.2

Scoop Config

908ms β—‰ scoop config

last_update            scoop_repo                              scoop_branch
-----------            ----------                              ------------
9/6/2024 δΈ‹εˆ 12:02:29 https://github.com/ScoopInstaller/Scoop master

PowerShell Version

β—‰ $PSVersionTable

Name                           Value
----                           -----
PSVersion                      7.4.2
PSEdition                      Core
GitCommitId                    7.4.2
OS                             Microsoft Windows 10.0.22631
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Additional Softwares

No response

Initsnow commented 2 weeks ago

I try scoop install openssl again. If I use admin permission to execute the command it will create symbol link correctly, vice versa. I think the script should quest admin permission if still use symbol link.