Skip to content

Commit 8ae31ed

Browse files
committed
Merge from master
2 parents 3eca4b0 + 5c66da1 commit 8ae31ed

40 files changed

+1328
-225
lines changed

.github/actions/spelling/allow.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,8 @@ subcontext
306306
SUBLANG
307307
subresource
308308
subselect
309+
substr
310+
SUPPRESSMSGBOXES
309311
SWIPECONTROL
310312
SYMED
311313
symlinktarget

.github/actions/spelling/expect.txt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ APPTERMINATION
2323
argumentlist
2424
ARMNT
2525
arphelper
26-
ASAN
26+
asan
2727
ASequence
2828
ashpatil
2929
Ashwini
@@ -78,6 +78,7 @@ corecrt
7878
count'th
7979
countof
8080
countryregion
81+
Cov
8182
CPIL
8283
craigloewen
8384
createmanifestmetadata
@@ -137,6 +138,7 @@ foldcase
137138
FOLDERID
138139
FORPARSING
139140
foundfr
141+
fsanitize
140142
fundraiser
141143
fuzzer
142144
fzanollo
@@ -158,6 +160,7 @@ HINSTANCE
158160
hkey
159161
hlocal
160162
hmodule
163+
Hostx
161164
hre
162165
hresults
163166
hrow
@@ -175,6 +178,7 @@ iid
175178
IISOn
176179
ilemode
177180
inproc
181+
Insta
178182
installinprogress
179183
INSTALLPROPERTY
180184
installshield
@@ -207,6 +211,7 @@ KNOWNFOLDERID
207211
ktf
208212
ldcase
209213
learnxinyminutes
214+
libfuzzer
210215
libsolv
211216
libyaml
212217
Linq
@@ -305,6 +310,7 @@ nuffing
305310
objbase
306311
objidl
307312
ofile
313+
onefuzz
308314
ools
309315
oop
310316
OPTOUT
@@ -320,6 +326,7 @@ PCCERT
320326
PCs
321327
pcwsz
322328
PDWORD
329+
peetdev
323330
PEGI
324331
PFM
325332
pfxpath
@@ -471,6 +478,7 @@ VALUENAMECASE
471478
vclib
472479
VERSI
473480
VERSIE
481+
visualstudiocode
474482
vns
475483
vsconfig
476484
vstest

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ settings.json
2020
[Rr]eleases/
2121
x64/
2222
x86/
23+
Fuzzing/
2324
bld/
2425
[Bb]in/
2526
[Oo]bj/

azure-pipelines.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -538,3 +538,57 @@ jobs:
538538
inputs:
539539
targetPath: '$(Build.ArtifactStagingDirectory)'
540540
condition: succeededOrFailed()
541+
542+
- job: 'Fuzzing'
543+
timeoutInMinutes: 60
544+
condition: not(eq(variables['Build.Reason'], 'PullRequest'))
545+
546+
strategy:
547+
matrix:
548+
x64:
549+
buildConfiguration: 'Fuzzing'
550+
buildPlatform: 'x64'
551+
x86:
552+
buildConfiguration: 'Fuzzing'
553+
buildPlatform: 'x86'
554+
555+
variables:
556+
buildOutDir: $(Build.SourcesDirectory)\src\$(buildPlatform)\$(buildConfiguration)
557+
artifactsDir: $(Build.ArtifactStagingDirectory)\$(buildPlatform)
558+
559+
steps:
560+
- task: NuGetToolInstaller@1
561+
displayName: Install Nuget
562+
563+
- task: NuGetCommand@2
564+
displayName: Restore Solution
565+
inputs:
566+
restoreSolution: '$(solution)'
567+
568+
- task: VSBuild@1
569+
displayName: Build Fuzzing Artifacts
570+
inputs:
571+
platform: '$(buildPlatform)'
572+
solution: '$(solution)'
573+
configuration: '$(buildConfiguration)'
574+
msbuildArgs: '/bl:$(artifactsDir)\msbuild.binlog'
575+
576+
- task: CopyFiles@2
577+
displayName: Copy Fuzzing Artifacts for Publishing
578+
inputs:
579+
SourceFolder: '$(buildOutDir)\WinGetYamlFuzzing'
580+
Contents: '**'
581+
TargetFolder: '$(artifactsDir)'
582+
583+
- task: PublishPipelineArtifact@1
584+
displayName: Publish Fuzzing Artifacts
585+
inputs:
586+
targetPath: '$(artifactsDir)'
587+
588+
- task: onefuzz-task@0
589+
inputs:
590+
onefuzzOSes: 'Windows'
591+
env:
592+
onefuzzDropDirectory: '$(buildOutDir)\WinGetYamlFuzzing'
593+
onefuzzDropPAT: $(onefuzzDropPAT)
594+
onefuzzFilingBugPAT: $(onefuzzBugFilingPAT)
Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
---
2+
author: Roy MacLachlan @RDMaclachlan, Ryan Fu @ryfu-msft
3+
created on: 2023-02-09
4+
last updated: 2024-02-15
5+
issue id: 658
6+
---
7+
8+
# `Download` command
9+
10+
"For [#658](https://github.com/microsoft/winget-cli/issues/658)"
11+
12+
## Abstract
13+
14+
This spec describes the functionality and high-level implementation design for downloading package installers using the Windows Package Manager.
15+
16+
## Inspiration
17+
18+
This is inspired by customer feedback, and a need for broader application deployments:
19+
* Customers want to share the installer with an offline device.
20+
21+
## Solution Design
22+
23+
The `download` command will provide users with the ability to download any installer from a single package. The following command options are available:
24+
25+
```
26+
-d,--download-directory Directory where the installers are downloaded to
27+
-m,--manifest The path to the manifest of the package
28+
--id Filter results by id
29+
--name Filter results by name
30+
--moniker Filter results by moniker
31+
-v,--version Use the specified version; default is the latest version
32+
-s,--source Find package using the specified source
33+
--scope Select install scope (user or machine)
34+
-a,--architecture Select the architecture
35+
--installer-type Select the installer type
36+
-e,--exact Find package using exact match
37+
--locale Locale to use (BCP47 format)
38+
--ignore-security-hash Ignore the installer hash check failure
39+
--skip-dependencies Skips processing package dependencies and Windows features
40+
--header Optional Windows-Package-Manager REST source HTTP header
41+
--authentication-mode Specify authentication window preference (silent, silentPreferred or interactive)
42+
--authentication-account Specify the account to be used for authentication
43+
--accept-package-agreements Accept all license agreements for packages
44+
--accept-source-agreements Accept all source agreements during source operations
45+
-?,--help Shows help about the selected command
46+
--wait Prompts the user to press any key before exiting
47+
--logs,--open-logs Open the default logs location
48+
--verbose,--verbose-logs Enables verbose logging for winget
49+
--disable-interactivity Disable interactive prompts
50+
```
51+
52+
### Selecting the installer
53+
A new command argument for `--installer-type` has been added to support selecting a specific installer type to download. A package installer should also be able to be selected by `--scope`, `--architecture`, and `--locale`.
54+
55+
### Downloading the installer
56+
Downloading the package's installer will still require that the package's installer hash be verified before becoming available to the user to interact with. By default, installers will be downloaded to a unique folder name located in the `%USERPROFILE%/Downloads` directory. The default download directory can be modified in the user's settings. The unique folder name is comprised of the package identifier and package version. The installer will be comprised of the package identifier, package version, scope, architecture, and locale. This naming pattern ensures that the installer is unique and identifiable based on the installer filters applied:
57+
58+
> Example installer download path name: `%USER_PROFILE%\Downloads\Microsoft.PowerToys_0.78.0\PowerToys (Preview)_0.78.0_User_X64_burn_en-US.exe`
59+
60+
When downloading the package's installer, if a file with the same name exists the new download will overwrite the existing file.
61+
62+
### Downloading the manifest
63+
Along with downloading the installer, a merged manifest will be generated and outputted in the same installer download directory. The naming of the file will be exactly the same as the installer except for the extension which will be `.yaml`. The manifest is useful for providing information about the installer such as scope, product code, installer switches, etc.
64+
65+
## UI/UX Design
66+
67+
### WinGet Command Line
68+
Downloading an installer will output information relative to each step performed. Informing the user of any license agreements that must be accepted prior to download. Acceptance of license agreements will trigger the download to begin, displaying a progress bar that shows the download status. Upon download, the user will then be informed of the file hash validation status before being notified of the download status.
69+
70+
The following is representative of the user experience.
71+
72+
```PowerShell
73+
PS C:\> WinGet download --id Microsoft.VisualStudioCode
74+
Found Microsoft Visual Studio Code [Microsoft.VisualStudioCode] Version 1.73.1
75+
This application is licensed to you by its owner.
76+
Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.
77+
Starting package download...
78+
\
79+
Successfully verified installer hash
80+
Installer downloaded:%USERPROFILE%\Downloads\Microsoft.VisualStudioCode_1.86.1\Microsoft Visual Studio Code_1.86.1_User_X64_inno_en-US.exe
81+
```
82+
83+
When the user runs `download` command with the `--help` argument, the following information will be provided:
84+
85+
```
86+
PS C:\> WinGet Download --help
87+
Windows Package Manager v1.1.1
88+
Copyright (c) Microsoft Corporation. All rights reserved.
89+
90+
Downloads the installer from the selected package, either found by searching a configured source or directly from a manifest. By default, the query must case-insensitively match the id, name, or moniker of the package. Other fields can be used by passing their appropriate option. By default, download command will download the appropriate installer to the user's Downloads folder.
91+
92+
usage: winget download [[-q] <query>] [<options>]
93+
```
94+
95+
### WinGet Setting - Default Download Output
96+
97+
The following items will be included in the WinGet Settings Schema
98+
99+
```json
100+
"DownloadBehavior: {
101+
"defaultDownloadDirectory":"%USERPROFILE%/Downloads/"
102+
}"
103+
```
104+
105+
The "defaultDownloadDirectory" setting will be used as the default folder where the package installer and manifest is downloaded to.
106+
107+
### WinGet PowerShell Cmdlet
108+
WinGet PowerShell cmdlet will download the identified package's installer and manifest based on the user specified parameters. While downloading the package's installer, PowerShell will show a progress bar displaying the progress. Afterwards, it will return the downloaded directory where the files were downloaded to.:
109+
110+
```PS
111+
PS C:\> Get-Help Save-WinGetPackage
112+
113+
NAME
114+
Save-WinGetPackage
115+
116+
SYNOPSIS
117+
Downloads a package installer from a WinGet configured source.
118+
119+
SYNTAX
120+
Save-WinGetPackage [-ID <System.String>] [-Name <System.String>] [-Moniker <System.String>]
121+
[-Scope <System.String>] [-Locale <System.String>] [-FileName <System.String>]
122+
[-Version <System.String>] [-Source <System.String>] [-Architecture <System.String>] [-Exact]
123+
[-Output <System.String>] [InstallerType <System.String>] [-IgnoreSecurityHash]
124+
[-AcceptPackageAgreement] [-Wait] [-Verbose]
125+
126+
DESCRIPTION
127+
Downloads a package installer and manifest, either found by searching a configured source or
128+
directly from a manifest. By default, the query must case-insensitively match the id, name, or
129+
moniker of the package. Other fields can be used by passing their appropriate option.
130+
131+
```
132+
133+
## Capabilities
134+
135+
### Accessibility
136+
137+
Accessibility should not be impacted by this change. There will be a new column in WinGet search that will appear if an application is downloadable.
138+
139+
### Security
140+
141+
Security of the Windows Package Manager should not be impacted by this change.
142+
143+
### Reliability
144+
145+
There will be no change to the reliability of the Windows Package Manager.
146+
147+
### Compatibility
148+
149+
There will be no breaking changes to the code. A subsection of the WinGet Install functionality will be leveraged for this new functionality.
150+
151+
### Performance, Power, and Efficiency
152+
153+
## Potential Issues
154+
155+
## Future considerations
156+
157+
* AAD Authentication
158+
159+
## Resources

0 commit comments

Comments
 (0)