Skip to content

Install winget's package and set the execution policy without starting PowerShell - #57

Merged
nunreasonable merged 2 commits into
mainfrom
setup-without-powershell
Nov 13, 2026
Merged

nunreasonable merged 2 commits into
mainfrom
setup-without-powershell

Conversation

@nunreasonable

@nunreasonable nunreasonable commented Nov 9, 2026 •

Copy link
Copy Markdown
Owner

The setup no longer starts Windows PowerShell to install or remove winget's App Installer package, or to read and set the execution policy:

  • winget's msixbundle and its dependencies are installed through PackageManager.AddPackageAsync, and removed by finding the current user's packages with that name and calling RemovePackageAsync. Failures report the HRESULT and Windows' own error text.
  • The execution policy is read from the same registry values Windows PowerShell 5.1 uses (group policy first, then CurrentUser and LocalMachine), and the CurrentUser value is written or deleted directly.

$PROFILE is still read through PowerShell, since PowerShell is what defines it.

The uninstall page now also offers to remove winget when it's the only thing this setup installed with it. Before, the switch was greyed out unless the setup had also installed terminal tools, so App Installer stayed behind.

New tests in win:: compare every scope with Get-ExecutionPolicy -List, round-trip the CurrentUser value and check it through PowerShell, and make sure the package calls return errors for a missing package and a path with a space and #.

Meant for the release after 26.1.1.1. Installing and removing the real App Installer on Windows 10 without winget still needs a manual test.

Copilot AI balanced review requested due to automatic review settings November 9, 2026 14:41

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

Copilot AI balanced review requested due to automatic review settings November 9, 2026 15:43

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@nunreasonable
nunreasonable merged commit 7cf5e6c into main Nov 13, 2026
7 checks passed
@nunreasonable
nunreasonable deleted the setup-without-powershell branch November 14, 2026 11:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants