iTranslated by AI

The content below is an AI-generated translation. This is an experimental feature, and may contain errors. View original article
🪆

Windows: winget: Installing Apps with Options

に公開
2021/12/24

Introduction

With winget, you can specify options during installation. However, since it is still in development preview, not everything works perfectly.

In this article, I will explain useful options to know. Based on results tested with winget v1.0.11694

Basic Installation Syntax

winget installs apps using the following syntax:

winget install <package> [<options>]


<package> specifies the package of the app to be installed. For how to specify it, please refer to Basic app installation methods with winget.

<options> specifies the detailed behavior of the installer. Frequently used options are explained in this article.

Frequently Used Options

I will explain frequently used options.

  • --help
    Outputs information about each option available for the install command.

    PowerShell
    winget install --help
    
    
  • -i, --interactive
    Performs an interactive installation. User input may be required.

    PowerShell
    winget install <package> --interactive
    
    
  • -h, --silent

    Performs a silent installation. If supported by the package

    PowerInstall
    winget install <package> --silent
    
    
  • -o, --log
    Outputs the installation log to the specified log file.

    winget install <package> --log <logfile>
    
    
  • -e, --exact
    Installs the package that exactly matches the input keyword, including case sensitivity. Mainly used to specify packages by ID

    PowerShell
    winget install --exact <package>
    
    
  • -v, --version
    Installs the specified version of the package. ~(If this option is not specified, the latest version will be installed)~

    PowerShell
    winget install <package> --version <version>
    
    
  • -l, --location
    Installs the app at the location specified in the option. If supported by the package
    Currently, folders containing spaces are not supported

    PowerShell
    winget install <package> --location <installDir>
    
    
  • --override
    Specifies options for the package's installer.
    Use this option for fine-grained app-specific settings, such as changing the installation destination.
    If you want to specify multiple options, wrap them in quotes

    PowerShell
    winget install <package> --override <installOption>
    
    

The following links are helpful for reference:

GitHubで編集を提案

Discussion