当前位置:网站首页 > 更多 > 玩电脑 > 正文

[玩转系统] 在没有 Microsoft Store 的情况下安装 Windows 终端

作者:精品下载站 日期:2024-12-14 06:36:07 浏览:15 分类:玩电脑

在没有 Microsoft Store 的情况下安装 Windows 终端


Windows Terminal 是一个新的终端应用程序,旨在让您轻松使用命令行工具、cmd.exe 和 Powershell 环境。 Windows 终端支持选项卡,设置您自己的配置文件、样式和配置。如果安装了 WSL 或 Azure Cloud Shell,这些环境的 shell 会自动添加到 Windows 终端控制台。

Windows 终端控制台预安装在 Windows 11 和 Windows 10 22 H2 上。在其他版本的 Windows 上,必须手动安装。 Microsoft 的官方建议是从 Microsoft Store 安装 Windows Terminal,以确保您拥有最新版本,该版本会自动更新 (https://www.microsoft.com/en-us/p/windows-terminal/9n0dx20hk701?activetab=pivot :概述选项卡)。

如果 Microsoft Store 应用丢失或损坏(例如,在 Windows 10 LTSC 或 Windows Server 2022 中),您可以通过以下方式之一安装 Windows 终端:

  • 通过从 GitHub 手动下载最新的 Windows Terminal 版本并在 Windows 中安装 MSIX 文件;

  • 通过使用 Chocolatey 或 WinGet 包管理器。

对于手动安装 Windows Terminal,您需要从项目的官方 GitHub https://github.com/microsoft/terminal/releases 下载 msixbundle 包。在资产部分找到适合您的 Windows 版本的最新终端版本并下载该文件。

您还可以从 Microsoft Store 手动下载最新版本的 APPX/MSIXbundle 应用程序。

您可以使用 Invoke-WebRequest cmdlet 下载安装文件:

Invoke-WebRequest -Uri https://github.com/microsoft/terminal/releases/download/v1.18.3181.0/Microsoft.WindowsTerminal_1.18.3181.0_8wekyb3d8bbwe.msixbundle

接下来,使用 Add-AppxPackage cmdlet 在 Windows 中安装该软件包:

Add-AppxPackage -Path .\Microsoft.WindowsTerminal_1.18.3181.0_8wekyb3d8bbwe.msixbundle

检查软件包是否已成功安装::

Get-AppxPackage *WindowsTerminal* -AllUsers

[玩转系统] 在没有 Microsoft Store 的情况下安装 Windows 终端

如果您使用的是最新的 PowerShell Core 7.x,请首先导入 AppX/MSIX 包安装模块:

Import-Module Appx -UseWindowsPowerShell

在较旧的 Windows 10 版本上手动安装 Windows 终端时,可能会出现以下错误:

Add-AppPackage : Deployment failed with HRESULT: 0x80073CF3, Package failed updates, dependency or conflict validation.
Windows cannot install package Microsoft.WindowsTerminal_1.18.3181.0_8wekyb3d8bbwe.msixbundle because this package depends on a framework that could not be found. Provide the framework "Microsoft.VCLibs.140.00.UWPDesktop" published by "CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US", with neutral or x64 processor architecture and minimum version 14.0.30035.0, along with this package to install. The frameworks with name Microsoft.VCLibs.140.00.UWPDesktop" currently installed are .....
You must download and install the VCLibs framework before installing the Microsoft.WindowsTerminal package.

下载 VCLibs 包 (https://learn.microsoft.com/en-us/troubleshoot/developer/visualstudio/cpp/libraries/c-runtime-packages-desktop-bridge) 并使用以下命令进行安装命令:

Add-AppPackage .\Microsoft.VCLibs.x64.14.00.Desktop.appx

在 Windows Server 2019 或 2016 上安装 Microsoft.WindowsTerminal 包时,您可能会收到另一个错误:

Add-AppxPackage : Deployment failed with HRESULT: 0x80073CFD, A Prerequisite for an install could not be satisfied.

Windows cannot install package Microsoft.WindowsTerminal_1.18.3181.0_8wekyb3d8bbwe because this package is not compatible with the device. The package requires OS version 10.0.19041.0 or higher on the Windows.Mobile device family. The device is currently running OS version 10.0.17763.107.

[玩转系统] 在没有 Microsoft Store 的情况下安装 Windows 终端

您可以在此处看到该软件包在安装过程中检查操作系统。要安装 Windows 终端,您需要 Windows 1903 (10.0.18362.0) 或更高版本。因此,您无法在 Windows Server 2019 上安装 Windows 终端。在这种情况下,您可以使用独立的经典 Windows 终端应用程序,该应用程序自 v1.17.11391.0 版本起可在 GitHub 上获取。下载Microsoft.WindowsTerminal_1.18.3181.0_x64.zip存档并将其解压到本地驱动器上的目录中。

[玩转系统] 在没有 Microsoft Store 的情况下安装 Windows 终端

如果您得到的是

0x80073CFD

Windows 10 中出现错误,请尝试安装更新或使用早期版本的 Microsoft.WindowsTerminal。

您还可以下载最新版本的 Microsoft.WindowsTerminal 软件包并使用 WinGet 软件包管理器进行安装:

winget install --id=Microsoft.WindowsTerminal -e

[玩转系统] 在没有 Microsoft Store 的情况下安装 Windows 终端

或者加巧克力:

Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
choco install microsoft-windows-terminal

可以安装旧版本的软件包:

choco install -y microsoft-windows-terminal --version 1.12.10732.0

在 Windows Server 2019 上通过 choco 安装软件包时,您会看到以下错误:

ERROR: This package requires at least Windows 10 version 1903/OS build 18362.x.
The install of microsoft-windows-terminal was NOT successful.
Error while running 'C:\ProgramData\chocolatey\lib\microsoft-windows-terminal\tools\chocolateyInstall.ps1'.

[玩转系统] 在没有 Microsoft Store 的情况下安装 Windows 终端

最后,要运行 Windows 终端,请运行命令:

wt.exe

[玩转系统] 在没有 Microsoft Store 的情况下安装 Windows 终端

您需要 登录账户 后才能发表评论

取消回复欢迎 发表评论:

关灯