Files
winget-pkgs/README.md
Felipe Santos 9619e1aa83 Create SandboxTest script (#827)
* Create SandboxTest script

* Add missing appx dependencies

* Clear temp folder

* Validate manifest before pushing to sandbox

* Fix invalid character in Sandbox.ps1

The dash character in -ExecutionPolicy was a special character which broke the command.

* Download dependencies on the fly

* remove vscode launch file

* Add newline in gitignore

* Fix when there is no temp folder

* Add Test in Sandbox to README

* Add some comments and enhance some messages

* Properly accept mandatory parameter

* Check if Windows Sandbox exist or not

* Fix Sandbox install snippet and typo

* Fix wrong conflict resolution in README

* Upgrade WinGet to v0.1.41821-preview

* Rewrite the whole script

Adding some cool features such as:
- Specify folder to mount (default to current)
- Make Manifest optional, so we can use the script to just start the
  Sandbox and install WinGet
- Add optional Script parameter, to specify which script block to run
  after all the steps inside the Sandbox
- Automatically refresh environment variables after installing the
  Manifest, and leave the function Update-Environment available for the
  users
- Use a temporary folder on system's temp directory, thus deleting the
  .gitignore
- Make Powershell open maximized and without splash messages
- Improve overall UX both in local machine and in the Sandbox
- Close Sandbox automatically if needed
- Upgrade WinGet to latest version

Most of the refactor came from my PR at
https://github.com/chocolatey-community/chocolatey-coreteampackages/pull/1512

* Add tip for Update-Environment

* Fix relative paths on map folder

* Copy the manifest instead of installing from the source

* Fix call without manifest param and enhance logs

* Use VCLibs UWPDesktop from official source and update winget

* Add some missing new lines

* Fetch latest WinGet release automatically

* Add -SkipManifestValidation switch and fix checksum

* Fix TLS issues, handle PowerShell 7, remove unneeded VCLibs dep and fix manifest as folder

* Restore file/folder check for manifest

* Change checksum output filename

* Update Update-EnvironmentVariables function

Co-authored-by: chausner <chausner@users.noreply.github.com>
2021-05-03 11:36:36 -07:00

82 lines
5.3 KiB
Markdown

# Welcome to the Windows Package Manager Community repo
This repository contains the manifest files for the **Windows Package Manager**. You are highly encouraged to submit manifests for your favorite application.
The **Windows Package Manager** is an open source client. You will find the source code [here](https://github.com/microsoft/winget-cli).
# Submitting a Package
To submit a package to the repository, you should follow these steps:
1) Follow the **Contributing** guidelines below
2) Author a Manifest
3) Test your manifest
4) Submit your PR
5) Respond to any feedback
>Note: Please check that the package's manifest you intend to submit does not already exist in the manifests folder, and that there are no open PRs for it in order to avoid duplicates.
## Authoring a Manifest
The minimal manifest syntax is below. Additional information on writing manifests can be found on [Microsoft Docs](https://docs.microsoft.com/en-us/windows/package-manager/package/manifest) or on the [v1.0 manifest spec](https://github.com/microsoft/winget-cli/blob/master/doc/ManifestSpecv1.0.md).
Current limitations are:
* One manifest per PR
Be sure the manifest filenames match the `PackageIdentifier` manifest naming conventions and the manifest is located in the folder path matching `manifests\<first lower case letter of publisher>\<publisher>\<package>\<version>\.yaml`
### Using the YAMLCreate.ps1
To help author manifest files, we have provided a YAMLCreate.ps1 powershell script located in the Tools folder.
The script will prompt you for the URL to the installer, then will prompt you to fill in metadata.
I recommend running the script in the location where you want to produce the manifest file. For example: `manifests\<publisher>\<package>\`. After successful completion, it will produce the YAML file.
### Using Windows Package Manager YAML Generator
If you prefer to use a GUI to generate YAML files, you can use the **Windows Package Manager YAML Generator**. It is available as an app [in the Microsoft Store](https://www.microsoft.com/en-us/p/windows-package-manager-yaml-generator/9p3n60fs22k5) and the code is also available [on GitHub](https://github.com/ptorr-msft/WinGetYamlGenerator).
Although the Windows Package Manager YAML Generator can create YAML files with multiple installers, winget does not support more than one installer for now.
## Test your manifest
Now that you have authored your manifest, you should make sure it works as expected.
### Locally
1) Verify the syntax. You can do that by typing the following command: `winget validate <manifest>`
2) Test the install. You can do that by installing the manifest: `winget install -m <manifest>`
For more details, see [packages](https://docs.microsoft.com/windows/package-manager/package).
### In Windows Sandbox
You can use the [`Tools\SandboxTest.ps1`](Tools/SandboxTest.ps1) script for testing a manifest installation in [Windows Sandbox](https://docs.microsoft.com/en-us/windows/security/threat-protection/windows-sandbox/windows-sandbox-overview). The manifest will be also validated.
Just provide the path to manifest as parameter:
```powershell
.\Tools\SandboxTest.ps1 <path-to-manifest>
```
## Submit your PR
With the manifest verified, you will need to submit a PR. Your manifest should be located in the folder path matching `manifests\<first lower case letter of publisher>\<publisher>\<package>\<version>.yaml`
### Validation Process
The PR request will go through a validation process. During the process, the PR request will get labels to help drive the validation.
In the event of a failure, the BOT will suggest where the problem is with the submission and assign the PR back to you.
### Respond to PR feedback
If the PR has been assigned to you, a timer is triggered. You will have 7 days to resolve the issue, or the PR will be closed automatically by the BOT.
The installer may be identified as malware. If you believe it's a false positive you can submit the installer to the defender team for analysis from [here](https://www.microsoft.com/wdsi/filesubmission).
For a list of the BOT labels, see [packages](https://docs.microsoft.com/windows/package-manager/package/repository#pull-request-labels).
# Contributing
This project welcomes contributions and suggestions. Most contributions require you to agree to a
Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.
When you submit a pull request, a CLA bot will automatically determine whether you need to provide
a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions
provided by the bot. You will only need to do this once across all repos using our CLA.
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
For the avoidance of doubt, you may not make any Submissions linking to third party materials if such
Submission is prohibited by the applicable third party and/or otherwise violates such third party's rights.