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

Look into winget for CLI wanix #140

Closed
taramk opened this issue Apr 5, 2024 · 4 comments
Closed

Look into winget for CLI wanix #140

taramk opened this issue Apr 5, 2024 · 4 comments
Assignees
Milestone

Comments

@taramk
Copy link
Collaborator

taramk commented Apr 5, 2024

Find out where the docs are to set that up and create an outline of what's necessary to set it up

@taramk taramk added this to the 0.2 milestone Apr 5, 2024
@Parzival-3141
Copy link
Collaborator

Winget Package Submission: CliffsNotes edition

winget uses a repository of manifest files to query package information. There's two repositories which are pertinent to submission:

  • The open-source winget-pkgs repository, which acts as a staging ground for manifest updates and submissions.
  • The public-facing package catalog, which contains the current set of published manifests used by the winget cli.

Manifests submitted to the GitHub repository are automatically validated and, if accepted, pushed to the public-facing catalog.

Create package manifest

Manifests are written in YAML. Microsoft supplies some tools to help create manifests (winget-create and YAMLCreate), but you can always create one by hand.

If your package contains one installer and locale, only one YAML file is necessary. Otherwise multiple must be used. Here's the minimum number of files for the latter case:

  • Version
  • Default locale
  • Installer
  • Additional locales (recommended)

And here are the currently supported installer types:

  • exe
  • MSI
  • MSIX
  • Inno
  • WiX
  • Nullsoft
  • APPX

See the documentation for more details.

Submit manifest

After creating your manifest, you can submit it by creating a pull-request on the winget-pkgs repository. A GitHub workflow will automatically validate the manifest and ensure it complies with their policies. You should validate your package locally before submission.

It seems that the submission process should be relatively quick, as validated manifests are merged automatically. The publishing pipeline runs as long as there are new valid manifests to publish. From start to finish, it shouldn't take more than a few hours.

1. Validate locally

Manifests must adhere to Microsoft's policies.
For example:

  • The manifest complies with the schema requirements.
  • All URLs in the manifest lead to safe websites.
  • The installer and application are virus free. The package may be identified as malware by mistake. If you believe it is a false positive you can submit the installer to the Microsoft Defender team for analysis.
  • The application installs and uninstalls correctly for both administrators and non-administrators.
  • The installer supports non-interactive modes.
  • All manifest entries are accurate and not misleading.
  • The installer comes directly from the publisher's website.

The winget cli provides a tool for validating manifests locally:

winget validate <path-to-manifests>

If your manifest is deemed valid, move on to the next step.

Optionally, you can also test your manifest in the Windows Sandbox.

2. Add manifest to local repository

Fork and clone the winget-pkgs repository.

You must add your manifest files to the repository in the following folder structure:

manifests / letter / publisher / application / version

  • The manifests folder is the root folder for all manifests in the repository.
  • The letter folder is the first letter of the publisher name in the lower case. For example, m of the publisher Microsoft.
  • The publisher folder is the name of the company that publishes the software. For example, Microsoft.
  • The application folder is the name of the application or tool. For example, VSCode.
  • The version folder is the version of the application or tool. For example, 1.0.0.

The PackageIdentifier and the PackageVersion values in the manifest must match the publisher, application names and version in the manifest folder path. For more information, see Create package manifest.

3. Create pull request

Commit and push your changes, then create a PR on winget-pkgs repository. Once the automated validation process has completed, your package will be manually reviewed by a moderator. If accepted, it will then be added to the public-facing winget catalog.

The GitHub bot will add labels to your PR to communicate progress. You'll be notified if there are errors during the validation process, and the labels and bot will help you fix your submission. Here's the list of common errors.

@progrium
Copy link
Contributor

Presumably if installer type is exe it can just be an executable?

@Parzival-3141
Copy link
Collaborator

Parzival-3141 commented Apr 22, 2024

It seems so. The only requirement seems to be options for silent installs, i.e. bypassing the GUI wizard

@progrium
Copy link
Contributor

But is the exe expected to be an installer or can it be the executable that's installed? How do we get a wanix binary put somewhere it can be called (PATH or whatever)? Can you see what some other simple CLI utilities are doing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants