Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export/Import apps list #220

Closed
brunovieira97 opened this issue May 19, 2020 · 22 comments · Fixed by #699 or #969
Closed

Export/Import apps list #220

brunovieira97 opened this issue May 19, 2020 · 22 comments · Fixed by #699 or #969
Assignees
Labels
Experimental This experimental feature can be enabled in settings Issue-Feature This is a feature request for the Windows Package Manager client.

Comments

@brunovieira97
Copy link

brunovieira97 commented May 19, 2020

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

@brunovieira97 brunovieira97 added the Issue-Feature This is a feature request for the Windows Package Manager client. label May 19, 2020
@gibfahn
Copy link

gibfahn commented May 24, 2020

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.

@denelon
Copy link
Contributor

denelon commented May 28, 2020

This looks like a duplicate of #155 and #156

@denelon
Copy link
Contributor

denelon commented Mar 4, 2021

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

@denelon denelon linked a pull request Mar 4, 2021 that will close this issue
@denelon
Copy link
Contributor

denelon commented Mar 18, 2021

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"
}

@denelon
Copy link
Contributor

denelon commented Mar 18, 2021

WingetImport

@denelon
Copy link
Contributor

denelon commented Apr 2, 2021

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.

@denelon denelon added the Experimental This experimental feature can be enabled in settings label Apr 22, 2021
@denelon
Copy link
Contributor

denelon commented Apr 22, 2021

Import was just released as a stable feature https://github.com/microsoft/winget-cli/releases/tag/v-0.3.11102-preview.

@denelon denelon modified the milestones: Package Manager v0.6.x, Package Manager v1.0 May 3, 2021
@gioluca2
Copy link

gioluca2 commented May 4, 2021

Is there a site where I can select apps and create a json file?
On winstall . app you can export only a batch file...

@denelon
Copy link
Contributor

denelon commented May 5, 2021

@MehediH This looks like a request to add support to provide a packages.json file.

@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.

@quangkieu
Copy link

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?

@denelon
Copy link
Contributor

denelon commented May 6, 2021

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

@gioluca2
Copy link

gioluca2 commented May 6, 2021

@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?

@denelon
Copy link
Contributor

denelon commented May 6, 2021

@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
    }
}

@gioluca2
Copy link

gioluca2 commented May 6, 2021

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" }

@denelon
Copy link
Contributor

denelon commented May 6, 2021

@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

@gioluca2
Copy link

gioluca2 commented May 6, 2021

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

@denelon
Copy link
Contributor

denelon commented May 6, 2021

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.

@quangkieu
Copy link

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

Hey @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

@Airkro
Copy link

Airkro commented May 12, 2021

will import support interactive to exclude some packages?

@denelon
Copy link
Contributor

denelon commented May 12, 2021

@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.

@gioluca2
Copy link

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

@denelon
Copy link
Contributor

denelon commented May 18, 2021

@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
Labels
Experimental This experimental feature can be enabled in settings Issue-Feature This is a feature request for the Windows Package Manager client.
Projects
None yet
7 participants