microsoft / winget-cli

WinGet is the Windows Package Manager. This project includes a CLI (Command Line Interface), PowerShell modules, and a COM (Component Object Model) API (Application Programming Interface).
https://learn.microsoft.com/windows/package-manager/
MIT License
23.35k stars 1.45k forks source link

Add commandline parameter to set temp directory #4989

Open alie2n opened 5 days ago

alie2n commented 5 days ago

Description of the new feature / enhancement

Hi, in my environment we use WithSecure with a bunch of anti ransomware rules. One of these rules is to prevent rare files with unknown reputation to be run from the default temp path. In my case I tried to install "Microsoft SQL Management Studio" or Git, which were blocked during the installation. I can define exceptions based on the sha256 hash of the installers, but it would be easier to be able to define an alternate temp path to be used.

Proposed technical implementation details

I'd like to be able to call winget like this: winget --temp-path c:\temp install Git.Git

alie2n commented 5 days ago

I'd like to be able to call winget like this: winget --temp-path c:\temp install Git.Git this would download the installer file to C:\temp and execute from there. To prevent overwriting existing files this command could of course create a temporary directory like C:\temp\winget. and put the downloaded file there and remove the folder after the operation.

Trenly commented 5 days ago