DSC icon indicating copy to clipboard operation
DSC copied to clipboard

Store installed `dsc` breaks executables

Open Gijsreyn opened this issue 5 months ago • 4 comments

Prerequisites

  • [X] Write a descriptive title.
  • [X] Make sure you are able to repro it on the latest version
  • [X] Search the existing issues.

Summary

When you install DesiredStateConfiguration-Preview using WinGet, the executables that are packaged e.g. registry.exe, cannot be called anymore.

The error message:

image

I'm not aware of the process behind WinGet, but it looks like the executables should also be registered in the USERPROFILE.

image

It also became harder to discover the original resources:

if (TestWinGetModule)
{
    # TODO: life is difficult with WinGet
    $version = (GetDscVersion) -replace "preview.", ""
    $architecture = ([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture).ToString().ToLower()
    $Path = Join-Path $env:ProgramFiles 'WindowsApps' "Microsoft.DesiredStateConfiguration-Preview_3.0.$version.0_$architecture`__8wekyb3d8bbwe" 'dsc.exe'
}

The other side-effect will be for bootsrapping scenario's - Pester tests will fail if called directly.

Steps to reproduce

Install dsc.exe from WinGet and try calling registry.exe.

Expected behavior

Able to call `registry.exe` outside `dsc.exe`

Actual behavior

Unable to call `registry.exe` outside `dsc.exe`

Error details

No response

Environment data

Name                           Value
----                           -----
PSVersion                      7.4.5
PSEdition                      Core
GitCommitId                    7.4.5
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

Version

dsc 3.0.0-preview.10

Visuals

No response

Gijsreyn avatar Sep 26 '24 10:09 Gijsreyn