Main icon indicating copy to clipboard operation
Main copied to clipboard

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

Open Initsnow opened this issue 1 year ago β€’ 1 comments

Prerequisites

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

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) [email protected]: 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 avatar Jun 09 '24 04:06 Initsnow

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.

Initsnow avatar Jun 09 '24 04:06 Initsnow

@brian6932 Please take a look.

#5372 There are missing conditions on if-else statements. admin rights and developer mode value should be checked.

HUMORCE avatar Apr 23 '25 01:04 HUMORCE