winget-cli icon indicating copy to clipboard operation
winget-cli copied to clipboard

Enhance import/export schema to include override values

Open MisinformedDNA opened this issue 4 years ago • 7 comments

Add a Override property to the schema for each package.

Beyond using the Import feature to specify what I want to install, I would like to specify how I want to install. For instance, when I install Git, I prefer to exclude shell integration. For VS, I probably want to specify certain workloads.

At it's simplest form, a user can simply edit the schema file to include their desired overrides. A more complex use case would be for winget to remember the arguments used during install so that it can export those values as well.

We may also want to add a command line option for winget input to ignore the overrides.

Proposed technical implementation details (optional)

Desired schema:

"Packages": {
  "items": {
    "properties": {
      "PackageIdentifier": { },
      "Version": { },
      "Channel": { },
      "Scope": { },
      "Override": {
        "description": "Arguments passed through to --override",
        "type": "string"
      },
    }
  }
}

Desired example

{
  "Sources": 
  [
    {
      "Packages": 
      [
        {
          "PackageIdentifier": "Microsoft.VisualStudio.2019.Enterprise",
          "Override": "--add Microsoft.VisualStudio.Workload.Universal"
        },
        {
          "PackageIdentifier": "Git.Git",
          "Override": "/NoShellIntegration /NoGitLfs"
        },
      ],
    }
  ],
}

MisinformedDNA avatar Sep 25 '21 20:09 MisinformedDNA

I really want this too, because for things like Visual Studio there's a very small chance you're going to use the arguments we pass in since you want your own workloads. Saving the custom arguments somewhere (although I know winget doesn't have a lot of state on the system right now, this might be something where that should change) so that they can be put into the file you get on winget export would be awesome!

jedieaston avatar Sep 25 '21 23:09 jedieaston

I was trying to use this for adding workloads to my install of Visual Studio.

alananderson-Allocate avatar May 23 '22 02:05 alananderson-Allocate

What can we do to help move on this? Would be super useful especially for pre-defined install scenarios where the export / import feature would be helpful.

Note that the Import support for such feature should come before the support for populating this in the "export" function (as some parameters might not be good to re-export - relevant to only one machine, etc..)

Trouffman avatar Jan 03 '23 19:01 Trouffman

Doesn't the v2 schema support doing this now?

Eonasdan avatar Jan 04 '23 14:01 Eonasdan

@Eonasdan it does not look like it.

There is a section "Argument": { "description": "Argument used to install the source", "type": "string" }, But this is under the "Source" object (URL to the "cache" source repo) and not the Package.

Trouffman avatar Jan 04 '23 15:01 Trouffman

Ah yes you are correct.

Eonasdan avatar Jan 05 '23 14:01 Eonasdan

my current company just went through a dept-wide laptop refresh for devs - how I wish this was an option before the holidays. I really want this feature. I'd be okay if we treated this like nodejs packages.json ex: winget install --id "abc" --save, and a winget.packages.json file saves the package and args. just thoughts. then we can use that file to install. manual, but sure be nice.

reecebradley avatar Jan 13 '23 14:01 reecebradley

Hi everyone,

I also want to voice my support for this request. Having something like this would greatly help in my automated winget deployments and would reduce my reliance on other third-party tools to accomplish this task. I would like to use winget for most of my application management needs going forward, and the implementation of this feature alone would allow for this to happen.

I'm not very familiar with the winget codebase beyond the manifest files themselves, but I'd be willing to learn and help someone else with the implementation if this isn't feasible for only one person to work on.

Thanks in advance for your consideration!

mariobrostech avatar Jul 20 '23 16:07 mariobrostech