winget-cli

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

index.md (7528B)


      1 ---
      2 title: Use the winget tool to install and manage applications
      3 description: The winget command line tool enables developers to discover, install, upgrade, remove and configure applications on Windows 10 computers.
      4 ms.date: 10/22/2020
      5 ms.topic: overview
      6 ms.localizationpriority: medium
      7 ---
      8 
      9 # Use the winget tool to install and manage applications
     10 
     11 The **winget** command line tool enables users to discover, install, upgrade, remove and configure applications on Windows 10 and Windows 11 computers. This tool is the client interface to the Windows Package Manager service.
     12 
     13 ## Install winget
     14 
     15 There are several ways to install the **winget** tool:
     16 
     17 * The **winget** tool is included in the flight or preview version of [Windows App Installer](https://apps.microsoft.com/detail/9nblggh4nns1?ocid=9nblggh4nns1_ORSEARCH_Bing&rtc=1&activetab=pivot:overviewtab). You must install the preview version of **App Installer** to use **winget**. To gain early access, submit your request to the [Windows Package Manager Insiders Program](https://aka.ms/AppInstaller_InsiderProgram). Participating in the flight ring will guarantee you see the latest preview updates.
     18 
     19 * Participate in the [Windows Insider Dev Channel](https://insider.windows.com/understand-flighting).
     20 
     21 * Install the Windows Desktop App Installer package located on the [Releases page for the winget repository](https://github.com/microsoft/winget-cli/releases).
     22 
     23 > The **winget** tool is supported on Windows 10, version 1809 (build 17763) and above.
     24 
     25 ## Administrator considerations
     26 
     27 Installer behavior can be different depending on whether you are running **winget** with administrator privileges.
     28 
     29 * When running **winget** without administrator privileges, some applications may [require elevation](https://docs.microsoft.com/windows/security/identity-protection/user-account-control/how-user-account-control-works) to install. When the installer runs, Windows will prompt you to [elevate](https://docs.microsoft.com/windows/security/identity-protection/user-account-control/how-user-account-control-works). If you choose not to elevate, the application will fail to install.
     30 
     31 * When running **winget** in an Administrator Command Prompt, you will not see [elevation prompts](https://docs.microsoft.com/windows/security/identity-protection/user-account-control/how-user-account-control-works) if the application requires it. Always use caution when running your command prompt as an administrator, and only install applications you trust.
     32 
     33 ## Use winget
     34 
     35 After **App Installer** is installed, you can run **winget** by typing 'winget' from a Command Prompt.
     36 
     37 One of the most common usage scenarios is to search for and install a favorite tool.
     38 
     39 1. To [search](search.md) for a tool, type `winget search <appname>`.
     40 2. After you have confirmed that the tool you want is available, you can [install](install.md) the tool by typing `winget install <appname>`. The **winget** tool will launch the installer and install the application on your PC.
     41     ![winget commandline](images/install.png)
     42 3. In addition to install and search, **winget** provides a number of other commands that enable you to [show details](show.md) on applications, [change sources](source.md), and [validate packages](validate.md). To get a complete list of commands, type: `winget --help`.
     43     ![winget help](images/help.png)
     44 
     45 ### Commands
     46 
     47 The current preview of the **winget** tool supports the following commands.
     48 | Command | Description |
     49 |---------|-------------|
     50 | [install](install.md) | Installs the specified application. |
     51 | [show](show.md) | Displays details for the specified application. |
     52 | [source](source.md) | Adds, removes, and updates the Windows Package Manager repositories accessed by the **winget** tool. |
     53 | [search](search.md) | Searches for an application. |
     54 | [list](list.md) | Display installed packages. |
     55 | [upgrade](upgrade.md) |  Upgrades the given package. |
     56 | [uninstall](uninstall.md) | Uninstalls the given package. |
     57 | [hash](hash.md) | Generates the SHA256 hash for the installer. |
     58 | [validate](validate.md) | Validates a manifest file for submission to the Windows Package Manager repository. |
     59 | [settings](settings.md) | Open settings. |
     60 | [features](features.md) | Shows the status of experimental features. |
     61 | [export](export.md) | Exports a list of the installed packages. |
     62 | [import](import.md) | Installs all the packages in a file. |
     63 | pin | Manage package pins. |
     64 | configure | Configures the system into a desired state. |
     65 | download | Downloads the installer from a given package. |
     66 
     67 ### Options
     68 
     69 The current version of the **winget** tool supports the following options.
     70 
     71 | Option | Description |
     72 |--------------|-------------|
     73 | **-v, --version** | Returns the current version of winget. |
     74 | **--info** |  Provides you with all detailed information on winget, including the links to the license, privacy statement, and configured group policies. |
     75 | **-?, --help** |  Shows additional help for winget. |
     76 | **--wait** | Waits for user input upon command completion. |
     77 | **--logs,--open-logs** | Open the default logs location |
     78 | **--verbose,--verbose-logs** | Enables verbose logging for winget |
     79 | **--disable-interactivity** | Disable interactive prompts |
     80 
     81 ## Supported installer formats
     82 
     83 The current version of the **winget** tool supports the following types of installers:
     84 
     85 * EXE (with **Silent** and **SilentWithProgress** flags)
     86 * INNO
     87 * NULLSOFT
     88 * MSI
     89 * APPX
     90 * MSIX
     91 * BURN
     92 * PORTABLE
     93 * ZIP
     94 
     95 ## Scripting winget
     96 
     97 You can author batch scripts and PowerShell scripts to install multiple applications.
     98 
     99 ```CMD
    100 @echo off
    101 Echo Install Powertoys and Terminal
    102 REM Powertoys
    103 winget install Microsoft.Powertoys
    104 if %ERRORLEVEL% EQU 0 Echo Powertoys installed successfully.
    105 REM Terminal
    106 winget install Microsoft.WindowsTerminal
    107 if %ERRORLEVEL% EQU 0 Echo Terminal installed successfully. %ERRORLEVEL%
    108 ```
    109 
    110 > When scripted, **winget** will launch the applications in the specified order. When an installer returns success or failure, **winget** will launch the next installer. If an installer launches another process, it is possible that it will return to **winget** prematurely. This will cause **winget** to install the next installer before the previous installer has completed.
    111 
    112 ## Missing tools
    113 
    114 If the [community repository](../package/repository.md) does not include your tool or application, please submit a package to our [repository](https://github.com/microsoft/winget-pkgs). By adding your favorite tool, it will be available to you and everyone else.
    115 
    116 ## Customize winget settings
    117 
    118 You can configure the **winget** command line experience by modifying the **settings.json** file. For more information, see [https://aka.ms/winget-settings](https://aka.ms/winget-settings). Note that the settings are still in an experimental state and not yet finalized for the preview version of the tool.
    119 
    120 ## Open source details
    121 
    122 The **winget** tool is open source software available on GitHub in the repo [https://github.com/microsoft/winget-cli/](https://github.com/microsoft/winget-cli/). The source for building the client is located in the [src folder](https://github.com/microsoft/winget-cli/tree/master/src).
    123 
    124 The source for **winget** is contained in a Visual Studio solution. To build the solution correctly, install the latest [Visual Studio with the C++ workload](https://visualstudio.microsoft.com/downloads/).
    125 
    126 We encourage you to contribute to the **winget** source on GitHub. You must first agree to and sign the Microsoft CLA.