Skip to content

.NET Framework 4.8 install fails in PowerShell 7 #3880

Description

@Henje

Checklist

  • I confirm there are no unresolved issues reported on the Chocolatey Status page.
  • I have verified this is the correct repository for opening this issue.
  • I have verified no other issues exist related to my problem.
  • I have verified this is not an issue for a specific package.
  • I have verified this issue is not security related.
  • I confirm I am using official, and not unofficial, or modified, Chocolatey products.

What You Are Seeing?

When running the chocolatey install script in PowerShell 7, the installer for .NET Framework fails.

What is Expected?

Running the script should install .NET Framework.

How Did You Get This To Happen?

Open pwsh and run the install command from the website.

User Story

No response

System Details

  • Operating System: Windows 10 LTSC 1809
  • Windows PowerShell version: 7.6.0
  • Chocolatey CLI Version: 2.6.0
  • Chocolatey Licensed Extension version:
  • Chocolatey License type:
  • Terminal/Emulator:

Installed Packages

N/A

Output Log

Installing Chocolatey on the local machine
The registry key for .Net 4.8 was not found or this is forced
Installing 'C:\Users\<User>\AppData\Local\Temp\ndp48-x86-x64-allos-enu.exe' - this may take awhile with no output.
MethodInvocationException: Exception calling "Start" with "1" argument(s): "An error occurred trying to start process
'ndp48-x86-x64-allos-enu.exe' with working directory 'C:\Users\<User>\AppData\Local\Temp'. The system cannot find the
file specified."
InvalidOperation: You cannot call a method on a null-valued expression.
WARNING: Try #1 of .NET framework install failed with exit code ''. Trying again.

Additional Context

The problem is that the process start cannot find the installer executable. This seems to be caused by the change of the default value of UseShellExecute of True in PowerShell 5 to False in PowerShell 7. I would suggest setting UseShellExecute explicitly to True.

Acceptance Criteria

No response

Related Issues

No response

┆Issue is synchronized with this Clickup task by Unito

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugIssues where something has happened which was not expected or intended.ClickUp - BacklogUsed when syncing issues between GitHub and Clickup.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions