wslu icon indicating copy to clipboard operation
wslu copied to clipboard

wslview fails when registry access is disabled

Open jaknz opened this issue 8 months ago • 4 comments

Windows Version

Windows 11

Windows Build Number

22621.2428

WSL Version

WSL 2

Distro Version

Debian 12

WSL Utilities Version

4.1.1

Describe the bug

On a corporate GPO-managed Windows workstation where group policy prohibits access to the registry, multiple calls to reg.exe fail with errors, leading to internal failures in the utility and broken functionality. Pages do load in my Windows browser, so obviously these calls to the registry aren't core to the functionality. Would be really great to either not depend on REG at all, or have an option flag to not check whatever it is trying to check.

Steps to Reproduce

$ wslview "http://github.com"

Expected behavior

Script runs quietly and launches Windows web browser, without several lines of error messages.

Additional context

Error stream output from script:

ERROR: Registry editing has been disabled by your administrator.
ERROR: Registry editing has been disabled by your administrator.
ERROR: Registry editing has been disabled by your administrator.
/usr/bin/wslview: line 267: [: : integer expression expected
Parameter format not correct - ""
Cannot find an overload for "GetEncoding" and the argument count: "0".
At line:1 char:59
+ ... ing]::UTF8; [Console]::InputEncoding = [System.Text.Encoding]::GetEnc ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodException
    + FullyQualifiedErrorId : MethodCountCouldNotFindBest

/usr/bin/wslview: line 270: [: : integer expression expected

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

jaknz avatar Oct 18 '23 01:10 jaknz