Skip to content

Installer fails at pwsh-install.ps1:100 due to missing InstallDir registry value #57

@zenwav

Description

@zenwav

When running the Coreutils for Windows installer, the setup fails with a runtime error during the PowerShell profile update phase. The pwsh-install.ps1 script hardcodes a check for the InstallDir registry value under HKLM:\SOFTWARE\Microsoft\PowerShellCore\InstalledVersions\<GUID>.

However, that value doesn't seem to exist on my system. Instead, I see an InstallLocation value in that same location. I'm not 100% certain, but I believe modern PowerShell installers may now use InstallLocation rather than InstallDir, at least that's what's present on my machine. The script may need to account for this newer value.

Environment Details

PS ❯ $PSVersionTable.PSVersion
Major  Minor  Patch  PreReleaseLabel BuildLabel
-----  -----  -----  --------------- ----------
7      6      2

Edition	Windows 10 Enterprise
Version	22H2
OS Build	19045.7291
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions