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]: extract_dir seems dependent on PS character encoding #13221

Closed
3 tasks done
ifeelagood opened this issue May 3, 2024 · 1 comment · Fixed by ScoopInstaller/Scoop#5964
Closed
3 tasks done

[Bug]: extract_dir seems dependent on PS character encoding #13221

ifeelagood opened this issue May 3, 2024 · 1 comment · Fixed by ScoopInstaller/Scoop#5964
Labels

Comments

@ifeelagood
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

extras/openrgb

Expected/Current Behaviour

When installing the manifest for openrgb in Powershell 5.1, core.ps1 claims not to find the extract_dir "OpenRGB Windows 64-bit" even though it is infact the correct string. Installing using Powershell 7 using a different character encoding works just fine.

Steps to Reproduce

PS> $PSVersionTable.PSVersion

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

PS> [System.Text.Encoding]::Default
IsSingleByte      : True
BodyName          : iso-8859-1
EncodingName      : Western European (Windows)
HeaderName        : Windows-1252
WebName           : Windows-1252
WindowsCodePage   : 1252
IsBrowserDisplay  : True
IsBrowserSave     : True
IsMailNewsDisplay : True
IsMailNewsSave    : True
EncoderFallback   : System.Text.InternalEncoderBestFitFallback
DecoderFallback   : System.Text.InternalDecoderBestFitFallback
IsReadOnly        : True
CodePage          : 1252



PS> scoop install openrgb
Installing 'openrgb' (0.9) [64bit] from 'extras' bucket
Loading OpenRGB_0.9_Windows_64_b5f46e3.zip from cache
Checking hash of OpenRGB_0.9_Windows_64_b5f46e3.zip ... ok.
Extracting OpenRGB_0.9_Windows_64_b5f46e3.zip ... Could not find 'OpenRGB Windows 64-bit'! (error 16)
At C:\scoop\apps\scoop\current\lib\core.ps1:860 char:9
+         throw "Could not find '$(fname $from)'! (error $($proc.ExitCo ...
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (Could not find ...it'! (error 16):String) [], RuntimeException
    + FullyQualifiedErrorId : Could not find 'OpenRGB Windows 64-bit'! (error 16)

-----------
PS> $PSVersionTable.PSVersion

Major  Minor  Patch  PreReleaseLabel BuildLabel
-----  -----  -----  --------------- ----------
7      4      1

PS> [System.Text.Encoding]::Default

Preamble          :
BodyName          : utf-8
EncodingName      : Unicode (UTF-8)
HeaderName        : utf-8
WebName           : utf-8
WindowsCodePage   : 1200
IsBrowserDisplay  : True
IsBrowserSave     : True
IsMailNewsDisplay : True
IsMailNewsSave    : True
IsSingleByte      : False
EncoderFallback   : System.Text.EncoderReplacementFallback
DecoderFallback   : System.Text.DecoderReplacementFallback
IsReadOnly        : True
CodePage          : 65001

PS> scoop install openrgb
Installing 'openrgb' (0.9) [64bit] from 'extras' bucket
Loading OpenRGB_0.9_Windows_64_b5f46e3.zip from cache
Checking hash of OpenRGB_0.9_Windows_64_b5f46e3.zip ... ok.
Extracting OpenRGB_0.9_Windows_64_b5f46e3.zip ... done.
Linking C:\scoop\apps\openrgb\current => C:\scoop\apps\openrgb\0.9
Creating shortcut for OpenRGB (OpenRGB.exe)
'openrgb' (0.9) was installed successfully!
'openrgb' suggests installing 'extras/vcredist2022'.

Possible Solution

  1. Do not allow scoop to run on certain character encoding/version (terrible solution)
  2. Account for encodings in core.ps1 by either a) converting to UTF-8 or b) changing extraction utility (I have not read the code for scoop and cannot comment)

Scoop and Buckets Version

PS> scoop --version
Current Scoop version:
d285bb08 (HEAD -> master, tag: v0.4.1, origin/master, origin/HEAD) chore(release): Bump to version 0.4.1 (#5924)

'extras' bucket:
4e0ff2774 (HEAD -> master, origin/master, origin/HEAD) supermium: Update to version 122.0.6261.152

Scoop Config

PS> scoop config
last_update           : 2024-05-03T11:02:34.6707081+10:00
root_path             : C:\scoop
aria2-warning-enabled : False
aria2-enabled         : False
scoop_branch          : master
scoop_repo            : https://github.com/ScoopInstaller/Scoop

PowerShell Version

(likely to do with [System.Text.Encoding]::Default !!!)
Failing Version:

PS> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.19041.4291
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.19041.4291
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Working Version: 
PS> $PSVersionTable

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

Additional Softwares

Powershell 7

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