Skip to content

Export/Import apps list #220

Closed

Description

@brunovieira97

Description of the new feature/enhancement

Allow the user to export a list of all currently installed apps from WinGet.

This list can then be imported (with the specific versions too) on WinGet and its apps will be batch installed. Useful for a "dotfiles-based" computer setup, where I just have a winget-apps.json and can set my machine up with a single command.

Poposed commands:

  • winget export <app-list>
    • Here the user can specify an app list for exporting, or use --all or * for exporting the entire list.
  • winget import <file-path>

Edited by denelon:

Stable Feature
winget import packages.json - installs packages referenced in packages.json (requires sources to be configured).
winget import -? - displays help for the import command.

Experimental Feature
winget export packages.json - generates export file for packages in Add / Remove Programs matching installed sources.
winget export -? - displays help for the export command.

Note: export depends on list also being enabled.

winget features - displays all experimental features and their status
winget settings - launches settings.json to configure settings like experimental features

Edited: experimental status

Activity

  1. gibfahn commented on May 24, 2020

    @gibfahn

    For an example in other package managers see Homebrew's brew bundle.

    Nice thing about it is it's easy to add support for other tools like Casks, mas, and whalebrew, all of which are (or started as) third-party extensions to brew.

  2. denelon commented on May 28, 2020

    @denelon
    Collaborator

    This looks like a duplicate of #155 and #156

  3. added this to the milestone on May 28, 2020
  4. modified the milestones: , on Aug 19, 2020
  5. denelon commented on Mar 4, 2021

    @denelon
    Collaborator

    The schema for the import file is located at https://aka.ms/winget-packages.schema.1.0.json

  6. linked a pull request that will close this issueAdd Export/Import commands #699on Mar 4, 2021
  7. denelon commented on Mar 18, 2021

    @denelon
    Collaborator

    I'll be publishing a build with "import" enabled next week if testing goes well. I'm publishing a sample file here as a starting point.

    {
    	"$schema" : "https://aka.ms/winget-packages.schema.1.0.json",
    	"CreationDate" : "2021- 3-18 13:14:44.599",
    	"Sources" : 
    	[
    		{
    			"Packages" : 
    			[
    				{
    					"Id" : "Microsoft.Whiteboard"
    				}
    			],
    			"SourceDetails" : 
    			{
    				"Argument" : "https://winget.azureedge.net/msstore",
    				"Identifier" : "Microsoft.Winget.MSStore.Source_8wekyb3d8bbwe",
    				"Name" : "msstore",
    				"Type" : "Microsoft.PreIndexed.Package"
    			}
    		},
    		{
    			"Packages" : 
    			[
    				{
    					"Id" : "Microsoft.PowerToys"
    				}
    			],
    			"SourceDetails" : 
    			{
    				"Argument" : "https://winget.azureedge.net/cache",
    				"Identifier" : "Microsoft.Winget.Source_8wekyb3d8bbwe",
    				"Name" : "winget",
    				"Type" : "Microsoft.PreIndexed.Package"
    			}
    		}
    	],
    	"WinGetVersion" : "0.2.10771"
    }
  8. denelon commented on Mar 18, 2021

    @denelon
    Collaborator

    WingetImport

  9. denelon commented on Apr 2, 2021

    @denelon
    Collaborator

    Note: if you have a terminal or shell in your import, it will restart and interrupt the flow of package installation. I've had success with one of these packages if it's the last one in the list.

  10. denelon commented on Apr 22, 2021

    @denelon
    Collaborator
  11. 4 remaining items

  12. quangkieu commented on May 6, 2021

    @quangkieu

    I wonder if export feature could also output list of generic unknown source and its version info from registry if available
    How about driver info? As now Windows would like to push to DCH type, I though this type of driver give Windows more info and control.
    Or those hidden OEM pre-install programs?

  13. denelon commented on May 6, 2021

    @denelon
    Collaborator

    Quang Kieu (@quangkieu) what scenario would providing the list of applications without a known source address? You've piqued my interest 😄

  14. gioluca2 commented on May 6, 2021

    @gioluca2

    gioluca2 You can enable export in your settings to run an export. Then you can modify that file with the packages you want included for import.

    Sorry but I don't understand which settings you are talking about. Can you help me?

  15. denelon commented on May 6, 2021

    @denelon
    Collaborator

    gioluca2 you can execute winget settings your default .json editor will open. If you have Visual Studio Code configured as your default editor the schema file at the top will help provide auto-complete and context aware help.

    You can enable the "export" ("list" is also required) as an experimental feature to generate an initial file to start with:
    winget export packages.json for example.

    Then you can edit the packages listed in that file to build an import.
    winget import packages.json for example.

    Here is a sample for settings.json:

    {
        "$schema": "https://aka.ms/winget-settings.schema.json",
        "experimentalFeatures": {
            "list": true,
            "export": true
        }
    }
  16. gioluca2 commented on May 6, 2021

    @gioluca2

    The command "winget list" returns wrong ids. I try to import this packages.json:

    { "$schema" : "https://aka.ms/winget-packages.schema.1.0.json", "CreationDate" : "2021-05-07T00:13:54.897-00:00", "Sources" : [ { "Packages" : [ { "Id" : "7-Zip" }, { "Id" : "Audacity_is1" }, { "Id" : "Bitdefender" }, { "Id" : "CCleaner" }, { "Id" : "Discord" }, { "Id" : "FFBATCH_cv_is1" }, { "Id" : "FormatFactory" }, { "Id" : "Mozilla Firefox (x64 it)" }, { "Id" : "Notepad++ (64-bit x64)" }, { "Id" : "OBS Studio" }, { "Id" : "ProPlusRetail - it-it" }, { "Id" : "Skype_is1" }, { "Id" : "VLC media player" }, { "Id" : "WhatsApp" }, { "Id" : "jdownloader2" }, { "Id" : "Microsoft.Edge" }, { "Id" : "Google.DriveFileStream" } ], "SourceDetails" : { "Argument" : "https://winget.azureedge.net/cache", "Identifier" : "Microsoft.Winget.Source_8wekyb3d8bbwe", "Name" : "winget", "Type" : "Microsoft.PreIndexed.Package" } } ], "WinGetVersion" : "0.2.10971" }

  17. denelon commented on May 6, 2021

    @denelon
    Collaborator

    gioluca2 the "Id" needs to be the same value as "PackageIdentifier" in the v1.0 manifest schema. For example, "7-zip" should be "7zip.7zip"
    7zip

  18. gioluca2 commented on May 6, 2021

    @gioluca2

    And so I have to search all packages one by one...

  19. denelon commented on May 6, 2021

    @denelon
    Collaborator

    We're still working on the logic for list (it drives export and several other features). I've made several changes recently to manifests to improve matching (including 7-zip). We have a client coming out in the next few days with changes implemented to improve matching logic. We will continue working on this area. It's the reason "list", "upgrade", "uninstall", and "export" are all still experimental features.

  20. quangkieu commented on May 10, 2021

    @quangkieu

    Quang Kieu (@quangkieu) what scenario would providing the list of applications without a known source address? You've piqued my interest 😄

    Hey Demitrius Nelon (@denelon), mostly so the output of export match what winget list is showing and we could use the output as a way to compare between systems, easy to consume for next step in script as right now the winget list is much hard consume compare to json file

  21. Airkro commented on May 12, 2021

    @Airkro

    will import support interactive to exclude some packages?

  22. denelon commented on May 12, 2021

    @denelon
    Collaborator

    Eric Chen (@Airkro) feel free to request the feature covering the scenario you are interested in 😄. The initial intent for import was to give a single command to install a set of packages. Most of the users requesting that capability in asks I received were looking for unattended use cases. I think we will want to be able to have commands or arguments (and an import file structure) to support many other scenarios. Several installers don't support silent/unattended behavior. In order to allow those into the repository we need to ensure the silent/unattended scenario works for the other commands in the Windows Package Manager client.

  23. gioluca2 commented on May 18, 2021

    @gioluca2

    I can't find real ID of bitdefender, ffbatch and office 2019. Can you help me?

  24. denelon commented on May 18, 2021

    @denelon
    Collaborator

    Gio Luca (@gioluca), I did a search for all three. "Microsoft.Office" version 16.0.1329.20371 is available. You might need to create a "Help-Wanted" Issues in the https://github.com/microsoft/winget-pkgs repository to ask for the other two packages to be added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

ExperimentalThis experimental feature can be enabled in settingsIssue-FeatureThis is a feature request for the Windows Package Manager client.

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions