diff --git a/.github/ISSUE_TEMPLATE/Bug_Report.yml b/.github/ISSUE_TEMPLATE/Bug_Report.yml index cbb4b5b49b..894db6ab0c 100644 --- a/.github/ISSUE_TEMPLATE/Bug_Report.yml +++ b/.github/ISSUE_TEMPLATE/Bug_Report.yml @@ -9,8 +9,8 @@ body: > **Important: When reporting BSODs or security issues, DO NOT attach memory dumps, logs, or traces to GitHub issues**. > Instead, send dumps/traces to secure@microsoft.com, referencing this GitHub issue. > - > If this is an application crash, please also provide a Feedback Hub submission link if at all possible so we can find your diagnostic data on the backend. - > You can open the Feedback Hub directly to the pre-populated form at https://aka.ms/winget-feedback + > If this is an application crash, please provide a Feedback Hub submission link if possible so we can find your diagnostic data on the backend. + > You can open the Feedback Hub directly to the prepopulated form at https://aka.ms/winget-feedback > Alternatively, use the category "Apps > Windows Package Manager" and choose "Share My Feedback" after submission to get the link. > > Please use this form and describe your issue, concisely but precisely, with as much detail as possible. diff --git a/.github/actions/spelling/README.md b/.github/actions/spelling/README.md index 1f699f3de3..01bb8c2e1e 100644 --- a/.github/actions/spelling/README.md +++ b/.github/actions/spelling/README.md @@ -14,4 +14,4 @@ File | Purpose | Format | Info [advice.md](advice.md) | Supplement for GitHub comment when unrecognized words are found | GitHub Markdown | [advice](https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples%3A-advice) Note: you can replace any of these files with a directory by the same name (minus the suffix) -and then include multiple files inside that directory (with that suffix) to merge multiple files together. +and then include multiple files inside that directory (with that suffix) to merge multiple files. diff --git a/.github/actions/spelling/advice.md b/.github/actions/spelling/advice.md index 1004eeaa60..4bca1ad52b 100644 --- a/.github/actions/spelling/advice.md +++ b/.github/actions/spelling/advice.md @@ -14,7 +14,9 @@ https://www.regexplanet.com/advanced/perl/) yours before committing to verify it * well-formed pattern. - If you can write a [pattern](https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples:-patterns) that would match it, + If you can write a [pattern]( +https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples:-patterns +) that would match it, try adding it to the `patterns.txt` file. Patterns are Perl 5 Regular Expressions - you can [test]( @@ -23,3 +25,6 @@ https://www.regexplanet.com/advanced/perl/) yours before committing to verify it Note that patterns can't match multiline strings. + diff --git a/.github/actions/spelling/allow.txt b/.github/actions/spelling/allow.txt index b3aa0806e9..809babdc53 100644 --- a/.github/actions/spelling/allow.txt +++ b/.github/actions/spelling/allow.txt @@ -17,7 +17,9 @@ appxsdk APSTUDIO ARRAYSIZE artifactstagingdirectory +Asn aspirational +Authenticode AUTOLISTEN azureedge binlog @@ -40,8 +42,7 @@ COMMANDBARFLYOUT COMMONDATA comparand conemu -contosa -contosainstaller +contoso COSTDEFERRED cotaskmem cpprest @@ -69,6 +70,7 @@ denelon depersist differentpath DIRECTONLY +DISMAPI distro dllmain dotnet @@ -143,6 +145,7 @@ INVALIDARG INVALIDSID iot IPinning +ipmo IPortable ISAPPROVEDFOROUTPUT IUnknown @@ -163,6 +166,7 @@ MAKEINTRESOURCE makemsix MANIFESTSCHEMA MANIFESTVERSION +meme metadatas Minimatch Moq @@ -194,6 +198,7 @@ norestart normalizednameandpublisher normalizedpackagenameandpublisher notcontains +NTAPI NTSTATUS nullsoft nunit @@ -209,6 +214,9 @@ packagefamilyname packageidentifier packagename PACKAGESSCHEMA +paket +Params +params parentidx pathpart Pathto @@ -224,11 +232,14 @@ pinningindex pipssource Pkcs portableindex +powertoys pplx ppv PRECONFIG preindexed prepareforpackaging +prepopulate +prepopulated prioritization processthreadsapi PRODUCTNAME @@ -251,6 +262,7 @@ removemanifest removepin removeportablefile repolibtest +requeue rescap resetpins resheader @@ -287,6 +299,7 @@ SHTDN shtypes signtool silentwithprogress +Silverlight simplesave simpletest sln @@ -330,7 +343,7 @@ Testrun testsettingname TEXTFORMAT TEXTINCLUDE -Threadpool +threadpool tpl TRACELOGGING triaged @@ -371,6 +384,7 @@ vcvars vcxitems VERYSILENT VFT +visualstudio VOS vso wapproj diff --git a/.github/actions/spelling/candidate.patterns b/.github/actions/spelling/candidate.patterns index 4b40e728ee..b159d41dc0 100644 --- a/.github/actions/spelling/candidate.patterns +++ b/.github/actions/spelling/candidate.patterns @@ -2,24 +2,39 @@ ^.*/\* #no-spell-check-line \*/.*$ # marker for ignoring a comment to the end of the line // #no-spell-check.*$ +# marker to ignore all code on line +^.*\bno-spell-check(?:-line|)(?:\s.*|)$ + +# https://cspell.org/configuration/document-settings/ +# cspell inline +^.*\b[Cc][Ss][Pp][Ee][Ll]{2}:\s*[Dd][Ii][Ss][Aa][Bb][Ll][Ee]-[Ll][Ii][Nn][Ee]\b # patch hunk comments -^\@\@ -\d+(?:,\d+|) \+\d+(?:,\d+|) \@\@ .* +^@@ -\d+(?:,\d+|) \+\d+(?:,\d+|) @@ .* # git index header -index [0-9a-z]{7,40}\.\.[0-9a-z]{7,40} +index (?:[0-9a-z]{7,40},|)[0-9a-z]{7,40}\.\.[0-9a-z]{7,40} + +# file permissions +['"`\s][-bcdLlpsw](?:[-r][-w][-Ssx]){2}[-r][-w][-SsTtx]\+?['"`\s] + +# css url wrappings +\burl\([^)]+\) # cid urls (['"])cid:.*?\g{-1} # data url in parens -\(data:[^)]*?(?:[A-Z]{3,}|[A-Z][a-z]{2,}|[a-z]{3,})[^)]*\) +\(data:(?:[^) ][^)]*?|)(?:[A-Z]{3,}|[A-Z][a-z]{2,}|[a-z]{3,})[^)]*\) # data url in quotes -([`'"])data:.*?(?:[A-Z]{3,}|[A-Z][a-z]{2,}|[a-z]{3,}).*\g{-1} +([`'"])data:(?:[^ `'"].*?|)(?:[A-Z]{3,}|[A-Z][a-z]{2,}|[a-z]{3,}).*\g{-1} # data url -data:[-a-zA-Z=;:/0-9+]*,\S* +\bdata:[-a-zA-Z=;:/0-9+]*,\S* + +# https/http/file urls +#(?:\b(?:https?|ftp|file)://)[-A-Za-z0-9+&@#/*%?=~_|!:,.;]+[-A-Za-z0-9+&@#/*%=~_|] # mailto urls -mailto:[-a-zA-Z=;:/?%&0-9+@.]{3,} +mailto:[-a-zA-Z=;:/?%&0-9+@._]{3,} # magnet urls magnet:[?=:\w]+ @@ -35,6 +50,9 @@ magnet:[?=:\w]+ # asciinema \basciinema\.org/a/[0-9a-zA-Z]+ +# asciinema v2 +^\[\d+\.\d+, "[io]", ".*"\]$ + # apple \bdeveloper\.apple\.com/[-\w?=/]+ # Apple music @@ -89,7 +107,7 @@ vpc-\w+ # Google Drive \bdrive\.google\.com/(?:file/d/|open)[-0-9a-zA-Z_?=]* # Google Groups -\bgroups\.google\.com/(?:(?:forum/#!|d/)(?:msg|topics?|searchin)|a)/[^/\s"]+/[-a-zA-Z0-9$]+(?:/[-a-zA-Z0-9]+)* +\bgroups\.google\.com(?:/[a-z]+/(?:#!|)[^/\s"]+)* # Google Maps \bmaps\.google\.com/maps\?[\w&;=]* # Google themes @@ -117,6 +135,8 @@ themes\.googleusercontent\.com/static/fonts/[^/\s"]+/v\d+/[^.]+. (?:\[`?[0-9a-f]+`?\]\(https:/|)/(?:www\.|)github\.com(?:/[^/\s"]+){2,}(?:/[^/\s")]+)(?:[0-9a-f]+(?:[-0-9a-zA-Z/#.]*|)\b|) # GitHub SHAs \bgithub\.com(?:/[^/\s"]+){2}[@#][0-9a-f]+\b +# GitHub SHA refs +\[([0-9a-f]+)\]\(https://(?:www\.|)github.com/[-\w]+/[-\w]+/commit/\g{-1}[0-9a-f]* # GitHub wiki \bgithub\.com/(?:[^/]+/){2}wiki/(?:(?:[^/]+/|)_history|[^/]+(?:/_compare|)/[0-9a-f.]{40,})\b # githubusercontent @@ -128,12 +148,15 @@ themes\.googleusercontent\.com/static/fonts/[^/\s"]+/v\d+/[^.]+. # git.io \bgit\.io/[0-9a-zA-Z]+ # GitHub JSON -"node_id": "[-a-zA-Z=;:/0-9+]*" +"node_id": "[-a-zA-Z=;:/0-9+_]*" # Contributor -\[[^\]]+\]\(https://github\.com/[^/\s"]+\) +\[[^\]]+\]\(https://github\.com/[^/\s"]+/?\) # GHSA GHSA(?:-[0-9a-z]{4}){3} +# GitHub actions +\buses:\s+[-\w.]+/[-\w./]+@[-\w.]+ + # GitLab commit \bgitlab\.[^/\s"]*/\S+/\S+/commit/[0-9a-f]{7,16}#[0-9a-f]{40}\b # GitLab merge requests @@ -143,8 +166,8 @@ GHSA(?:-[0-9a-z]{4}){3} # GitLab commits \bgitlab\.[^/\s"]*/(?:[^/\s"]+/){2}commits?/[0-9a-f]+\b -# binanace -accounts.binance.com/[a-z/]*oauth/authorize\?[-0-9a-zA-Z&%]* +# binance +accounts\.binance\.com/[a-z/]*oauth/authorize\?[-0-9a-zA-Z&%]* # bitbucket diff \bapi\.bitbucket\.org/\d+\.\d+/repositories/(?:[^/\s"]+/){2}diff(?:stat|)(?:/[^/\s"]+){2}:[0-9a-f]+ @@ -192,7 +215,7 @@ accounts.binance.com/[a-z/]*oauth/authorize\?[-0-9a-zA-Z&%]* # medium link \blink\.medium\.com/[a-zA-Z0-9]+ # medium -\bmedium\.com/\@?[^/\s"]+/[-\w]+ +\bmedium\.com/@?[^/\s"]+/[-\w]+ # microsoft \b(?:https?://|)(?:(?:download\.visualstudio|docs|msdn2?|research)\.microsoft|blogs\.msdn)\.com/[-_a-zA-Z0-9()=./%]* @@ -257,7 +280,7 @@ slack://[a-zA-Z0-9?&=]+ [0-9a-f]{32}\@o\d+\.ingest\.sentry\.io\b # Twitter markdown -\[\@[^[/\]:]*?\]\(https://twitter.com/[^/\s"')]*(?:/status/\d+(?:\?[-_0-9a-zA-Z&=]*|)|)\) +\[@[^[/\]:]*?\]\(https://twitter.com/[^/\s"')]*(?:/status/\d+(?:\?[-_0-9a-zA-Z&=]*|)|)\) # Twitter hashtag \btwitter\.com/hashtag/[\w?_=&]* # Twitter status @@ -280,9 +303,9 @@ slack://[a-zA-Z0-9?&=]+ \bdropbox\.com/sh?/[^/\s"]+/[-0-9A-Za-z_.%?=&;]+ # ipfs protocol -ipfs://[0-9a-z]* +ipfs://[0-9a-zA-Z]{3,} # ipfs url -/ipfs/[0-9a-z]* +/ipfs/[0-9a-zA-Z]{3,} # w3 \bw3\.org/[-0-9a-zA-Z/#.]+ @@ -312,7 +335,7 @@ ipfs://[0-9a-z]* [^"\s]+/gitweb/\S+;h=[0-9a-f]+ # HyperKitty lists -/archives/list/[^@/]+\@[^/\s"]*/message/[^/\s"]*/ +/archives/list/[^@/]+@[^/\s"]*/message/[^/\s"]*/ # lists /thread\.html/[^"\s]+ @@ -330,7 +353,7 @@ ipfs://[0-9a-z]* \bopen\.spotify\.com/embed/playlist/\w+ # Mastodon -\bmastodon\.[-a-z.]*/(?:media/|\@)[?&=0-9a-zA-Z_]* +\bmastodon\.[-a-z.]*/(?:media/|@)[?&=0-9a-zA-Z_]* # scastie \bscastie\.scala-lang\.org/[^/]+/\w+ @@ -359,14 +382,22 @@ ipfs://[0-9a-z]* # tinyurl \btinyurl\.com/\w+ +# codepen +\bcodepen\.io/[\w/]+ + +# registry.npmjs.org +\bregistry\.npmjs\.org/(?:@[^/"']+/|)[^/"']+/-/[-\w@.]+ + # getopts \bgetopts\s+(?:"[^"]+"|'[^']+') # ANSI color codes -(?:\\(?:u00|x)1b|\x1b)\[\d+(?:;\d+|)m +(?:\\(?:u00|x)1[Bb]|\x1b|\\u\{1[Bb]\})\[\d+(?:;\d+|)m # URL escaped characters -\%[0-9A-F][A-F] +%[0-9A-F][A-F](?=[A-Za-z]) +# lower URL escaped characters +%[0-9a-f][a-f](?=[a-z]{2,}) # IPv6 \b(?:[0-9a-fA-F]{0,4}:){3,7}[0-9a-fA-F]{0,4}\b # c99 hex digits (not the full format, just one I've seen) @@ -376,7 +407,7 @@ ipfs://[0-9a-z]* # sha sha\d+:[0-9]*[a-f]{3,}[0-9a-f]* # sha-... -- uses a fancy capture -(['"]|")[0-9a-f]{40,}\g{-1} +(\\?['"]|")[0-9a-f]{40,}\g{-1} # hex runs \b[0-9a-fA-F]{16,}\b # hex in url queries @@ -391,18 +422,21 @@ sha\d+:[0-9]*[a-f]{3,}[0-9a-f]* # Well known gpg keys .well-known/openpgpkey/[\w./]+ +# pki +-----BEGIN.*-----END + # uuid: \b[0-9a-fA-F]{8}-(?:[0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}\b # hex digits including css/html color classes: -(?:[\\0][xX]|\\u|[uU]\+|#x?|\%23)[0-9_a-fA-FgGrR]*?[a-fA-FgGrR]{2,}[0-9_a-fA-FgGrR]*(?:[uUlL]{0,3}|u\d+)\b +(?:[\\0][xX]|\\u|[uU]\+|#x?|%23)[0-9_a-fA-FgGrR]*?[a-fA-FgGrR]{2,}[0-9_a-fA-FgGrR]*(?:[uUlL]{0,3}|[iu]\d+)\b # integrity -integrity="sha\d+-[-a-zA-Z=;:/0-9+]{40,}" +integrity=(['"])(?:\s*sha\d+-[-a-zA-Z=;:/0-9+]{40,})+\g{-1} # https://www.gnu.org/software/groff/manual/groff.html # man troff content \\f[BCIPR] -# ' -\\\(aq +# '/" +\\\([ad]q # .desktop mime types ^MimeTypes?=.*$ @@ -411,46 +445,96 @@ integrity="sha\d+-[-a-zA-Z=;:/0-9+]{40,}" # Localized .desktop content Name\[[^\]]+\]=.* -# IServiceProvider -\bI(?=(?:[A-Z][a-z]{2,})+\b) +# IServiceProvider / isAThing +(?:\b|_)(?:I|isA)(?=(?:[A-Z][a-z]{2,})+(?:[A-Z]|\b)) # crypt -"\$2[ayb]\$.{56}" +(['"])\$2[ayb]\$.{56}\g{-1} # scrypt / argon \$(?:scrypt|argon\d+[di]*)\$\S+ +# go.sum +\bh1:\S+ + +# scala imports +^import (?:[\w.]|\{\w*?(?:,\s*(?:\w*|\*))+\})+ + +# scala modules +("[^"]+"\s*%%?\s*){2,3}"[^"]+" + +# Intel intrinsics +_mm_\w+ + # Input to GitHub JSON -content: "[-a-zA-Z=;:/0-9+]*=" +content: (['"])[-a-zA-Z=;:/0-9+]*=\g{-1} -# Python stringprefix / binaryprefix +# This does not cover multiline strings, if your repository has them, +# you'll want to remove the `(?=.*?")` suffix. +# The `(?=.*?")` suffix should limit the false positives rate +# printf +#%(?:(?:(?:hh?|ll?|[jzt])?[diuoxn]|l?[cs]|L?[fega]|p)(?=[a-z]{2,})|(?:X|L?[FEGA]|p)(?=[a-zA-Z]{2,}))(?!%)(?=[_a-zA-Z]+(?!%)\b)(?=.*?['"]) + +# Alternative printf +# %s +%(?:s(?=[a-z]{2,}))(?!%)(?=[_a-zA-Z]+(?!%)\b)(?=.*?['"]) + +# Python string prefix / binary prefix # Note that there's a high false positive rate, remove the `?=` and search for the regex to see if the matches seem like reasonable strings -(?|m([|!/@#,;']).*?\g{-1}) + +# perl qr regex +(?|\(.*?\)|([|!/@#,;']).*?\g{-1}) + +# perl run +perl(?:\s+-[a-zA-Z]\w*)+ + +# C network byte conversions +#(?:\d|\bh)to(?!ken)(?=[a-z])|to(?=[adhiklpun]\() # Go regular expressions regexp?\.MustCompile\(`[^`]*`\) +# regex choice +\(\?:[^)]+\|[^)]+\) + +# proto +^\s*(\w+)\s\g{-1} = + # sed regular expressions sed 's/(?:[^/]*?[a-zA-Z]{3,}[^/]*?/){2} +# node packages +(["'])@[^/'" ]+/[^/'" ]+\g{-1} + # go install go install(?:\s+[a-z]+\.[-@\w/.]+)+ +# pom.xml +<(?:group|artifact)Id>.*?< + +# jetbrains schema https://youtrack.jetbrains.com/issue/RSRP-489571 +urn:shemas-jetbrains-com + # kubernetes pod status lists # https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-phase \w+(?:-\w+)+\s+\d+/\d+\s+(?:Running|Pending|Succeeded|Failed|Unknown)\s+ @@ -462,62 +546,146 @@ go install(?:\s+[a-z]+\.[-@\w/.]+)+ -[0-9a-f]{10}-\w{5}\s # posthog secrets -posthog\.init\((['"])phc_[^"',]+\g{-1}, +([`'"])phc_[^"',]+\g{-1} # xcode # xcodeproject scenes -(?:Controller|ID|id)="\w{3}-\w{2}-\w{3}" +(?:Controller|destination|ID|id)="\w{3}-\w{2}-\w{3}" # xcode api botches customObjectInstantitationMethod +# msvc api botches +PrependWithABINamepsace + +# configure flags +.* \| --\w{2,}.*?(?=\w+\s\w+) + # font awesome classes \.fa-[-a-z0-9]+ +# bearer auth +(['"])[Bb]ear[e][r] .*?\g{-1} + +# bearer auth +\b[Bb]ear[e][r]:? [-a-zA-Z=;:/0-9+.]+ + +# basic auth +(['"])[Bb]asic [-a-zA-Z=;:/0-9+]{3,}\g{-1} + +# base64 encoded content +([`'"])[-a-zA-Z=;:/0-9+]{3,}=\g{-1} +# base64 encoded content in xml/sgml +>[-a-zA-Z=;:/0-9+]{3,}== 0.0.22) +\\\w{2,}\{ + +# American Mathematical Society (AMS) / Doxygen +TeX/AMS + +# File extensions +\*\.[+\w]+, + +# eslint +"varsIgnorePattern": ".+" + +# Windows short paths +[/\\][^/\\]{5,6}~\d{1,2}[/\\] + +# cygwin paths +/cygdrive/[a-zA-Z]/(?:Program Files(?: \(.*?\)| ?)(?:/[-+.~\\/()\w ]+)*|[-+.~\\/()\w])+ + +# in check-spelling@v0.0.22+, printf markers aren't automatically consumed +# printf markers +#(?v# (?:(?<=[A-Z]{2})V|(?<=[a-z]{2}|[A-Z]{2})v)\d+(?:\b|(?=[a-zA-Z_])) -# Compiler flags (Scala) -(?:^|[\t ,>"'`=(])-J-[DPWXY](?=[A-Z]{2,}|[A-Z][a-z]|[a-z]{2,}) -# Compiler flags -#(?:^|[\t ,"'`=(])-[DPWXYLlf](?=[A-Z]{2,}|[A-Z][a-z]|[a-z]{2,}) + +# Compiler flags (Unix, Java/Scala) +# Use if you have things like `-Pdocker` and want to treat them as `docker` +#(?:^|[\t ,>"'`=(])-(?:(?:J-|)[DPWXY]|[Llf])(?=[A-Z]{2,}|[A-Z][a-z]|[a-z]{2,}) + +# Compiler flags (Windows / PowerShell) +# This is a subset of the more general compiler flags pattern. +# It avoids matching `-Path` to prevent it from being treated as `ath` +#(?:^|[\t ,"'`=(])-(?:[DPL](?=[A-Z]{2,})|[WXYlf](?=[A-Z]{2,}|[A-Z][a-z]|[a-z]{2,})) # Compiler flags (linker) ,-B + +# libraries +\blib(?!erty|rar(?:i(?:an|es)|y))(?=[a-z]) + +# WWNN/WWPN (NAA identifiers) +\b(?:0x)?10[0-9a-f]{14}\b|\b(?:0x|3)?[25][0-9a-f]{15}\b|\b(?:0x|3)?6[0-9a-f]{31}\b + +# iSCSI iqn (approximate regex) +\biqn\.[0-9]{4}-[0-9]{2}(?:[\.-][a-z][a-z0-9]*)*\b + # curl arguments -\b(?:\\n|)curl(?:\s+-[a-zA-Z]{1,2}\b)*(?:\s+-[a-zA-Z]{3,})(?:\s+-[a-zA-Z]+)* +\b(?:\\n|)curl(?:\.exe|)(?:\s+-[a-zA-Z]{1,2}\b)*(?:\s+-[a-zA-Z]{3,})(?:\s+-[a-zA-Z]+)* # set arguments -\bset(?:\s+-[abefimouxE]{1,2})*\s+-[abefimouxE]{3,}(?:\s+-[abefimouxE]+)* +\b(?:bash|sh|set)(?:\s+-[abefimouxE]{1,2})*\s+-[abefimouxE]{3,}(?:\s+-[abefimouxE]+)* # tar arguments \b(?:\\n|)g?tar(?:\.exe|)(?:(?:\s+--[-a-zA-Z]+|\s+-[a-zA-Z]+|\s[ABGJMOPRSUWZacdfh-pr-xz]+\b)(?:=[^ ]*|))+ # tput arguments -- https://man7.org/linux/man-pages/man5/terminfo.5.html -- technically they can be more than 5 chars long... \btput\s+(?:(?:-[SV]|-T\s*\w+)\s+)*\w{3,5}\b # macOS temp folders /var/folders/\w\w/[+\w]+/(?:T|-Caches-)/ +# github runner temp folders +/home/runner/work/_temp/[-_/a-z0-9]+ diff --git a/.github/actions/spelling/excludes.txt b/.github/actions/spelling/excludes.txt index 6229365c68..749d52c670 100644 --- a/.github/actions/spelling/excludes.txt +++ b/.github/actions/spelling/excludes.txt @@ -1,31 +1,48 @@ # See https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples:-excludes (?:^|/)(?i)COPYRIGHT (?:^|/)(?i)LICEN[CS]E +(?:^|/)(?i)third[-_]?party/ (?:^|/)3rdparty/ +(?:^|/)AUTHORS$ +(?:^|/)generated/ (?:^|/)go\.sum$ (?:^|/)package(?:-lock|)\.json$ +(?:^|/)Pipfile$ +(?:^|/)PSGet\.Resource\.psd1$ +(?:^|/)pyproject.toml +(?:^|/)requirements(?:-dev|-doc|-test|)\.txt$ (?:^|/)vendor/ +/ExternalModules/ /shared\.manifest$ +/thirdparty/ \.a$ \.ai$ +\.all-contributorsrc$ \.avi$ \.bmp$ \.bz2$ \.cer$ \.class$ +\.coveragerc$ +\.crl$ \.crt$ +\.csr$ \.dll$ \.docx?$ \.drawio$ \.DS_Store$ \.eot$ +\.eps$ \.exe$ \.gif$ +\.git-blame-ignore-revs$ \.gitattributes$ +\.gitkeep$ \.graffle$ \.gz$ \.icns$ \.ico$ +\.ipynb$ \.jar$ \.jks$ \.jpe?g$ @@ -34,22 +51,33 @@ \.lock$ \.map$ \.min\.. +\.mo$ \.mod$ \.mp[34]$ \.msix$ +\.msi$ \.msixbundle$ \.o$ \.ocf$ \.otf$ +\.p12$ +\.parquet$ \.pdf$ \.pem$ -\.png$ +\.pfx$ +(?i)\.png$ \.psd$ \.pyc$ +\.pylintrc$ +\.qm$ \.s$ +\.sig$ \.sln$ +\.so$ \.svgz?$ +\.sys$ \.tar$ +\.tgz$ \.tiff?$ \.ttf$ \.vcxitems$ @@ -62,17 +90,18 @@ \.webp$ \.winmd$ \.woff2?$ +\.xcf$ \.xlsx?$ +\.xpm$ +\.xz$ \.zip$ ^\.github/actions/spelling/ ^\.github/policies/ ^\.github/workflows/spelling\d*\.yml$ -^\Qsrc/PureLib/pure/AUTHORS\E$ ^cgmanifest\.json$ ^Localization/ ^NOTICE ^src/AppInstallerCLICore/Commands/ExperimentalCommand\.cpp$ -^src/AppInstallerCLIE2ETests/TestData/AppInstallerTestMsiInstaller.msi$ ^src/AppInstallerCLIE2ETests/TestData/Configuration/Empty.yml$ ^src/AppInstallerCLITests/TestData/InputARPData.txt$ ^src/AppInstallerCLITests/TestData/InputNames.txt$ @@ -82,16 +111,12 @@ ^src/catch2/ ^src/cpprestsdk/ ^src/JsonCppLib/ -^src/PowerShell/ExternalModules +^src/PowerShell/ExternalModules/PowerShellGet/2\.2\.5/Modules/ +^src/PowerShell/Help/markdownlint.yaml$ ^src/PureLib/ ^src/SfsClient/ ^src/UndockedRegFreeWinRT/ ^src/Valijson/ ^src/Xlang/ ^src/YamlCppLib/ -# Because it doesn't handle argument -Words well -^src/PowerShell/tests/ -^tools/CorrelationTestbed/.*\.ps1$ -^tools/DevInSandbox/.*\.ps1$ -^tools/COMTrace/ComTrace.wprp$ ignore$ diff --git a/.github/actions/spelling/expect.txt b/.github/actions/spelling/expect.txt index 5542cb8220..5f08cc9674 100644 --- a/.github/actions/spelling/expect.txt +++ b/.github/actions/spelling/expect.txt @@ -1,7 +1,11 @@ +AAD abcd +abi ABORTIFHUNG accepteula +ACCESSDENIED ACCESSTOKEN +acl adjacents adml admx @@ -12,89 +16,113 @@ AKV allusers alreadyinstalled AMap +Amd amrutha ansistring APARTMENTTHREADED apfn apicontract apiset +appdata appinstallertest applic +appname appshutdown APPTERMINATION -argumentlist +archs ARMNT +arp arphelper asan ASequence ashpatil Ashwini ASwitch +Asn ASYNCRTIMP -ata Atest ATL +AType AUrl -Authenticode +auxdata +awgpm +awgs azcopy azurewebsites +Baz bcp BEFACEF +bfd BFirst bght bigcatalog BITMAPINFOHEADER -bitspace +bitmask bkup blargle blockedbypolicy blogs -bomgar +bluetooth +Bomgar BOMs boop boundparms +bpp +brk +Browsable BSODs +Buf BUILDOUTDIR buildtransitive cancelledbyuser casemap casemappings cch -CDEF centralus certmgr +certs +cgi cinq CLASSNOTREG -CLIE CLOSEAPP cloudapp clsctx clsid +cmpwgc +CMSG +cnwgc cobertura CODEOWNERS +codepage COINIT COMGLB commandline compressapi concurrencysal +constexpr contactsupport contentfiles -contoso +contosoinstaller contractversion +copyable corecrt count'th countof countryregion Cov CPIL -craigloewen createmanifestmetadata cswinrt ctc +CTL +ctwgcy currentuser dacl datetimeoffset +Dbg +Dcom debian +decompressor dedupe deigh deleteifnotneeded @@ -104,7 +132,7 @@ devhome dic diskfull displaycatalog -DISMAPI +DMC dnld Dobbeleer DONOT @@ -112,30 +140,32 @@ dsc DUPLICATEALIAS dustojnikhummer dvinns +dwgs ecfr ecfrbrowse -ECustom EFGH -EFile efileresource -EMalicious -endregion ENDSESSION -EPester -epth EQU +ERANGE +errcode +errmsg ERRORONEXIT -ESource +errstr ESRB -ests etest etl +ewgp +ewgs execustom EXEHASH experimentalfeatures +fdw +fdwgp FECAFEB fedorapeople fileinuse +filemode Filtercriteria Finalizers fintimes @@ -149,19 +179,32 @@ FOLDERID FORPARSING foundfr fsanitize +FULLMUTEX +FULLWIDTH fundraiser fuzzer fzanollo gcpi +GES GESMBH getwinget GHS +github +gitlab gity goku Gomu GRPICONDIR GRPICONDIRENTRY guiddef +Gumbalapura +gwgc +gwgcd +gwgp +gwgse +gwgso +gwgus +gwgv Hackathon hashtables helplib @@ -171,42 +214,46 @@ highcontrast HINSTANCE hkey hlocal +hmac hmodule Hostx +Howto hre hresults hrow hwnd +Hyperlink IARP IAttachment ICONDIR ICONDIRENTRY ICONIMAGE +icu idl -IEnum +idx IFACEMETHODIMP -IHelp iid IISOn -ilemode +img +inet inproc Insta installinprogress INSTALLPROPERTY installshield +instream insufficientmemory Intelli INTRESOURCE invalidparameter -IPackage isable -IServer ishelp ISQ -issuetitle ISVs +iswgp itr -IWin +iwr +iwgc JArray JDictionary jdk @@ -222,19 +269,21 @@ Kaido KNOWNFOLDERID kool ktf +LCID ldcase learnxinyminutes -libfuzzer -libsolv -libyaml -Linq +lhs +LIBYAML liv liwpx localizationpriority localsource +Logon +LONGLONG LOWORD LPARAM LPBYTE +LPCWSTR lpdw LPDWORD lpfn @@ -245,6 +294,8 @@ LPICONDIRENTRY LPICONIMAGE lpitemidlist LPSTR +lpsz +LPVOID LPW LPWCH LPWSTR @@ -254,21 +305,25 @@ LTDA luffy Luffytaro maclachlan +Madhusudhan +MAJORVERSION malware mapdatafolding -mapview Maxed +MAXLENGTH maxvalue maybenull MBH +MBs +mday mdmp MDs megamorf -meme microsoftentraid midl minexample minidump +MINORVERSION minschema missingdependency mkgmtime @@ -284,7 +339,6 @@ MSIXHASH msstore MSZIP mszyml -Mta Mugiwara Multideclaration mycustom @@ -292,12 +346,11 @@ myinstalldir mylog mysilent mysilentwithprogress -nameof +mysource Nami nativehandle NBLGGH NESTEDINSTALLER -netfx netlify NETSDK Newtonsoft @@ -308,6 +361,8 @@ NOCLOSE NOCRLF NOEXPAND NOLINKINFO +nomem +NONAME nonetwork NONFOLDERS nonterminated @@ -317,46 +372,63 @@ NOSEARCH NOSEPARATOR notalostreference NOTAPROPERTY +NOTIMPL notmatch NOTRACK NOUPDATE +nowarn npmjs nsis +NTFS nuffing objbase objidl ofile +oid omus onefuzz -ools oop +opensource OPTOUT +osfhandle +oss +outfile +OUTOFMEMORY +Outptr OVERLAPPEDWINDOW +OWC packageinuse packageinusebyapplication PACL PARAMETERMAP -paramref pathparts Patil +pcb PCCERT PCs pcwsz +pdb PDWORD Peet peetdev PEGI -PFM -pfxpath +pfn +pgp Pherson +pid pidl pidlist +PKCS pkgmgr pkindex +pkix +placeholders PMS positionals +posix powershellgallery -powertoys +pri +PRIMARYKEY processthreads productcode PRODUCTICON @@ -365,6 +437,7 @@ pscustomobject pseudocode PSHOST psobject +psz ptstr publickey PVD @@ -375,6 +448,7 @@ PWAs PWSTR QUERYENDSESSION qword +RAII rebootinitiated rebootrequiredforinstall rebootrequiredtofinish @@ -384,32 +458,45 @@ REFIID REGDB regexes REGSAM +REINSTALLMODE relativefilepath remoting +removefile reparse repeatedkey +REQS restsource RGBQUAD -rgex rgp rgpsz +rhs riid -roblox +Roblox ronomon -rosoft Roronoa -rowids +rosoft +rowid roy +rpwgpm +RRF +rrr +rswgs +RTTI runspace runtimeclass +runtimes +rwgch +rwgs ryfu -rzkzqaqjwj sacl SARL +sas SASURL +savepoint +sawgc schematab +Scm sddl -SECUREFILEPATH secureobject securestring seof @@ -421,8 +508,10 @@ SETTINGMAPPING sfs sfsclient SHCONTF +shellapi SHGDN SHOWNORMAL +sid Sideload SIGNATUREHASH silentpreferred @@ -430,67 +519,75 @@ similarissues similaritytolerance Skipx sku +SLAPI SMTO +SNAME sortof +sourceforge SOURCESDIRECTORY sourceversion spamming SPAPI +spwgc +sqlite Srinivasan +SRL srs startswith -STARTUPINFOW STDMETHODCALLTYPE storeapps storeorigin STRRET stylecop subdir +subkey +Sudarshan superstring swervy +swgus SYD SYG sysrefcomp systemnotsupported Tagit +TARG taskhostw -TCpp tcs TEMPDIRECTORY -Templating +templating temppath -testdata testexampleinstaller thiscouldbeapc threehundred timespan Tlg tombstoned -TOperation -TOptions -TProgress -TResult -TReturn +transitioning trimstart -TState -TStatus +ttl +twgc +twgus +typedef typeparam UCase ucasemap UChars ucnv +udwgp uec +ULONGLONG +UNAVAIL uninitialize unins uninstallation uninstaller uninstallprevious uninstalls -Unk unknwn Unknwnbase UNMARSHALING unparsable +Unregisters unvirtualized UParse upgradable @@ -499,24 +596,27 @@ URLZONE USEDEFAULT userfilesetting userprofile -UWP +uswgp +uwp VALUENAMECASE vclib -VERSI -VERSIE -visualstudiocode +versioned +VERSIONINFO vns vsconfig vstest +waitable wcex +WDAG webpages Webserver -websites -WERSJA +website wesome wfsopen wgetenv Whatif +wildcards +WINAPI windir windowsdeveloper winerror @@ -528,12 +628,16 @@ winreg winrtact winstring withstarts +Wnd WNDCLASS WNDCLASSEX +workaround WPARAM +Wpp wpr wprp wputenv +wsb wsl wsv wto @@ -543,6 +647,7 @@ xcopy XFile XManifest XMUGIWARAMODULE +XName XPLATSTR XRESOURCEZORO xsi diff --git a/.github/actions/spelling/line_forbidden.patterns b/.github/actions/spelling/line_forbidden.patterns index 9050d6614c..58bbc70304 100644 --- a/.github/actions/spelling/line_forbidden.patterns +++ b/.github/actions/spelling/line_forbidden.patterns @@ -1,62 +1,205 @@ -# reject `m_data` as there's a certain OS which has evil defines that break things if it's used elsewhere -# \bm_data\b +# reject `m_data` as VxWorks defined it and that breaks things if it's used elsewhere +# see [fprime](https://github.com/nasa/fprime/commit/d589f0a25c59ea9a800d851ea84c2f5df02fb529) +# and [Qt](https://github.com/qtproject/qt-solutions/blame/fb7bc42bfcc578ff3fa3b9ca21a41e96eb37c1c7/qtscriptclassic/src/qscriptbuffer_p.h#L46) +#\bm_data\b +# Were you debugging using a framework with `fit()`? # If you have a framework that uses `it()` for testing and `fit()` for debugging a specific test, -# you might not want to check in code where you were debugging w/ `fit()`, in which case, you might want -# to use this: +# you might not want to check in code where you skip all the other tests. #\bfit\( -# s.b. GitHub -\bGithub\b +# Should be `HH:MM:SS` +\bHH:SS:MM\b -# s.b. GitLab -\bGitlab\b +# Should be `86400` (seconds in a standard day) +\b84600\b(?:.*\bday\b) -# s.b. JavaScript +# Should probably be `2006-01-02` (yyyy-mm-dd) +\b2006-01-02\b + +# Should probably be `YYYYMMDD` +\b[Yy]{4}[Dd]{2}[Mm]{2}(?!.*[Yy]{4}[Dd]{2}[Mm]{2}).*$ + +# Should only be one of `a`, `an`, or `the` +\b(?:(?:an?|the)\s+){2,}\b + +# Should be `anymore` +\bany more[,.] + +# Should be `'` +(?i)\b(?:(?:i|s?he|they|what|who|you)"ll|(?:are|ca|did|do|does|ha[ds]|have|is|should|were|wo|would)n"t|(?:s?he|let|that|there|what|where|who)"s|(?:i|they|we|what|who|you)"ve)\b + +# Should be `briefcase` +\bbrief-case\b + +# Should be `cannot` (or `can't`) +# See https://www.grammarly.com/blog/cannot-or-can-not/ +# > Don't use `can not` when you mean `cannot`. The only time you're likely to see `can not` written as separate words is when the word `can` happens to precede some other phrase that happens to start with `not`. +# > `Can't` is a contraction of `cannot`, and it's best suited for informal writing. +# > In formal writing and where contractions are frowned upon, use `cannot`. +# > It is possible to write `can not`, but you generally find it only as part of some other construction, such as `not only . . . but also.` +# - if you encounter such a case, add a pattern for that case to patterns.txt. +\b[Cc]an not\b + +# Should be `GitHub` +(?v# (?:(?<=[A-Z]{2})V|(?<=[a-z]{2}|[A-Z]{2})v)\d+(?:\b|(?=[a-zA-Z_])) +# hit-count: 8 file-count: 4 +# libraries +\b(?i)lib(?!elous|erty|rar(?:i(?:an|es)|y))(?=[a-z]) + # hit-count: 4 file-count: 4 # Non-English [a-zA-Z]*[ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýÿĀāŁłŃńŅņŒœŚśŠšŜŝŸŽžź][a-zA-Z]{3}[a-zA-ZÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýÿĀāŁłŃńŅņŒœŚśŠšŜŝŸŽžź]* @@ -86,6 +99,11 @@ REQUIRE\(Rest::GetRestAPIBaseUri\(".*"\) == L".*" # tar arguments \b(?:\\n|)g?tar(?:\.exe|)(?:(?:\s+--[-a-zA-Z]+|\s+-[a-zA-Z]+|\s[ABGJMOPRSUWZacdfh-pr-xz]+\b)(?:=[^ ]*|))+ +# hit-count: 3 file-count: 3 +# Python string prefix / binary prefix +# Note that there's a high false positive rate, remove the `?=` and search for the regex to see if the matches seem like reasonable strings +(?]*>|[^<]*)\s*$ @@ -164,3 +201,6 @@ ReplaceWhileCopying\(L.*\) # devil fruits \s([A-Z]{3,}|[A-Z][a-z]{2,}|[a-z]{3,})\s\g{-1}\sno Mi + +# PowerShell Aliases defined in .cs files (not those in AliasesToExport in psd1 files) +\[Alias\("[a-z]+"\)\] diff --git a/.github/actions/spelling/reject.txt b/.github/actions/spelling/reject.txt index b5a6d36809..465ea35e43 100644 --- a/.github/actions/spelling/reject.txt +++ b/.github/actions/spelling/reject.txt @@ -1,10 +1,12 @@ ^attache$ +^bellow$ benefitting occurences? ^dependan.* ^oer$ Sorce ^[Ss]pae.* +^Teh$ ^untill$ ^untilling$ ^wether.* diff --git a/.github/workflows/similarissues.yml b/.github/workflows/similarissues.yml deleted file mode 100644 index 1ab7b643cb..0000000000 --- a/.github/workflows/similarissues.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: GitGudSimilarIssues comments - -on: - issues: - types: [opened] - -jobs: - getSimilarIssues: - runs-on: ubuntu-latest - permissions: - issues: read - outputs: - message: ${{ steps.getBody.outputs.message }} - steps: - - id: getBody - uses: craigloewen-msft/GitGudSimilarIssues@main - with: - issueTitle: ${{ github.event.issue.title }} - issueBody: ${{ github.event.issue.body }} - repo: ${{ github.repository }} - similaritytolerance: '0.75' - add-comment: - needs: getSimilarIssues - runs-on: ubuntu-latest - permissions: - issues: write - if: needs.getSimilarIssues.outputs.message != '' - steps: - - name: Add comment - run: gh issue comment "$NUMBER" --repo "$REPO" --body "$BODY" - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - NUMBER: ${{ github.event.issue.number }} - REPO: ${{ github.repository }} - BODY: ${{ needs.getSimilarIssues.outputs.message }} diff --git a/.github/workflows/spelling3.yml b/.github/workflows/spelling3.yml index c4c10bb788..004901df84 100644 --- a/.github/workflows/spelling3.yml +++ b/.github/workflows/spelling3.yml @@ -36,21 +36,42 @@ name: Check Spelling # # For background, see: https://github.com/check-spelling/check-spelling/wiki/Feature:-Update-with-deploy-key +# SARIF reporting +# +# Access to SARIF reports is generally restricted (by GitHub) to members of the repository. +# +# Requires enabling `security-events: write` +# and configuring the action with `use_sarif: 1` +# +# For information on the feature, see: https://github.com/check-spelling/check-spelling/wiki/Feature:-SARIF-output + +# Minimal workflow structure: +# +# on: +# push: +# ... +# pull_request_target: +# ... +# jobs: +# # you only want the spelling job, all others should be omitted +# spelling: +# # remove `security-events: write` and `use_sarif: 1` +# # remove `experimental_apply_changes_via_bot: 1` +# ... otherwise adjust the `with:` as you wish + on: push: branches: - - '**' + - "**" tags-ignore: - - '**' + - "**" pull_request_target: branches: - - '**' - tags-ignore: - - '**' + - "**" types: - - 'opened' - - 'reopened' - - 'synchronize' + - "opened" + - "reopened" + - "synchronize" jobs: spelling: @@ -62,7 +83,7 @@ jobs: outputs: followup: ${{ steps.spelling.outputs.followup }} runs-on: ubuntu-latest - if: "contains(github.event_name, 'pull_request') || github.event_name == 'push'" + if: ${{ contains(github.event_name, 'pull_request') || github.event_name == 'push' }} concurrency: group: spelling-${{ github.event.pull_request.number || github.ref }} # note: If you use only_check_changed_files, you do not want cancel-in-progress @@ -70,40 +91,26 @@ jobs: steps: - name: check-spelling id: spelling - uses: check-spelling/check-spelling@v0.0.21 + uses: check-spelling/check-spelling@v0.0.22 with: - suppress_push_for_open_pull_request: 1 + suppress_push_for_open_pull_request: ${{ github.actor != 'dependabot[bot]' && 1 }} checkout: true check_file_names: 1 - spell_check_this: check-spelling/spell-check-this@prerelease post_comment: 0 use_magic_file: 1 + warnings: bad-regex,binary-file,deprecated-feature,ignored-expect-variant,large-file,limited-references,no-newline-at-eof,noisy-file,non-alpha-in-dictionary,token-is-substring,unexpected-line-ending,whitespace-in-dictionary,minified-file,unsupported-configuration,no-files-to-check extra_dictionary_limit: 10 - extra_dictionaries: + extra_dictionaries: | cspell:cpp/src/compiler-msvc.txt - cspell:cpp/src/cpp.txt cspell:cpp/src/stdlib-c.txt cspell:cpp/src/stdlib-cpp.txt cspell:filetypes/filetypes.txt - cspell:fullstack/fullstack.txt - cspell:powershell/powershell.txt - cspell:software-terms/src/software-terms.txt - - comment-push: - name: Report (Push) - # If your workflow isn't running on push, you can remove this job - runs-on: ubuntu-latest - needs: spelling - permissions: - contents: write - if: (success() || failure()) && needs.spelling.outputs.followup && github.event_name == 'push' - steps: - - name: comment - uses: check-spelling/check-spelling@v0.0.21 - with: - checkout: true - spell_check_this: check-spelling/spell-check-this@prerelease - task: ${{ needs.spelling.outputs.followup }} + cspell:fullstack/dict/fullstack.txt + cspell:powershell/dict/powershell.txt + cspell:software-terms/dict/softwareTerms.txt + cspell:csharp/csharp.txt + cspell:dotnet/dict/dotnet.txt + check_extra_dictionaries: '' comment-pr: name: Report (PR) @@ -111,12 +118,13 @@ jobs: runs-on: ubuntu-latest needs: spelling permissions: + actions: read + contents: read pull-requests: write if: (success() || failure()) && needs.spelling.outputs.followup && contains(github.event_name, 'pull_request') steps: - name: comment - uses: check-spelling/check-spelling@v0.0.21 + uses: check-spelling/check-spelling@v0.0.22 with: checkout: true - spell_check_this: check-spelling/spell-check-this@prerelease task: ${{ needs.spelling.outputs.followup }} diff --git a/.gitignore b/.gitignore index 49f85067dc..b46c39e263 100644 --- a/.gitignore +++ b/.gitignore @@ -170,13 +170,13 @@ publish/ # Publish Web Output *.[Pp]ublish.xml *.azurePubxml -# Note: Comment the next line if you want to checkin your web deploy settings, +# Note: Comment the next line if you want to check in your web deploy settings, # but database connection strings (with potential passwords) will be unencrypted *.pubxml *.publishproj # Microsoft Azure Web App publish settings. Comment the next line if you want to -# checkin your Azure Web App publish settings, but sensitive information contained +# check in your Azure Web App publish settings, but sensitive information contained # in these scripts will be unencrypted PublishScripts/ diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index c72a5749c5..b3a330dbd0 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -6,4 +6,4 @@ Resources: - [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/) - [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) -- Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns +- Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0ca09efaef..adf8758a74 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,9 +6,9 @@ Below is our guidance for how to report issues, propose new features, and submit The Windows Package Manager team is VERY active in this GitHub Repository. In fact, we live in it all day long and carry out all our development in the open! -When the team finds issues we file them in the repository. When we propose new ideas or think-up new features, we file new feature requests. When we work on fixes or features, we create branches and work on those improvements. And when PRs are reviewed, we review in public - including all the good, the bad, and the ugly parts. +When the team finds issues we file them in the repository. When we propose new ideas or think up new features, we file new feature requests. When we work on fixes or features, we create branches and work on those improvements. And when PRs are reviewed, we review them in public - including all the good, the bad, and the ugly parts. -The point of doing all this work in public is to ensure that we are holding ourselves to a high degree of transparency, and so that the community sees that we apply the same processes and hold ourselves to the same quality-bar as we do to community-submitted issues and PRs. We also want to make sure that we expose our team culture and "tribal knowledge" that is inherent in any closely-knit team, which often contains considerable value to those new to the project who are trying to figure out "why the heck does this thing look/work like this???" +The point of doing all this work in public is to ensure that we are holding ourselves to a high degree of transparency, and so that the community sees that we apply the same processes and hold ourselves to the same quality bar as we do to community-submitted issues and PRs. We also want to make sure that we expose our team culture and "tribal knowledge" that is inherent in any closely-knit team, which often contains considerable value to those new to the project who are trying to figure out "why the heck does this thing look/work like this???" ### Repository Bot @@ -79,19 +79,19 @@ For those able & willing to help fix issues and/or implement features ... Some issues/features may be quick and simple to describe and understand. For such scenarios, once a team member has agreed with your approach, skip ahead to the section headed "Fork, Branch, and Create your PR", below. -Small issues that do not require a spec will be labelled Issue-Bug or Issue-Task. +Small issues that do not require a spec will be labeled Issue-Bug or Issue-Task. However, some issues/features will require careful thought & formal design before implementation. For these scenarios, we'll request that a spec is written and the associated issue will be labeled Issue-Feature. -Specs help collaborators discuss different approaches to solve a problem, describe how the feature will behave, how the feature will impact the user, what happens if something goes wrong, etc. Driving towards agreement in a spec, before any code is written, often results in simpler code, and less wasted effort in the long run. +Specs help collaborators discuss different approaches to solving a problem, describe how the feature will behave, how the feature will impact the user, what happens if something goes wrong, etc. Driving towards agreement in a spec, before any code is written, often results in simpler code, and less wasted effort in the long run. -Specs will be managed in a very similar manner as code contributions so please follow the "Fork, Branch and Create your PR" below. +Specs will be managed in a very similar manner as code contributions so please follow the "Fork, Branch, and Create your PR" below. ### Writing / Contributing-to a Spec -To write/contribute to a spec: fork, branch and commit via PRs, as you would with any code changes. +To write/contribute to a spec: fork, branch, and commit via PRs, as you would with any code changes. -Specs are written in markdown, stored under the `/doc/specs` folder and named `[issue id] - [spec description].md`. +Specs are written in markdown, stored under the `/doc/specs` folder, and named `[issue id] - [spec description].md`. 👉 **It is important to follow the spec templates and complete the requested information**. The available spec templates will help ensure that specs contain the minimum information & decisions necessary to permit development to begin. In particular, specs require you to confirm that you've already discussed the issue/idea with the team in an issue and that you provide the issue ID for reference. @@ -99,7 +99,7 @@ Team members will be happy to help review specs and guide them to completion. ### Help Wanted -Once the team have approved an issue/spec, development can proceed. If no developers are immediately available, the spec can be parked ready for a developer to get started. Parked specs' issues will be labeled "Help Wanted". To find a list of development opportunities waiting for developer involvement, visit the Issues and filter on [the Help-Wanted label](https://github.com/microsoft/winget-cli/labels/Help%20Wanted). +Once the team has approved an issue/spec, development can proceed. If no developers are immediately available, the spec can be parked ready for a developer to get started. Parked specs' issues will be labeled "Help Wanted". To find a list of development opportunities waiting for developer involvement, visit the Issues and filter on [the Help-Wanted label](https://github.com/microsoft/winget-cli/labels/Help%20Wanted). --- @@ -122,9 +122,9 @@ Testing is a key component in the development workflow. ### Code Review -When you'd like the team to take a look, (even if the work is not yet fully-complete), mark the Draft PR as 'Ready For Review' so that the team can review your work and provide comments, suggestions, and request changes. It may take several cycles, but the end result will be solid, testable, conformant code that is safe for us to merge. +When you'd like the team to take a look, (even if the work is not yet fully-complete), mark the Draft PR as 'Ready For Review' so that the team can review your work and provide comments, suggestions, and request changes. It may take several cycles, but the result will be solid, testable, conformant code that is safe for us to merge. -> ⚠ Remember: **changes you make may affect both the Windows Package Manager and the schema support implemented in our validation pipelines!** Because of this, we will treat community PR's with the same level of scrutiny and rigor as commits submitted to the official Windows source by team members and partners. +> ⚠ Remember: **changes you make may affect both the Windows Package Manager and the schema support implemented in our validation pipelines!** Because of this, we will treat community PRs with the same level of scrutiny and rigor as commits submitted to the official Windows source by team members and partners. ### Merge diff --git a/NOTICE b/NOTICE index 6e18b46e1c..c0d217de1e 100644 --- a/NOTICE +++ b/NOTICE @@ -1,1068 +1,457 @@ -NOTICES AND INFORMATION -Do Not Translate or Localize - -This software incorporates material from third parties. -Microsoft makes certain open source code available at https://3rdpartysource.microsoft.com, -or you may send a check or money order for US $5.00, including the product name, -the open source component name, platform, and version number, to: - -Source Code Compliance Team -Microsoft Corporation -One Microsoft Way -Redmond, WA 98052 -USA - -Notwithstanding any other terms, you may reverse engineer this software to the extent -required to debug changes to any libraries licensed under the GNU Lesser General Public License. - ---------------------------------------------------------- - -Castle.Core 5.1.0 - Apache-2.0 - - -(c) 2004-2022 Castle Project - http://www.castleproject.org -Copyright 2004-2021 Castle Project - http://www.castleproject.org -Copyright (c) 2004-2022 Castle Project - http://www.castleproject.org - -Copyright 2004-2021 Castle Project - http://www.castleproject.org/ - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. - ---------------------------------------------------------- - ---------------------------------------------------------- - -NuGet.Frameworks 5.0.0 - Apache-2.0 - - -(c) Microsoft Corporation. - -Apache License - -Version 2.0, January 2004 - -http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION +NOTICES AND INFORMATION +Do Not Translate or Localize + +This software incorporates material from third parties. +Microsoft makes certain open source code available at https://3rdpartysource.microsoft.com, +or you may send a check or money order for US $5.00, including the product name, +the open source component name, platform, and version number, to: + +Source Code Compliance Team +Microsoft Corporation +One Microsoft Way +Redmond, WA 98052 +USA + +Notwithstanding any other terms, you may reverse engineer this software to the extent +required to debug changes to any libraries licensed under the GNU Lesser General Public License. + +--------------------------------------------------------- + +openssl/openssl 01d5e2318405362b4de5e670c90d9b40a351d053 - Apache-2.0 + + +(c) 2005 WISeKey SA1 +Copyright 2005 Nokia +Copyright 2021 UnionTech +Copyright 2021- IBM Inc. +Copyright IBM Corp. 2018 +Copyright IBM Corp. 2019 +Copyright Nokia 2007-2018 +Copyright Nokia 2007-2019 +Copyright Nokia 2007-2020 +Copyright Siemens AG 2020 +Copyright 2011 Google Inc. +Copyright 2017 Ribose Inc. +(c) 2013 ATT Wi-Fi Services +Copyright 2017 BaishanCloud +Copyright 2013 M. J. Dominus +Copyright 2019 Red Hat, Inc. +Copyright IBM Corp. 2018-2019 +Copyright Patrick Powell 1995 +Copyright (c) 2011, RTFM, Inc. +Copyright Siemens AG 2015-2019 +Copyright Siemens AG 2015-2020 +Copyright Siemens AG 2015-2022 +Copyright Siemens AG 2018-2020 +Copyright Siemens AG 2019-2022 +Copyright 2016 VMS Software, Inc. +Copyright (c) 2004, EdelKey Project +Copyright (c) 2015 CloudFlare, Inc. +Copyright (c) 2015, CloudFlare, Inc. +Copyright (c) 2005 WISeKey SA1 InterU +Copyright (c) 2012, Intel Corporation +Copyright (c) 2014, Intel Corporation +Copyright (c) 2020, Intel Corporation +Copyright (c) 2021, Intel Corporation +Copyright (c) 2002 The OpenTSA Project +Copyright 1998-$YEAR The OpenSSL Authors +Copyright 2004-2014, Akamai Technologies +Copyright 2023The OpenSSL Project Authors +Copyright (c) 2020-2021, Intel Corporation +Copyright 2014 Cryptography Research, Inc. +Copyright 2015 Cryptography Research, Inc. +Copyright 2016 Cryptography Research, Inc. +Copyright 2016 The OpenSSL Project Authors +Copyright 2017 The OpenSSL Project Authors +Copyright 2018 The OpenSSL Project Authors +Copyright 2019 The OpenSSL Project Authors +Copyright 2020 The OpenSSL Project Authors +Copyright 2021 The OpenSSL Project Authors +Copyright 2022 The OpenSSL Project Authors +Copyright 2023 The OpenSSL Project Authors +Copyright (c) 1998-2023 The OpenSSL Project +Copyright (c) 2006, Network Resonance, Inc. +Copyright (c) 2012-2014 Daniel J. Bernstein +copyrighted by the Free Software Foundation +Copyright (c) 2012-2016 Jean-Philippe Aumasson +Copyright 1995-2016 The OpenSSL Project Authors +Copyright 1995-2017 The OpenSSL Project Authors +Copyright 1995-2018 The OpenSSL Project Authors +Copyright 1995-2019 The OpenSSL Project Authors +Copyright 1995-2020 The OpenSSL Project Authors +Copyright 1995-2021 The OpenSSL Project Authors +Copyright 1995-2022 The OpenSSL Project Authors +Copyright 1995-2023 The OpenSSL Project Authors +Copyright 1998-2016 The OpenSSL Project Authors +Copyright 1998-2017 The OpenSSL Project Authors +Copyright 1998-2020 The OpenSSL Project Authors +Copyright 1998-2021 The OpenSSL Project Authors +Copyright 1998-2022 The OpenSSL Project Authors +Copyright 1998-2023 The OpenSSL Project Authors +Copyright 1999-2016 The OpenSSL Project Authors +Copyright 1999-2018 The OpenSSL Project Authors +Copyright 1999-2020 The OpenSSL Project Authors +Copyright 1999-2021 The OpenSSL Project Authors +Copyright 1999-2022 The OpenSSL Project Authors +Copyright 1999-2023 The OpenSSL Project Authors +Copyright 2000-2016 The OpenSSL Project Authors +Copyright 2000-2017 The OpenSSL Project Authors +Copyright 2000-2018 The OpenSSL Project Authors +Copyright 2000-2019 The OpenSSL Project Authors +Copyright 2000-2020 The OpenSSL Project Authors +Copyright 2000-2021 The OpenSSL Project Authors +Copyright 2000-2022 The OpenSSL Project Authors +Copyright 2000-2023 The OpenSSL Project Authors +Copyright 2001-2016 The OpenSSL Project Authors +Copyright 2001-2017 The OpenSSL Project Authors +Copyright 2001-2018 The OpenSSL Project Authors +Copyright 2001-2020 The OpenSSL Project Authors +Copyright 2001-2021 The OpenSSL Project Authors +Copyright 2001-2022 The OpenSSL Project Authors +Copyright 2001-2023 The OpenSSL Project Authors +Copyright 2002-2016 The OpenSSL Project Authors +Copyright 2002-2018 The OpenSSL Project Authors +Copyright 2002-2020 The OpenSSL Project Authors +Copyright 2002-2021 The OpenSSL Project Authors +Copyright 2002-2022 The OpenSSL Project Authors +Copyright 2002-2023 The OpenSSL Project Authors +Copyright 2003-2021 The OpenSSL Project Authors +Copyright 2003-2022 The OpenSSL Project Authors +Copyright 2003-2023 The OpenSSL Project Authors +Copyright 2004-2016 The OpenSSL Project Authors +Copyright 2004-2017 The OpenSSL Project Authors +Copyright 2004-2018 The OpenSSL Project Authors +Copyright 2004-2020 The OpenSSL Project Authors +Copyright 2004-2021 The OpenSSL Project Authors +Copyright 2004-2022 The OpenSSL Project Authors +Copyright 2004-2023 The OpenSSL Project Authors +Copyright 2005-2016 The OpenSSL Project Authors +Copyright 2005-2018 The OpenSSL Project Authors +Copyright 2005-2020 The OpenSSL Project Authors +Copyright 2005-2021 The OpenSSL Project Authors +Copyright 2005-2022 The OpenSSL Project Authors +Copyright 2005-2023 The OpenSSL Project Authors +Copyright 2006-2016 The OpenSSL Project Authors +Copyright 2006-2017 The OpenSSL Project Authors +Copyright 2006-2018 The OpenSSL Project Authors +Copyright 2006-2020 The OpenSSL Project Authors +Copyright 2006-2021 The OpenSSL Project Authors +Copyright 2006-2022 The OpenSSL Project Authors +Copyright 2006-2023 The OpenSSL Project Authors +Copyright 2007-2016 The OpenSSL Project Authors +Copyright 2007-2018 The OpenSSL Project Authors +Copyright 2007-2019 The OpenSSL Project Authors +Copyright 2007-2020 The OpenSSL Project Authors +Copyright 2007-2021 The OpenSSL Project Authors +Copyright 2007-2022 The OpenSSL Project Authors +Copyright 2007-2023 The OpenSSL Project Authors +Copyright 2008-2016 The OpenSSL Project Authors +Copyright 2008-2018 The OpenSSL Project Authors +Copyright 2008-2020 The OpenSSL Project Authors +Copyright 2008-2021 The OpenSSL Project Authors +Copyright 2008-2022 The OpenSSL Project Authors +Copyright 2008-2023 The OpenSSL Project Authors +Copyright 2009-2020 The OpenSSL Project Authors +Copyright 2009-2021 The OpenSSL Project Authors +Copyright 2009-2022 The OpenSSL Project Authors +Copyright 2009-2023 The OpenSSL Project Authors +Copyright 2010-2016 The OpenSSL Project Authors +Copyright 2010-2020 The OpenSSL Project Authors +Copyright 2010-2021 The OpenSSL Project Authors +Copyright 2010-2022 The OpenSSL Project Authors +Copyright 2010-2023 The OpenSSL Project Authors +Copyright 2011-2016 The OpenSSL Project Authors +Copyright 2011-2020 The OpenSSL Project Authors +Copyright 2011-2021 The OpenSSL Project Authors +Copyright 2011-2022 The OpenSSL Project Authors +Copyright 2011-2023 The OpenSSL Project Authors +Copyright 2012, Samuel Neves +Copyright 2012-2016 The OpenSSL Project Authors +Copyright 2012-2020 The OpenSSL Project Authors +Copyright 2012-2021 The OpenSSL Project Authors +Copyright 2012-2022 The OpenSSL Project Authors +Copyright 2012-2023 The OpenSSL Project Authors +Copyright 2013-2017 The OpenSSL Project Authors +Copyright 2013-2018 The OpenSSL Project Authors +Copyright 2013-2020 The OpenSSL Project Authors +Copyright 2013-2021 The OpenSSL Project Authors +Copyright 2013-2022 The OpenSSL Project Authors +Copyright 2013-2023 The OpenSSL Project Authors +Copyright 2014-2016 Cryptography Research, Inc. +Copyright 2014-2016 The OpenSSL Project Authors +Copyright 2014-2017 The OpenSSL Project Authors +Copyright 2014-2018 The OpenSSL Project Authors +Copyright 2014-2020 The OpenSSL Project Authors +Copyright 2014-2021 The OpenSSL Project Authors +Copyright 2014-2022 The OpenSSL Project Authors +Copyright 2014-2023 The OpenSSL Project Authors +Copyright 2015-2016 Cryptography Research, Inc. +Copyright 2015-2016 The OpenSSL Project Authors +Copyright 2015-2017 The OpenSSL Project Authors +Copyright 2015-2018 The OpenSSL Project Authors +Copyright 2015-2020 The OpenSSL Project Authors +Copyright 2015-2021 The OpenSSL Project Authors +Copyright 2015-2022 The OpenSSL Project Authors +Copyright 2015-2023 The OpenSSL Project Authors +Copyright 2016-2016 The OpenSSL Project Authors +Copyright 2016-2017 The OpenSSL Project Authors +Copyright 2016-2018 The OpenSSL Project Authors +Copyright 2016-2019 The OpenSSL Project Authors +Copyright 2016-2020 The OpenSSL Project Authors +Copyright 2016-2021 The OpenSSL Project Authors +Copyright 2016-2022 The OpenSSL Project Authors +Copyright 2016-2023 The OpenSSL Project Authors +Copyright 2017-2018 The OpenSSL Project Authors +Copyright 2017-2019 The OpenSSL Project Authors +Copyright 2017-2020 The OpenSSL Project Authors +Copyright 2017-2021 The OpenSSL Project Authors +Copyright 2017-2022 The OpenSSL Project Authors +Copyright 2017-2023 The OpenSSL Project Authors +Copyright 2018-2019 The OpenSSL Project Authors +Copyright 2018-2020 The OpenSSL Project Authors +Copyright 2018-2021 The OpenSSL Project Authors +Copyright 2018-2022 The OpenSSL Project Authors +Copyright 2018-2023 The OpenSSL Project Authors +Copyright 2019-2020 The OpenSSL Project Authors +Copyright 2019-2021 The OpenSSL Project Authors +Copyright 2019-2022 The OpenSSL Project Authors +Copyright 2019-2023 The OpenSSL Project Authors +Copyright 2020-2021 The OpenSSL Project Authors +Copyright 2020-2022 The OpenSSL Project Authors +Copyright 2020-2023 The OpenSSL Project Authors +Copyright 2021-2022 The OpenSSL Project Authors +Copyright 2021-2023 The OpenSSL Project Authors +Copyright 2022-2023 The OpenSSL Project Authors +Copyright 20xx-20yy The OpenSSL Project Authors +Copyright (c) 2002, Oracle and/or its affiliates +Copyright (c) 2017, Oracle and/or its affiliates +Copyright (c) 2018, Oracle and/or its affiliates +Copyright (c) 2019, Oracle and/or its affiliates +Copyright 1995-$YEAR The OpenSSL Project Authors +Copyright 1998-$YEAR The OpenSSL Project Authors +Copyright 1999-$YEAR The OpenSSL Project Authors +Copyright 2000-$YEAR The OpenSSL Project Authors +Copyright 2020-$YEAR The OpenSSL Project Authors +Copyright (c) 1989 Free Software Foundation, Inc. +Copyright 2017 Ribose Inc. (https://www.ribose.com) +Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson +Copyright (c) 2008 Andy Polyakov +Copyright 2021 UnionTech (https://www.uniontech.com) +Copyright (c) 2018-2019, Oracle and/or its affiliates +Copyright (c) 2018-2020, Oracle and/or its affiliates +Copyright (c) 2019-2020, Oracle and/or its affiliates +Copyright (c) 2013 by Mark Jason Dominus +Copyright (c) 2017 National Security Research Institute +copyright (c) 2013 by Mark Jason Dominus +Copyright (c) 2004, Richard Levitte +Copyright (c) 2013-2014 Timo Teras +Copyright (c) 2007 KISA(Korea Information Security Agency) +Copyright (c) 2004, 2018, Richard Levitte +Copyright (c) 2016 Viktor Dukhovni +Copyright 2006 NTT (Nippon Telegraph and Telephone Corporation) +Copyright (c) 2005 WISeKey SA1 Internat(onal1)0 WISeKey CertifyID Advanced G1 CA0 +Copyright (c) 2005 WISeKey SA1 International1 0 WISeKey CertifyID Advanced G1 CA0 +Copyright (c) 2004 Kungliga Tekniska Hogskolan (Royal Institute of Technology, Stockholm, Sweden) + + + Apache License + Version 2.0, January 2004 + https://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. - - - "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. - - - - "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. - - - - "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. - - - - "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. - - - - "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. - - - - "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. - - - - "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). - - - - "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. - - - - "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." - - - - "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: - - (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. - - You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS - -APPENDIX: How to apply the Apache License to your work. - -To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. - -Copyright [yyyy] [name of copyright owner] - -Licensed under the Apache License, Version 2.0 (the "License"); - -you may not use this file except in compliance with the License. - -You may obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software - -distributed under the License is distributed on an "AS IS" BASIS, - -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - -See the License for the specific language governing permissions and - -limitations under the License. - ---------------------------------------------------------- - ---------------------------------------------------------- - -StyleCop.Analyzers 1.1.118 - Apache-2.0 - - -copyright company -Copyright (c) 2015 Dennis Fischer -Copyright (c) 2017 Marcos Lopez C. -Copyright 2014 Giovanni Bassi and Elemar Jr. -Copyright (c) Tunnel Vision Laboratories, LLC. -Copyright Tunnel Vision Laboratories, LLC 2015 -1Copyright Tunnel Vision Laboratories, LLC 2015 -GetCopyrightText copyrightText WithDocumentText -copyright tag should contain a non-empty company -1Copyright Tunnel Vision Laboratories, LLC 2015 DAn -Copyright 2015 Tunnel Vision Laboratories, LLC StyleCop DotNetAnalyzers Roslyn Diagnostic Analyzer - -Copyright (c) Tunnel Vision Laboratories, LLC. All rights reserved. - -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -these files except in compliance with the License. You may obtain a copy of the -License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software distributed -under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -CONDITIONS OF ANY KIND, either express or implied. See the License for the -specific language governing permissions and limitations under the License. - ---- - -This project uses other open source projects, which are used under the terms -of the following license(s). - -.NET Compiler Platform ("Roslyn") - - Copyright Microsoft. - - Licensed under the Apache License, Version 2.0 (the "License"); you may not use - these files except in compliance with the License. You may obtain a copy of the - License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software distributed - under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR - CONDITIONS OF ANY KIND, either express or implied. See the License for the - specific language governing permissions and limitations under the License. - -Code Cracker - - Copyright 2014 Giovanni Bassi and Elemar Jr. - - Licensed under the Apache License, Version 2.0 (the "License"); you may not use - these files except in compliance with the License. You may obtain a copy of the - License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software distributed - under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR - CONDITIONS OF ANY KIND, either express or implied. See the License for the - specific language governing permissions and limitations under the License. - -LightJson - - Copyright (c) 2017 Marcos López C. - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - - ---------------------------------------------------------- - ---------------------------------------------------------- - -xunit 2.4.2 - Apache-2.0 - - -Copyright (c) .NET Foundation - -Apache License - -Version 2.0, January 2004 - -http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - - - "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. - - - - "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. - - - - "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. - - - - "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. - - - - "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. - - - - "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. - - - - "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). - - - - "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. - - - - "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." - - - - "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: - - (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. - - You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS - -APPENDIX: How to apply the Apache License to your work. - -To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. - -Copyright [yyyy] [name of copyright owner] - -Licensed under the Apache License, Version 2.0 (the "License"); - -you may not use this file except in compliance with the License. - -You may obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software - -distributed under the License is distributed on an "AS IS" BASIS, - -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - -See the License for the specific language governing permissions and - -limitations under the License. - ---------------------------------------------------------- - ---------------------------------------------------------- - -xunit.abstractions 2.0.3 - Apache-2.0 - - -Copyright (c) Outercurve Foundation -Copyright (c) Outercurve Foundation WrapNonExceptionThrows RSDS - -Apache License - -Version 2.0, January 2004 - -http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - - - "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. - - - - "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. - - - - "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. - - - - "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. - - - - "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. - - - - "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. - - - - "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). - - - - "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. - - - - "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." - - - - "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: - - (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. - - You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS - -APPENDIX: How to apply the Apache License to your work. - -To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. - -Copyright [yyyy] [name of copyright owner] - -Licensed under the Apache License, Version 2.0 (the "License"); - -you may not use this file except in compliance with the License. - -You may obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software - -distributed under the License is distributed on an "AS IS" BASIS, - -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - -See the License for the specific language governing permissions and - -limitations under the License. - ---------------------------------------------------------- - ---------------------------------------------------------- - -xunit.analyzers 1.0.0 - Apache-2.0 - - -Copyright (c) .NET Foundation -Copyright (c) .NET Foundation xUnit.net -Copyright (c) .NET Foundation xunit.analyzers, analyzers, roslyn, xunit, xunit.net - -Apache License - -Version 2.0, January 2004 - -http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - - - "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. - - - - "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. - - - - "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. - - - - "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. - - - - "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. - - - - "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. - - - - "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). - - - - "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. - - - - "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." - - - - "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: - - (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. - - You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS - -APPENDIX: How to apply the Apache License to your work. - -To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. - -Copyright [yyyy] [name of copyright owner] - -Licensed under the Apache License, Version 2.0 (the "License"); - -you may not use this file except in compliance with the License. - -You may obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software - -distributed under the License is distributed on an "AS IS" BASIS, - -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - -See the License for the specific language governing permissions and - -limitations under the License. - ---------------------------------------------------------- - ---------------------------------------------------------- - -xunit.assert 2.4.2 - Apache-2.0 - - -Copyright (c) .NET Foundation -Copyright (c) .NET Foundation xUnit.net - -Apache License - -Version 2.0, January 2004 - -http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - - - "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. - - - - "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. - - - - "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. - - - - "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. - - - - "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. - - - - "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. - - - - "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). - - - - "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. - - - - "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." - - - - "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: - - (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. - - You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS - -APPENDIX: How to apply the Apache License to your work. - -To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. - -Copyright [yyyy] [name of copyright owner] - -Licensed under the Apache License, Version 2.0 (the "License"); - -you may not use this file except in compliance with the License. - -You may obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software - -distributed under the License is distributed on an "AS IS" BASIS, - -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - -See the License for the specific language governing permissions and - -limitations under the License. - ---------------------------------------------------------- - ---------------------------------------------------------- - -xunit.core 2.4.2 - Apache-2.0 - - -Copyright (c) .NET Foundation - -Apache License - -Version 2.0, January 2004 - -http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - - - "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. - - - - "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. - - - - "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. - - - - "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. - - - - "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. - - - - "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. - - - - "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). - - - - "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. - - - - "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." - - - - "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: - - (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. - - You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS - -APPENDIX: How to apply the Apache License to your work. - -To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. - -Copyright [yyyy] [name of copyright owner] - -Licensed under the Apache License, Version 2.0 (the "License"); - -you may not use this file except in compliance with the License. - -You may obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software - -distributed under the License is distributed on an "AS IS" BASIS, - -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - -See the License for the specific language governing permissions and - -limitations under the License. - ---------------------------------------------------------- - ---------------------------------------------------------- - -xunit.extensibility.core 2.4.2 - Apache-2.0 - - -Copyright (c) .NET Foundation -Copyright (c) .NET Foundation xUnit.net -Copyright (c) .NET Foundation 0xUnit.net -Copyright (c) .NET Foundation xUnit.net Runner Utility - -Apache License - -Version 2.0, January 2004 - -http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - - - "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. - - - - "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. - - - - "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. - - - - "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. - - - - "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. - - - - "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. - - - - "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). - - - - "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. - - - - "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." - - - - "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: - - (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. - - You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS - -APPENDIX: How to apply the Apache License to your work. - -To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. - -Copyright [yyyy] [name of copyright owner] - -Licensed under the Apache License, Version 2.0 (the "License"); - -you may not use this file except in compliance with the License. - -You may obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software - -distributed under the License is distributed on an "AS IS" BASIS, - -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - -See the License for the specific language governing permissions and - -limitations under the License. - ---------------------------------------------------------- - ---------------------------------------------------------- - -xunit.extensibility.execution 2.4.2 - Apache-2.0 - - -Copyright (c) .NET Foundation -Copyright (c) .NET Foundation xUnit.net - -Apache License - -Version 2.0, January 2004 - -http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - - - "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. - - - - "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. - - - - "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. - - - - "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. - - - - "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. - - - - "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. - - - - "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). - - - - "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. - - - - "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." - - - - "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: - - (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. - - You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS - -APPENDIX: How to apply the Apache License to your work. - -To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. - -Copyright [yyyy] [name of copyright owner] - -Licensed under the Apache License, Version 2.0 (the "License"); - -you may not use this file except in compliance with the License. - -You may obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software - -distributed under the License is distributed on an "AS IS" BASIS, - -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - -See the License for the specific language governing permissions and + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + +--------------------------------------------------------- + +--------------------------------------------------------- + +tristanpenman/valijson 0b4771e273a065d437814baf426bcfcafec0f434 - BSD-2-Clause + + +Copyright (c) 2021 Tristan Penman +Copyright (c) 2016, Tristan Penman +Copyright (c) The Internet Society (2005) +Copyright (c) The Internet Society (2006) +Copyright (c) 2011 - 2012 Andrzej Krzemienski +Copyright (c) 2016, Akamai Technologies, Inc. +Copyright (c) 2016 Akamai Technologies Polymorphic +Copyright (c) 2010 IETF Trust and the persons identified as the document authors +Copyright (c) 2012 IETF Trust and the persons identified as the document authors +Copyright (c) 2013 IETF Trust and the persons identified as the document authors -limitations under the License. - ---------------------------------------------------------- - ---------------------------------------------------------- - -tristanpenman/valijson 2dfc7499a31b84edef71189f4247919268ebc74e - BSD-2-Clause AND MIT - - -Copyright 2005 Google Inc. -Copyright 2008 Google Inc. -Copyright 2009 Google Inc. -Copyright 2010 Google Inc. -Copyright 2013 Google Inc. -Copyright 2015 Google Inc. -Copyright 2017 Google Inc. -Copyright 2018 Google LLC. -Copyright 2019 Google LLC. -Copyright (c) 2002 JSON.org -Copyright 2005, Google Inc. -Copyright 2006, Google Inc. -Copyright 2007 Neal Norwitz -Copyright 2007, Google Inc. -Copyright 2008, Google Inc. -Copyright 2009 Neal Norwitz -Copyright 2009, Google Inc. -Copyright 2010, Google Inc. -Copyright 2013, Google Inc. -Copyright 2015, Google Inc. -Copyright 2018, Google Inc. -Copyright 2018, Google LLC. -Copyright 2019, Google Inc. -Copyright 2019, Google LLC. -(c) Copyright IBM Corporation -Copyright (c) 2010 IETF Trust -Copyright (c) 2012 IETF Trust -Copyright (c) 2013 IETF Trust -Copyright 2011-2014 Kazuho Oku -Copyright (c) 2012 Julian Berman -Copyright (c) 2013 Dropbox, Inc. -Copyright (c) 2016 InfoTeCS JSC. -Copyright (c) 2014 DeNA Co., Ltd. -Copyright (c) 2011-2015 Kazuho Oku -Copyright (c) 2016, Tristan Penman -Copyright (c) 2009 Florian Loitsch. -Copyright (c) 2015 THL A29 Limited. -Portions Copyright 2007 Google Inc. -Portions Copyright 2009 Google Inc. -Copyright 2009-2010 Cybozu Labs, Inc. -copyright (c) 2013-2017 Niels Lohmann -Copyright (c) 2016 Akamai Technologies -Copyright (c) 2009-2010 Cybozu Labs, Inc. -Copyright (c) 2006-2013 Alexander Chemeris -Copyright (c) The Internet Society (2005). -Copyright (c) The Internet Society (2006). -copyright 2009-2013 Christopher M. Kohlhoff -Copyright (c) 2016, Akamai Technolgies, Inc. -Copyright (c) 2011 - 2012 Andrzej Krzemienski. -Copyright (c) 2003-2013 Christopher M. Kohlhoff -Copyright (c) 2009-2013 Christopher M. Kohlhoff -Copyright 2011 Baptiste Lepilleur and The JsonCpp Authors -Copyright (c) 2013-2018 Niels Lohmann -Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors -Copyright 2007-2011 Baptiste Lepilleur and The JsonCpp Authors -Copyright (c) 2015 THL A29 Limited, a Tencent company, and Milo -Copyright (c) 2007-2010 Baptiste Lepilleur and The JsonCpp Authors -Copyright (c) 2015 THL A29 Limited, a Tencent company, and Milo Yip. -Copyright 2011-2014 Kazuho Oku, Yasuhiro Matsumoto, Shigeo Mitsunari -Copyright (c) 2007-2010 by Baptiste Lepilleur and The JsonCpp Authors -Copyright (c) 2008-2009 Bjoern Hoehrmann sa http://bjoern.hoehrmann.de/utf-8/decoder/dfa - Copyright (c) 2016, Tristan Penman -Copyright (c) 2016, Akamai Technolgies, Inc. +Copyright (c) 2016, Akamai Technologies, Inc. All rights reserved. Redistribution and use in source and binary forms, with or without @@ -1084,57 +473,163 @@ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - ---------------------------------------------------------- - ---------------------------------------------------------- - -Moq 4.18.2 - BSD-3-Clause - - -Copyright (c) 2007, Clarius Consulting, Manas Technology Solutions, InSTEDD, and Contributors - -Copyright (c) . All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - ---------------------------------------------------------- - ---------------------------------------------------------- - -catchorg/catch2 e1c9d5569dc4135babb9c81891d70a8ba8ed938c - BSL-1.0 - - -Copyright Social Point -Copyright 2012 Martin Moene. -Copyright 2015 Martin Moene. -Copyright 2017 Justin R. Wilson. -Copyright (c) Two Blue Cubes Ltd. -Copyright 2010 Two Blue Cubes Ltd. -Copyright 2011 Two Blue Cubes Ltd. -Copyright 2012 Two Blue Cubes Ltd. -Copyright 2013 Two Blue Cubes Ltd. -Copyright 2014 Two Blue Cubes Ltd. -Copyright 2015 Two Blue Cubes Ltd. -Copyright 2016 Two Blue Cubes Ltd. -Copyright 2017 Two Blue Cubes Ltd. -Copyright 2018 Two Blue Cubes Ltd. -Copyright 2019 Two Blue Cubes Ltd. -Copyright (c) 2012 Two Blue Cubes Ltd. -Copyright (c) 2017 Two Blue Cubes Ltd. -Copyright (c) 2019 Two Blue Cubes Ltd. -Copyright.txt or https://cmake.org/licensing -Copyright (c) 2015-2017 RWTH Aachen University, Federal Republic of Germany - + + +--------------------------------------------------------- + +--------------------------------------------------------- + +curl/curl fd567d4f06857f4fc8e2f64ea727b1318f76ad33 - BSD-3-Clause AND BSD-4-Clause-UC AND ISC AND curl + + +Copyright (C) David Shaw +Copyright (C) Howard Chu +Copyright (C) Max Dymond +Copyright (c) 1998, 1999 +(c) ! ISCNTRL (c) ISSPACE +Copyright (C) Jeroen Ooms +Copyright (C) Mark Gaiser +Copyright (c) Evgeny Grin +Daniel Stenberg, , et al. +Copyright (C) Dan Fandrich +Copyright (C) Jan Venekamp +Copyright (c) Dan Fandrich +Copyright (C) Dmitry Karpov +Copyright (C) Jay Satiro, . +Copyright (C) John Malmberg +Copyright (C) Red Hat, Inc. +Copyright (c) John Malmberg +Copyright (c) Red Hat, Inc. +copyright When contributing +Copyright (C) Björn Stenberg +Copyright (C) Michael Forney +Copyright (C) Steve Holme, . +Copyright (C) Viktor Szakats +Copyright (c) Viktor Szakats +Copyright (C) Daniel Stenberg +Copyright (c) Daniel Fandrich +Copyright (c) Daniel Stenberg +Copyright (C), Daniel Stenberg +Copyright (C) Nicolas Sterchele +Copyright (C) " CURL_COPYRIGHT "\0" +Copyright (C) Jacob Hoffman-Andrews +Copyright (C) 2006-2022 wolfSSL Inc. +Copyright (C) James Fuller, , et al. +Copyright (C) Linus Nielsen Feltzing +Copyright (c) 2001 Alexander Peslyak +Copyright (c) 2006-2022 wolfSSL Inc. +Copyright (C) Daniel Fandrich, et al. +Copyright (C) Vijay Panghal, , et al. +Copyright (C) " LIBCURL_COPYRIGHT "\0" +Copyright (C) Daniel Fandrich, , et al. +Copyright (C) Daniel Stenberg, , et al. +Copyright (C) Simon Josefsson, , et al. +Copyright (C) Evgeny Grin (Karlson2k), . +2022 Free Software Foundation Europe e.V. +Copyright (c) Internet Software Consortium. +Copyright Daniel Stenberg, +Copyright (c) Howard Chu, +Copyright (c) Mandy Wu, +Copyright (C) Bill Nagel , Exacq Technologies +Copyright (c) Bjorn Stenberg, +Copyright (c) Daniel Stenberg +Copyright (c) Jan Venekamp, +Copyright (c) Mark Gaiser, +Copyright (c) Daniel Stenberg, +Copyright (c) Howard Chu, +Copyright (c) Jay Satiro, +Copyright (c) , Daniel Stenberg +Copyright (c) David Shaw +Copyright (c) Jeroen Ooms +Copyright (c) Hoi-Ho Chan, +Copyright (c) Nick Zitzmann, +Copyright (C) EdelWeb for EdelKey and OpenEvidence +Copyright (c) EdelWeb for EdelKey and OpenEvidence +Copyright (c) James Fuller, +Copyright (c) Dmitry Karpov +Copyright (c) Michael Forney, +Copyright (C) 1998 - 2022, Daniel Stenberg, , et al. +Copyright (C) 2008 - 2022, Daniel Stenberg, , et al. +Copyright (c) 1996-2022 Internet Software Consortium +Copyright (c) 1998, 1999 Kungliga Tekniska Hogskolan +Copyright (c) Linus Nielsen Feltzing +Copyright (c) Marc Hoersken, +Copyright (c) Max Dymond, +Copyright (c) Simon Josefsson, +Copyright (c) Steve Holme, +Copyright (C) 1996-2022 Internet Software Consortium. +Copyright (c) Linus Nielsen Feltzing, +Copyright (c) Mark Salisbury, +Copyright (c) Vijay Panghal, +Copyright (c) 2001-2004 Damien Miller +Copyright (c) Daniel Fandrich, +Copyright (c) Florin Petriuc, +Copyright (c) Nicolas Sterchele, +Copyright (c) 1983, Regents of the University of California +Copyright (c) 1998 - 2022, Daniel Stenberg, +Copyright (c) 2008 - 2022, Daniel Stenberg, +Copyright (c) Markus Moeller, +Copyright (c) Jacob Hoffman-Andrews, +Copyright (c) Bill Nagel , Exacq Technologies +Copyright various years The Regents of the University of California +Copyright (C) Daniel Stenberg et al. OS/400 version by P. Monnerat")' +Copyright 2022 Free Software Foundation Europe e.V. +Copyright (c) Daniel Stenberg, , and many contributors +Copyright (c) 1996 - 2024, Daniel Stenberg, , and many contributors +Copyright (c) 1995, 1996, 1997, 1998, 1999 Kungliga Tekniska Hogskolan (Royal Institute of Technology, Stockholm, Sweden) + +COPYRIGHT AND PERMISSION NOTICE + +Copyright (c) 1996 - 2024, Daniel Stenberg, , and many +contributors, see the THANKS file. + +All rights reserved. + +Permission to use, copy, modify, and distribute this software for any purpose +with or without fee is hereby granted, provided that the above copyright +notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN +NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE +OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of a copyright holder shall not +be used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization of the copyright holder. + + +--------------------------------------------------------- + +--------------------------------------------------------- + +catchorg/catch2 e1c9d5569dc4135babb9c81891d70a8ba8ed938c - BSL-1.0 + + +Copyright Social Point +Copyright 2012 Martin Moene. +Copyright 2015 Martin Moene. +Copyright 2017 Justin R. Wilson. +Copyright (c) Two Blue Cubes Ltd. +Copyright 2010 Two Blue Cubes Ltd. +Copyright 2011 Two Blue Cubes Ltd. +Copyright 2012 Two Blue Cubes Ltd. +Copyright 2013 Two Blue Cubes Ltd. +Copyright 2014 Two Blue Cubes Ltd. +Copyright 2015 Two Blue Cubes Ltd. +Copyright 2016 Two Blue Cubes Ltd. +Copyright 2017 Two Blue Cubes Ltd. +Copyright 2018 Two Blue Cubes Ltd. +Copyright 2019 Two Blue Cubes Ltd. +Copyright (c) 2012 Two Blue Cubes Ltd. +Copyright (c) 2017 Two Blue Cubes Ltd. +Copyright (c) 2019 Two Blue Cubes Ltd. +Copyright.txt or https://cmake.org/licensing +Copyright (c) 2015-2017 RWTH Aachen University, Federal Republic of Germany + Boost Software License - Version 1.0 - August 17th, 2003 Permission is hereby granted, free of charge, to any person or organization @@ -1158,75 +653,125 @@ SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - ---------------------------------------------------------- - ---------------------------------------------------------- - -coverlet.collector 1.2.0 - MIT - - -Copyright 2008 - 2018 Jb Evain -Copyright Microsoft Corporation -Copyright James Newton-King 2008 - -MIT License - -Copyright (c) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - ---------------------------------------------------------- - ---------------------------------------------------------- - -Microsoft.ApplicationInsights 2.21.0 - MIT - - - -MIT License - -Copyright (c) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - ---------------------------------------------------------- - ---------------------------------------------------------- - -Microsoft.Msix.Utils 2.1.1 - MIT - - - -MIT License - -Copyright (c) -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +--------------------------------------------------------- + +--------------------------------------------------------- + +c-ares/c-ares fddf01938d3789e06cc1c3774e4cd0c7d2a89976 - HPND + + +Copyright 2008 Google Inc. +Copyright 2005, Google Inc. +Copyright 2006, Google Inc. +Copyright 2007, Google Inc. +Copyright 2008, Google Inc. +Copyright 2013, Google Inc. +Copyright 2015, Google Inc. +Copyright (c) 2012 Xan Lopez +Copyright (c) 2021 Permission +Copyright (c) 2012 Dan Winship +Copyright 2005 Dominick Meglio +Copyright (c) 2012 Paolo Borelli +Copyright (c) 2021 by Brad House +Copyright 1998 by Daniel Stenberg +Copyright 2004 by Daniel Stenberg +Copyright 2005 by Dominick Meglio +Copyright (c) 2012 Christian Persch +Copyright (c) 2017 by John Schember +Copyright (c) 2014, 2015 Google Inc. +Copyright (c) 2004 by Daniel Stenberg +Copyright (c) 2005 by Dominick Meglio +Copyright (c) 2008 by Daniel Stenberg +Copyright (c) 2013 by Daniel Stenberg +Copyright (c) 2016 by Daniel Stenberg +Copyright (c) 2019 by Andrew Selivanov +Copyright (c) 2012, 2016 Philip Withnall +Copyright (c) 2015,2018 Bastien ROUCARIES +Copyright (c) 2004-2009 by Daniel Stenberg +Copyright (c) 2004-2010 by Daniel Stenberg +Copyright (c) 2004-2011 by Daniel Stenberg +Copyright (c) 2004-2017 by Daniel Stenberg +Copyright (c) 2005 - 2010, Daniel Stenberg +Copyright (c) 2005-2013 by Daniel Stenberg +Copyright (c) 2007 - 2018, Daniel Stenberg +Copyright (c) 2007-2013 by Daniel Stenberg +Copyright (c) 2008-2010 by Daniel Stenberg +Copyright (c) 2008-2013 by Daniel Stenberg +Copyright (c) 2009-2013 by Daniel Stenberg +Copyright (c) 2009-2021 by Daniel Stenberg +Copyright (c) 2010-2012 by Daniel Stenberg +Copyright (c) 2010-2013 by Daniel Stenberg +Copyright (c) 2005, 2013 by Dominick Meglio +Copyright (c) 2004 - 2011 by Daniel Stenberg +Copyright (c) 2004 - 2012 by Daniel Stenberg +Copyright (c) 2004 - 2013 by Daniel Stenberg +Copyright (c) 2008 - 2009 by Daniel Stenberg +Copyright (c) 2008 - 2012 by Daniel Stenberg +Copyright (c) 2008 - 2013 by Daniel Stenberg +Copyright (c) 2009 - 2021 by Daniel Stenberg +Copyright (c) 2017 - 2018 by Christian Ammer +Copyright (c) 2010 Jeremy Lal +Copyright (c) 2012 Marko Kreen +Copyright (c) 2012 Zack Weinberg +Copyright (c) 2018 The Android Open Source Project +Copyright 2020 by +Copyright (c) 2011 Daniel Stenberg +Copyright (c) 2013 Daniel Stenberg +Copyright (c) 2008 Benjamin Kosnik +Copyright (c) 1995, 1996, 1997, and 1998 WIDE Project +Copyright (c) 2014 Mike Frysinger +Copyright (c) 2008 Tom Howard +Copyright (c) 2009 Tom Howard +Copyright 2010 by Ben Greear +Copyright 2020 Danny Sonnenschein +Copyright (c) 1996,1999 by Internet Software Consortium +Copyright (c) 1996-1999 by Internet Software Consortium +Copyright (c) 2004 by Internet Systems Consortium, Inc. +Copyright (c) 2009 by Jakub Hrozek +Copyright (c) 2011 Daniel Richard G. +Copyright (c) 2009 Allan Caffee +Copyright (c) 2013 Roy Stogner +Copyright (c) 2017 by John Schember +Copyright (c) 2018 by John Schember +Copyright (c) 2008 Steven G. Johnson +Copyright 1998 by the Massachusetts Institute of Technology +Copyright 2000 by the Massachusetts Institute of Technology +Copyright 1998, 2000 by the Massachusetts Institute of Technology +Copyright 1998, 2011 by the Massachusetts Institute of Technology +Copyright (c) 1987-2001 The Regents of the University of California +Copyright (c) 2008 John Darrington +Copyright (c) 2015 Enrico M. Crisostomo +Copyright 1998, 2011, 2013 by the Massachusetts Institute of Technology + +# c-ares license + +Copyright (c) 2007 - 2018, Daniel Stenberg with many contributors, see AUTHORS +file. + +Copyright 1998 by the Massachusetts Institute of Technology. + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that +the above copyright notice appear in all copies and that both that copyright +notice and this permission notice appear in supporting documentation, and that +the name of M.I.T. not be used in advertising or publicity pertaining to +distribution of the software without specific, written prior permission. +M.I.T. makes no representations about the suitability of this software for any +purpose. It is provided "as is" without express or implied warranty. + + +--------------------------------------------------------- + +--------------------------------------------------------- + +Microsoft.Windows.CppWinRT 2.0.210503.1 - MIT + + +(c) Microsoft Corporation. +Copyright (c) Microsoft Corporation. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - ---------------------------------------------------------- - ---------------------------------------------------------- - -Microsoft.Windows.CppWinRT 2.0.200117.5 - MIT - - -(c) Microsoft Corporation. -Copyright (c) Microsoft Corporation. - MIT License Copyright (c) Microsoft Corporation. @@ -1248,125 +793,17 @@ Copyright (c) Microsoft Corporation. LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE - - ---------------------------------------------------------- - ---------------------------------------------------------- - -Microsoft.Windows.CppWinRT 2.0.210503.1 - MIT - - -(c) Microsoft Corporation. -Copyright (c) Microsoft Corporation. - - MIT License - Copyright (c) Microsoft Corporation. - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. +--------------------------------------------------------- - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE - - ---------------------------------------------------------- - ---------------------------------------------------------- - -Microsoft.Windows.CppWinRT 2.0.220331.4 - MIT - - -(c) Microsoft 2022 -(c) Microsoft Corporation -Copyright (c) Microsoft Corporation - - MIT License +--------------------------------------------------------- - Copyright (c) Microsoft Corporation. +microsoft/correlationvector-cpp cf38d2b44baaf352509ad9980786bc49554c32e4 - MIT - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. +Copyright (c) Microsoft Corporation. - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE - - ---------------------------------------------------------- - ---------------------------------------------------------- - -Microsoft.Windows.CsWinRT 1.6.5 - MIT - - -(c) Microsoft 2022 -(c) Microsoft Corporation -Copyright 2008 - 2018 Jb Evain -Copyright (c) 2008 - 2015 Jb Evain -Copyright (c) Microsoft Corporation -Copyright (c) 2008 - 2011 Novell, Inc. -Copyright (c) .NET Foundation and Contributors - - MIT License - - Copyright (c) Microsoft Corporation. - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE - - ---------------------------------------------------------- - ---------------------------------------------------------- - -Microsoft.Windows.ImplementationLibrary 1.0.200519.2 - MIT - - -Copyright (c) Microsoft. -(c) Microsoft Corporation. -Copyright (c) Microsoft Corporation. -Copyright (c) 2009-2014 by the contributors - MIT License Copyright (c) Microsoft Corporation. All rights reserved. @@ -1388,58 +825,51 @@ Copyright (c) 2009-2014 by the contributors LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE - - ---------------------------------------------------------- - ---------------------------------------------------------- - -Microsoft.Windows.ImplementationLibrary 1.0.200902.2 - MIT - - -Copyright (c) Microsoft. -(c) Microsoft Corporation. -Copyright (c) Microsoft Corporation. -Copyright (c) 2009-2014 by the contributors - - MIT License - Copyright (c) Microsoft Corporation. All rights reserved. - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: +--------------------------------------------------------- - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. +--------------------------------------------------------- + +microsoft/cpprestsdk 122d09549201da5383321d870bed45ecb9e168c5 - MIT + + +Copyright (c) Microsoft. +Copyright (c) 2014, Peter Thorson. +Copyright (c) Microsoft Corporation. +Copyright (c) 2011, Micael Hildenborg +Copyright (c) 2004-2008 Rene Nyffenegger +Portions Copyright (c) Microsoft Corporation +Copyright (c) 1999, 2002 Aladdin Enterprises. +Copyright (c) 2006 Noel Llopis and Charles Nicholson +Copyright (c) 2008-2009 Bjoern Hoehrmann + +MIT License + +Copyright (c) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +microsoft/sfs-client ff315ecfa2ef2953d8a808e51e8a61a4e0759180 - MIT + + +Copyright (c) Microsoft Corporation +Copyright (c) 2013-2022 Niels Lohmann +Copyright (c) 2007 - 2023 Daniel Stenberg +Copyright (c) 1998 Massachusetts Institute of Technology +Copyright (c) 1996 - 2024, Daniel Stenberg, , and many contributors - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE - - ---------------------------------------------------------- - ---------------------------------------------------------- - -Microsoft.Windows.ImplementationLibrary 1.0.210204.1 - MIT - - -Copyright (c) Microsoft. -(c) Microsoft Corporation. -Copyright (c) Microsoft Corporation. -Copyright (c) 2009-2014 by the contributors - MIT License - Copyright (c) Microsoft Corporation. All rights reserved. + Copyright (c) Microsoft Corporation. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -1458,255 +888,162 @@ Copyright (c) 2009-2014 by the contributors LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE - - ---------------------------------------------------------- - ---------------------------------------------------------- - -microsoft/cpprestsdk 122d09549201da5383321d870bed45ecb9e168c5 - MIT - - -Copyright (c) Microsoft. -Copyright (c) 2014, Peter Thorson. -Copyright (c) Microsoft Corporation. -Copyright (c) 2011, Micael Hildenborg -Copyright (c) 2004-2008 Rene Nyffenegger -Portions Copyright (c) Microsoft Corporation -Copyright (c) 1999, 2002 Aladdin Enterprises. -Copyright (c) 2006 Noel Llopis and Charles Nicholson -Copyright (c) 2008-2009 Bjoern Hoehrmann - -MIT License -Copyright (c) -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +--------------------------------------------------------- + +--------------------------------------------------------- + +nlohmann/json 9cca280a4d0ccf0c08f47a99aa71d1b0e52f8d03 - MIT + + +(c) 2016 +2012 Erik Edlund +(c) 2013-2022 Niels +2017 Georg Sauthoff +2018 Vitaliy Manushkin +2013-2022 Niels Lohmann +2013-2023 Niels Lohmann +2015-2017 Niels Lohmann +2016-2021 Evan Nemerson +2018 The Abseil Authors +2003-2022, LLVM Project. +2016-2021 Viktor Kirilov +Copyright 2003-2022, LLVM Project +Copyright 2015-2017 Niels Lohmann +Copyright 2018 The Abseil Authors +Copyright (c) 2009 Florian Loitsch +Copyright 2016-2021 Viktor Kirilov +Copyright (c) 2013-2022 Niels Lohmann +Copyright (c) 2015-2017 Niels Lohmann +copyright (c) 2013-2022 Niels Lohmann +copyright (c) 2013-2023 Niels Lohmann +Copyright (c) 2016-2023 Viktor Kirilov +Copyright 2017 Georg Sauthoff +copyright Niels Lohmann +Copyright 2012 Erik Edlund +Copyright Copyright (c) 2013 - 2023 Niels Lohmann +Copyright 2018 Vitaliy Manushkin +Copyright 2016-2021 Evan Nemerson +Copyright (c) 2012, Erik Edlund +Copyright 2013-2022 Niels Lohmann +Copyright 2013-2023 Niels Lohmann +Copyright 2020 Hannes Domani +Copyright 2008-2009 Bjorn Hoehrmann +Copyright (c) 2013-2019 Niels Lohmann +Copyright (c) 2013-2022 Niels Lohmann +Copyright (c) 2013-2022 Niels Lohmann (https://nlohmann.me) +Copyright (c) 2020 Hannes Domani (https://github.com/ssbssa) +Copyright 2009 Florian Loitsch +Copyright (c) 2009 Florian Loitsch (https://florian.loitsch.com/) +Copyright (c) 2007 Free Software Foundation, Inc. +Copyright (c) 2008-2009 Bjorn Hoehrmann (http://bjoern.hoehrmann.de/) +Copyright (c) 2008-2009 Bjorn Hoehrmann (https://bjoern.hoehrmann.de/) +Copyright (c) 2008-2009 Bjoern Hoehrmann sa http://bjoern.hoehrmann.de/utf-8/decoder/dfa + +MIT License + +Copyright (c) 2013-2022 Niels Lohmann -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - ---------------------------------------------------------- - ---------------------------------------------------------- - -Newtonsoft.Json 13.0.1 - MIT - - -Copyright James Newton-King 2008 -Copyright (c) 2007 James Newton-King -Copyright (c) James Newton-King 2008 -Copyright James Newton-King 2008 Json.NET - -The MIT License (MIT) - -Copyright (c) 2007 James Newton-King - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - ---------------------------------------------------------- - ---------------------------------------------------------- - -Newtonsoft.Json.Bson 1.0.1 - MIT - - -Copyright James Newton-King 2017 -Copyright (c) James Newton-King 2017 - -MIT License +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. -Copyright (c) +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +--------------------------------------------------------- -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - ---------------------------------------------------------- - ---------------------------------------------------------- - -NUnit 3.12.0 - MIT - - - -Copyright (c) 2019 Charlie Poole, Rob Prouse - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - - - ---------------------------------------------------------- - ---------------------------------------------------------- - -NUnit3TestAdapter 3.15.1 - MIT - - -Copyright 2008 - 2015 Jb Evain -Copyright 2008 - 2018 Jb Evain -Copyright (c) 2019 Charlie Poole, Rob Prouse -Copyright 2011-2019 Charlie Poole, 2014-2019 Terje Sandstrom -Copyright (c) 2011-2019 Charlie Poole, 2014-2019 Terje Sandstrom -https://github.com/nunit/docs/wiki/Adapter-Release-Notes Copyright (c) 2011-2019 Charlie Poole, 2014-2019 Terje Sandstrom -works with Visual Studio 2012 and newer. NUnit Project NUnit3TestAdapter ?Copyright 2011-2019 Charlie Poole, 2014-2019 Terje Sandstrom - -Copyright (c) 2011-2019 Charlie Poole, 2014-2019 Terje Sandstrom - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - - - ---------------------------------------------------------- - ---------------------------------------------------------- - -PowerShellStandard.Library 5.1.1 - MIT - - -(c) Microsoft Corporation. - -MIT License +--------------------------------------------------------- -Copyright (c) +ronomon/pure fd54913e65338e678440ae66b3b5022ab23b761b - MIT -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +Copyright (c) 2003 Mark Adler +Copyright (c) 2020 Ronomon CC +Copyright 1995-2017 Mark Adler +Copyright (c) 2003 Cosmin Truta +Copyright (c) 1990-2000 Info-ZIP. +Copyright (c) 1998 by Bob Dellaca +Copyright (c) 1995-2003 Mark Adler +Copyright (c) 1995-2008 Mark Adler +Copyright (c) 1995-2016 Mark Adler +Copyright (c) 1995-2017 Mark Adler +Copyright (c) 2002-2013 Mark Adler +Copyright (c) 2003 by Cosmin Truta +Copyright (c) 2003-2010 Mark Adler +Copyright (c) 2004-2017 Mark Adler +Copyright (c) 1996 L. Peter Deutsch +Copyright (c) 1997,99 Borland Corp. +Copyright (c) 2003, 2012 Mark Adler +Copyright (c) 2004, 2005 Mark Adler +Copyright (c) 2004, 2010 Mark Adler +Copyright (c) 2005, 2012 Mark Adler +Copyright (c) 2011, 2016 Mark Adler +Copyright (c) 2007-2008 Even Rouault +Copyright (c) 1998-2005 Gilles Vollant +Copyright (c) 2004, 2005 by Mark Adler +Copyright (c) 1995-1998 Jean-loup Gailly +Copyright (c) 1995-2003 Jean-loup Gailly +Copyright (c) 1995-2003, 2010 Mark Adler +Copyright (c) 1995-2005, 2010 Mark Adler +Copyright (c) 1995-2011, 2016 Mark Adler +Copyright (c) 1995-2016 Jean-loup Gailly +Copyright (c) 1995-2017 Jean-loup Gailly +Copyright (c) 1997,99 Borland Corporation +Copyright (c) 1998 by Andreas R. Kleinert +Copyright (c) 2002-2003 Dmitriy Anisimkov +Copyright (c) 2002-2004 Dmitriy Anisimkov +Copyright (c) 2003, 2012, 2013 Mark Adler +Copyright (c) 2004, 2005, 2012 Mark Adler +Copyright (c) 2004, 2008, 2012 Mark Adler +Copyright (c) 2007, 2008, 2012 Mark Adler +Copyright (c) 1998 by Jacques Nomssi Nzali +(c) 1995-2017 Jean-loup Gailly & Mark Adler +Copyright (c) 1995-2003 by Jean-loup Gailly +Copyright (c) 1998-2010 - by Gilles Vollant +(c) 1995-2017 Jean-loup Gailly and Mark Adler +Copyright (c) 2004, 2008, 2012, 2016 Mark Adler +Copyright 1995-2017 Jean-loup Gailly and Mark Adler +Copyright (c) 1995-2006, 2011, 2016 Jean-loup Gailly +Copyright (c) 1995-2016 Jean-loup Gailly, Mark Adler +Copyright (c) 1995-2017 Jean-Loup Gailly, Mark Adler +Copyright (c) 1995-2017 Jean-loup Gailly, Mark Adler +Copyright (c) 1998,1999,2000 by Jacques Nomssi Nzali +Copyright (c) 2003, 2005, 2008, 2010, 2012 Mark Adler +Copyright (c) 2003 Chris Anderson +Copyright (c) 1995-2003 Jean-loup Gailly and Mark Adler +Copyright (c) 1995-2017 Jean-loup Gailly and Mark Adler +copyright (c) 1995-2017 Jean-loup Gailly and Mark Adler +Copyright (c) 1996 L. Peter Deutsch and Jean-Loup Gailly +Copyright (c) 1998 Brian Raiter +Copyright (c) 1995-2006, 2010, 2011, 2012, 2016 Mark Adler +Copyright (c) 1995-2006, 2010, 2011, 2016 Jean-loup Gailly +Copyright (c) 2009-2010 Mathias Svensson http://result42.com +Copyright (c) 1998, 2007 Brian Raiter +Copyright (c) 1995-2005, 2014, 2016 Jean-loup Gailly, Mark Adler +Copyright (c) 2004, 2005, 2010, 2011, 2012, 2013, 2016 Mark Adler +Copyright Jean-loup Gailly Osma Ahvenlampi +Copyright 1998-2004 Gilles Vollant - http://www.winimage.com/zLibDll +Copyright (c) 1997 Christian Michelsen Research AS Advanced Computing +Copyright (c) 1995-2003, 2010, 2014, 2016 Jean-loup Gailly, Mark Adler +Copyright (c) 1998 - 2010 Gilles Vollant, Even Rouault, Mathias Svensson +Copyright (c) 1995-1996 Jean-loup Gailly, Brian Raiter and Gilles Vollant +Copyright (c) 1995-2010 Jean-loup Gailly, Brian Raiter and Gilles Vollant +Copyright (c) 1998-2010 Gilles Vollant (minizip) http://www.winimage.com/zLibDll/minizip.html -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - ---------------------------------------------------------- - ---------------------------------------------------------- - -ronomon/pure fd54913e65338e678440ae66b3b5022ab23b761b - MIT - - -Copyright (c) 2003 Mark Adler -Copyright (c) 2020 Ronomon CC -Copyright 1995-2017 Mark Adler -Copyright (c) 2003 Cosmin Truta -Copyright (c) 1990-2000 Info-ZIP. -Copyright (c) 1998 by Bob Dellaca -Copyright (c) 1995-2003 Mark Adler -Copyright (c) 1995-2008 Mark Adler -Copyright (c) 1995-2016 Mark Adler -Copyright (c) 1995-2017 Mark Adler -Copyright (c) 2002-2013 Mark Adler -Copyright (c) 2003 by Cosmin Truta -Copyright (c) 2003-2010 Mark Adler -Copyright (c) 2004-2017 Mark Adler -Copyright (c) 1996 L. Peter Deutsch -Copyright (c) 1997,99 Borland Corp. -Copyright (c) 2003, 2012 Mark Adler -Copyright (c) 2004, 2005 Mark Adler -Copyright (c) 2004, 2010 Mark Adler -Copyright (c) 2005, 2012 Mark Adler -Copyright (c) 2011, 2016 Mark Adler -Copyright (c) 2007-2008 Even Rouault -Copyright (c) 1998-2005 Gilles Vollant -Copyright (c) 2004, 2005 by Mark Adler -Copyright (c) 1995-1998 Jean-loup Gailly -Copyright (c) 1995-2003 Jean-loup Gailly -Copyright (c) 1995-2003, 2010 Mark Adler -Copyright (c) 1995-2005, 2010 Mark Adler -Copyright (c) 1995-2011, 2016 Mark Adler -Copyright (c) 1995-2016 Jean-loup Gailly -Copyright (c) 1995-2017 Jean-loup Gailly -Copyright (c) 1997,99 Borland Corporation -Copyright (c) 1998 by Andreas R. Kleinert -Copyright (c) 2002-2003 Dmitriy Anisimkov -Copyright (c) 2002-2004 Dmitriy Anisimkov -Copyright (c) 2003, 2012, 2013 Mark Adler -Copyright (c) 2004, 2005, 2012 Mark Adler -Copyright (c) 2004, 2008, 2012 Mark Adler -Copyright (c) 2007, 2008, 2012 Mark Adler -Copyright (c) 1998 by Jacques Nomssi Nzali -(c) 1995-2017 Jean-loup Gailly & Mark Adler -Copyright (c) 1995-2003 by Jean-loup Gailly -Copyright (c) 1998-2010 - by Gilles Vollant -(c) 1995-2017 Jean-loup Gailly and Mark Adler -Copyright (c) 2004, 2008, 2012, 2016 Mark Adler -Copyright 1995-2017 Jean-loup Gailly and Mark Adler -Copyright (c) 1995-2006, 2011, 2016 Jean-loup Gailly -Copyright (c) 1995-2016 Jean-loup Gailly, Mark Adler -Copyright (c) 1995-2017 Jean-Loup Gailly, Mark Adler -Copyright (c) 1995-2017 Jean-loup Gailly, Mark Adler -Copyright (c) 1998,1999,2000 by Jacques Nomssi Nzali -Copyright (c) 2003, 2005, 2008, 2010, 2012 Mark Adler -Copyright (c) 2003 Chris Anderson -Copyright (c) 1995-2003 Jean-loup Gailly and Mark Adler -Copyright (c) 1995-2017 Jean-loup Gailly and Mark Adler -copyright (c) 1995-2017 Jean-loup Gailly and Mark Adler -Copyright (c) 1996 L. Peter Deutsch and Jean-Loup Gailly -Copyright (c) 1998 Brian Raiter -Copyright (c) 1995-2006, 2010, 2011, 2012, 2016 Mark Adler -Copyright (c) 1995-2006, 2010, 2011, 2016 Jean-loup Gailly -Copyright (c) 2009-2010 Mathias Svensson http://result42.com -Copyright (c) 1998, 2007 Brian Raiter -Copyright (c) 1995-2005, 2014, 2016 Jean-loup Gailly, Mark Adler -Copyright (c) 2004, 2005, 2010, 2011, 2012, 2013, 2016 Mark Adler -Copyright Jean-loup Gailly Osma Ahvenlampi -Copyright 1998-2004 Gilles Vollant - http://www.winimage.com/zLibDll -Copyright (c) 1997 Christian Michelsen Research AS Advanced Computing -Copyright (c) 1995-2003, 2010, 2014, 2016 Jean-loup Gailly, Mark Adler -Copyright (c) 1998 - 2010 Gilles Vollant, Even Rouault, Mathias Svensson -Copyright (c) 1995-1996 Jean-loup Gailly, Brian Raiter and Gilles Vollant -Copyright (c) 1995-2010 Jean-loup Gailly, Brian Raiter and Gilles Vollant -Copyright (c) 1998-2010 Gilles Vollant (minizip) http://www.winimage.com/zLibDll/minizip.html - The MIT License (MIT) Copyright (c) 2020 Ronomon CC @@ -1728,246 +1065,20 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - ---------------------------------------------------------- - ---------------------------------------------------------- - -System.Diagnostics.EventLog 4.7.0 - MIT - - -(c) Microsoft Corporation. -Copyright (c) .NET Foundation. -Copyright (c) 2011, Google Inc. -(c) 1997-2005 Sean Eron Anderson. -Copyright (c) 2007 James Newton-King -Copyright (c) 1991-2017 Unicode, Inc. -Copyright (c) 2013-2017, Alfred Klomp -Copyright (c) 2015-2017, Wojciech Mula -Copyright (c) 2005-2007, Nick Galbreath -Portions (c) International Organization -Copyright (c) 2015 The Chromium Authors. -Copyright (c) 2004-2006 Intel Corporation -Copyright (c) 2016-2017, Matthieu Darbois -Copyright (c) .NET Foundation Contributors -Copyright (c) .NET Foundation and Contributors -Copyright (c) 2011 Novell, Inc (http://www.novell.com) -Copyright (c) 1995-2017 Jean-loup Gailly and Mark Adler -Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com) -Copyright (c) 2009, 2010, 2013-2016 by the Brotli Authors. -Copyright (c) YEAR W3C(r) (MIT, ERCIM, Keio, Beihang). Disclaimers THIS WORK IS PROVIDED AS - -The MIT License (MIT) - -Copyright (c) .NET Foundation and Contributors - -All rights reserved. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - ---------------------------------------------------------- - ---------------------------------------------------------- - -System.Runtime.WindowsRuntime 4.6.0 - MIT - - -(c) Microsoft Corporation. -Copyright (c) .NET Foundation. -Copyright (c) 2011, Google Inc. -(c) 1997-2005 Sean Eron Anderson. -Copyright (c) 2007 James Newton-King -Copyright (c) 1991-2017 Unicode, Inc. -Copyright (c) 2013-2017, Alfred Klomp -Copyright (c) 2015-2017, Wojciech Mula -Copyright (c) 2005-2007, Nick Galbreath -Portions (c) International Organization -Copyright (c) 2015 The Chromium Authors. -Copyright (c) 2004-2006 Intel Corporation -Copyright (c) 2016-2017, Matthieu Darbois -Copyright (c) .NET Foundation Contributors -Copyright (c) .NET Foundation and Contributors -Copyright (c) 2011 Novell, Inc (http://www.novell.com) -Copyright (c) 1995-2017 Jean-loup Gailly and Mark Adler -Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com) -Copyright (c) 2009, 2010, 2013-2016 by the Brotli Authors. -Copyright (c) YEAR W3C(r) (MIT, ERCIM, Keio, Beihang). Disclaimers THIS WORK IS PROVIDED AS - -The MIT License (MIT) - -Copyright (c) .NET Foundation and Contributors - -All rights reserved. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - ---------------------------------------------------------- - ---------------------------------------------------------- - -System.Runtime.WindowsRuntime.UI.Xaml 4.6.0 - MIT - - -(c) Microsoft Corporation. -Copyright (c) .NET Foundation. -Copyright (c) 2011, Google Inc. -(c) 1997-2005 Sean Eron Anderson. -Copyright (c) 2007 James Newton-King -Copyright (c) 1991-2017 Unicode, Inc. -Copyright (c) 2013-2017, Alfred Klomp -Copyright (c) 2015-2017, Wojciech Mula -Copyright (c) 2005-2007, Nick Galbreath -Portions (c) International Organization -Copyright (c) 2015 The Chromium Authors. -Copyright (c) 2004-2006 Intel Corporation -Copyright (c) 2016-2017, Matthieu Darbois -Copyright (c) .NET Foundation Contributors -Copyright (c) .NET Foundation and Contributors -Copyright (c) 2011 Novell, Inc (http://www.novell.com) -Copyright (c) 1995-2017 Jean-loup Gailly and Mark Adler -Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com) -Copyright (c) 2009, 2010, 2013-2016 by the Brotli Authors. -Copyright (c) YEAR W3C(r) (MIT, ERCIM, Keio, Beihang). Disclaimers THIS WORK IS PROVIDED AS - -The MIT License (MIT) - -Copyright (c) .NET Foundation and Contributors - -All rights reserved. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - ---------------------------------------------------------- - ---------------------------------------------------------- - -xunit.runner.visualstudio 2.4.5 - MIT - - -Copyright (c) .NET Foundation -Copyright (c) 2015 .NET Foundation -Copyright (c) Outercurve Foundation -Copyright (c) .NET Foundation and Contributors -Copyright (c) .NET Foundation xUnit.net Runner Utility -Copyright (c) .NET Foundation ,xUnit.net Runner Utility -Copyright (c) .NET Foundation 1xUnit.net Runner Utility -Copyright (c) .NET Foundation xUnit.net Runner Reporters -Copyright (c) .NET Foundation .xUnit.net Runner Reporters -Copyright (c) Outercurve Foundation WrapNonExceptionThrows RSDS -Copyright (c) .NET Foundation and Contributors. Visual Studio 2019 - -Unless otherwise noted, the source code here is covered by the following license: - - Copyright (c) .NET Foundation and Contributors - All Rights Reserved - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - ------------------------ - -The code in src/xunit.runner.visualstudio/Utility/AssemblyResolution/Microsoft.DotNet.PlatformAbstractions was imported from: - https://github.com/dotnet/core-setup/tree/v2.0.1/src/managed/Microsoft.DotNet.PlatformAbstractions - -The code in src/xunit.runner.visualstudio/Utility/AssemblyResolution/Microsoft.DotNet.PlatformAbstractions was imported from: - https://github.com/dotnet/core-setup/tree/v2.0.1/src/managed/Microsoft.Extensions.DependencyModel - -Both sets of code are covered by the following license: - - The MIT License (MIT) - - Copyright (c) 2015 .NET Foundation - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. - - ---------------------------------------------------------- - ---------------------------------------------------------- - -yaml/libyaml 2c891fc7a770e8ba2fec34fc6b545c672beb37e6 - MIT - - -Copyright (c) 2006-2016 Kirill Simonov -Copyright (c) 2006-2016 Kirill Simonov - + + +--------------------------------------------------------- + +--------------------------------------------------------- + +yaml/libyaml 840b65c40675e2d06bf40405ad3f12dec7f35923 - MIT + + +Copyright (c) 2017-2020 Ingy dot Net +Copyright (c) 2006-2016 Kirill Simonov +Copyright (c) 2017-2020 Ingy dot Net +Copyright (c) 2006-2016 Kirill Simonov + Copyright (c) 2017-2020 Ingy döt Net Copyright (c) 2006-2016 Kirill Simonov @@ -1988,59 +1099,27 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - ---------------------------------------------------------- - ---------------------------------------------------------- - -YamlDotNet 8.1.2 - MIT - - -Copyright (c) Antoine Aubry and contributors 2008 - 2019 -8Copyright (c) Antoine Aubry and contributors 2008 - 2019 -Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014 Antoine Aubry and contributors - -Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014 Antoine Aubry and contributors -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. +--------------------------------------------------------- + +--------------------------------------------------------- + +open-source-parsers/jsoncpp 9be589598595963f94ba264d7b416d0533421106 - MIT OR OTHER + + +Copyright (c) 2016 InfoTeCS JSC. +Copyright 2007-2010 The JsonCpp Authors +Copyright 2007-2019 The JsonCpp Authors +Copyright 2007 Baptiste Lepilleur and The JsonCpp Authors +Copyright 2009 Baptiste Lepilleur and The JsonCpp Authors +Copyright 2010 Baptiste Lepilleur and The JsonCpp Authors +Copyright 2011 Baptiste Lepilleur and The JsonCpp Authors +Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors +Copyright 2007-2011 Baptiste Lepilleur and The JsonCpp Authors +Copyright (c) 2007-2010 Baptiste Lepilleur and The JsonCpp Authors +Copyright (c) 2007-2010 by Baptiste Lepilleur and The JsonCpp Authors -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - ---------------------------------------------------------- - ---------------------------------------------------------- - -open-source-parsers/jsoncpp 9be589598595963f94ba264d7b416d0533421106 - MIT OR OTHER - - -Copyright (c) 2016 InfoTeCS JSC. -Copyright 2007-2010 The JsonCpp Authors -Copyright 2007-2019 The JsonCpp Authors -Copyright 2007 Baptiste Lepilleur and The JsonCpp Authors -Copyright 2009 Baptiste Lepilleur and The JsonCpp Authors -Copyright 2010 Baptiste Lepilleur and The JsonCpp Authors -Copyright 2011 Baptiste Lepilleur and The JsonCpp Authors -Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors -Copyright 2007-2011 Baptiste Lepilleur and The JsonCpp Authors -Copyright (c) 2007-2010 Baptiste Lepilleur and The JsonCpp Authors -Copyright (c) 2007-2010 by Baptiste Lepilleur and The JsonCpp Authors - The JsonCpp library's source code, including accompanying documentation, tests and demonstration applications, are licensed under the following conditions... @@ -2096,7 +1175,208 @@ minor nuisance of being required to keep the above copyright notice and license text in the source code. Note also that by accepting the Public Domain "license" you can re-license your copy using whatever license you like. - - ---------------------------------------------------------- - + + +--------------------------------------------------------- + +--------------------------------------------------------- + +madler/zlib 51b7f2abdade71cd9bb0e7a373ef2610ec6f9daf - Zlib + + +Copyright (c) 2003 Mark Adler +Copyright (c) 2018 Mark Adler +(c) Copyright Henrik Ravn 2004 +Copyright (c) Henrik Ravn 2004 +Copyright 1995-2024 Mark Adler +Copyright (c) 2003 Cosmin Truta +Copyright (c) 1990-2000 Info-ZIP. +Copyright (c) 1998 by Bob Dellaca +Copyright (c) 2004 by Henrik Ravn +Copyright (c) 1995-2003 Mark Adler +Copyright (c) 1995-2008 Mark Adler +Copyright (c) 1995-2017 Mark Adler +Copyright (c) 1995-2019 Mark Adler +Copyright (c) 1995-2022 Mark Adler +Copyright (c) 1995-2024 Mark Adler +Copyright (c) 2002-2013 Mark Adler +Copyright (c) 2003 by Cosmin Truta +Copyright (c) 2003-2010 Mark Adler +Copyright (c) 2004-2017 Mark Adler +Copyright (c) 2004-2019 Mark Adler +Copyright (c) 2004-2023 Mark Adler +Copyright (c) 2004-2024 Mark Adler +Copyright (c) 1996 L. Peter Deutsch +Copyright (c) 1997,99 Borland Corp. +Copyright (c) 2003, 2012 Mark Adler +Copyright (c) 2004, 2010 Mark Adler +Copyright (c) 2011, 2016 Mark Adler +Copyright (c) 2007-2008 Even Rouault +Copyright (c) 1998-2005 Gilles Vollant +Copyright (c) 1995-1998 Jean-loup Gailly +Copyright (c) 1995-2003 Jean-loup Gailly +Copyright (c) 1995-2003, 2010 Mark Adler +Copyright (c) 1995-2005, 2010 Mark Adler +Copyright (c) 1995-2011, 2016 Mark Adler +Copyright (c) 1995-2017 Jean-loup Gailly +Copyright (c) 1995-2024 Jean-loup Gailly +Copyright (c) 1997,99 Borland Corporation +Copyright (c) 1998 by Andreas R. Kleinert +Copyright (c) 2002-2003 Dmitriy Anisimkov +Copyright (c) 2002-2004 Dmitriy Anisimkov +Copyright (c) 2003, 2012, 2013 Mark Adler +Copyright (c) 2004, 2005, 2012 Mark Adler +Copyright (c) 2004, 2008, 2012 Mark Adler +Copyright (c) 1998 by Jacques Nomssi Nzali +(c) 1995-2022 Jean-loup Gailly & Mark Adler +(c) 1995-2024 Jean-loup Gailly & Mark Adler +Copyright (c) 1995-2003 by Jean-loup Gailly +Copyright (c) 1998-2010 - by Gilles Vollant +(c) 1995-2017 Jean-loup Gailly and Mark Adler +(c) 1995-2022 Jean-loup Gailly and Mark Adler +(c) 1995-2024 Jean-loup Gailly and Mark Adler +Copyright (c) 2005, 2012, 2018, 2023 Mark Adler +Copyright (c) 2007, 2008, 2012, 2018 Mark Adler +Copyright 1995-2024 Jean-loup Gailly and Mark Adler +Copyright (c) 1995-2006, 2011, 2016 Jean-loup Gailly +Copyright (c) 1995-2017 Jean-Loup Gailly, Mark Adler +Copyright (c) 1995-2024 Jean-loup Gailly, Mark Adler +Copyright (c) 1998,1999,2000 by Jacques Nomssi Nzali +Copyright (c) 2003, 2005, 2008, 2010, 2012 Mark Adler +Copyright (c) 2004, 2008, 2012, 2016, 2019 Mark Adler +Copyright (c) 1995-2003 Jean-loup Gailly and Mark Adler +Copyright (c) 1995-2024 Jean-loup Gailly and Mark Adler +copyright (c) 1995-2017 Jean-loup Gailly and Mark Adler +Copyright (c) 1996 L. Peter Deutsch and Jean-Loup Gailly +Copyright (c) 1995-2006, 2010, 2011, 2016 Jean-loup Gailly +Copyright (c) 2009-2010 Mathias Svensson http://result42.com +Copyright (c) 1995-2005, 2014, 2016 Jean-loup Gailly, Mark Adler +Copyright Jean-loup Gailly Osma Ahvenlampi +Copyright 1998-2004 Gilles Vollant - http://www.winimage.com/zLibDll +Copyright (c) 1997 Christian Michelsen Research AS Advanced Computing +Copyright (c) 1995-2003, 2010, 2014, 2016 Jean-loup Gailly, Mark Adler +Copyright (c) 1998 - 2010 Gilles Vollant, Even Rouault, Mathias Svensson +Copyright (c) 1995-2010 Jean-loup Gailly, Brian Raiter and Gilles Vollant +Copyright (c) 1998-2010 Gilles Vollant (minizip) http://www.winimage.com/zLibDll/minizip.html + +Copyright notice: + + (C) 1995-2022 Jean-loup Gailly and Mark Adler + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + Jean-loup Gailly Mark Adler + jloup@gzip.org madler@alumni.caltech.edu + + +--------------------------------------------------------- + +--------------------------------------------------------- + +Microsoft.Windows.ImplementationLibrary - MIT + + +Copyright (c) Microsoft. +(c) Microsoft Corporation. +Copyright (c) Microsoft Corporation. +Copyright (c) 2009-2014 by the contributors + + MIT License + + Copyright (c) Microsoft Corporation. All rights reserved. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE + + +--------------------------------------------------------- + +--------------------------------------------------------- + +microsoft/do-client d71ade6f692dd8bc319ec3228c956517e9b29292 - MIT + + +Copyright (c) Microsoft Corporation. + +MIT License + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + +--------------------------------------------------------- + +--------------------------------------------------------- + +yhirose/cpp-httplib 5c00bbf36ba8ff47b4fb97712fc38cb2884e5b98 - MIT + + +The MIT License (MIT) + +Copyright (c) 2017 yhirose + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + +--------------------------------------------------------- + diff --git a/README.md b/README.md index 0d4dc0c450..3d5908e020 100644 --- a/README.md +++ b/README.md @@ -44,11 +44,11 @@ Please read our [troubleshooting guide](/doc/troubleshooting/README.md). ## Administrator Considerations -Installer behavior can be different depending on whether you are running **winget** with administrator privileges. +Installer behavior can be different depending on whether you are running **WinGet** with administrator privileges. -* When running **winget** without administrator privileges, some applications may [require elevation](https://docs.microsoft.com/windows/security/identity-protection/user-account-control/how-user-account-control-works) to install. When the installer runs, Windows will prompt you to [elevate](https://docs.microsoft.com/windows/security/identity-protection/user-account-control/how-user-account-control-works#the-uac-user-experience). If you choose not to elevate, the application will fail to install. +* When running **WinGet** without administrator privileges, some applications may [require elevation](https://docs.microsoft.com/windows/security/identity-protection/user-account-control/how-user-account-control-works) to install. When the installer runs, Windows will prompt you to [elevate](https://docs.microsoft.com/windows/security/identity-protection/user-account-control/how-user-account-control-works#the-uac-user-experience). If you choose not to elevate, the application will fail to install. -* When running **winget** in an Administrator Command Prompt, you will not see [elevation prompts](https://docs.microsoft.com/windows/security/identity-protection/user-account-control/how-user-account-control-works#the-uac-user-experience) if the application requires it. Always use caution when running your command prompt as an administrator, and only install applications you trust. +* When running **WinGet** in an Administrator Command Prompt, you will not see [elevation prompts](https://docs.microsoft.com/windows/security/identity-protection/user-account-control/how-user-account-control-works#the-uac-user-experience) if the application requires it. Always use caution when running your command prompt as an administrator, and only install applications you trust. ### Build your own @@ -56,7 +56,7 @@ You can also [build the client yourself](#building-the-client). While the client ## Build Status -[![Build Status](https://dev.azure.com/ms/winget-cli/_apis/build/status/microsoft.winget-cli?branchName=master)](https://dev.azure.com/ms/winget-cli/_build/latest?definitionId=344&branchName=master) +[![Build Status](https://dev.azure.com/shine-oss/winget-cli/_apis/build/status/winget-cli%20Build_Test?branchName=master&label=Main%20Branch%20(Including%20PRs))](https://dev.azure.com/shine-oss/winget-cli/_build/latest?definitionId=10&branchName=master) ## Windows Package Manager Release Roadmap @@ -88,14 +88,14 @@ The client is built around the concept of sources; a set of packages effectively 2. Configure your system, please use the [configuration file](.configurations/configuration.dsc.yaml). This can be applied by either: * [Dev Home](https://github.com/microsoft/devhome)'s machine configuration tool * WinGet configuration. Run `winget configure .configurations/configuration.dsc.yaml` from the project root so relative paths resolve correctly. -3. Run `vcpkg integrate install` from the Developer Command Prompt for VS 2022. This is a one time setup step until the configuration file in step 2 is updated to work with vcpkg setup. +3. Run `vcpkg integrate install` from the Developer Command Prompt for VS 2022. This is a one-time setup step until the configuration file in step 2 is updated to work with vcpkg setup. ### Prerequisites * Windows 10 1809 (17763) or later * [Developer Mode enabled](https://docs.microsoft.com/windows/uwp/get-started/enable-your-device-for-development) * [Visual Studio 2022](https://visualstudio.microsoft.com/downloads/) - * Or use winget to install it ;) (although you may need to adjust the workloads via Tools->Get Tools and Features...) + * Or use WinGet to install it ;) (although you may need to adjust the workloads via Tools->Get Tools and Features...) * The following workloads: * .NET Desktop Development * Desktop Development with C++ @@ -118,8 +118,7 @@ We would like to thank [Keivan Beigi (@kayone)](https://github.com/kayone) for h ## 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. More +Contributor License Agreement (CLA) declaring that you have the right to, and do, actually grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com. More information is available in our [CONTRIBUTING.md](/CONTRIBUTING.md) file. When you submit a pull request, a CLA bot will automatically determine whether you need to provide @@ -136,9 +135,9 @@ The winget.exe client is instrumented to collect usage and diagnostic (error) da If you build the client yourself the instrumentation will not be enabled and no data will be sent to Microsoft. -The winget.exe client respects machine-wide privacy settings and users can opt-out on their device, as documented in the Microsoft Windows privacy statement [here](https://support.microsoft.com/help/4468236/diagnostics-feedback-and-privacy-in-windows-10-microsoft-privacy). In addition, you may also explicitly block telemetry using [settings](https://docs.microsoft.com/windows/package-manager/winget/settings) +The winget.exe client respects machine-wide privacy settings and users can opt out on their device, as documented in the Microsoft Windows privacy statement [here](https://support.microsoft.com/help/4468236/diagnostics-feedback-and-privacy-in-windows-10-microsoft-privacy). In addition, you may also explicitly block telemetry using [settings](https://docs.microsoft.com/windows/package-manager/winget/settings) -In short, to opt-out, do one of the following: +In short, to opt out, do one of the following: **Windows 11**: Go to `Start`, then select `Settings` > `Privacy & Security` > `Diagnostics & feedback` > `Diagnostic data` and unselect `Send optional diagnostic data`. diff --git a/SECURITY.md b/SECURITY.md index 82db58aa7c..01cc1e4fb2 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -1,5 +1,4 @@ - ## Security Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet) and [Xamarin](https://github.com/xamarin). diff --git a/WinGetUtil.nuspec b/WinGetUtil.nuspec deleted file mode 100644 index a48047c359..0000000000 --- a/WinGetUtil.nuspec +++ /dev/null @@ -1,31 +0,0 @@ - - - - Microsoft.WindowsPackageManager.Utils - $version$ - - Microsoft - - https://github.com/microsoft/winget-cli - MIT - true - The utility binary for use with the WinGet CLI. - © Microsoft Corporation. All rights reserved. - winget - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/azure-pipelines.coverage.yml b/azure-pipelines.coverage.yml deleted file mode 100644 index 8d94e1a4f3..0000000000 --- a/azure-pipelines.coverage.yml +++ /dev/null @@ -1,70 +0,0 @@ -# Code coverage pipeline required by OneFuzz -pr: none -trigger: none - -pool: - vmImage: windows-latest - -parameters: - - name: sasUrl - type: string - displayName: SAS URL - - name: branch - type: string - displayName: Branch - - name: jobID - type: string - displayName: OneFuzz Job ID - - name: buildDate - type: string - displayName: Build Date - - name: commitID - type: string - displayName: Commit ID - -variables: - - name: coverage-file - value: cobertura-coverage.xml - - name: job-ID - value: ${{ parameters.jobID }} - - name: build-date - value: ${{ parameters.buildDate }} - - name: branch - value: ${{ parameters.branch }} - - name: sas-url - value: ${{ parameters.sasUrl }} - - name: commit-ID - value: ${{ parameters.commitID }} - -jobs: -- job: prod - displayName: Prod Task - steps: - # Get source code - - script: | - git clone https://github.com/microsoft/winget-cli.git - git checkout $(commit-ID) - displayName: 'Clone winget-cli' - - # Get code coverage from OneFuzz for the job - - powershell: | - Write-Host "Job ID: $(job-ID), Build Date: $(build-date), Branch: $(branch)" - $SASUrl = [System.Uri]::new("$(sas-url)") - azcopy cp $SASUrl.AbsoluteUri ./ --recursive - $ContainerName = $SASURL.LocalPath.Split("/")[1] - Write-Host "##vso[task.setvariable variable=container-name;]$ContainerName" - cd $ContainerName - $size = ((Get-Item .\$(coverage-file)).length) - if ($size -eq 0) { - Write-Host "Cobertura coverage XML is empty." - exit 1 - } - displayName: PowerShell script to get coverage - - # Use Cobertura report generator - - task: PublishCodeCoverageResults@1 - inputs: - codeCoverageTool: 'Cobertura' - summaryFileLocation: ./$(container-name)\$(coverage-file) - pathToSources: $(System.DefaultWorkingDirectory) - displayName: Built in ADO Task that uses ReportGenerator \ No newline at end of file diff --git a/azure-pipelines.nuget.yml b/azure-pipelines.nuget.yml deleted file mode 100644 index 27b46300b5..0000000000 --- a/azure-pipelines.nuget.yml +++ /dev/null @@ -1,213 +0,0 @@ -trigger: none - -parameters: - - name: version - displayName: Version to stamp on binaries and nuget package. Should be in form of "major.minor", for example "1.0" - type: string - -pool: - vmImage: "windows-latest" - -variables: - solution: "src/AppInstallerCLI.sln" - packageName: Microsoft.WindowsPackageManager.Utils - buildVer: $[counter(${{ parameters.version }}, 1)] - version: ${{ parameters.version }}.$(buildVer) - EnableDetectorVcpkg: true - -jobs: - - job: "Build" - timeoutInMinutes: 120 - strategy: - matrix: - x86_release: - buildConfiguration: 'Release' - buildPlatform: 'x86' - x64_release: - buildConfiguration: 'Release' - buildPlatform: 'x64' - variables: - artifactsDir: $(Build.ArtifactStagingDirectory)\$(buildPlatform) - steps: - - script: echo $(version) - - - task: NuGetToolInstaller@1 - displayName: Install Nuget - - # Restores all projects, including native (vcxproj) projects - - task: NuGetCommand@2 - displayName: Restore Solution - inputs: - restoreSolution: "$(solution)" - - # Restore these UAP packages as https://github.com/NuGet/Home/issues/7796 leads to all UAP packages being skipped for restore. - # Even though they don't need any actual restore action, they need the project.assets.json file to be created and a direct restore does that. - - task: NuGetCommand@2 - displayName: Restore AppInstallerCLIPackage - inputs: - restoreSolution: 'src\AppInstallerCLIPackage\AppInstallerCLIPackage.wapproj' - - - task: NuGetCommand@2 - displayName: Restore AppInstallerTestMsixInstaller - inputs: - restoreSolution: 'src\AppInstallerTestMsixInstaller\AppInstallerTestMsixInstaller.wapproj' - - # Restores only .NET core projects, but is still necessary, as without this the IndexCreationTool and LocalhostWebServer projects fail to build - - task: DotNetCoreCLI@2 - displayName: DotNet Restore - inputs: - command: "restore" - projects: "**/*.csproj" - - - task: CmdLine@2 - displayName: Enable Vcpkg Install - inputs: - script: | - $(VCPKG_INSTALLATION_ROOT)\vcpkg.exe integrate install - workingDirectory: '$(VCPKG_INSTALLATION_ROOT)' - - - task: PowerShell@2 - displayName: Update Binary Version - condition: not(eq(variables['Build.Reason'], 'PullRequest')) - inputs: - filePath: 'src\binver\Update-BinVer.ps1' - arguments: '-TargetFile binver\binver\version.h -BuildVersion $(buildVer) -MajorMinorOverride ${{ parameters.version }}' - workingDirectory: "src" - - - task: VSBuild@1 - displayName: Build Solution - inputs: - platform: "$(buildPlatform)" - solution: "$(solution)" - configuration: "$(buildConfiguration)" - - - task: EsrpCodeSigning@5 - displayName: "ESRP CodeSigning - Package contents" - inputs: - ConnectedServiceName: "WindowsPackageManager ESRP CodeSigning" - AppRegistrationClientId: '32216f16-efc9-4013-9fae-c6a2c54a3fc0' - AppRegistrationTenantId: '72f988bf-86f1-41af-91ab-2d7cd011db47' - AuthAKVName: 'PeetDevOpsKeyVault' - AuthCertName: 'ESRPAuth' - AuthSignCertName: 'ESRPRequestSigning' - FolderPath: src - Pattern: | - *\$(buildConfiguration)\WinGetUtil\WinGetUtil.dll - WinGetUtilInterop\bin\$(buildConfiguration)\netstandard2.1\WinGetUtilInterop.dll - UseMinimatch: true - signConfigType: inlineSignParams - inlineOperation: | - [ - { - "KeyCode" : "CP-230012", - "OperationCode" : "SigntoolSign", - "Parameters" : { - "OpusName" : "Microsoft", - "OpusInfo" : "http://www.microsoft.com", - "FileDigest" : "/fd \"SHA256\"", - "PageHash" : "/NPH", - "TimeStamp" : "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256" - }, - "ToolName" : "sign", - "ToolVersion" : "1.0" - }, - { - "KeyCode" : "CP-230012", - "OperationCode" : "SigntoolVerify", - "Parameters" : {}, - "ToolName" : "sign", - "ToolVersion" : "1.0" - } - ] - - - task: CopyFiles@2 - displayName: 'Copy nuget pack files to artifacts folder' - inputs: - Contents: | - WinGetUtil.nuspec - src\$(buildPlatform)\$(buildConfiguration)\WinGetUtil\WinGetUtil.dll - src\$(buildPlatform)\$(buildConfiguration)\WinGetUtil\WinGetUtil.pdb - src\WinGetUtilInterop\bin\$(buildConfiguration)\netstandard2.1\WinGetUtilInterop.dll - src\WinGetUtilInterop\bin\$(buildConfiguration)\netstandard2.1\WinGetUtilInterop.pdb - src\WinGetUtilInterop\build\Microsoft.WindowsPackageManager.Utils.targets - schemas\JSON\manifests\** - TargetFolder: '$(artifactsDir)' - - - task: PublishPipelineArtifact@1 - displayName: Publish Pipeline Artifacts - inputs: - targetPath: '$(artifactsDir)' - - - job: "Nuget" - timeoutInMinutes: 60 - dependsOn: 'Build' - steps: - - checkout: none - - - task: DownloadPipelineArtifact@2 - displayName: 'Download Build.x64release artifacts' - inputs: - artifactName: Build.x64release - targetPath: '$(Pipeline.Workspace)\Build.x64release' - - - task: DownloadPipelineArtifact@2 - displayName: 'Download Build.x86release artifacts' - inputs: - artifactName: Build.x86release - targetPath: '$(Pipeline.Workspace)\Build.x86release' - - - task: NuGetCommand@2 - displayName: Pack WingetUtil nuget package - inputs: - command: pack - packagesToPack: '$(Pipeline.Workspace)\Build.x64release\WinGetUtil.nuspec' - versioningScheme: byEnvVar - versionEnvVar: version - packDestination: '$(Build.ArtifactStagingDirectory)' - basePath: $(Pipeline.Workspace) - - - task: EsrpCodeSigning@5 - displayName: "ESRP CodeSigning - NuGet package" - inputs: - ConnectedServiceName: "WindowsPackageManager ESRP CodeSigning" - AppRegistrationClientId: '32216f16-efc9-4013-9fae-c6a2c54a3fc0' - AppRegistrationTenantId: '72f988bf-86f1-41af-91ab-2d7cd011db47' - AuthAKVName: 'PeetDevOpsKeyVault' - AuthCertName: 'ESRPAuth' - AuthSignCertName: 'ESRPRequestSigning' - FolderPath: "$(Build.ArtifactStagingDirectory)" - Pattern: "$(packageName).$(version).nupkg" - signConfigType: inlineSignParams - inlineOperation: | - [ - { - "KeyCode" : "CP-401405", - "OperationCode" : "NuGetSign", - "Parameters" : {}, - "ToolName" : "sign", - "ToolVersion" : "1.0" - }, - { - "KeyCode" : "CP-401405", - "OperationCode" : "NuGetVerify", - "Parameters" : {}, - "ToolName" : "sign", - "ToolVersion" : "1.0" - } - ] - - - task: PublishBuildArtifacts@1 - displayName: Publish nuget package to artifacts - inputs: - PathtoPublish: '$(Build.ArtifactStagingDirectory)\$(packageName).$(version).nupkg' - ArtifactName: $(packageName) - publishLocation: Container - - - task: NuGetCommand@2 - displayName: Push WingetUtil nuget package to nuget.org - inputs: - command: push - nuGetFeedType: external - includeNugetOrg: true - packagesToPush: '$(Build.ArtifactStagingDirectory)\$(packageName).$(version).nupkg' - publishFeedCredentials: "WindowsPackageManagerAzurePipelineNuget - NuGet.org" diff --git a/azure-pipelines.yml b/azure-pipelines.yml index cbdc83e50e..359568312a 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -10,6 +10,7 @@ pr: paths: include: - azure-pipelines.yml + - templates/* - src/* - schemas/JSON/manifests/* @@ -38,6 +39,8 @@ jobs: arguments: '-OutVar' workingDirectory: 'src' +# Build job creates artifacts for use in test jobs + - job: 'Build' timeoutInMinutes: 120 dependsOn: 'GetReleaseTag' @@ -49,10 +52,12 @@ jobs: buildConfiguration: 'Release' buildPlatform: 'x86' testBuildConfiguration: 'TestRelease' + artifactIdentifier: 'x86release' x64_release: buildConfiguration: 'Release' buildPlatform: 'x64' testBuildConfiguration: 'TestRelease' + artifactIdentifier: 'x64release' variables: BuildVer: $[counter(dependencies.GetReleaseTag.outputs['GetTag.tag'], 1)] @@ -130,48 +135,243 @@ jobs: /p:AppxBundle=Always /p:UapAppxPackageBuildMode=SideloadOnly' + - task: MSBuild@1 + displayName: Build MSIX Test Installer File + inputs: + platform: '$(buildPlatform)' + solution: 'src\AppInstallerTestMsixInstaller\AppInstallerTestMsixInstaller.wapproj' + configuration: '$(buildConfiguration)' + msbuildArguments: '/p:AppxPackageOutput="$(Build.ArtifactStagingDirectory)\AppInstallerTestMsixInstaller.msix" + /p:AppxBundle=Never + /p:UapAppxPackageBuildMode=SideLoadOnly + /p:AppxPackageSigningEnabled=false' + - task: CopyFiles@2 - displayName: 'Copy Symbols to artifacts folder' + displayName: 'Copy specific build artifacts' inputs: Contents: | $(buildOutDir)\WindowsPackageManager\WindowsPackageManager.pdb - $(buildOutDir)\Microsoft.Management.Configuration\Microsoft.Management.Configuration.pdb + $(buildOutDir)\WinGetUtil\WinGetUtil.dll + $(buildOutDir)\WinGetUtil\WinGetUtil.pdb TargetFolder: '$(artifactsDir)' - condition: succeededOrFailed() + + - task: PowerShell@2 + displayName: Create Package Layout + inputs: + filePath: 'src\AppInstallerCLIPackage\Execute-AppxRecipe.ps1' + arguments: '-AppxRecipePath AppInstallerCLIPackage\bin\$(buildPlatform)\$(buildConfiguration)\AppInstallerCLIPackage.build.appxrecipe -LayoutPath $(packageLayoutDir) -Force -Verbose' + workingDirectory: 'src' + + - task: CopyFiles@2 + displayName: 'Copy Dev Package (Loose Files)' + inputs: + SourceFolder: '$(packageLayoutDir)' + TargetFolder: '$(artifactsDir)\DevPackage' + + - task: CopyFiles@2 + displayName: 'Copy Dev Packages' + inputs: + SourceFolder: '$(appxPackageDir)' + TargetFolder: '$(artifactsDir)\AppxPackages' + + - task: CopyFiles@2 + displayName: 'Copy native binaries for Microsoft.WinGet.Client (net6)' + inputs: + SourceFolder: $(buildOutDir) + Contents: | + Microsoft.Management.Deployment.InProc\Microsoft.Management.Deployment.dll + Microsoft.Management.Deployment\Microsoft.Management.Deployment.winmd + WindowsPackageManager\WindowsPackageManager.dll + UndockedRegFreeWinRT\winrtact.dll + TargetFolder: $(buildOutDirAnyCpu)\PowerShell\Microsoft.WinGet.Client\net6.0-windows10.0.22000.0\SharedDependencies\$(BuildPlatform) + flattenFolders: true + + - task: CopyFiles@2 + displayName: 'Copy native binaries for Microsoft.WinGet.Client (net48)' + inputs: + SourceFolder: $(buildOutDir) + Contents: | + Microsoft.Management.Deployment.InProc\Microsoft.Management.Deployment.dll + Microsoft.Management.Deployment\Microsoft.Management.Deployment.winmd + WindowsPackageManager\WindowsPackageManager.dll + UndockedRegFreeWinRT\winrtact.dll + TargetFolder: $(buildOutDirAnyCpu)\PowerShell\Microsoft.WinGet.Client\net48\SharedDependencies\$(BuildPlatform) + flattenFolders: true + + - task: CopyFiles@2 + displayName: 'Copy native binaries for Microsoft.WinGet.Configuration' + inputs: + SourceFolder: $(buildOutDir) + Contents: | + Microsoft.Management.Configuration\Microsoft.Management.Configuration.dll + TargetFolder: $(buildOutDirAnyCpu)\PowerShell\Microsoft.WinGet.Configuration\SharedDependencies\$(BuildPlatform) + flattenFolders: true + + - task: CopyFiles@2 + displayName: 'Copy managed binaries for Microsoft.WinGet.Configuration in arch specific' + inputs: + SourceFolder: $(buildOutDirAnyCpu) + Contents: | + Microsoft.Management.Configuration.Projection\net6.0-windows10.0.22000.0\Microsoft.Management.Configuration.Projection.dll + TargetFolder: $(buildOutDirAnyCpu)\PowerShell\Microsoft.WinGet.Configuration\SharedDependencies\$(BuildPlatform) + flattenFolders: true + + - task: CopyFiles@2 + displayName: 'Copy PowerShell AnyCPU Module Files' + inputs: + SourceFolder: '$(buildOutDirAnyCpu)\PowerShell' + TargetFolder: '$(artifactsDir)\PowerShell' + + - task: CopyFiles@2 + displayName: 'Copy binaries' + inputs: + SourceFolder: '$(buildOutDir)' + TargetFolder: '$(artifactsDir)' + Contents: | + AppInstallerCLIE2ETests\** + AppInstallerCLITests\** + Microsoft.Management.Configuration\** + Microsoft.Management.Configuration.UnitTests\** + Microsoft.Management.Configuration.OutOfProc\** + + - task: CopyFiles@2 + displayName: 'Copy Files: WinGetUtilInterop.UnitTests' + inputs: + SourceFolder: '$(Build.SourcesDirectory)\src\WinGetUtilInterop.UnitTests\bin\$(buildPlatform)\$(BuildConfiguration)\net6.0' + TargetFolder: '$(artifactsDir)\WinGetUtilInterop.UnitTests\' + CleanTargetFolder: true + OverWrite: true + + - task: CopyFiles@2 + displayName: 'Copy WinGetUtil to WinGetUtilInterop.UnitTests folder' + inputs: + Contents: | + $(buildOutDir)\WinGetUtil\WinGetUtil.dll + TargetFolder: '$(artifactsDir)\WinGetUtilInterop.UnitTests\' + flattenFolders: true + + - task: CopyFiles@2 + displayName: 'Copy LocalhostWebServer to E2ETests' + inputs: + SourceFolder: '$(buildOutDir)\LocalhostWebServer' + TargetFolder: '$(artifactsDir)\E2ETests\LocalhostWebServer' + + # Invoke E2E setup to generate the TestLocalIndex; could optimize out some of its steps if needed + - template: templates/e2e-setup.yml + parameters: + sourceDir: $(Build.SourcesDirectory) + localhostWebServerArgs: '-BuildRoot $(artifactsDir)\E2ETests\LocalhostWebServer -StaticFileRoot $(Agent.TempDirectory)\TestLocalIndex -LocalSourceJson $(Build.SourcesDirectory)\src\AppInstallerCLIE2ETests\TestData\localsource.json -TestDataPath $(Build.SourcesDirectory)\src\AppInstallerCLIE2ETests\TestData -ExitBeforeRun' + signingCertOutDir: $(artifactsDir)\E2ETests + + - task: CopyFiles@2 + displayName: 'Copy TestLocalIndex' + inputs: + SourceFolder: '$(Agent.TempDirectory)\TestLocalIndex' + TargetFolder: '$(artifactsDir)\E2ETests\TestLocalIndex' + + - task: CopyFiles@2 + displayName: 'Copy TestData' + inputs: + SourceFolder: '$(Build.SourcesDirectory)\src\AppInstallerCLIE2ETests\TestData\' + TargetFolder: '$(artifactsDir)\E2ETests\TestData' + + - task: CopyFiles@2 + displayName: 'Copy Dev Package Dependencies' + inputs: + SourceFolder: '$(appxPackageDir)\AppInstallerCLIPackage_0.0.2.0_Test\Dependencies\$(buildPlatform)\' + TargetFolder: '$(artifactsDir)\E2ETests\DevPackageDependencies' + + - task: CopyFiles@2 + displayName: 'Copy test scripts to artifacts' + inputs: + Contents: | + $(Build.SourcesDirectory)\src\PowerShell\scripts\Execute-WinGetTests.ps1 + $(Build.SourcesDirectory)\src\PowerShell\tests\** + $(Build.SourcesDirectory)\src\LocalhostWebServer\Run-LocalhostWebServer.ps1 + TargetFolder: '$(artifactsDir)\E2ETests\Scripts' + flattenFolders: true + + - task: PublishPipelineArtifact@1 + displayName: Publish Pipeline Artifacts + inputs: + targetPath: '$(artifactsDir)' + artifact: 'Build.$(artifactIdentifier)' + + - task: ComponentGovernanceComponentDetection@0 + displayName: Component Governance + inputs: + scanType: 'Register' + verbosity: 'Verbose' + alertWarningLevel: 'High' + +# Test job runs tests using build artifacts + +- job: 'Test' + timeoutInMinutes: 120 + dependsOn: 'Build' + condition: succeeded('Build') + + strategy: + matrix: + x86_release: + buildConfiguration: 'Release' + buildPlatform: 'x86' + testBuildConfiguration: 'TestRelease' + artifactIdentifier: 'x86release' + x64_release: + buildConfiguration: 'Release' + buildPlatform: 'x64' + testBuildConfiguration: 'TestRelease' + artifactIdentifier: 'x64release' + + variables: + buildOutDir: $(Pipeline.Workspace)\Build.$(artifactIdentifier) + artifactsDir: $(Build.ArtifactStagingDirectory) + packageLayoutDir: $(Pipeline.Workspace)\Build.$(artifactIdentifier)\DevPackage + + steps: + - task: DownloadPipelineArtifact@2 + displayName: 'Download Build Artifacts' + inputs: + artifact: 'Build.$(artifactIdentifier)' + path: '$(buildOutDir)' - task: PowerShell@2 displayName: Install Tests Dependencies inputs: targetType: 'inline' script: | - Get-ChildItem AppInstallerCLIPackage_0.0.2.0_Test\Dependencies\$(buildPlatform) -Filter *.appx | %{ Add-AppxPackage $_.FullName } - workingDirectory: $(appxPackageDir) + Get-ChildItem $(buildOutDir)\E2ETests\DevPackageDependencies -Filter *.appx | %{ Add-AppxPackage $_.FullName } - task: VisualStudioTestPlatformInstaller@1 displayName: Prepare VSTest for E2E Tests inputs: packageFeedSelector: 'nugetOrg' - - task: DownloadSecureFile@1 - name: PsExec - displayName: 'Download PsExec.exe' - inputs: - secureFile: 'PsExec.exe' - - - task: CmdLine@2 + # TODO: Repair-WinGetPackageManager will fail because it tries to install x64 for an x86 build machine. + # Remove manual installation of VCLibs (x64) once this is fixed. + - powershell: | + if ("$(buildPlatform)" -eq "x86") { + iwr https://aka.ms/Microsoft.VCLibs.x64.14.00.Desktop.appx -OutFile Microsoft.VCLibs.x64.appx + Add-AppxPackage Microsoft.VCLibs.x64.appx + } + Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force + Install-Module Microsoft.WinGet.Client -Repository PSGallery -Force + Repair-WingetPackageManager -AllUsers -Latest + Install-WinGetPackage -Id Microsoft.Sysinternals.PsTools -Source winget + displayName: Install Sysinternals PsTools Using Winget + condition: succeededOrFailed() + + - powershell: | + $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") + PsExec -accepteula -s -i $(buildOutDir)\AppInstallerCLITests\AppInstallerCLITests.exe -logto $(artifactsDir)\AICLI-Unpackaged-System.log -s -r junit -o $(artifactsDir)\TEST-AppInstallerCLI-Unpackaged-System.xml displayName: Run Unit Tests Unpackaged Under System Context - inputs: - script: | - $(PsExec.secureFilePath) -accepteula -s -i $(buildOutDir)\AppInstallerCLITests\AppInstallerCLITests.exe -logto $(artifactsDir)\AICLI-Unpackaged-System.log -s -r junit -o $(artifactsDir)\TEST-AppInstallerCLI-Unpackaged-System.xml - workingDirectory: '$(buildOutDir)\AppInstallerCLITests' + workingDirectory: '$(buildOutDir)\AppInstallerCLITests' condition: succeededOrFailed() - - task: PowerShell@2 - displayName: Create Package Layout - inputs: - filePath: 'src\AppInstallerCLIPackage\Execute-AppxRecipe.ps1' - arguments: '-AppxRecipePath AppInstallerCLIPackage\bin\$(buildPlatform)\$(buildConfiguration)\AppInstallerCLIPackage.build.appxrecipe -LayoutPath $(packageLayoutDir) -Force -Verbose' - workingDirectory: 'src' + - powershell: | + Uninstall-WinGetPackage -Id Microsoft.Sysinternals.PsTools -Source winget + displayName: Clean up Sysinternals PsTools condition: succeededOrFailed() - task: PowerShell@2 @@ -190,18 +390,6 @@ jobs: failTaskOnFailedTests: true condition: succeededOrFailed() - - task: MSBuild@1 - displayName: Build MSIX Test Installer File - inputs: - platform: '$(buildPlatform)' - solution: 'src\AppInstallerTestMsixInstaller\AppInstallerTestMsixInstaller.wapproj' - configuration: '$(buildConfiguration)' - msbuildArguments: '/p:AppxPackageOutput="$(Build.ArtifactStagingDirectory)\AppInstallerTestMsixInstaller.msix" - /p:AppxBundle=Never - /p:UapAppxPackageBuildMode=SideLoadOnly - /p:AppxPackageSigningEnabled=false' - condition: succeededOrFailed() - - task: PowerShell@2 displayName: 'Set program files directory' inputs: @@ -218,7 +406,7 @@ jobs: - task: CopyFiles@2 displayName: 'Copy resources.pri to dotnet directory' inputs: - SourceFolder: '$(buildOutDir)\AppInstallerCLI' + SourceFolder: '$(buildOutDir)\DevPackage' TargetFolder: '$(platformProgramFiles)\dotnet' Contents: resources.pri condition: succeededOrFailed() @@ -227,7 +415,7 @@ jobs: - task: CopyFiles@2 displayName: 'Copy winmd to dotnet directory' inputs: - SourceFolder: '$(buildOutDir)\Microsoft.Management.Deployment' + SourceFolder: '$(buildOutDir)\DevPackage' TargetFolder: '$(platformProgramFiles)\dotnet' Contents: Microsoft.Management.Deployment.winmd condition: succeededOrFailed() @@ -235,7 +423,7 @@ jobs: - template: templates/e2e-setup.yml parameters: sourceDir: $(Build.SourcesDirectory) - localhostWebServerArgs: '-BuildRoot $(buildOutDir)\LocalhostWebServer -StaticFileRoot $(Agent.TempDirectory)\TestLocalIndex -LocalSourceJson $(Build.SourcesDirectory)\src\AppInstallerCLIE2ETests\TestData\localsource.json -TestDataPath $(Build.SourcesDirectory)\src\AppInstallerCLIE2ETests\TestData -SourceCert $(Build.SourcesDirectory)\src\AppInstallerCLIE2ETests\TestData\AppInstallerTest.cer' + localhostWebServerArgs: '-BuildRoot $(buildOutDir)\E2ETests\LocalhostWebServer -StaticFileRoot $(buildOutDir)\E2ETests\TestLocalIndex -SourceCert $(buildOutDir)\E2ETests\TestSigningCert.cer' - template: templates/e2e-test.template.yml parameters: @@ -259,64 +447,7 @@ jobs: displayName: 'Copy E2E Tests Package Log to artifacts folder' inputs: SourceFolder: '$(temp)\E2ETestLogs' - TargetFolder: '$(artifactsDir)\E2ETests\PackagedLog' - condition: succeededOrFailed() - - - task: CopyFiles@2 - displayName: 'Copy E2E Test Source' - inputs: - SourceFolder: '$(Agent.TempDirectory)\TestLocalIndex' - TargetFolder: '$(artifactsDir)\E2ETests\TestLocalIndex' - condition: succeededOrFailed() - - - task: CopyFiles@2 - displayName: 'Copy TestData' - inputs: - SourceFolder: '$(Build.SourcesDirectory)\src\AppInstallerCLIE2ETests\TestData\' - TargetFolder: '$(artifactsDir)\E2ETests\TestData' - condition: succeededOrFailed() - - - task: CopyFiles@2 - displayName: 'Copy LocalhostWebServer' - inputs: - SourceFolder: '$(buildOutDir)\LocalhostWebServer' - TargetFolder: '$(artifactsDir)\E2ETests\LocalhostWebServer' - condition: succeededOrFailed() - - - task: CopyFiles@2 - displayName: 'Copy Dev Package Dependencies' - inputs: - SourceFolder: '$(appxPackageDir)\AppInstallerCLIPackage_0.0.2.0_Test\Dependencies\$(buildPlatform)\' - TargetFolder: '$(artifactsDir)\E2ETests\DevPackageDependencies' - condition: succeededOrFailed() - - - task: CopyFiles@2 - displayName: 'Copy test scripts to artifacts' - inputs: - Contents: | - $(Build.SourcesDirectory)\src\PowerShell\scripts\Execute-WinGetTests.ps1 - $(Build.SourcesDirectory)\src\PowerShell\tests\** - $(Build.SourcesDirectory)\src\LocalhostWebServer\Run-LocalhostWebServer.ps1 - TargetFolder: '$(artifactsDir)\E2ETests\Scripts' - flattenFolders: true - condition: succeededOrFailed() - - - task: CopyFiles@2 - displayName: 'Copy Files: WinGetUtilInterop.UnitTests' - inputs: - SourceFolder: '$(Build.SourcesDirectory)\src\WinGetUtilInterop.UnitTests\bin\$(buildPlatform)\$(BuildConfiguration)\net6.0' - TargetFolder: '$(Build.ArtifactStagingDirectory)\WinGetUtilInterop.UnitTests\' - CleanTargetFolder: true - OverWrite: true - condition: succeededOrFailed() - - - task: CopyFiles@2 - displayName: 'Copy WinGetUtil to WinGetUtilInterop.UnitTests folder' - inputs: - Contents: | - $(buildOutDir)\WinGetUtil\WinGetUtil.dll - TargetFolder: '$(Build.ArtifactStagingDirectory)\WinGetUtilInterop.UnitTests\' - flattenFolders: true + TargetFolder: '$(artifactsDir)\PackagedLog' condition: succeededOrFailed() - task: VSTest@2 @@ -324,7 +455,7 @@ jobs: inputs: testSelector: 'testAssemblies' testAssemblyVer2: 'WinGetUtilInterop.UnitTests.dll' - searchFolder: '$(Build.ArtifactStagingDirectory)\WinGetUtilInterop.UnitTests' + searchFolder: '$(buildOutDir)\WinGetUtilInterop.UnitTests' codeCoverageEnabled: true platform: '$(buildPlatform)' configuration: '$(BuildConfiguration)' @@ -372,121 +503,25 @@ jobs: arguments: '-TargetLocation $(artifactsDir)\ConfigOOPTestsLog' condition: succeededOrFailed() - - task: CopyFiles@2 - displayName: 'Copy Util to artifacts folder' - inputs: - Contents: | - $(buildOutDir)\WinGetUtil\WinGetUtil.dll - $(buildOutDir)\WinGetUtil\WinGetUtil.pdb - TargetFolder: '$(artifactsDir)' - condition: succeededOrFailed() - - - task: CopyFiles@2 - displayName: 'Copy native binaries for Microsoft.WinGet.Client' - inputs: - SourceFolder: $(buildOutDir) - Contents: | - Microsoft.Management.Deployment.InProc\Microsoft.Management.Deployment.dll - Microsoft.Management.Deployment\Microsoft.Management.Deployment.winmd - WindowsPackageManager\WindowsPackageManager.dll - UndockedRegFreeWinRT\winrtact.dll - TargetFolder: $(buildOutDirAnyCpu)\PowerShell\Microsoft.WinGet.Client\net6.0-windows10.0.22000.0\SharedDependencies\$(BuildPlatform) - flattenFolders: true - condition: succeededOrFailed() - - - task: CopyFiles@2 - displayName: 'Copy native binaries for Microsoft.WinGet.Client' - inputs: - SourceFolder: $(buildOutDir) - Contents: | - Microsoft.Management.Deployment.InProc\Microsoft.Management.Deployment.dll - Microsoft.Management.Deployment\Microsoft.Management.Deployment.winmd - WindowsPackageManager\WindowsPackageManager.dll - UndockedRegFreeWinRT\winrtact.dll - TargetFolder: $(buildOutDirAnyCpu)\PowerShell\Microsoft.WinGet.Client\net48\SharedDependencies\$(BuildPlatform) - flattenFolders: true - condition: succeededOrFailed() - - - task: CopyFiles@2 - displayName: 'Copy native binaries for Microsoft.WinGet.Configuration' - inputs: - SourceFolder: $(buildOutDir) - Contents: | - Microsoft.Management.Configuration\Microsoft.Management.Configuration.dll - TargetFolder: $(buildOutDirAnyCpu)\PowerShell\Microsoft.WinGet.Configuration\SharedDependencies\$(BuildPlatform) - flattenFolders: true - condition: succeededOrFailed() - - - task: CopyFiles@2 - displayName: 'Copy managed binaries for Microsoft.WinGet.Configuration in arch specific' - inputs: - SourceFolder: $(buildOutDirAnyCpu) - Contents: | - Microsoft.Management.Configuration.Projection\net6.0-windows10.0.22000.0\Microsoft.Management.Configuration.Projection.dll - TargetFolder: $(buildOutDirAnyCpu)\PowerShell\Microsoft.WinGet.Configuration\SharedDependencies\$(BuildPlatform) - flattenFolders: true - condition: succeededOrFailed() - - - task: CopyFiles@2 - displayName: 'Copy PowerShell AnyCPU Module Files' - inputs: - SourceFolder: '$(buildOutDirAnyCpu)\PowerShell' - TargetFolder: '$(artifactsDir)\PowerShell' - condition: succeededOrFailed() - - - task: CopyFiles@2 - displayName: 'Copy Dev Package (Loose Files)' - inputs: - SourceFolder: '$(packageLayoutDir)' - TargetFolder: '$(artifactsDir)\DevPackage' - condition: succeededOrFailed() - - - task: CopyFiles@2 - displayName: 'Copy Dev Packages' - inputs: - SourceFolder: '$(appxPackageDir)' - TargetFolder: '$(artifactsDir)\AppxPackages' + - powershell: Get-Process LocalhostWebServer | Stop-Process + displayName: Stop LocalhostWebServer condition: succeededOrFailed() - task: PublishPipelineArtifact@1 displayName: Publish Pipeline Artifacts inputs: targetPath: '$(artifactsDir)' + artifact: 'Test.$(artifactIdentifier).$(System.JobAttempt)' condition: succeededOrFailed() - - task: ComponentGovernanceComponentDetection@0 - displayName: Component Governance - inputs: - scanType: 'Register' - verbosity: 'Verbose' - alertWarningLevel: 'High' - - # Run BimSkim for all the binaries - - task: BinSkim@4 - displayName: 'Run BinSkim ' - inputs: - arguments: 'analyze - "$(buildOutDir)\AppInstallerCLI\winget.exe" - "$(buildOutDir)\WinGetUtil\WinGetUtil.dll" - "$(buildOutDir)\WindowsPackageManager\WindowsPackageManager.dll" - "$(buildOutDir)\Microsoft.Management.Deployment.InProc\Microsoft.Management.Deployment.InProc.dll" - "$(Build.SourcesDirectory)\src\WinGetUtilInterop\bin\WinGetUtil*Interop.dll" - "$(buildOutDir)\UndockedRegFreeWinRT\winrtact.dll" - "$(buildOutDir)\Microsoft.WinGet.Client.Cmdlets\Microsoft.WinGet.Client*.dll" - "$(buildOutDir)\ConfigurationRemotingServer\ConfigurationRemoting*Server.dll" - "$(buildOutDir)\ConfigurationRemotingServer\ConfigurationRemoting*Server.exe" - "$(buildOutDir)\ConfigurationRemotingServer\Microsoft.Management.Configuration*.dll" - "$(buildOutDir)\Microsoft.Management.Configuration\Microsoft.Management.Configuration*.dll" - "$(buildOutDir)\Microsoft.Management.Configuration.OutOfProc\Microsoft.Management.Configuration*.dll" - --config default --recurse' - - - task: securedevelopmentteam.vss-secure-development-tools.build-task-publishsecurityanalysislogs.PublishSecurityAnalysisLogs@3 - displayName: 'Publish Security Analysis Logs' +# Build and test PowerShell module - job: 'BuildPowerShellModule' timeoutInMinutes: 120 dependsOn: 'Build' - condition: always() + condition: succeeded('Build') + variables: + buildOutDir: $(Pipeline.Workspace)\Build.x64Release steps: - task: DownloadPipelineArtifact@2 @@ -495,7 +530,7 @@ jobs: - task: CopyFiles@2 displayName: 'Copy x64 PowerShell Binaries to Output' inputs: - SourceFolder: '$(Pipeline.Workspace)\Build.x64release\PowerShell' + SourceFolder: '$(buildOutDir)\PowerShell' Contents: '**\*' TargetFolder: '$(Build.ArtifactStagingDirectory)' @@ -506,6 +541,16 @@ jobs: Contents: '**\*' TargetFolder: '$(Build.ArtifactStagingDirectory)' + - task: PowerShell@2 + displayName: Generate Microsoft.WinGet.Client Help Documentation + inputs: + pwsh: true + targetType: inline + script: | + Install-Module -Name platyPS -Force + Import-Module platyPS + New-ExternalHelp -Path '$(Build.SourcesDirectory)\src\PowerShell\Help\Microsoft.WinGet.Client' -OutputPath '$(Build.ArtifactStagingDirectory)\Microsoft.WinGet.Client' + - task: CopyFiles@2 displayName: 'Copy Microsoft.WinGet.DSC module to staging directory' inputs: @@ -518,15 +563,15 @@ jobs: inputs: targetType: 'inline' script: | - Get-ChildItem E2ETests\DevPackageDependencies -Filter *.appx | %{ Add-AppxPackage $_.FullName } - workingDirectory: $(Pipeline.Workspace)\Build.x64release\ + Get-ChildItem AppxPackages\AppInstallerCLIPackage_0.0.2.0_Test\Dependencies\x64 -Filter *.appx | %{ Add-AppxPackage $_.FullName } + workingDirectory: $(buildOutDir) - template: templates/e2e-setup.yml parameters: sourceDir: $(Build.SourcesDirectory) - localhostWebServerArgs: '-BuildRoot $(Pipeline.Workspace)\Build.x64release\E2ETests\LocalhostWebServer -StaticFileRoot $(Pipeline.Workspace)\Build.x64release\E2ETests\TestLocalIndex -SourceCert $(Build.SourcesDirectory)\src\AppInstallerCLIE2ETests\TestData\AppInstallerTest.cer' + localhostWebServerArgs: '-BuildRoot $(buildOutDir)\E2ETests\LocalhostWebServer -StaticFileRoot $(buildOutDir)\E2ETests\TestLocalIndex -SourceCert $(buildOutDir)\E2ETests\TestSigningCert.cer' - - pwsh: .\RunTests.ps1 -testModulesPath $(Build.ArtifactStagingDirectory) -outputPath $(Pipeline.Workspace)\PesterTest -packageLayoutPath $(Pipeline.Workspace)\Build.x64release\DevPackage + - pwsh: .\RunTests.ps1 -testModulesPath $(Build.ArtifactStagingDirectory) -outputPath $(Pipeline.Workspace)\PesterTest -packageLayoutPath $(buildOutDir)\DevPackage workingDirectory: $(Build.SourcesDirectory)\src\PowerShell\tests\ displayName: Run PowerShell 7 Tests @@ -535,6 +580,10 @@ jobs: displayName: Run Windows PowerShell Tests condition: succeededOrFailed() + - powershell: Get-Process LocalhostWebServer | Stop-Process + displayName: Stop LocalhostWebServer + condition: succeededOrFailed() + - task: PublishTestResults@2 displayName: Publish Pester Test Results PowerShell 7 inputs: diff --git a/cgmanifest.json b/cgmanifest.json index ff0147ae02..b270b0022b 100644 --- a/cgmanifest.json +++ b/cgmanifest.json @@ -55,6 +55,15 @@ } } }, + { + "component": { + "type": "git", + "git": { + "repositoryUrl": "https://github.com/madler/zlib.git", + "commitHash": "51b7f2abdade71cd9bb0e7a373ef2610ec6f9daf" + } + } + }, { "component": { "type": "git", diff --git a/doc/specs/#148 - Repair Support.md b/doc/specs/#148 - Repair Support.md new file mode 100644 index 0000000000..d3556ef1d7 --- /dev/null +++ b/doc/specs/#148 - Repair Support.md @@ -0,0 +1,120 @@ +--- +author: Madhusudhan Gumbalapura Sudarshan @Madhusudhan-MSFT +created on: 2023-12-01 +last updated: 2024-08-27 +issue id: 148 +--- + +# Repair Feature for Windows Package Manager + +"For [#148](https://github.com/microsoft/winget-cli/issues/148)" + +## Abstract + +This specification outlines the design and implementation of a repair feature for the Windows Package Manager.The repair feature aims to provide a convenient and reliable way for users to fix any issues that may arise with their installed applications, such as corrupted files, missing dependencies, or broken registry entries.The initial implementation will support repair for main installer types, such as Msi, Wix, Msix and MSStore installer types, which have native repair capabilities from their respective frameworks. Additionally, other installer types such as Burn/Exe/Nullsoft/Inno that can specify a custom repair switch in their YAML manifest files can also use the repair feature.The document also outlines the future plans for extending the repair feature to other installer types Portables that do not have a standard repair mechanism. + +## Inspiration + +The motivation for creating a repair feature in the Windows Package Manager is to provide users with a convenient and consistent way to fix their malfunctioning applications, regardless of the installer type. Currently, users have to rely on different methods to repair their applications, such as using the Windows Settings app, the Control Panel, the command line, or the application's own repair tool. These methods are not always available, accessible, or intuitive, and they may vary depending on the application and the installer type. The repair feature aims to provide a unified experience for users to repair their applications, regardless of the installer type. + +## Solution Design + +### Repair Command Syntax +`winget repair [[-q] ...] []` +will initiate the repair of the specified package. The command will display an error message if the application is not installed. The command will attempt to repair the application if it is installed. The command will display a success message if the repair succeeds. The command will display an error message if the repair fails. + +#### Arguments +| Argument | Description | +|-------------|-------------| +| **-q,--query** | The query used to search for an app. | + + +#### Optional Arguments + +| Option | Description | +|--------|-------------| +| **-m, --manifest** | Must be followed by the path to the manifest (YAML) file.You can use the manifest to run the repair experience from a [local manifest file](#local-repair).| +| **--id** | Limits the repair to the specified ID of the application.| +| **--name** | Limits the repair to the specified name of the application.| +| **--moniker** | Limits the repair to the specified moniker of the application.| +| **-v --version** | Limits the repair to the specified version of the application.If not specified, the repair will be applied to the latest version of the application.| +| **--architectures** | Select the architecture | +| **-s --source** | Limits the search to specified source(s).Must be followed by the source name.| +| **-o, --log** | Directs the logging to a log file. You must provide a path to a file that you have the write rights to. | +| **-i --interactive** | Runs the repair in interactive mode.| +| **-h --silent** | Runs the repair in silent mode.| +| **-?, --help** | Get additional help on this command. | +| **--accept-source-agreements** | Accept all source agreements during source operations | +| **--logs, --open-logs** | Open the default logs location. | +| **--locale** | Sets the locale.| + + +### Repair Feature for different Installer Types with Native Repair Capabilities + - Msi, Wix : The repair command will use the built-in repair features of the MSI installer type. It will run the msiexec command with the default [repair options](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/msiexec#repair-options) to repair the application using a ShellExecute call. + - Msix : The repair command will use the built-in repair features of the MSIX installer type. It will make an MSIX API call to register the application package, which will attempt to repair the package. + > We can't do the same thing as setting app repair for MSIX app right now because we can't use the private APIs that it uses to do repair operations with winget. + - MSStore : The repair command will make an MSStore API [StartProductInstallAsync](https://learn.microsoft.com/en-us/uwp/api/windows.applicationmodel.store.preview.installcontrol.appinstallmanager.startproductinstallasync?view=winrt-22621) call to repair the application with 'Repair' property of AppInstallOption set to true. + +### Repair Feature for Installer Types that require Custom Repair Switch + - Burn, Exe, Nullsoft & Inno : The custom switch for repair in the YAML manifest file will be used to perform the repair. The repair command will run the installer with the custom switch to repair the application. To have enough flexibility, different options are possible depending on the installer source used for repair. + - Installed Source: + - If the YAML manifest file specifies the `Repair` switch and `Modify` as the `RepairBehavior`, the repair command will use the modify command in the ARP `ModifyPath` registry key, along with the repair switch, through a ShellExecute call, as long as `NoModify` and `NoRepair` ARP registry flags are not set to 1. + - If the YAML manifest file specifies the `Repair` switch and `Uninstaller` as the RepairBehavior, the repair command will use the uninstall command in the ARP `UninstallString` registry key, along with the repair switch, through a ShellExecute call, as long as `NoRepair` APR registry flag is not set to 1. + - Remote Source: If the YAML manifest file specifies the `Repair` switch and `Installer` value for the RepairBehavior, the repair command will obtain the matching installer from the remote source and use the repair switch on the downloaded installer through a ShellExecute call.. + +> If neither switch is specified, the repair command will display an error message. + +> Note: The initial implementation will not support repair for Portables installer type. Based on feedback from the community, we may add the repair feature for these installer type in a future release. + +## Manifest Changes +Addition of `Repair` property to InstallerSwitch +- The `Repair` property is used to set the custom repair option that works with `RepairBehavior` field that controls the different repair behavior. + +Addition of `RepairBehavior` enumerable property to Installer Object +- With the `RepairBehavior` switch, we can adjust the repair behavior by choosing the installer source (Installed/local or remote) and making sure that the proper ARP registry entries are applied to identify the local installer type when carrying out a repair operation using a local installer source. +- The permitted initial values for the `RepairBehavior` switch include: + - Performing a repair using a Installed/Local Installer Source: + - `Modify`: if this option is specified, the repair switch will be applied to the `ModifyPath` ARP command entry, as long as `NoModify` and `NoRepair` ARP registry flags are not set to 1. + - `Uninstaller` : if this option is specified, the repair switch will be applied to the `UninstallString` ARP command entry, as long as `NoRepair` APR registry flag is note set to 1. + - Performing a repair using a Remote Installer Source: + - `Installer` : If this option is specified, the repair switch will be applied to the appropriate installer obtained from the remote installer source. + +## Manifest Validation +- Specifying `Repair` switch without `RepairBehavior` switch will result in an error. + - Specifying `RepairBehavior` switch without `Repair` switch will result in an error. + - `Repair` switch can't be empty when specified. + - `RepairBehavior` switch can't be empty when specified. + +## Handling Elevation Requirement +- The design presumes that the elevation requirements for modification/repair are consistent with those for installation, much like uninstallation. +- The expectations are: + - If a non-elevated session tries to modify a package installed for machine scope, the installer should prompt for elevation, as observed in sample runs. + - If a package installed for user scope attempts a repair operation in an admin context, it is restricted due to possible security risks. + +## Supported Repair Scenarios +- Repair for installed applications of Msi, Wix, Msix and MSStore installer types. +- Repair for the application using the custom repair switch specified in the YAML manifest file for Burn/Exe/Nullsoft/Inno/Wix/Msi installer types. + - The appropriate repair behavior is determined by the combination of the `Repair` switch and the `RepairBehavior` value in the YAML manifest. + +## Potential Issues +- For Msi based installer types + - To repair an Msi-based installer using msiexec platform support, the original installer must be present at the location registered as 'InstallSource' in the ARP registry. If the original installer is moved or renamed, the repair operation will fail, which is consistent with the modify repair through the settings app. This issue is more likely with installers installed via the winget install command, as it removes the installer right after installation to reduce disk footprint by design, making the 'InstallSource' path invalid. However, this issue does not apply if the installer can store the installer in a package cache path for future use and registers that path in 'InstallSource' in the ARP registry at the time of installation. +- For Burn/Exe/Nullsoft/Inno installer types + - the repair command will not work if the installer does not have a custom repair switch specified in the YAML manifest file. + - the repair command will not work if the installed Burn/Exe/Nullsoft/inno installer type doesn't correlate to the remote installer type that has a custom repair switch specified in the YAML manifest file. + +## Future considerations + +- Repair for Portables installer types. The possible options are: + - Download matching installer , uninstall & Install OR + - Download matching installer & re Install to overwrite existing files. +- Repair for Burn/Exe/Nullsoft/Inno installer types without custom repair switch. The possible options are: + - Download matching installer , uninstall & Install OR + - Download matching installer & re Install to overwrite existing files. + +## Resources +- https://learn.microsoft.com/en-us/windows/msix/desktop/managing-your-msix-reset-and-repair +- https://learn.microsoft.com/en-us/windows/win32/msi/reinstalling-a-feature-or-application +- https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/msiexec#repair-options +- https://learn.microsoft.com/en-us/uwp/api/windows.applicationmodel.store.preview.installcontrol.appinstallmanager.startproductinstallasync?view=winrt-22621 +- https://learn.microsoft.com/en-us/windows/win32/api/msi/nf-msi-msireinstallproductw diff --git a/doc/specs/#292 - winget should install an app if there is an exact match.md b/doc/specs/#292 - winget should install an app if there is an exact match.md index 6e6b932a51..6b722de132 100644 --- a/doc/specs/#292 - winget should install an app if there is an exact match.md +++ b/doc/specs/#292 - winget should install an app if there is an exact match.md @@ -12,7 +12,7 @@ For [#292](https://github.com/microsoft/winget-cli/issues/292) ## Abstract The winget.exe client attempts to be generous with the `search` command, but is a bit too generous with `install`. The *id* -should be the unique key to identifying a package (other than the package version). It should also be case insensitive from the perspective of command execution, but it should be case sensitive in terms of the displayed value. +should be the unique key to identifying a package (other than the package version). It should also be case-insensitive from the perspective of command execution, but it should be case-sensitive in terms of the displayed value. If a manifest was created with the *id* "Git.Git" then that is what would be displayed in the client output. Any combination of case in the `install` command should match. @@ -29,7 +29,7 @@ The latest version of a package is also the version that should be displayed dur ## Solution Design Installing a package by using the *Id* as the package name should not require disambiguation. -The package *Id* should perform a case insensitive match. If the given *Id* is exact, it should not +The package *Id* should perform a case-insensitive match. If the given *Id* is exact, it should not be confused with a longer *Id* `winget install git.git` should install that package The `git.gitLFS` should not cause ambiguity @@ -76,7 +76,7 @@ be installed rather than what they intended. ## Future considerations There are changes to how results should displayed to reduce the likelihood of a user mistakenly assuming the "Name" is a key value -for a package. The client commands should be case insensitive, but the display should still be case sensitive to support ease of +for a package. The client commands should be case-insensitive, but the display should still be case-sensitive to support ease of reading. Long names can be easier to understand when presented in camel case, pascal case, or with a branded letter casing. The client also needs a mechanism to display all of the available versions of a package. diff --git a/doc/specs/#364 - Feature Toggle.md b/doc/specs/#364 - Feature Toggle.md index 08ee95a13c..781c68fad0 100644 --- a/doc/specs/#364 - Feature Toggle.md +++ b/doc/specs/#364 - Feature Toggle.md @@ -71,7 +71,7 @@ This should have no direct impact on accessibility. ### Security -There should be no security impact directly, although we must remember that any medium IL process will be able to enable any feature by writing to the settings file. But any experimental feature should be created with the intention of becoming released, and so should have it's own security consideration. +There should be no security impact directly, although we must remember that any medium IL process will be able to enable any feature by writing to the settings file. But any experimental feature should be created with the intention of becoming released, and so should have its own security consideration. ### Reliability diff --git a/doc/specs/#476 - Package Pinning.md b/doc/specs/#476 - Package Pinning.md index 046aa8f7d4..3eba8c540f 100644 --- a/doc/specs/#476 - Package Pinning.md +++ b/doc/specs/#476 - Package Pinning.md @@ -170,7 +170,7 @@ Security of the Windows Package Manager should not be impacted by this change. H ### Reliability -The change will improve reliability, as users will be able to have fine grained control of the Windows Package Manager's upgrade functionality to ensure their workflow is not disrupted. +The change will improve reliability, as users will be able to have fine-grained control of the Windows Package Manager's upgrade functionality to ensure their workflow is not disrupted. ### Compatibility @@ -191,7 +191,7 @@ There should not be any notable performance changes. - Implementation in this spec only supports pinning from remote sources, so all installed versions from same package share the same pinning configuration. Winget could better support side by side installations by introducing package pinning from installed source. - Package pinning from user and from manifest are stored separately, we may integrate the `winget pin` commands to control package pinning from manifests. - A couple UI integrations can be made to `winget upgrade` and `winget list` to show pinned status during listing. -- Dependencies flow can be improved to first check pinned status of each dependant package before trying to install all dependencies. +- Dependencies flow can be improved to first check pinned status of each dependent package before trying to install all dependencies. - Support setting pinned state right after installation/upgrades like `winget install foo --pin`. - Improvements to import export commands to work seamlessly with existing package pinning configurations. diff --git a/doc/windows/package-manager/winget/returnCodes.md b/doc/windows/package-manager/winget/returnCodes.md index d4ee7fff31..29486e308d 100644 --- a/doc/windows/package-manager/winget/returnCodes.md +++ b/doc/windows/package-manager/winget/returnCodes.md @@ -140,8 +140,8 @@ ms.localizationpriority: medium | 0x8A15007E | -1978335106 | APPINSTALLER_CLI_ERROR_SQLITE_CONNECTION_TERMINATED | The SQLite connection was terminated to prevent corruption. | | 0x8A15007F | -1978335105 | APPINSTALLER_CLI_ERROR_DISPLAYCATALOG_API_FAILED | Failed to get Microsoft Store package catalog. | | 0x8A150080 | -1978335104 | APPINSTALLER_CLI_ERROR_NO_APPLICABLE_DISPLAYCATALOG_PACKAGE | No applicable Microsoft Store package found from Microsoft Store package catalog. | -| 0x8A150081 | -1978335103 | APPINSTALLER_CLI_ERROR_SFSCLIENT_API_FAILED | Failed to get Microsoft Store package download infomation. | -| 0x8A150082 | -1978335102 | APPINSTALLER_CLI_ERROR_NO_APPLICABLE_SFSCLIENT_PACKAGE | No applicable Microsoft Store package download infomation found. | +| 0x8A150081 | -1978335103 | APPINSTALLER_CLI_ERROR_SFSCLIENT_API_FAILED | Failed to get Microsoft Store package download information. | +| 0x8A150082 | -1978335102 | APPINSTALLER_CLI_ERROR_NO_APPLICABLE_SFSCLIENT_PACKAGE | No applicable Microsoft Store package download information found. | | 0x8A150083 | -1978335101 | APPINSTALLER_CLI_ERROR_LICENSING_API_FAILED | Failed to retrieve Microsoft Store package license. | ## Install errors. diff --git a/doc/windows/package-manager/winget/search.md b/doc/windows/package-manager/winget/search.md index 210ae9b2e7..8f38a20605 100644 --- a/doc/windows/package-manager/winget/search.md +++ b/doc/windows/package-manager/winget/search.md @@ -56,7 +56,7 @@ Search strings can be filtered with the following options. | **--verbose, --verbose-logs** | Enables verbose logging for winget. | | **--disable-interactivity** | Disable interactive prompts. | -The string will be treated as a substring. The search by default is also case insensitive. For example, `winget search micro` could return the following: +The string will be treated as a substring. The search by default is also case-insensitive. For example, `winget search micro` could return the following: * Microsoft * Microscope diff --git a/samples/WinGetUWPCaller/WinGetUWPCaller.sln b/samples/WinGetUWPCaller/WinGetUWPCaller.sln new file mode 100644 index 0000000000..16cbf3a6c8 --- /dev/null +++ b/samples/WinGetUWPCaller/WinGetUWPCaller.sln @@ -0,0 +1,43 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30704.19 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WinGetUWPCaller", "WinGetUWPCaller\WinGetUWPCaller.vcxproj", "{37F1FD2A-4D63-45A0-82AA-66EF126CB322}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|ARM64 = Debug|ARM64 + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|ARM64 = Release|ARM64 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {37F1FD2A-4D63-45A0-82AA-66EF126CB322}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {37F1FD2A-4D63-45A0-82AA-66EF126CB322}.Debug|ARM64.Build.0 = Debug|ARM64 + {37F1FD2A-4D63-45A0-82AA-66EF126CB322}.Debug|ARM64.Deploy.0 = Debug|ARM64 + {37F1FD2A-4D63-45A0-82AA-66EF126CB322}.Debug|x64.ActiveCfg = Debug|x64 + {37F1FD2A-4D63-45A0-82AA-66EF126CB322}.Debug|x64.Build.0 = Debug|x64 + {37F1FD2A-4D63-45A0-82AA-66EF126CB322}.Debug|x64.Deploy.0 = Debug|x64 + {37F1FD2A-4D63-45A0-82AA-66EF126CB322}.Debug|x86.ActiveCfg = Debug|Win32 + {37F1FD2A-4D63-45A0-82AA-66EF126CB322}.Debug|x86.Build.0 = Debug|Win32 + {37F1FD2A-4D63-45A0-82AA-66EF126CB322}.Debug|x86.Deploy.0 = Debug|Win32 + {37F1FD2A-4D63-45A0-82AA-66EF126CB322}.Release|ARM64.ActiveCfg = Release|ARM64 + {37F1FD2A-4D63-45A0-82AA-66EF126CB322}.Release|ARM64.Build.0 = Release|ARM64 + {37F1FD2A-4D63-45A0-82AA-66EF126CB322}.Release|ARM64.Deploy.0 = Release|ARM64 + {37F1FD2A-4D63-45A0-82AA-66EF126CB322}.Release|x64.ActiveCfg = Release|x64 + {37F1FD2A-4D63-45A0-82AA-66EF126CB322}.Release|x64.Build.0 = Release|x64 + {37F1FD2A-4D63-45A0-82AA-66EF126CB322}.Release|x64.Deploy.0 = Release|x64 + {37F1FD2A-4D63-45A0-82AA-66EF126CB322}.Release|x86.ActiveCfg = Release|Win32 + {37F1FD2A-4D63-45A0-82AA-66EF126CB322}.Release|x86.Build.0 = Release|Win32 + {37F1FD2A-4D63-45A0-82AA-66EF126CB322}.Release|x86.Deploy.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {D7D1DE2E-A7C1-4FB3-A191-C848562A3EBD} + EndGlobalSection +EndGlobal diff --git a/samples/WinGetUWPCaller/WinGetUWPCaller/ActivePackageView.cpp b/samples/WinGetUWPCaller/WinGetUWPCaller/ActivePackageView.cpp new file mode 100644 index 0000000000..aff6c3a8aa --- /dev/null +++ b/samples/WinGetUWPCaller/WinGetUWPCaller/ActivePackageView.cpp @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +#include "pch.h" +#include "ActivePackageView.h" +#include "ActivePackageView.g.cpp" +#include + +namespace winrt::WinGetUWPCaller::implementation +{ + Microsoft::Management::Deployment::CatalogPackage ActivePackageView::Package() + { + return m_package; + } + + void ActivePackageView::Package(Microsoft::Management::Deployment::CatalogPackage const& value) + { + m_package = value; + } + + ActivePackageView::AsyncOperation_t ActivePackageView::AsyncOperation() + { + return m_asyncOperation; + } + + Windows::Foundation::IAsyncAction UpdateUIProgress( + Microsoft::Management::Deployment::InstallProgress progress, + WinGetUWPCaller::ActivePackageView view) + { + co_await resume_foreground(view.Dispatcher()); + view.Progress(progress.DownloadProgress * 100); + } + + void ActivePackageView::AsyncOperation(ActivePackageView::AsyncOperation_t const& value) + { + m_asyncOperation = value; + m_asyncOperation.Progress([=]( + ActivePackageView::AsyncOperation_t const& /* sender */, + Microsoft::Management::Deployment::InstallProgress const& progress) + { + UpdateUIProgress(progress, *this); + }); + } + + double ActivePackageView::Progress() + { + return m_progress; + } + + void ActivePackageView::Progress(double value) + { + if (m_progress != value) + { + m_progress = value; + m_propertyChanged(*this, Windows::UI::Xaml::Data::PropertyChangedEventArgs{ L"Progress" }); + } + } + + hstring ActivePackageView::StatusText() + { + return m_text; + } + + void ActivePackageView::StatusText(hstring const& value) + { + m_text = value; + } + + Windows::UI::Core::CoreDispatcher ActivePackageView::Dispatcher() + { + return m_dispatcher; + } + + void ActivePackageView::Dispatcher(Windows::UI::Core::CoreDispatcher const& value) + { + m_dispatcher = value; + } + + event_token ActivePackageView::PropertyChanged(Windows::UI::Xaml::Data::PropertyChangedEventHandler const& handler) + { + return m_propertyChanged.add(handler); + } + + void ActivePackageView::PropertyChanged(event_token const& token) + { + m_propertyChanged.remove(token); + } +} diff --git a/samples/WinGetUWPCaller/WinGetUWPCaller/ActivePackageView.h b/samples/WinGetUWPCaller/WinGetUWPCaller/ActivePackageView.h new file mode 100644 index 0000000000..b9cdfeeed7 --- /dev/null +++ b/samples/WinGetUWPCaller/WinGetUWPCaller/ActivePackageView.h @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +#pragma once +#include "ActivePackageView.g.h" + +namespace winrt::WinGetUWPCaller::implementation +{ + struct ActivePackageView : ActivePackageViewT + { + using AsyncOperation_t = Windows::Foundation::IAsyncOperationWithProgress; + + ActivePackageView() = default; + + Microsoft::Management::Deployment::CatalogPackage Package(); + void Package(Microsoft::Management::Deployment::CatalogPackage const& value); + AsyncOperation_t AsyncOperation(); + void AsyncOperation(AsyncOperation_t const& value); + double Progress(); + void Progress(double value); + hstring StatusText(); + void StatusText(hstring const& value); + Windows::UI::Core::CoreDispatcher Dispatcher(); + void Dispatcher(Windows::UI::Core::CoreDispatcher const& value); + event_token PropertyChanged(Windows::UI::Xaml::Data::PropertyChangedEventHandler const& value); + void PropertyChanged(event_token const& token); + + private: + Microsoft::Management::Deployment::CatalogPackage m_package{ nullptr }; + AsyncOperation_t m_asyncOperation{ nullptr }; + double m_progress = 0; + hstring m_text; + Windows::UI::Core::CoreDispatcher m_dispatcher{ nullptr }; + event m_propertyChanged; + }; +} + +namespace winrt::WinGetUWPCaller::factory_implementation +{ + struct ActivePackageView : ActivePackageViewT + { + }; +} diff --git a/samples/WinGetUWPCaller/WinGetUWPCaller/App.cpp b/samples/WinGetUWPCaller/WinGetUWPCaller/App.cpp new file mode 100644 index 0000000000..a9e9cbc1a2 --- /dev/null +++ b/samples/WinGetUWPCaller/WinGetUWPCaller/App.cpp @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +#include "pch.h" + +#include "App.h" +#include "MainPage.h" + +using namespace winrt; +using namespace Windows::ApplicationModel; +using namespace Windows::ApplicationModel::Activation; +using namespace Windows::Foundation; +using namespace Windows::UI::Xaml; +using namespace Windows::UI::Xaml::Controls; +using namespace Windows::UI::Xaml::Navigation; +using namespace WinGetUWPCaller; +using namespace WinGetUWPCaller::implementation; + +/// +/// Initializes the singleton application object. This is the first line of authored code +/// executed, and as such is the logical equivalent of main() or WinMain(). +/// +App::App() +{ + InitializeComponent(); + Suspending({ this, &App::OnSuspending }); + +#if defined _DEBUG && !defined DISABLE_XAML_GENERATED_BREAK_ON_UNHANDLED_EXCEPTION + UnhandledException([this](IInspectable const&, UnhandledExceptionEventArgs const& e) + { + if (IsDebuggerPresent()) + { + auto errorMessage = e.Message(); + __debugbreak(); + } + }); +#endif +} + +/// +/// Invoked when the application is launched normally by the end user. Other entry points +/// will be used such as when the application is launched to open a specific file. +/// +/// Details about the launch request and process. +void App::OnLaunched(LaunchActivatedEventArgs const& e) +{ + Frame rootFrame{ nullptr }; + auto content = Window::Current().Content(); + if (content) + { + rootFrame = content.try_as(); + } + + // Do not repeat app initialization when the Window already has content, + // just ensure that the window is active + if (rootFrame == nullptr) + { + // Create a Frame to act as the navigation context and associate it with + // a SuspensionManager key + rootFrame = Frame(); + + rootFrame.NavigationFailed({ this, &App::OnNavigationFailed }); + + if (e.PreviousExecutionState() == ApplicationExecutionState::Terminated) + { + // Restore the saved session state only when appropriate, scheduling the + // final launch steps after the restore is complete + } + + if (e.PrelaunchActivated() == false) + { + if (rootFrame.Content() == nullptr) + { + // When the navigation stack isn't restored navigate to the first page, + // configuring the new page by passing required information as a navigation + // parameter + rootFrame.Navigate(xaml_typename(), box_value(e.Arguments())); + } + // Place the frame in the current Window + Window::Current().Content(rootFrame); + // Ensure the current window is active + Window::Current().Activate(); + } + } + else + { + if (e.PrelaunchActivated() == false) + { + if (rootFrame.Content() == nullptr) + { + // When the navigation stack isn't restored navigate to the first page, + // configuring the new page by passing required information as a navigation + // parameter + rootFrame.Navigate(xaml_typename(), box_value(e.Arguments())); + } + // Ensure the current window is active + Window::Current().Activate(); + } + } +} + +/// +/// Invoked when application execution is being suspended. Application state is saved +/// without knowing whether the application will be terminated or resumed with the contents +/// of memory still intact. +/// +/// The source of the suspend request. +/// Details about the suspend request. +void App::OnSuspending([[maybe_unused]] IInspectable const& sender, [[maybe_unused]] SuspendingEventArgs const& e) +{ + // Save application state and stop any background activity +} + +/// +/// Invoked when Navigation to a certain page fails +/// +/// The Frame which failed navigation +/// Details about the navigation failure +void App::OnNavigationFailed(IInspectable const&, NavigationFailedEventArgs const& e) +{ + throw hresult_error(E_FAIL, hstring(L"Failed to load Page ") + e.SourcePageType().Name); +} diff --git a/samples/WinGetUWPCaller/WinGetUWPCaller/App.h b/samples/WinGetUWPCaller/WinGetUWPCaller/App.h new file mode 100644 index 0000000000..1f9fbf7704 --- /dev/null +++ b/samples/WinGetUWPCaller/WinGetUWPCaller/App.h @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +#pragma once +#include "App.xaml.g.h" + +namespace winrt::WinGetUWPCaller::implementation +{ + struct App : AppT + { + App(); + + void OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs const&); + void OnSuspending(IInspectable const&, Windows::ApplicationModel::SuspendingEventArgs const&); + void OnNavigationFailed(IInspectable const&, Windows::UI::Xaml::Navigation::NavigationFailedEventArgs const&); + }; +} diff --git a/samples/WinGetUWPCaller/WinGetUWPCaller/App.idl b/samples/WinGetUWPCaller/WinGetUWPCaller/App.idl new file mode 100644 index 0000000000..d42b0b33de --- /dev/null +++ b/samples/WinGetUWPCaller/WinGetUWPCaller/App.idl @@ -0,0 +1,3 @@ +namespace WinGetUWPCaller +{ +} diff --git a/samples/WinGetUWPCaller/WinGetUWPCaller/App.xaml b/samples/WinGetUWPCaller/WinGetUWPCaller/App.xaml new file mode 100644 index 0000000000..710944ef82 --- /dev/null +++ b/samples/WinGetUWPCaller/WinGetUWPCaller/App.xaml @@ -0,0 +1,9 @@ + + + + diff --git a/samples/WinGetUWPCaller/WinGetUWPCaller/Assets/LockScreenLogo.scale-200.png b/samples/WinGetUWPCaller/WinGetUWPCaller/Assets/LockScreenLogo.scale-200.png new file mode 100644 index 0000000000..3c5ba2c736 Binary files /dev/null and b/samples/WinGetUWPCaller/WinGetUWPCaller/Assets/LockScreenLogo.scale-200.png differ diff --git a/samples/WinGetUWPCaller/WinGetUWPCaller/Assets/SplashScreen.scale-200.png b/samples/WinGetUWPCaller/WinGetUWPCaller/Assets/SplashScreen.scale-200.png new file mode 100644 index 0000000000..23e8eeb811 Binary files /dev/null and b/samples/WinGetUWPCaller/WinGetUWPCaller/Assets/SplashScreen.scale-200.png differ diff --git a/samples/WinGetUWPCaller/WinGetUWPCaller/Assets/Square150x150Logo.scale-200.png b/samples/WinGetUWPCaller/WinGetUWPCaller/Assets/Square150x150Logo.scale-200.png new file mode 100644 index 0000000000..0ae664127b Binary files /dev/null and b/samples/WinGetUWPCaller/WinGetUWPCaller/Assets/Square150x150Logo.scale-200.png differ diff --git a/samples/WinGetUWPCaller/WinGetUWPCaller/Assets/Square44x44Logo.scale-200.png b/samples/WinGetUWPCaller/WinGetUWPCaller/Assets/Square44x44Logo.scale-200.png new file mode 100644 index 0000000000..f0357adbab Binary files /dev/null and b/samples/WinGetUWPCaller/WinGetUWPCaller/Assets/Square44x44Logo.scale-200.png differ diff --git a/samples/WinGetUWPCaller/WinGetUWPCaller/Assets/Square44x44Logo.targetsize-24_altform-unplated.png b/samples/WinGetUWPCaller/WinGetUWPCaller/Assets/Square44x44Logo.targetsize-24_altform-unplated.png new file mode 100644 index 0000000000..fa1edd468c Binary files /dev/null and b/samples/WinGetUWPCaller/WinGetUWPCaller/Assets/Square44x44Logo.targetsize-24_altform-unplated.png differ diff --git a/samples/WinGetUWPCaller/WinGetUWPCaller/Assets/StoreLogo.png b/samples/WinGetUWPCaller/WinGetUWPCaller/Assets/StoreLogo.png new file mode 100644 index 0000000000..5db65cb83f Binary files /dev/null and b/samples/WinGetUWPCaller/WinGetUWPCaller/Assets/StoreLogo.png differ diff --git a/samples/WinGetUWPCaller/WinGetUWPCaller/Assets/Wide310x150Logo.scale-200.png b/samples/WinGetUWPCaller/WinGetUWPCaller/Assets/Wide310x150Logo.scale-200.png new file mode 100644 index 0000000000..4d31be0494 Binary files /dev/null and b/samples/WinGetUWPCaller/WinGetUWPCaller/Assets/Wide310x150Logo.scale-200.png differ diff --git a/samples/WinGetUWPCaller/WinGetUWPCaller/MainPage.cpp b/samples/WinGetUWPCaller/WinGetUWPCaller/MainPage.cpp new file mode 100644 index 0000000000..37d7434448 --- /dev/null +++ b/samples/WinGetUWPCaller/WinGetUWPCaller/MainPage.cpp @@ -0,0 +1,951 @@ +#include "pch.h" +#include "MainPage.h" +#include "MainPage.g.cpp" + +#include + +using namespace std::chrono_literals; +using namespace std::string_view_literals; +using namespace winrt::Microsoft::Management::Deployment; + +namespace winrt +{ + using namespace Windows::UI::Xaml; + using namespace Windows::Foundation; + using namespace Windows::Foundation::Collections; +} + +namespace winrt::WinGetUWPCaller::implementation +{ + namespace + { + std::wstring ConvertExceptionToStatusString(std::wstring_view context, std::exception_ptr exceptionPtr) + { + std::wostringstream result; + + try + { + std::rethrow_exception(exceptionPtr); + } + catch (const winrt::hresult_error& error) + { + result << context << L" :: " << L"0x" << std::hex << std::setw(8) << std::setfill(L'0') << error.code() << L": " << static_cast(error.message()); + } + catch (const std::exception& exception) + { + result << context << L" :: " << exception.what(); + } + catch (...) + { + result << context << L" :: Unknown exception"; + } + + return std::move(result).str(); + } + + template + std::wstring RunAndReturnStatus(std::wstring_view context, Operation&& operation) + { + try + { + operation(); + } + catch (...) + { + return ConvertExceptionToStatusString(context, std::current_exception()); + } + + return {}; + } + + // Helper object to control button states and status text. + struct BackgroundActionData + { + // This object should be constructed on the foreground thread. + // disabledButtons will be disabled during the operation. + // enabledButtons will be enabled during the operation. + // statusText will be updated with the result. + BackgroundActionData( + std::initializer_list disabledButtons, + Windows::UI::Xaml::Controls::TextBlock statusText) : + m_disabledButtons(disabledButtons), + m_statusText(statusText) + { + if (m_disabledButtons.empty()) + { + throw std::exception("Must specify at least one disabled button."); + } + + for (const auto& button : m_disabledButtons) + { + button.IsEnabled(false); + } + + m_statusText.Text(L""); + } + + BackgroundActionData( + std::initializer_list disabledButtons, + std::initializer_list enabledButtons, + Windows::UI::Xaml::Controls::TextBlock statusText) : + BackgroundActionData(disabledButtons, statusText) + { + m_enabledButtons = enabledButtons; + for (const auto& button : m_enabledButtons) + { + button.IsEnabled(true); + } + } + + // This should be run on the foreground thread. + void Finalize() const + { + for (const auto& button : m_disabledButtons) + { + button.IsEnabled(true); + } + + for (const auto& button : m_enabledButtons) + { + button.IsEnabled(false); + } + + m_statusText.Text(m_status); + } + + template + void RunAndCatchStatus(std::wstring_view context, Operation&& operation) + { + if (m_status.empty()) + { + m_status = RunAndReturnStatus(context, operation); + } + } + + void Status(std::wstring&& value) + { + m_status = std::move(value); + } + + bool Successful() const + { + return m_status.empty(); + } + + Windows::UI::Core::CoreDispatcher Dispatcher() const + { + return m_disabledButtons[0].Dispatcher(); + } + + private: + std::vector m_disabledButtons; + std::vector m_enabledButtons; + Windows::UI::Xaml::Controls::TextBlock m_statusText; + std::wstring m_status; + }; + + std::wstring MakeCompactByteString(uint64_t bytes) + { + static constexpr std::array s_sizeStrings = { L"B"sv, L"KB"sv, L"MB"sv, L"GB"sv }; + static constexpr size_t s_sizeIncrement = 1000; + + size_t sizeIndex = 0; + while (sizeIndex < s_sizeStrings.size() && bytes > s_sizeIncrement) + { + sizeIndex += 1; + bytes /= s_sizeIncrement; + } + + return std::to_wstring(bytes).append(L" ").append(s_sizeStrings[sizeIndex]); + } + } + + MainPage::MainPage() + { + InitializeComponent(); + m_packageCatalogs = winrt::single_threaded_observable_vector(); + m_installedPackages = winrt::single_threaded_observable_vector(); + m_activePackageViews = winrt::single_threaded_observable_vector(); + } + + Windows::Foundation::Collections::IObservableVector MainPage::PackageCatalogs() + { + return m_packageCatalogs; + } + + Windows::Foundation::Collections::IObservableVector MainPage::InstalledPackages() + { + return m_installedPackages; + } + + Windows::Foundation::Collections::IObservableVector MainPage::ActivePackages() + { + return m_activePackageViews; + } + + void MainPage::LoadCatalogsButtonClickHandler(IInspectable const&, RoutedEventArgs const&) + { + LoadCatalogsAsync(); + } + + void MainPage::CatalogSelectionChangedHandler(Windows::Foundation::IInspectable const&, Windows::UI::Xaml::RoutedEventArgs const&) + { + m_catalog = nullptr; + } + + void MainPage::SearchButtonClickHandler(IInspectable const&, RoutedEventArgs const&) + { + FindPackageAsync(); + } + + void MainPage::InstallButtonClickHandler(IInspectable const&, RoutedEventArgs const&) + { + if (m_packageOperation == nullptr || m_packageOperation.Status() != AsyncStatus::Started) + { + InstallOrUpgradeAsync(false); + } + } + + void MainPage::UpgradeButtonClickHandler(IInspectable const&, RoutedEventArgs const&) + { + if (m_packageOperation == nullptr || m_packageOperation.Status() != AsyncStatus::Started) + { + InstallOrUpgradeAsync(true); + } + } + + void MainPage::DownloadButtonClickHandler(IInspectable const&, RoutedEventArgs const&) + { + if (m_packageOperation == nullptr || m_packageOperation.Status() != AsyncStatus::Started) + { + DownloadAsync(); + } + } + + void MainPage::CancelButtonClickHandler(IInspectable const&, RoutedEventArgs const&) + { + if (m_packageOperation && m_packageOperation.Status() == AsyncStatus::Started) + { + m_packageOperation.Cancel(); + } + } + + void MainPage::RefreshInstalledButtonClickHandler(IInspectable const&, RoutedEventArgs const&) + { + GetInstalledPackagesAsync(); + } + + void MainPage::UninstallButtonClickHandler(IInspectable const&, RoutedEventArgs const&) + { + UninstallAsync(); + } + + void MainPage::RefreshActiveButtonClickHandler(IInspectable const&, RoutedEventArgs const&) + { + GetActivePackagesAsync(); + } + + std::wstring MainPage::EnsurePackageManager(bool forceRecreate) + { + std::lock_guard lock{ m_packageManagerMutex }; + + std::wstring result; + + if (!m_packageManager || forceRecreate) + { + result = RunAndReturnStatus(L"Create PackageManager", [&]() { + m_packageManager = PackageManager{}; + }); + } + + return result; + } + + IAsyncAction MainPage::LoadCatalogsAsync() + { + BackgroundActionData actionData{ { loadCatalogsButton() }, catalogStatusText() }; + + co_await winrt::resume_background(); + + actionData.Status(EnsurePackageManager(true)); + + decltype(m_packageManager.GetPackageCatalogs()) catalogs{ nullptr }; + actionData.RunAndCatchStatus(L"Load Catalogs", [&]() { + catalogs = m_packageManager.GetPackageCatalogs(); + }); + + co_await winrt::resume_foreground(actionData.Dispatcher()); + + m_packageCatalogs.Clear(); + + if (catalogs) + { + for (auto const catalog : catalogs) + { + m_packageCatalogs.Append(catalog); + } + } + + actionData.Finalize(); + } + + IAsyncAction MainPage::FindPackageAsync() + { + hstring queryInput = queryTextBox().Text(); + auto selectedItems = catalogsListBox().SelectedItems(); + int32_t searchType = searchField().SelectedIndex(); + PackageCatalog catalog = m_catalog; + + BackgroundActionData actionData{ { searchButton() }, operationStatusText() }; + + co_await winrt::resume_background(); + + actionData.Status(EnsurePackageManager()); + + if (!catalog) + { + actionData.RunAndCatchStatus(L"Connect catalog(s)", [&]() { + PackageCatalogReference catalogReference{ nullptr }; + + if (selectedItems.Size() == 0) + { + // If no items are selected, we use all available catalogs. + CreateCompositePackageCatalogOptions createCompositePackageCatalogOptions; + createCompositePackageCatalogOptions.CompositeSearchBehavior(CompositeSearchBehavior::RemotePackagesFromRemoteCatalogs); + + for (const auto& item : m_packageManager.GetPackageCatalogs()) + { + createCompositePackageCatalogOptions.Catalogs().Append(item); + } + + catalogReference = m_packageManager.CreateCompositePackageCatalog(createCompositePackageCatalogOptions); + } + else if (selectedItems.Size() == 1) + { + // If one items is selected, we can directly use this catalog. + catalogReference = selectedItems.GetAt(0).as(); + } + else + { + // If multiple items are selected, we create a composite catalog using those catalogs. + CreateCompositePackageCatalogOptions createCompositePackageCatalogOptions; + createCompositePackageCatalogOptions.CompositeSearchBehavior(CompositeSearchBehavior::RemotePackagesFromRemoteCatalogs); + + for (const auto& item : selectedItems) + { + createCompositePackageCatalogOptions.Catalogs().Append(item.as()); + } + + catalogReference = m_packageManager.CreateCompositePackageCatalog(createCompositePackageCatalogOptions); + } + + ConnectResult connectResult{ catalogReference.Connect() }; + + switch (connectResult.Status()) + { + case ConnectResultStatus::Ok: break; + case ConnectResultStatus::CatalogError: throw std::exception{ "Catalog connection error." }; + case ConnectResultStatus::SourceAgreementsNotAccepted: throw std::exception{ "Required catalog agreements not accepted." }; + } + + catalog = connectResult.PackageCatalog(); + }); + } + + CatalogPackage package{ nullptr }; + + actionData.RunAndCatchStatus(L"Find package", [&]() { + FindPackagesOptions findPackagesOptions; + PackageMatchFilter filter; + + switch (searchType) + { + case 0: // Generic query + filter.Field(PackageMatchField::CatalogDefault); + filter.Option(PackageFieldMatchOption::ContainsCaseInsensitive); + break; + case 1: // Identifier (case-insensitive) + filter.Field(PackageMatchField::Id); + filter.Option(PackageFieldMatchOption::EqualsCaseInsensitive); + break; + case 2: // Name (substring) + filter.Field(PackageMatchField::Name); + filter.Option(PackageFieldMatchOption::ContainsCaseInsensitive); + break; + } + + filter.Value(queryInput); + findPackagesOptions.Selectors().Append(filter); + FindPackagesResult findPackagesResult = catalog.FindPackages(findPackagesOptions); + + winrt::IVectorView matches = findPackagesResult.Matches(); + if (matches.Size() == 0) + { + throw std::exception{ "No package found matching input" }; + } + else if (matches.Size() > 1) + { + throw std::exception{ "Multiple packages found matching input; refine query." }; + } + else + { + package = matches.GetAt(0).CatalogPackage(); + } + }); + + if (package) + { + // Display the package name using the user's default localization information. + std::wostringstream stream; + stream << L"Found package: " << + static_cast(package.DefaultInstallVersion().GetCatalogPackageMetadata().PackageName()) << L" [" << + static_cast(package.Id()) << L"]"; + actionData.Status(std::move(stream).str()); + } + + co_await winrt::resume_foreground(actionData.Dispatcher()); + + m_catalog = catalog; + m_package = package; + + bool operationButtonsEnabled = static_cast(m_package); + installButton().IsEnabled(operationButtonsEnabled); + upgradeButton().IsEnabled(operationButtonsEnabled); + downloadButton().IsEnabled(operationButtonsEnabled); + + actionData.Finalize(); + } + + IAsyncAction MainPage::InstallOrUpgradeAsync(bool upgrade) + { + PackageManager packageManager = m_packageManager; + CatalogPackage package = m_package; + auto progressBar = operationProgressBar(); + auto statusText = operationStatusText(); + + BackgroundActionData actionData{ { installButton(), upgradeButton(), downloadButton() }, { cancelButton() }, statusText }; + + co_await winrt::resume_background(); + + Windows::Foundation::IAsyncOperationWithProgress packageOperation; + + actionData.RunAndCatchStatus(L"Begin install", [&]() { + InstallOptions installOptions; + + // Passing PackageInstallScope::User causes the install to fail if there's no installer that supports that. + installOptions.PackageInstallScope(PackageInstallScope::Any); + installOptions.PackageInstallMode(PackageInstallMode::Silent); + + if (upgrade) + { + packageOperation = packageManager.UpgradePackageAsync(package, installOptions); + } + else + { + packageOperation = packageManager.InstallPackageAsync(package, installOptions); + } + }); + + actionData.Dispatcher().RunAsync(Windows::UI::Core::CoreDispatcherPriority::Normal, + [packageOperation, this]() { m_packageOperation = packageOperation; }); + + actionData.RunAndCatchStatus(L"Set progress handler", [&]() { + packageOperation.Progress([&]( + IAsyncOperationWithProgress const& /* sender */, + InstallProgress const& progress) + { + actionData.Dispatcher().RunAsync(Windows::UI::Core::CoreDispatcherPriority::Normal, + [progressBar, statusText, progress]() { + progressBar.Value(progress.DownloadProgress * 100); + + switch (progress.State) + { + case PackageInstallProgressState::Queued: + statusText.Text(L"Queued"); + break; + case PackageInstallProgressState::Downloading: + { + std::wstring downloadText{ L"Downloaded " }; + downloadText += MakeCompactByteString(progress.BytesDownloaded) + L" of " + MakeCompactByteString(progress.BytesRequired); + statusText.Text(downloadText); + } + break; + case PackageInstallProgressState::Installing: + statusText.Text(L"Installer running"); + progressBar.IsIndeterminate(true); + break; + case PackageInstallProgressState::PostInstall: + statusText.Text(L"Post install bookkeeping"); + break; + case PackageInstallProgressState::Finished: + statusText.Text(L"Done"); + progressBar.IsIndeterminate(false); + break; + default: + statusText.Text(L""); + } + }); + }); + }); + + InstallResult installResult{ nullptr }; + + actionData.RunAndCatchStatus(L"Install", [&]() { + installResult = packageOperation.get(); + }); + + if (packageOperation && packageOperation.Status() == AsyncStatus::Canceled) + { + actionData.Status(L"Cancelled"); + } + else if (installResult) + { + // Error handling for the installResult is done by first examining the Status. + // Any status value other than Ok will have additional error detail in the + // ExtendedErrorCode property. This HRESULT value will typically (but not always) + // have the Windows Package Manager facility value (0xA15). The symbolic names and + // meanings of these error codes can be found at: + // https://github.com/microsoft/winget-cli/blob/master/doc/windows/package-manager/winget/returnCodes.md + // or by using the winget CLI: + // > winget error 0x8A150049 + // > winget error -- -2146762487 + switch (installResult.Status()) + { + case InstallResultStatus::Ok: + actionData.Status(installResult.RebootRequired() ? L"Reboot required" : L"Done"); + break; + case InstallResultStatus::BlockedByPolicy: + // See installResult.ExtendedErrorCode for more detail. + // This is typically caused by system configuration applied by policy. + actionData.Status(L"Blocked by policy"); + break; + case InstallResultStatus::CatalogError: + // See installResult.ExtendedErrorCode for more detail. + // This is typically an issue with an external service. + actionData.Status(L"Catalog error"); + break; + case InstallResultStatus::InternalError: + // See installResult.ExtendedErrorCode for more detail. + // This is typically an issue with the Windows Package Manager code. + actionData.Status(L"Internal error"); + break; + case InstallResultStatus::InvalidOptions: + // See installResult.ExtendedErrorCode for more detail. + // This is caused by invalid input combinations. + actionData.Status(L"Invalid options"); + break; + case InstallResultStatus::DownloadError: + // See installResult.ExtendedErrorCode for more detail. + // This is typically a transient network error. + actionData.Status(L"Download error"); + break; + case InstallResultStatus::InstallError: + // See installResult.ExtendedErrorCode and installResult.InstallerErrorCode for more detail. + // This is caused by an error in the installer or an issue with the system state. + // InstallerErrorCode is the value returned by the installer technology in use for the install + // attempt and may or may not be an HRESULT. + actionData.Status(L"Installation error"); + break; + case InstallResultStatus::ManifestError: + // See installResult.ExtendedErrorCode for more detail. + // This is an issue with the catalog providing the package. + actionData.Status(L"Manifest error"); + break; + case InstallResultStatus::NoApplicableInstallers: + // No applicable installers were available due the combination of the current system, + // user settings, and parameters provided to the install request. + actionData.Status(L"No applicable installers"); + break; + case InstallResultStatus::NoApplicableUpgrade: + // No upgrade was available due the combination of available versions, the current system, + // user settings, and parameters provided to the upgrade request. + actionData.Status(L"No applicable upgrade"); + break; + case InstallResultStatus::PackageAgreementsNotAccepted: + // The user has not accepted the agreements required by the package. + actionData.Status(L"Package agreements not accepted"); + break; + } + } + + // Switch back to ui thread context. + co_await winrt::resume_foreground(actionData.Dispatcher()); + + progressBar.IsIndeterminate(false); + + actionData.Finalize(); + } + + IAsyncAction MainPage::DownloadAsync() + { + hstring downloadDirectory = downloadDirectoryTextBox().Text(); + PackageManager packageManager = m_packageManager; + CatalogPackage package = m_package; + auto progressBar = operationProgressBar(); + auto statusText = operationStatusText(); + + BackgroundActionData actionData{ { installButton(), upgradeButton(), downloadButton() }, { cancelButton() }, statusText}; + + co_await winrt::resume_background(); + + Windows::Foundation::IAsyncOperationWithProgress packageOperation; + + actionData.RunAndCatchStatus(L"Begin download", [&]() { + DownloadOptions downloadOptions; + + if (!downloadDirectory.empty()) + { + downloadOptions.DownloadDirectory(downloadDirectory); + } + + packageOperation = packageManager.DownloadPackageAsync(package, downloadOptions); + }); + + actionData.Dispatcher().RunAsync(Windows::UI::Core::CoreDispatcherPriority::Normal, + [packageOperation, this]() { m_packageOperation = packageOperation; }); + + actionData.RunAndCatchStatus(L"Set progress handler", [&]() { + packageOperation.Progress([&]( + IAsyncOperationWithProgress const& /* sender */, + PackageDownloadProgress const& progress) + { + actionData.Dispatcher().RunAsync(Windows::UI::Core::CoreDispatcherPriority::Normal, + [progressBar, statusText, progress]() { + progressBar.Value(progress.DownloadProgress * 100); + + switch (progress.State) + { + case PackageDownloadProgressState::Queued: + statusText.Text(L"Queued"); + break; + case PackageDownloadProgressState::Downloading: + { + std::wstring downloadText{ L"Downloaded " }; + downloadText += MakeCompactByteString(progress.BytesDownloaded) + L" of " + MakeCompactByteString(progress.BytesRequired); + statusText.Text(downloadText); + } + break; + case PackageDownloadProgressState::Finished: + statusText.Text(L"Done"); + progressBar.IsIndeterminate(false); + break; + default: + statusText.Text(L""); + } + }); + }); + }); + + DownloadResult downloadResult{ nullptr }; + + actionData.RunAndCatchStatus(L"Download", [&]() { + downloadResult = packageOperation.get(); + }); + + if (packageOperation && packageOperation.Status() == AsyncStatus::Canceled) + { + actionData.Status(L"Cancelled"); + } + else if (downloadResult) + { + // Error handling for the downloadResult is done by first examining the Status. + // Any status value other than Ok will have additional error detail in the + // ExtendedErrorCode property. This HRESULT value will typically (but not always) + // have the Windows Package Manager facility value (0xA15). The symbolic names and + // meanings of these error codes can be found at: + // https://github.com/microsoft/winget-cli/blob/master/doc/windows/package-manager/winget/returnCodes.md + // or by using the winget CLI: + // > winget error 0x8A150049 + // > winget error -- -2146762487 + switch (downloadResult.Status()) + { + case DownloadResultStatus::Ok: + actionData.Status(L"Done"); + break; + case DownloadResultStatus::BlockedByPolicy: + // See installResult.ExtendedErrorCode for more detail. + // This is typically caused by system configuration applied by policy. + actionData.Status(L"Blocked by policy"); + break; + case DownloadResultStatus::CatalogError: + // See installResult.ExtendedErrorCode for more detail. + // This is typically an issue with an external service. + actionData.Status(L"Catalog error"); + break; + case DownloadResultStatus::InternalError: + // See installResult.ExtendedErrorCode for more detail. + // This is typically an issue with the Windows Package Manager code. + actionData.Status(L"Internal error"); + break; + case DownloadResultStatus::InvalidOptions: + // See installResult.ExtendedErrorCode for more detail. + // This is caused by invalid input combinations. + actionData.Status(L"Invalid options"); + break; + case DownloadResultStatus::DownloadError: + // See installResult.ExtendedErrorCode for more detail. + // This is typically a transient network error. + actionData.Status(L"Download error"); + break; + case DownloadResultStatus::ManifestError: + // See installResult.ExtendedErrorCode for more detail. + // This is an issue with the catalog providing the package. + actionData.Status(L"Manifest error"); + break; + case DownloadResultStatus::NoApplicableInstallers: + // No applicable installers were available due the combination of the current system, + // user settings, and parameters provided to the install request. + actionData.Status(L"No applicable installers"); + break; + case DownloadResultStatus::PackageAgreementsNotAccepted: + // The user has not accepted the agreements required by the package. + actionData.Status(L"Package agreements not accepted"); + break; + } + } + + // Switch back to ui thread context. + co_await winrt::resume_foreground(actionData.Dispatcher()); + + progressBar.IsIndeterminate(false); + + actionData.Finalize(); + } + + IAsyncAction MainPage::GetInstalledPackagesAsync() + { + BackgroundActionData actionData{ { refreshInstalledButton() }, installedStatusText() }; + + co_await winrt::resume_background(); + + actionData.Status(EnsurePackageManager()); + + PackageCatalog catalog{ nullptr }; + + actionData.RunAndCatchStatus(L"Connect installed catalog", [&]() { + PackageCatalogReference catalogReference = m_packageManager.GetLocalPackageCatalog(LocalPackageCatalog::InstalledPackages); + ConnectResult connectResult{ catalogReference.Connect() }; + + switch (connectResult.Status()) + { + case ConnectResultStatus::Ok: break; + case ConnectResultStatus::CatalogError: throw std::exception{ "Catalog connection error." }; + } + + catalog = connectResult.PackageCatalog(); + }); + + winrt::IVectorView matches; + + actionData.RunAndCatchStatus(L"Find package", [&]() { + FindPackagesOptions findPackagesOptions; + FindPackagesResult findPackagesResult = catalog.FindPackages(findPackagesOptions); + + matches = findPackagesResult.Matches(); + }); + + co_await winrt::resume_foreground(actionData.Dispatcher()); + + m_installedPackages.Clear(); + + if (matches) + { + for (auto const& match : matches) + { + m_installedPackages.Append(match.CatalogPackage()); + } + } + + actionData.Finalize(); + } + + IAsyncAction MainPage::UninstallAsync() + { + PackageManager packageManager = m_packageManager; + + auto progressBar = uninstallProgressBar(); + auto statusText = uninstallStatusText(); + + IInspectable selectedValue = installedListBox().SelectedValue(); + CatalogPackage package{ nullptr }; + if (selectedValue) + { + package = selectedValue.as(); + } + else + { + statusText.Text(L"Select a package to uninstall"); + co_return; + } + + BackgroundActionData actionData{ { uninstallButton() }, statusText }; + + co_await winrt::resume_background(); + + Windows::Foundation::IAsyncOperationWithProgress packageOperation; + + actionData.RunAndCatchStatus(L"Begin uninstall", [&]() { + UninstallOptions uninstallOptions; + + uninstallOptions.PackageUninstallScope(PackageUninstallScope::Any); + uninstallOptions.PackageUninstallMode(PackageUninstallMode::Silent); + + packageOperation = packageManager.UninstallPackageAsync(package, uninstallOptions); + }); + + actionData.RunAndCatchStatus(L"Set progress handler", [&]() { + packageOperation.Progress([&]( + IAsyncOperationWithProgress const& /* sender */, + UninstallProgress const& progress) + { + actionData.Dispatcher().RunAsync(Windows::UI::Core::CoreDispatcherPriority::Normal, + [progressBar, statusText, progress]() { + progressBar.Value(progress.UninstallationProgress * 100); + + switch (progress.State) + { + case PackageUninstallProgressState::Queued: + statusText.Text(L"Queued"); + break; + case PackageUninstallProgressState::Uninstalling: + statusText.Text(L"Uninstaller running"); + progressBar.IsIndeterminate(true); + break; + case PackageUninstallProgressState::PostUninstall: + statusText.Text(L"Post uninstall bookkeeping"); + break; + case PackageUninstallProgressState::Finished: + statusText.Text(L"Done"); + progressBar.IsIndeterminate(false); + break; + default: + statusText.Text(L""); + } + }); + }); + }); + + UninstallResult uninstallResult{ nullptr }; + + actionData.RunAndCatchStatus(L"Uninstall", [&]() { + uninstallResult = packageOperation.get(); + }); + + if (packageOperation && packageOperation.Status() == AsyncStatus::Canceled) + { + actionData.Status(L"Cancelled"); + } + else if (uninstallResult) + { + // Error handling for the installResult is done by first examining the Status. + // Any status value other than Ok will have additional error detail in the + // ExtendedErrorCode property. This HRESULT value will typically (but not always) + // have the Windows Package Manager facility value (0xA15). The symbolic names and + // meanings of these error codes can be found at: + // https://github.com/microsoft/winget-cli/blob/master/doc/windows/package-manager/winget/returnCodes.md + // or by using the winget CLI: + // > winget error 0x8A150049 + // > winget error -- -2146762487 + switch (uninstallResult.Status()) + { + case UninstallResultStatus::Ok: + actionData.Status(uninstallResult.RebootRequired() ? L"Reboot required" : L"Done"); + break; + case UninstallResultStatus::BlockedByPolicy: + // See installResult.ExtendedErrorCode for more detail. + // This is typically caused by system configuration applied by policy. + actionData.Status(L"Blocked by policy"); + break; + case UninstallResultStatus::CatalogError: + // See installResult.ExtendedErrorCode for more detail. + // This is typically an issue with an external service. + actionData.Status(L"Catalog error"); + break; + case UninstallResultStatus::InternalError: + // See installResult.ExtendedErrorCode for more detail. + // This is typically an issue with the Windows Package Manager code. + actionData.Status(L"Internal error"); + break; + case UninstallResultStatus::InvalidOptions: + // See installResult.ExtendedErrorCode for more detail. + // This is caused by invalid input combinations. + actionData.Status(L"Invalid options"); + break; + case UninstallResultStatus::UninstallError: + // See installResult.ExtendedErrorCode and installResult.UninstallerErrorCode for more detail. + // This is caused by an error in the uninstaller or an issue with the system state. + // UninstallerErrorCode is the value returned by the uninstaller technology in use for the uninstall + // attempt and may or may not be an HRESULT. + actionData.Status(L"Uninstallation error"); + break; + case UninstallResultStatus::ManifestError: + // See installResult.ExtendedErrorCode for more detail. + // This is an issue with the catalog providing the package. + actionData.Status(L"Manifest error"); + break; + } + } + + // Switch back to ui thread context. + co_await winrt::resume_foreground(actionData.Dispatcher()); + + progressBar.IsIndeterminate(false); + + actionData.Finalize(); + } + + IAsyncAction MainPage::GetActivePackagesAsync() + { + BackgroundActionData actionData{ { activeRefreshButton() }, activeStatusText() }; + + co_await winrt::resume_background(); + + actionData.Status(EnsurePackageManager()); + + PackageCatalog catalog{ nullptr }; + + actionData.RunAndCatchStatus(L"Connect installed catalog", [&]() { + PackageCatalogReference catalogReference = m_packageManager.GetLocalPackageCatalog(LocalPackageCatalog::InstallingPackages); + ConnectResult connectResult{ catalogReference.Connect() }; + + switch (connectResult.Status()) + { + case ConnectResultStatus::Ok: break; + case ConnectResultStatus::CatalogError: throw std::exception{ "Catalog connection error." }; + } + + catalog = connectResult.PackageCatalog(); + }); + + winrt::IVectorView matches; + + actionData.RunAndCatchStatus(L"Find package", [&]() { + FindPackagesOptions findPackagesOptions; + FindPackagesResult findPackagesResult = catalog.FindPackages(findPackagesOptions); + + matches = findPackagesResult.Matches(); + }); + + co_await winrt::resume_foreground(actionData.Dispatcher()); + + m_activePackageViews.Clear(); + + if (matches) + { + for (auto const& match : matches) + { + WinGetUWPCaller::ActivePackageView activeView; + activeView.Package(match.CatalogPackage()); + auto installOperation = m_packageManager.GetInstallProgress(activeView.Package(), nullptr); + if (installOperation) + { + activeView.Dispatcher(actionData.Dispatcher()); + activeView.AsyncOperation(installOperation); + m_activePackageViews.Append(activeView); + } + } + } + + actionData.Finalize(); + } +} diff --git a/samples/WinGetUWPCaller/WinGetUWPCaller/MainPage.h b/samples/WinGetUWPCaller/WinGetUWPCaller/MainPage.h new file mode 100644 index 0000000000..2debcad2ef --- /dev/null +++ b/samples/WinGetUWPCaller/WinGetUWPCaller/MainPage.h @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +#pragma once +#include "MainPage.g.h" +#include "ActivePackageView.h" +#include +#include + +namespace Deployment = winrt::Microsoft::Management::Deployment; + +namespace winrt::WinGetUWPCaller::implementation +{ + struct MainPage : MainPageT + { + MainPage(); + + Windows::Foundation::Collections::IObservableVector PackageCatalogs(); + Windows::Foundation::Collections::IObservableVector InstalledPackages(); + Windows::Foundation::Collections::IObservableVector ActivePackages(); + + // Select Catalog(s) section + void LoadCatalogsButtonClickHandler(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& args); + void CatalogSelectionChangedHandler(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& args); + + // Package Operations section + void SearchButtonClickHandler(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& args); + void InstallButtonClickHandler(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& args); + void UpgradeButtonClickHandler(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& args); + void DownloadButtonClickHandler(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& args); + void CancelButtonClickHandler(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& args); + + // Installed Packages section + void RefreshInstalledButtonClickHandler(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& args); + void UninstallButtonClickHandler(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& args); + + // Active Operations section + void RefreshActiveButtonClickHandler(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& args); + + private: + // Ensures that the package manager object exists; potentially recreating it if requested. + // Should be called from a background thread. + // Is thread-safe. + // Returns an error string if it fails. + std::wstring EnsurePackageManager(bool forceRecreate = false); + + // Select Catalog(s) section + Windows::Foundation::IAsyncAction LoadCatalogsAsync(); + + // Package Operations section + Windows::Foundation::IAsyncAction FindPackageAsync(); + Windows::Foundation::IAsyncAction InstallOrUpgradeAsync(bool upgrade); + Windows::Foundation::IAsyncAction DownloadAsync(); + + // Installed Packages section + Windows::Foundation::IAsyncAction GetInstalledPackagesAsync(); + Windows::Foundation::IAsyncAction UninstallAsync(); + + // Active Operations section + Windows::Foundation::IAsyncAction GetActivePackagesAsync(); + + // Member fields + Windows::Foundation::Collections::IObservableVector m_packageCatalogs; + Windows::Foundation::Collections::IObservableVector m_installedPackages; + Windows::Foundation::Collections::IObservableVector m_activePackageViews; + + std::mutex m_packageManagerMutex; + Deployment::PackageManager m_packageManager{ nullptr }; + Deployment::PackageCatalog m_catalog{ nullptr }; + Deployment::CatalogPackage m_package{ nullptr }; + Windows::Foundation::IAsyncInfo m_packageOperation; + }; +} + +namespace winrt::WinGetUWPCaller::factory_implementation +{ + struct MainPage : MainPageT + { + }; +} diff --git a/samples/WinGetUWPCaller/WinGetUWPCaller/MainPage.idl b/samples/WinGetUWPCaller/WinGetUWPCaller/MainPage.idl new file mode 100644 index 0000000000..39e8ac0a62 --- /dev/null +++ b/samples/WinGetUWPCaller/WinGetUWPCaller/MainPage.idl @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +namespace WinGetUWPCaller +{ + [default_interface] + runtimeclass ActivePackageView : Windows.UI.Xaml.Data.INotifyPropertyChanged + { + ActivePackageView(); + + Microsoft.Management.Deployment.CatalogPackage Package; + Windows.Foundation.IAsyncOperationWithProgress AsyncOperation; + Double Progress; + String StatusText; + Windows.UI.Core.CoreDispatcher Dispatcher; + } + + [default_interface] + runtimeclass MainPage : Windows.UI.Xaml.Controls.Page + { + MainPage(); + + Windows.Foundation.Collections.IObservableVector PackageCatalogs{ get; }; + Windows.Foundation.Collections.IObservableVector InstalledPackages{ get; }; + Windows.Foundation.Collections.IObservableVector ActivePackages{ get; }; + } + + declare + { + interface Windows.Foundation.Collections.IVector; + interface Windows.Foundation.Collections.IVectorView; + } +} diff --git a/samples/WinGetUWPCaller/WinGetUWPCaller/MainPage.xaml b/samples/WinGetUWPCaller/WinGetUWPCaller/MainPage.xaml new file mode 100644 index 0000000000..3282556f19 --- /dev/null +++ b/samples/WinGetUWPCaller/WinGetUWPCaller/MainPage.xaml @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + Select Catalog(s) + + + + Select catalog(s) to use + + + + + + + + + + + Package Operations + Search for a package from the selected catalog(s) and take action on it. + + + + + + + + + + + + + + + + + + + + + + + + + + Installed Packages + View installed package information + + + + + + + + + + + + + + + + + Active Operations + View active package install/upgrade operations + + + + + + + + + + + + + + + + + + diff --git a/samples/WinGetUWPCaller/WinGetUWPCaller/Package.appxmanifest b/samples/WinGetUWPCaller/WinGetUWPCaller/Package.appxmanifest new file mode 100644 index 0000000000..a4f2653665 --- /dev/null +++ b/samples/WinGetUWPCaller/WinGetUWPCaller/Package.appxmanifest @@ -0,0 +1,31 @@ + + + + + + Sample WinGet Caller + Microsoft Corporation + Assets\StoreLogo.png + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/samples/WinGetUWPCaller/WinGetUWPCaller/WinGetUWPCaller.vcxproj b/samples/WinGetUWPCaller/WinGetUWPCaller/WinGetUWPCaller.vcxproj new file mode 100644 index 0000000000..421c70452a --- /dev/null +++ b/samples/WinGetUWPCaller/WinGetUWPCaller/WinGetUWPCaller.vcxproj @@ -0,0 +1,204 @@ + + + + + true + true + true + true + {37f1fd2a-4d63-45a0-82aa-66ef126cb322} + WinGetUWPCaller + WinGetUWPCaller + en-US + 15.0 + true + Windows Store + 10.0 + 10.0.22000.0 + 10.0.17763.0 + + + + + Debug + ARM64 + + + Debug + Win32 + + + Debug + x64 + + + Release + ARM64 + + + Release + Win32 + + + Release + x64 + + + + Application + v140 + v141 + v142 + v143 + Unicode + + + true + true + + + false + true + false + + + + + + + + + False + SHA256 + True + True + x64 + 0 + Always + + + + Use + pch.h + $(IntDir)pch.pch + Level4 + %(AdditionalOptions) /bigobj + + /DWINRT_NO_MAKE_DETECTION %(AdditionalOptions) + + + WIN32_LEAN_AND_MEAN;WINRT_LEAN_AND_MEAN;%(PreprocessorDefinitions) + + + false + + + + + _DEBUG;%(PreprocessorDefinitions) + + + + + + + + + NDEBUG;%(PreprocessorDefinitions) + + + true + true + + + + + + + + + + + App.xaml + + + MainPage.xaml + + + + + Designer + + + Designer + + + + + Designer + + + + + + + + + + + + + + + Create + + + App.xaml + + + MainPage.xaml + + + + + + App.xaml + + + MainPage.xaml + + + + + + + + win10-x86 + win10-x64 + win10-arm64 + + + + Microsoft.Management.Deployment.dll + + + + + + ..\packages\Microsoft.WindowsPackageManager.ComInterop.1.8.1911\lib\Microsoft.Management.Deployment.winmd + true + Microsoft.Management.Deployment.dll + + + + + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + \ No newline at end of file diff --git a/samples/WinGetUWPCaller/WinGetUWPCaller/WinGetUWPCaller.vcxproj.filters b/samples/WinGetUWPCaller/WinGetUWPCaller/WinGetUWPCaller.vcxproj.filters new file mode 100644 index 0000000000..5d42a428ca --- /dev/null +++ b/samples/WinGetUWPCaller/WinGetUWPCaller/WinGetUWPCaller.vcxproj.filters @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + Assets + + + Assets + + + Assets + + + Assets + + + Assets + + + Assets + + + Assets + + + + + + + + + + + {adeebf4e-70b7-41ae-936b-ded00e6e6777} + + + \ No newline at end of file diff --git a/samples/WinGetUWPCaller/WinGetUWPCaller/packages.config b/samples/WinGetUWPCaller/WinGetUWPCaller/packages.config new file mode 100644 index 0000000000..d716d962e4 --- /dev/null +++ b/samples/WinGetUWPCaller/WinGetUWPCaller/packages.config @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/samples/WinGetUWPCaller/WinGetUWPCaller/pch.cpp b/samples/WinGetUWPCaller/WinGetUWPCaller/pch.cpp new file mode 100644 index 0000000000..e4b1bd6915 --- /dev/null +++ b/samples/WinGetUWPCaller/WinGetUWPCaller/pch.cpp @@ -0,0 +1,3 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +#include "pch.h" diff --git a/samples/WinGetUWPCaller/WinGetUWPCaller/pch.h b/samples/WinGetUWPCaller/WinGetUWPCaller/pch.h new file mode 100644 index 0000000000..ad1bd05d51 --- /dev/null +++ b/samples/WinGetUWPCaller/WinGetUWPCaller/pch.h @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +#pragma once +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include diff --git a/schemas/JSON/manifests/v1.9.0/manifest.defaultLocale.1.9.0.json b/schemas/JSON/manifests/v1.9.0/manifest.defaultLocale.1.9.0.json new file mode 100644 index 0000000000..2aa7a504ab --- /dev/null +++ b/schemas/JSON/manifests/v1.9.0/manifest.defaultLocale.1.9.0.json @@ -0,0 +1,278 @@ +{ + "$id": "https://aka.ms/winget-manifest.defaultlocale.1.9.0.schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "description": "A representation of a multiple-file manifest representing a default app metadata in the OWC. v1.9.0", + "definitions": { + "Url": { + "type": [ "string", "null" ], + "pattern": "^([Hh][Tt][Tt][Pp][Ss]?)://.+$", + "maxLength": 2048, + "description": "Optional Url type" + }, + "Tag": { + "type": [ "string", "null" ], + "minLength": 1, + "maxLength": 40, + "description": "Package moniker or tag" + }, + "Agreement": { + "type": "object", + "properties": { + "AgreementLabel": { + "type": [ "string", "null" ], + "minLength": 1, + "maxLength": 100, + "description": "The label of the Agreement. i.e. EULA, AgeRating, etc. This field should be localized. Either Agreement or AgreementUrl is required. When we show the agreements, we would Bold the AgreementLabel" + }, + "Agreement": { + "type": [ "string", "null" ], + "minLength": 1, + "maxLength": 10000, + "description": "The agreement text content." + }, + "AgreementUrl": { + "$ref": "#/definitions/Url", + "description": "The agreement URL." + } + } + }, + "Documentation": { + "type": "object", + "properties": { + "DocumentLabel": { + "type": [ "string", "null" ], + "minLength": 1, + "maxLength": 100, + "description": "The label of the documentation for providing software guides such as manuals and troubleshooting URLs." + }, + "DocumentUrl": { + "$ref": "#/definitions/Url", + "description": "The documentation URL." + } + } + }, + "Icon": { + "type": "object", + "properties": { + "IconUrl": { + "$ref": "#/definitions/Url", + "description": "The url of the hosted icon file" + }, + "IconFileType": { + "type": "string", + "enum": [ + "png", + "jpeg", + "ico" + ], + "description": "The icon file type" + }, + "IconResolution": { + "type": [ "string", "null" ], + "enum": [ + "custom", + "16x16", + "20x20", + "24x24", + "30x30", + "32x32", + "36x36", + "40x40", + "48x48", + "60x60", + "64x64", + "72x72", + "80x80", + "96x96", + "256x256" + ], + "description": "Optional icon resolution" + }, + "IconTheme": { + "type": [ "string", "null" ], + "enum": [ + "default", + "light", + "dark", + "highContrast" + ], + "description": "Optional icon theme" + }, + "IconSha256": { + "type": [ "string", "null" ], + "pattern": "^[A-Fa-f0-9]{64}$", + "description": "Optional Sha256 of the icon file" + } + }, + "required": [ + "IconUrl", + "IconFileType" + ] + } + }, + "type": "object", + "properties": { + "PackageIdentifier": { + "type": "string", + "pattern": "^[^\\.\\s\\\\/:\\*\\?\"<>\\|\\x01-\\x1f]{1,32}(\\.[^\\.\\s\\\\/:\\*\\?\"<>\\|\\x01-\\x1f]{1,32}){1,7}$", + "maxLength": 128, + "description": "The package unique identifier" + }, + "PackageVersion": { + "type": "string", + "pattern": "^[^\\\\/:\\*\\?\"<>\\|\\x01-\\x1f]+$", + "maxLength": 128, + "description": "The package version" + }, + "PackageLocale": { + "type": "string", + "default": "en-US", + "pattern": "^([a-zA-Z]{2,3}|[iI]-[a-zA-Z]+|[xX]-[a-zA-Z]{1,8})(-[a-zA-Z]{1,8})*$", + "maxLength": 20, + "description": "The package meta-data locale" + }, + "Publisher": { + "type": "string", + "minLength": 2, + "maxLength": 256, + "description": "The publisher name" + }, + "PublisherUrl": { + "$ref": "#/definitions/Url", + "description": "The publisher home page" + }, + "PublisherSupportUrl": { + "$ref": "#/definitions/Url", + "description": "The publisher support page" + }, + "PrivacyUrl": { + "$ref": "#/definitions/Url", + "description": "The publisher privacy page or the package privacy page" + }, + "Author": { + "type": [ "string", "null" ], + "minLength": 2, + "maxLength": 256, + "description": "The package author" + }, + "PackageName": { + "type": "string", + "minLength": 2, + "maxLength": 256, + "description": "The package name" + }, + "PackageUrl": { + "$ref": "#/definitions/Url", + "description": "The package home page" + }, + "License": { + "type": "string", + "minLength": 3, + "maxLength": 512, + "description": "The package license" + }, + "LicenseUrl": { + "$ref": "#/definitions/Url", + "description": "The license page" + }, + "Copyright": { + "type": [ "string", "null" ], + "minLength": 3, + "maxLength": 512, + "description": "The package copyright" + }, + "CopyrightUrl": { + "$ref": "#/definitions/Url", + "description": "The package copyright page" + }, + "ShortDescription": { + "type": "string", + "minLength": 3, + "maxLength": 256, + "description": "The short package description" + }, + "Description": { + "type": [ "string", "null" ], + "minLength": 3, + "maxLength": 10000, + "description": "The full package description" + }, + "Moniker": { + "$ref": "#/definitions/Tag", + "description": "The most common package term" + }, + "Tags": { + "type": [ "array", "null" ], + "items": { + "$ref": "#/definitions/Tag" + }, + "maxItems": 16, + "uniqueItems": true, + "description": "List of additional package search terms" + }, + "Agreements": { + "type": [ "array", "null" ], + "items": { + "$ref": "#/definitions/Agreement" + }, + "maxItems": 128 + }, + "ReleaseNotes": { + "type": [ "string", "null" ], + "minLength": 1, + "maxLength": 10000, + "description": "The package release notes" + }, + "ReleaseNotesUrl": { + "$ref": "#/definitions/Url", + "description": "The package release notes url" + }, + "PurchaseUrl": { + "$ref": "#/definitions/Url", + "description": "The purchase url for acquiring entitlement for the package." + }, + "InstallationNotes": { + "type": [ "string", "null" ], + "minLength": 1, + "maxLength": 10000, + "description": "The notes displayed to the user upon completion of a package installation." + }, + "Documentations": { + "type": [ "array", "null" ], + "items": { + "$ref": "#/definitions/Documentation" + }, + "maxItems": 256 + }, + "Icons": { + "type": [ "array", "null" ], + "items": { + "$ref": "#/definitions/Icon" + }, + "maxItems": 1024 + }, + "ManifestType": { + "type": "string", + "default": "defaultLocale", + "const": "defaultLocale", + "description": "The manifest type" + }, + "ManifestVersion": { + "type": "string", + "default": "1.9.0", + "pattern": "^(0|[1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])(\\.(0|[1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])){2}$", + "description": "The manifest syntax version" + } + }, + "required": [ + "PackageIdentifier", + "PackageVersion", + "PackageLocale", + "Publisher", + "PackageName", + "License", + "ShortDescription", + "ManifestType", + "ManifestVersion" + ] +} \ No newline at end of file diff --git a/schemas/JSON/manifests/v1.9.0/manifest.installer.1.9.0.json b/schemas/JSON/manifests/v1.9.0/manifest.installer.1.9.0.json new file mode 100644 index 0000000000..a5b00edc5e --- /dev/null +++ b/schemas/JSON/manifests/v1.9.0/manifest.installer.1.9.0.json @@ -0,0 +1,876 @@ +{ + "$id": "https://aka.ms/winget-manifest.installer.1.9.0.schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "description": "A representation of a single-file manifest representing an app installers in the OWC. v1.9.0", + "definitions": { + "PackageIdentifier": { + "type": "string", + "pattern": "^[^\\.\\s\\\\/:\\*\\?\"<>\\|\\x01-\\x1f]{1,32}(\\.[^\\.\\s\\\\/:\\*\\?\"<>\\|\\x01-\\x1f]{1,32}){1,7}$", + "maxLength": 128, + "description": "The package unique identifier" + }, + "PackageVersion": { + "type": "string", + "pattern": "^[^\\\\/:\\*\\?\"<>\\|\\x01-\\x1f]+$", + "maxLength": 128, + "description": "The package version" + }, + "Locale": { + "type": [ "string", "null" ], + "pattern": "^([a-zA-Z]{2,3}|[iI]-[a-zA-Z]+|[xX]-[a-zA-Z]{1,8})(-[a-zA-Z]{1,8})*$", + "maxLength": 20, + "description": "The installer meta-data locale" + }, + "Channel": { + "type": [ "string", "null" ], + "minLength": 1, + "maxLength": 16, + "description": "The distribution channel" + }, + "Platform": { + "type": [ "array", "null" ], + "items": { + "title": "Platform", + "type": "string", + "enum": [ + "Windows.Desktop", + "Windows.Universal" + ] + }, + "maxItems": 2, + "uniqueItems": true, + "description": "The installer supported operating system" + }, + "MinimumOSVersion": { + "type": [ "string", "null" ], + "pattern": "^(0|[1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])(\\.(0|[1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])){0,3}$", + "description": "The installer minimum operating system version" + }, + "Url": { + "type": [ "string", "null" ], + "pattern": "^([Hh][Tt][Tt][Pp][Ss]?)://.+$", + "maxLength": 2048, + "description": "Url type" + }, + "InstallerType": { + "type": [ "string", "null" ], + "enum": [ + "msix", + "msi", + "appx", + "exe", + "zip", + "inno", + "nullsoft", + "wix", + "burn", + "pwa", + "portable" + ], + "description": "Enumeration of supported installer types. InstallerType is required in either root level or individual Installer level" + }, + "NestedInstallerType": { + "type": [ "string", "null" ], + "enum": [ + "msix", + "msi", + "appx", + "exe", + "inno", + "nullsoft", + "wix", + "burn", + "portable" + ], + "description": "Enumeration of supported nested installer types contained inside an archive file" + }, + "NestedInstallerFiles": { + "type": [ "array", "null" ], + "items": { + "type": "object", + "title": "NestedInstallerFile", + "properties": { + "RelativeFilePath": { + "type": "string", + "minLength": 1, + "maxLength": 512, + "description": "The relative path to the nested installer file" + }, + "PortableCommandAlias": { + "type": [ "string", "null" ], + "minLength": 1, + "maxLength": 40, + "description": "The command alias to be used for calling the package. Only applies to the nested portable package" + } + }, + "required": [ "RelativeFilePath" ], + "description": "A nested installer file contained inside an archive" + }, + "maxItems": 1024, + "description": "List of nested installer files contained inside an archive" + }, + "Architecture": { + "type": "string", + "enum": [ + "x86", + "x64", + "arm", + "arm64", + "neutral" + ], + "description": "The installer target architecture" + }, + "Scope": { + "type": [ "string", "null" ], + "enum": [ + "user", + "machine" + ], + "description": "Scope indicates if the installer is per user or per machine" + }, + "InstallModes": { + "type": [ "array", "null" ], + "items": { + "title": "InstallModes", + "type": "string", + "enum": [ + "interactive", + "silent", + "silentWithProgress" + ] + }, + "maxItems": 3, + "uniqueItems": true, + "description": "List of supported installer modes" + }, + "InstallerSwitches": { + "type": "object", + "properties": { + "Silent": { + "type": [ "string", "null" ], + "minLength": 1, + "maxLength": 512, + "description": "Silent is the value that should be passed to the installer when user chooses a silent or quiet install" + }, + "SilentWithProgress": { + "type": [ "string", "null" ], + "minLength": 1, + "maxLength": 512, + "description": "SilentWithProgress is the value that should be passed to the installer when user chooses a non-interactive install" + }, + "Interactive": { + "type": [ "string", "null" ], + "minLength": 1, + "maxLength": 512, + "description": "Interactive is the value that should be passed to the installer when user chooses an interactive install" + }, + "InstallLocation": { + "type": [ "string", "null" ], + "minLength": 1, + "maxLength": 512, + "description": "InstallLocation is the value passed to the installer for custom install location. token can be included in the switch value so that winget will replace the token with user provided path" + }, + "Log": { + "type": [ "string", "null" ], + "minLength": 1, + "maxLength": 512, + "description": "Log is the value passed to the installer for custom log file path. token can be included in the switch value so that winget will replace the token with user provided path" + }, + "Upgrade": { + "type": [ "string", "null" ], + "minLength": 1, + "maxLength": 512, + "description": "Upgrade is the value that should be passed to the installer when user chooses an upgrade" + }, + "Custom": { + "type": [ "string", "null" ], + "minLength": 1, + "maxLength": 2048, + "description": "Custom switches will be passed directly to the installer by winget" + }, + "Repair": { + "type": [ "string", "null" ], + "minLength": 1, + "maxLength": 512, + "description": "The 'Repair' value must be passed to the installer, ModifyPath ARP command, or uninstaller ARP command when the user opts for a repair." + } + } + }, + "InstallerReturnCode": { + "type": "integer", + "format": "long", + "not": { + "enum": [ 0 ] + }, + "minimum": -2147483648, + "maximum": 4294967295, + "description": "An exit code that can be returned by the installer after execution" + }, + "InstallerSuccessCodes": { + "type": [ "array", "null" ], + "items": { + "$ref": "#/definitions/InstallerReturnCode" + }, + "maxItems": 16, + "uniqueItems": true, + "description": "List of additional non-zero installer success exit codes other than known default values by winget" + }, + "ExpectedReturnCodes": { + "type": [ "array", "null" ], + "items": { + "type": "object", + "title": "ExpectedReturnCode", + "properties": { + "InstallerReturnCode": { + "$ref": "#/definitions/InstallerReturnCode" + }, + "ReturnResponse": { + "type": "string", + "enum": [ + "packageInUse", + "packageInUseByApplication", + "installInProgress", + "fileInUse", + "missingDependency", + "diskFull", + "insufficientMemory", + "invalidParameter", + "noNetwork", + "contactSupport", + "rebootRequiredToFinish", + "rebootRequiredForInstall", + "rebootInitiated", + "cancelledByUser", + "alreadyInstalled", + "downgrade", + "blockedByPolicy", + "systemNotSupported", + "custom" + ] + }, + "ReturnResponseUrl": { + "$ref": "#/definitions/Url", + "description": "The return response url to provide additional guidance for expected return codes" + } + } + }, + "maxItems": 128, + "description": "Installer exit codes for common errors" + }, + "UpgradeBehavior": { + "type": [ "string", "null" ], + "enum": [ + "install", + "uninstallPrevious", + "deny" + ], + "description": "The upgrade method" + }, + "Commands": { + "type": [ "array", "null" ], + "items": { + "type": "string", + "minLength": 1, + "maxLength": 40 + }, + "maxItems": 16, + "uniqueItems": true, + "description": "List of commands or aliases to run the package" + }, + "Protocols": { + "type": [ "array", "null" ], + "items": { + "type": "string", + "maxLength": 2048 + }, + "maxItems": 64, + "uniqueItems": true, + "description": "List of protocols the package provides a handler for" + }, + "FileExtensions": { + "type": [ "array", "null" ], + "items": { + "type": "string", + "pattern": "^[^\\\\/:\\*\\?\"<>\\|\\x01-\\x1f]+$", + "maxLength": 64 + }, + "maxItems": 512, + "uniqueItems": true, + "description": "List of file extensions the package could support" + }, + "Dependencies": { + "type": [ "object", "null" ], + "properties": { + "WindowsFeatures": { + "type": [ "array", "null" ], + "items": { + "type": "string", + "minLength": 1, + "maxLength": 128 + }, + "maxItems": 16, + "uniqueItems": true, + "description": "List of Windows feature dependencies" + }, + "WindowsLibraries": { + "type": [ "array", "null" ], + "items": { + "type": "string", + "minLength": 1, + "maxLength": 128 + }, + "maxItems": 16, + "uniqueItems": true, + "description": "List of Windows library dependencies" + }, + "PackageDependencies": { + "type": [ "array", "null" ], + "items": { + "type": "object", + "properties": { + "PackageIdentifier": { + "$ref": "#/definitions/PackageIdentifier" + }, + "MinimumVersion": { + "$ref": "#/definitions/PackageVersion" + } + }, + "required": [ "PackageIdentifier" ] + }, + "maxItems": 16, + "uniqueItems": true, + "description": "List of package dependencies from current source" + }, + "ExternalDependencies": { + "type": [ "array", "null" ], + "items": { + "type": "string", + "minLength": 1, + "maxLength": 128 + }, + "maxItems": 16, + "uniqueItems": true, + "description": "List of external package dependencies" + } + } + }, + "PackageFamilyName": { + "type": [ "string", "null" ], + "pattern": "^[A-Za-z0-9][-\\.A-Za-z0-9]+_[A-Za-z0-9]{13}$", + "maxLength": 255, + "description": "PackageFamilyName for appx or msix installer. Could be used for correlation of packages across sources" + }, + "ProductCode": { + "type": [ "string", "null" ], + "minLength": 1, + "maxLength": 255, + "description": "ProductCode could be used for correlation of packages across sources" + }, + "Capabilities": { + "type": [ "array", "null" ], + "items": { + "type": "string", + "minLength": 1, + "maxLength": 40 + }, + "maxItems": 1000, + "uniqueItems": true, + "description": "List of appx or msix installer capabilities" + }, + "RestrictedCapabilities": { + "type": [ "array", "null" ], + "items": { + "type": "string", + "minLength": 1, + "maxLength": 40 + }, + "maxItems": 1000, + "uniqueItems": true, + "description": "List of appx or msix installer restricted capabilities" + }, + "Market": { + "type": "string", + "pattern": "^[A-Z]{2}$", + "description": "The installer target market" + }, + "MarketArray": { + "type": [ "array", "null" ], + "uniqueItems": true, + "maxItems": 256, + "items": { + "$ref": "#/definitions/Market" + }, + "description": "Array of markets" + }, + "Markets": { + "description": "The installer markets", + "type": [ "object", "null" ], + "oneOf": [ + { + "properties": { + "AllowedMarkets": { + "$ref": "#/definitions/MarketArray" + } + }, + "required": [ "AllowedMarkets" ] + }, + { + "properties": { + "ExcludedMarkets": { + "$ref": "#/definitions/MarketArray" + } + }, + "required": [ "ExcludedMarkets" ] + } + ] + }, + "InstallerAbortsTerminal": { + "type": [ "boolean", "null" ], + "description": "Indicates whether the installer will abort terminal. Default is false" + }, + "ReleaseDate": { + "type": [ "string", "null" ], + "format": "date", + "description": "The installer release date" + }, + "InstallLocationRequired": { + "type": [ "boolean", "null" ], + "description": "Indicates whether the installer requires an install location provided" + }, + "RequireExplicitUpgrade": { + "type": [ "boolean", "null" ], + "description": "Indicates whether the installer should be pinned by default from upgrade" + }, + "DisplayInstallWarnings": { + "type": [ "boolean", "null" ], + "description": "Indicates whether winget should display a warning message if the install or upgrade is known to interfere with running applications." + }, + "UnsupportedOSArchitectures": { + "type": [ "array", "null" ], + "uniqueItems": true, + "items": { + "type": "string", + "title": "UnsupportedOSArchitecture", + "enum": [ + "x86", + "x64", + "arm", + "arm64" + ] + }, + "description": "List of OS architectures the installer does not support" + }, + "UnsupportedArguments": { + "type": [ "array", "null" ], + "uniqueItems": true, + "items": { + "type": "string", + "title": "UnsupportedArgument", + "enum": [ + "log", + "location" + ] + }, + "description": "List of winget arguments the installer does not support" + }, + "AppsAndFeaturesEntry": { + "type": "object", + "properties": { + "DisplayName": { + "type": [ "string", "null" ], + "minLength": 1, + "maxLength": 256, + "description": "The DisplayName registry value" + }, + "Publisher": { + "type": [ "string", "null" ], + "minLength": 1, + "maxLength": 256, + "description": "The Publisher registry value" + }, + "DisplayVersion": { + "type": [ "string", "null" ], + "minLength": 1, + "maxLength": 128, + "description": "The DisplayVersion registry value" + }, + "ProductCode": { + "$ref": "#/definitions/ProductCode" + }, + "UpgradeCode": { + "$ref": "#/definitions/ProductCode" + }, + "InstallerType": { + "$ref": "#/definitions/InstallerType" + } + }, + "description": "Various key values under installer's ARP entry" + }, + "AppsAndFeaturesEntries": { + "type": [ "array", "null" ], + "uniqueItems": true, + "maxItems": 128, + "items": { + "$ref": "#/definitions/AppsAndFeaturesEntry" + }, + "description": "List of ARP entries." + }, + "ElevationRequirement": { + "type": [ "string", "null" ], + "enum": [ + "elevationRequired", + "elevationProhibited", + "elevatesSelf" + ], + "description": "The installer's elevation requirement" + }, + "InstallationMetadata": { + "type": "object", + "title": "InstallationMetadata", + "properties": { + "DefaultInstallLocation": { + "type": [ "string", "null" ], + "minLength": 1, + "maxLength": 2048, + "description": "Represents the default installed package location. Used for deeper installation detection." + }, + "Files": { + "type": [ "array", "null" ], + "uniqueItems": true, + "maxItems": 2048, + "items": { + "type": "object", + "title": "InstalledFile", + "properties": { + "RelativeFilePath": { + "type": "string", + "minLength": 1, + "maxLength": 2048, + "description": "The relative path to the installed file." + }, + "FileSha256": { + "type": [ "string", "null" ], + "pattern": "^[A-Fa-f0-9]{64}$", + "description": "Optional Sha256 of the installed file." + }, + "FileType": { + "type": [ "string", "null" ], + "enum": [ + "launch", + "uninstall", + "other" + ], + "description": "The optional installed file type. If not specified, the file is treated as other." + }, + "InvocationParameter": { + "type": [ "string", "null" ], + "minLength": 1, + "maxLength": 2048, + "description": "Optional parameter for invocable files." + }, + "DisplayName": { + "type": [ "string", "null" ], + "minLength": 1, + "maxLength": 256, + "description": "Optional display name for invocable files." + } + }, + "required": [ "RelativeFilePath" ], + "description": "Represents an installed file." + }, + "description": "List of installed files." + } + }, + "description": "Details about the installation. Used for deeper installation detection." + }, + "DownloadCommandProhibited": { + "type": [ "boolean", "null" ], + "description": "Indicates whether the installer is prohibited from being downloaded for offline installation." + }, + "RepairBehavior": { + "type": [ "string", "null" ], + "enum": [ + "modify", + "uninstaller", + "installer" + ], + "description": "The repair method" + }, + "ArchiveBinariesDependOnPath": { + "type": [ "boolean", "null" ], + "description": "Indicates whether the install location should be added directly to the PATH environment variable. Only applies to an archive containing portable packages." + }, + "Installer": { + "type": "object", + "properties": { + "InstallerLocale": { + "$ref": "#/definitions/Locale" + }, + "Platform": { + "$ref": "#/definitions/Platform" + }, + "MinimumOSVersion": { + "$ref": "#/definitions/MinimumOSVersion" + }, + "Architecture": { + "$ref": "#/definitions/Architecture" + }, + "InstallerType": { + "$ref": "#/definitions/InstallerType" + }, + "NestedInstallerType": { + "$ref": "#/definitions/NestedInstallerType" + }, + "NestedInstallerFiles": { + "$ref": "#/definitions/NestedInstallerFiles" + }, + "Scope": { + "$ref": "#/definitions/Scope" + }, + "InstallerUrl": { + "type": "string", + "pattern": "^([Hh][Tt][Tt][Pp][Ss]?)://.+$", + "maxLength": 2048, + "description": "The installer Url" + }, + "InstallerSha256": { + "type": "string", + "pattern": "^[A-Fa-f0-9]{64}$", + "description": "Sha256 is required. Sha256 of the installer" + }, + "SignatureSha256": { + "type": [ "string", "null" ], + "pattern": "^[A-Fa-f0-9]{64}$", + "description": "SignatureSha256 is recommended for appx or msix. It is the sha256 of signature file inside appx or msix. Could be used during streaming install if applicable" + }, + "InstallModes": { + "$ref": "#/definitions/InstallModes" + }, + "InstallerSwitches": { + "$ref": "#/definitions/InstallerSwitches" + }, + "InstallerSuccessCodes": { + "$ref": "#/definitions/InstallerSuccessCodes" + }, + "ExpectedReturnCodes": { + "$ref": "#/definitions/ExpectedReturnCodes" + }, + "UpgradeBehavior": { + "$ref": "#/definitions/UpgradeBehavior" + }, + "Commands": { + "$ref": "#/definitions/Commands" + }, + "Protocols": { + "$ref": "#/definitions/Protocols" + }, + "FileExtensions": { + "$ref": "#/definitions/FileExtensions" + }, + "Dependencies": { + "$ref": "#/definitions/Dependencies" + }, + "PackageFamilyName": { + "$ref": "#/definitions/PackageFamilyName" + }, + "ProductCode": { + "$ref": "#/definitions/ProductCode" + }, + "Capabilities": { + "$ref": "#/definitions/Capabilities" + }, + "RestrictedCapabilities": { + "$ref": "#/definitions/RestrictedCapabilities" + }, + "Markets": { + "$ref": "#/definitions/Markets" + }, + "InstallerAbortsTerminal": { + "$ref": "#/definitions/InstallerAbortsTerminal" + }, + "ReleaseDate": { + "$ref": "#/definitions/ReleaseDate" + }, + "InstallLocationRequired": { + "$ref": "#/definitions/InstallLocationRequired" + }, + "RequireExplicitUpgrade": { + "$ref": "#/definitions/RequireExplicitUpgrade" + }, + "DisplayInstallWarnings": { + "$ref": "#/definitions/DisplayInstallWarnings" + }, + "UnsupportedOSArchitectures": { + "$ref": "#/definitions/UnsupportedOSArchitectures" + }, + "UnsupportedArguments": { + "$ref": "#/definitions/UnsupportedArguments" + }, + "AppsAndFeaturesEntries": { + "$ref": "#/definitions/AppsAndFeaturesEntries" + }, + "ElevationRequirement": { + "$ref": "#/definitions/ElevationRequirement" + }, + "InstallationMetadata": { + "$ref": "#/definitions/InstallationMetadata" + }, + "DownloadCommandProhibited": { + "$ref": "#/definitions/DownloadCommandProhibited" + }, + "RepairBehavior": { + "$ref": "#/definitions/RepairBehavior" + }, + "ArchiveBinariesDependOnPath": { + "$ref": "#/definitions/ArchiveBinariesDependOnPath" + } + }, + "required": [ + "Architecture", + "InstallerUrl", + "InstallerSha256" + ] + } + }, + "type": "object", + "properties": { + "PackageIdentifier": { + "$ref": "#/definitions/PackageIdentifier" + }, + "PackageVersion": { + "$ref": "#/definitions/PackageVersion" + }, + "Channel": { + "$ref": "#/definitions/Channel" + }, + "InstallerLocale": { + "$ref": "#/definitions/Locale" + }, + "Platform": { + "$ref": "#/definitions/Platform" + }, + "MinimumOSVersion": { + "$ref": "#/definitions/MinimumOSVersion" + }, + "InstallerType": { + "$ref": "#/definitions/InstallerType" + }, + "NestedInstallerType": { + "$ref": "#/definitions/NestedInstallerType" + }, + "NestedInstallerFiles": { + "$ref": "#/definitions/NestedInstallerFiles" + }, + "Scope": { + "$ref": "#/definitions/Scope" + }, + "InstallModes": { + "$ref": "#/definitions/InstallModes" + }, + "InstallerSwitches": { + "$ref": "#/definitions/InstallerSwitches" + }, + "InstallerSuccessCodes": { + "$ref": "#/definitions/InstallerSuccessCodes" + }, + "ExpectedReturnCodes": { + "$ref": "#/definitions/ExpectedReturnCodes" + }, + "UpgradeBehavior": { + "$ref": "#/definitions/UpgradeBehavior" + }, + "Commands": { + "$ref": "#/definitions/Commands" + }, + "Protocols": { + "$ref": "#/definitions/Protocols" + }, + "FileExtensions": { + "$ref": "#/definitions/FileExtensions" + }, + "Dependencies": { + "$ref": "#/definitions/Dependencies" + }, + "PackageFamilyName": { + "$ref": "#/definitions/PackageFamilyName" + }, + "ProductCode": { + "$ref": "#/definitions/ProductCode" + }, + "Capabilities": { + "$ref": "#/definitions/Capabilities" + }, + "RestrictedCapabilities": { + "$ref": "#/definitions/RestrictedCapabilities" + }, + "Markets": { + "$ref": "#/definitions/Markets" + }, + "InstallerAbortsTerminal": { + "$ref": "#/definitions/InstallerAbortsTerminal" + }, + "ReleaseDate": { + "$ref": "#/definitions/ReleaseDate" + }, + "InstallLocationRequired": { + "$ref": "#/definitions/InstallLocationRequired" + }, + "RequireExplicitUpgrade": { + "$ref": "#/definitions/RequireExplicitUpgrade" + }, + "DisplayInstallWarnings": { + "$ref": "#/definitions/DisplayInstallWarnings" + }, + "UnsupportedOSArchitectures": { + "$ref": "#/definitions/UnsupportedOSArchitectures" + }, + "UnsupportedArguments": { + "$ref": "#/definitions/UnsupportedArguments" + }, + "AppsAndFeaturesEntries": { + "$ref": "#/definitions/AppsAndFeaturesEntries" + }, + "ElevationRequirement": { + "$ref": "#/definitions/ElevationRequirement" + }, + "InstallationMetadata": { + "$ref": "#/definitions/InstallationMetadata" + }, + "DownloadCommandProhibited": { + "$ref": "#/definitions/DownloadCommandProhibited" + }, + "RepairBehavior": { + "$ref": "#/definitions/RepairBehavior" + }, + "ArchiveBinariesDependOnPath": { + "$ref": "#/definitions/ArchiveBinariesDependOnPath" + }, + "Installers": { + "type": "array", + "items": { + "$ref": "#/definitions/Installer" + }, + "minItems": 1, + "maxItems": 1024 + }, + "ManifestType": { + "type": "string", + "default": "installer", + "const": "installer", + "description": "The manifest type" + }, + "ManifestVersion": { + "type": "string", + "default": "1.9.0", + "pattern": "^(0|[1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])(\\.(0|[1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])){2}$", + "description": "The manifest syntax version" + } + }, + "required": [ + "PackageIdentifier", + "PackageVersion", + "Installers", + "ManifestType", + "ManifestVersion" + ] +} diff --git a/schemas/JSON/manifests/v1.9.0/manifest.locale.1.9.0.json b/schemas/JSON/manifests/v1.9.0/manifest.locale.1.9.0.json new file mode 100644 index 0000000000..7cf6502d51 --- /dev/null +++ b/schemas/JSON/manifests/v1.9.0/manifest.locale.1.9.0.json @@ -0,0 +1,269 @@ +{ + "$id": "https://aka.ms/winget-manifest.locale.1.9.0.schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "description": "A representation of a multiple-file manifest representing app metadata in other locale in the OWC. v1.9.0", + "definitions": { + "Url": { + "type": [ "string", "null" ], + "pattern": "^([Hh][Tt][Tt][Pp][Ss]?)://.+$", + "maxLength": 2048, + "description": "Optional Url type" + }, + "Tag": { + "type": [ "string", "null" ], + "minLength": 1, + "maxLength": 40, + "description": "Package tag" + }, + "Agreement": { + "type": "object", + "properties": { + "AgreementLabel": { + "type": [ "string", "null" ], + "minLength": 1, + "maxLength": 100, + "description": "The label of the Agreement. i.e. EULA, AgeRating, etc. This field should be localized. Either Agreement or AgreementUrl is required. When we show the agreements, we would Bold the AgreementLabel" + }, + "Agreement": { + "type": [ "string", "null" ], + "minLength": 1, + "maxLength": 10000, + "description": "The agreement text content." + }, + "AgreementUrl": { + "$ref": "#/definitions/Url", + "description": "The agreement URL." + } + } + }, + "Documentation": { + "type": "object", + "properties": { + "DocumentLabel": { + "type": [ "string", "null" ], + "minLength": 1, + "maxLength": 100, + "description": "The label of the documentation for providing software guides such as manuals and troubleshooting URLs." + }, + "DocumentUrl": { + "$ref": "#/definitions/Url", + "description": "The documentation URL." + } + } + }, + "Icon": { + "type": "object", + "properties": { + "IconUrl": { + "$ref": "#/definitions/Url", + "description": "The url of the hosted icon file" + }, + "IconFileType": { + "type": "string", + "enum": [ + "png", + "jpeg", + "ico" + ], + "description": "The icon file type" + }, + "IconResolution": { + "type": [ "string", "null" ], + "enum": [ + "custom", + "16x16", + "20x20", + "24x24", + "30x30", + "32x32", + "36x36", + "40x40", + "48x48", + "60x60", + "64x64", + "72x72", + "80x80", + "96x96", + "256x256" + ], + "description": "Optional icon resolution" + }, + "IconTheme": { + "type": [ "string", "null" ], + "enum": [ + "default", + "light", + "dark", + "highContrast" + ], + "description": "Optional icon theme" + }, + "IconSha256": { + "type": [ "string", "null" ], + "pattern": "^[A-Fa-f0-9]{64}$", + "description": "Optional Sha256 of the icon file" + } + }, + "required": [ + "IconUrl", + "IconFileType" + ] + } + }, + "type": "object", + "properties": { + "PackageIdentifier": { + "type": "string", + "pattern": "^[^\\.\\s\\\\/:\\*\\?\"<>\\|\\x01-\\x1f]{1,32}(\\.[^\\.\\s\\\\/:\\*\\?\"<>\\|\\x01-\\x1f]{1,32}){1,7}$", + "maxLength": 128, + "description": "The package unique identifier" + }, + "PackageVersion": { + "type": "string", + "pattern": "^[^\\\\/:\\*\\?\"<>\\|\\x01-\\x1f]+$", + "maxLength": 128, + "description": "The package version" + }, + "PackageLocale": { + "type": "string", + "pattern": "^([a-zA-Z]{2,3}|[iI]-[a-zA-Z]+|[xX]-[a-zA-Z]{1,8})(-[a-zA-Z]{1,8})*$", + "maxLength": 20, + "description": "The package meta-data locale" + }, + "Publisher": { + "type": [ "string", "null" ], + "minLength": 2, + "maxLength": 256, + "description": "The publisher name" + }, + "PublisherUrl": { + "$ref": "#/definitions/Url", + "description": "The publisher home page" + }, + "PublisherSupportUrl": { + "$ref": "#/definitions/Url", + "description": "The publisher support page" + }, + "PrivacyUrl": { + "$ref": "#/definitions/Url", + "description": "The publisher privacy page or the package privacy page" + }, + "Author": { + "type": [ "string", "null" ], + "minLength": 2, + "maxLength": 256, + "description": "The package author" + }, + "PackageName": { + "type": [ "string", "null" ], + "minLength": 2, + "maxLength": 256, + "description": "The package name" + }, + "PackageUrl": { + "$ref": "#/definitions/Url", + "description": "The package home page" + }, + "License": { + "type": [ "string", "null" ], + "minLength": 3, + "maxLength": 512, + "description": "The package license" + }, + "LicenseUrl": { + "$ref": "#/definitions/Url", + "description": "The license page" + }, + "Copyright": { + "type": [ "string", "null" ], + "minLength": 3, + "maxLength": 512, + "description": "The package copyright" + }, + "CopyrightUrl": { + "$ref": "#/definitions/Url", + "description": "The package copyright page" + }, + "ShortDescription": { + "type": [ "string", "null" ], + "minLength": 3, + "maxLength": 256, + "description": "The short package description" + }, + "Description": { + "type": [ "string", "null" ], + "minLength": 3, + "maxLength": 10000, + "description": "The full package description" + }, + "Tags": { + "type": [ "array", "null" ], + "items": { + "$ref": "#/definitions/Tag" + }, + "maxItems": 16, + "uniqueItems": true, + "description": "List of additional package search terms" + }, + "Agreements": { + "type": [ "array", "null" ], + "items": { + "$ref": "#/definitions/Agreement" + }, + "maxItems": 128 + }, + "ReleaseNotes": { + "type": [ "string", "null" ], + "minLength": 1, + "maxLength": 10000, + "description": "The package release notes" + }, + "ReleaseNotesUrl": { + "$ref": "#/definitions/Url", + "description": "The package release notes url" + }, + "PurchaseUrl": { + "$ref": "#/definitions/Url", + "description": "The purchase url for acquiring entitlement for the package." + }, + "InstallationNotes": { + "type": [ "string", "null" ], + "minLength": 1, + "maxLength": 10000, + "description": "The notes displayed to the user upon completion of a package installation." + }, + "Documentations": { + "type": [ "array", "null" ], + "items": { + "$ref": "#/definitions/Documentation" + }, + "maxItems": 256 + }, + "Icons": { + "type": [ "array", "null" ], + "items": { + "$ref": "#/definitions/Icon" + }, + "maxItems": 1024 + }, + "ManifestType": { + "type": "string", + "default": "locale", + "const": "locale", + "description": "The manifest type" + }, + "ManifestVersion": { + "type": "string", + "default": "1.9.0", + "pattern": "^(0|[1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])(\\.(0|[1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])){2}$", + "description": "The manifest syntax version" + } + }, + "required": [ + "PackageIdentifier", + "PackageVersion", + "PackageLocale", + "ManifestType", + "ManifestVersion" + ] +} \ No newline at end of file diff --git a/schemas/JSON/manifests/v1.9.0/manifest.singleton.1.9.0.json b/schemas/JSON/manifests/v1.9.0/manifest.singleton.1.9.0.json new file mode 100644 index 0000000000..223ac8343d --- /dev/null +++ b/schemas/JSON/manifests/v1.9.0/manifest.singleton.1.9.0.json @@ -0,0 +1,1103 @@ +{ + "$id": "https://aka.ms/winget-manifest.singleton.1.9.0.schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "description": "A representation of a single-file manifest representing an app in the OWC. v1.9.0", + "definitions": { + "PackageIdentifier": { + "type": "string", + "pattern": "^[^\\.\\s\\\\/:\\*\\?\"<>\\|\\x01-\\x1f]{1,32}(\\.[^\\.\\s\\\\/:\\*\\?\"<>\\|\\x01-\\x1f]{1,32}){1,7}$", + "maxLength": 128, + "description": "The package unique identifier" + }, + "PackageVersion": { + "type": "string", + "pattern": "^[^\\\\/:\\*\\?\"<>\\|\\x01-\\x1f]+$", + "maxLength": 128, + "description": "The package version" + }, + "Locale": { + "type": [ "string", "null" ], + "pattern": "^([a-zA-Z]{2,3}|[iI]-[a-zA-Z]+|[xX]-[a-zA-Z]{1,8})(-[a-zA-Z]{1,8})*$", + "maxLength": 20, + "description": "The package meta-data locale" + }, + "Url": { + "type": [ "string", "null" ], + "pattern": "^([Hh][Tt][Tt][Pp][Ss]?)://.+$", + "maxLength": 2048, + "description": "Optional Url type" + }, + "Tag": { + "type": [ "string", "null" ], + "minLength": 1, + "maxLength": 40, + "description": "Package moniker or tag" + }, + "Agreement": { + "type": "object", + "properties": { + "AgreementLabel": { + "type": [ "string", "null" ], + "minLength": 1, + "maxLength": 100, + "description": "The label of the Agreement. i.e. EULA, AgeRating, etc. This field should be localized. Either Agreement or AgreementUrl is required. When we show the agreements, we would Bold the AgreementLabel" + }, + "Agreement": { + "type": [ "string", "null" ], + "minLength": 1, + "maxLength": 10000, + "description": "The agreement text content." + }, + "AgreementUrl": { + "$ref": "#/definitions/Url", + "description": "The agreement URL." + } + } + }, + "Documentation": { + "type": "object", + "properties": { + "DocumentLabel": { + "type": [ "string", "null" ], + "minLength": 1, + "maxLength": 100, + "description": "The label of the documentation for providing software guides such as manuals and troubleshooting URLs." + }, + "DocumentUrl": { + "$ref": "#/definitions/Url", + "description": "The documentation URL." + } + } + }, + "Icon": { + "type": "object", + "properties": { + "IconUrl": { + "$ref": "#/definitions/Url", + "description": "The url of the hosted icon file" + }, + "IconFileType": { + "type": "string", + "enum": [ + "png", + "jpeg", + "ico" + ], + "description": "The icon file type" + }, + "IconResolution": { + "type": [ "string", "null" ], + "enum": [ + "custom", + "16x16", + "20x20", + "24x24", + "30x30", + "32x32", + "36x36", + "40x40", + "48x48", + "60x60", + "64x64", + "72x72", + "80x80", + "96x96", + "256x256" + ], + "description": "Optional icon resolution" + }, + "IconTheme": { + "type": [ "string", "null" ], + "enum": [ + "default", + "light", + "dark", + "highContrast" + ], + "description": "Optional icon theme" + }, + "IconSha256": { + "type": [ "string", "null" ], + "pattern": "^[A-Fa-f0-9]{64}$", + "description": "Optional Sha256 of the icon file" + } + }, + "required": [ + "IconUrl", + "IconFileType" + ] + }, + "Channel": { + "type": [ "string", "null" ], + "minLength": 1, + "maxLength": 16, + "description": "The distribution channel" + }, + "Platform": { + "type": [ "array", "null" ], + "items": { + "title": "Platform", + "type": "string", + "enum": [ + "Windows.Desktop", + "Windows.Universal" + ] + }, + "maxItems": 2, + "uniqueItems": true, + "description": "The installer supported operating system" + }, + "MinimumOSVersion": { + "type": [ "string", "null" ], + "pattern": "^(0|[1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])(\\.(0|[1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])){0,3}$", + "description": "The installer minimum operating system version" + }, + "InstallerType": { + "type": [ "string", "null" ], + "enum": [ + "msix", + "msi", + "appx", + "exe", + "zip", + "inno", + "nullsoft", + "wix", + "burn", + "pwa", + "portable" + ], + "description": "Enumeration of supported installer types. InstallerType is required in either root level or individual Installer level" + }, + "NestedInstallerType": { + "type": [ "string", "null" ], + "enum": [ + "msix", + "msi", + "appx", + "exe", + "inno", + "nullsoft", + "wix", + "burn", + "portable" + ], + "description": "Enumeration of supported nested installer types contained inside an archive file" + }, + "NestedInstallerFiles": { + "type": [ "array", "null" ], + "items": { + "type": "object", + "title": "NestedInstallerFile", + "properties": { + "RelativeFilePath": { + "type": "string", + "minLength": 1, + "maxLength": 512, + "description": "The relative path to the nested installer file" + }, + "PortableCommandAlias": { + "type": [ "string", "null" ], + "minLength": 1, + "maxLength": 40, + "description": "The command alias to be used for calling the package. Only applies to the nested portable package" + } + }, + "required": [ "RelativeFilePath" ], + "description": "A nested installer file contained inside an archive" + }, + "maxItems": 1024, + "description": "List of nested installer files contained inside an archive" + }, + "Architecture": { + "type": "string", + "enum": [ + "x86", + "x64", + "arm", + "arm64", + "neutral" + ], + "description": "The installer target architecture" + }, + "Scope": { + "type": [ "string", "null" ], + "enum": [ + "user", + "machine" + ], + "description": "Scope indicates if the installer is per user or per machine" + }, + "InstallModes": { + "type": [ "array", "null" ], + "items": { + "title": "InstallModes", + "type": "string", + "enum": [ + "interactive", + "silent", + "silentWithProgress" + ] + }, + "maxItems": 3, + "uniqueItems": true, + "description": "List of supported installer modes" + }, + "InstallerSwitches": { + "type": "object", + "properties": { + "Silent": { + "type": [ "string", "null" ], + "minLength": 1, + "maxLength": 512, + "description": "Silent is the value that should be passed to the installer when user chooses a silent or quiet install" + }, + "SilentWithProgress": { + "type": [ "string", "null" ], + "minLength": 1, + "maxLength": 512, + "description": "SilentWithProgress is the value that should be passed to the installer when user chooses a non-interactive install" + }, + "Interactive": { + "type": [ "string", "null" ], + "minLength": 1, + "maxLength": 512, + "description": "Interactive is the value that should be passed to the installer when user chooses an interactive install" + }, + "InstallLocation": { + "type": [ "string", "null" ], + "minLength": 1, + "maxLength": 512, + "description": "InstallLocation is the value passed to the installer for custom install location. token can be included in the switch value so that winget will replace the token with user provided path" + }, + "Log": { + "type": [ "string", "null" ], + "minLength": 1, + "maxLength": 512, + "description": "Log is the value passed to the installer for custom log file path. token can be included in the switch value so that winget will replace the token with user provided path" + }, + "Upgrade": { + "type": [ "string", "null" ], + "minLength": 1, + "maxLength": 512, + "description": "Upgrade is the value that should be passed to the installer when user chooses an upgrade" + }, + "Custom": { + "type": [ "string", "null" ], + "minLength": 1, + "maxLength": 2048, + "description": "Custom switches will be passed directly to the installer by winget" + }, + "Repair": { + "type": [ "string", "null" ], + "minLength": 1, + "maxLength": 512, + "description": "The 'Repair' value must be passed to the installer, ModifyPath ARP command, or uninstaller ARP command when the user opts for a repair" + } + } + }, + "InstallerReturnCode": { + "type": "integer", + "format": "long", + "not": { + "enum": [ 0 ] + }, + "minimum": -2147483648, + "maximum": 4294967295, + "description": "An exit code that can be returned by the installer after execution" + }, + "InstallerSuccessCodes": { + "type": [ "array", "null" ], + "items": { + "$ref": "#/definitions/InstallerReturnCode" + }, + "maxItems": 16, + "uniqueItems": true, + "description": "List of additional non-zero installer success exit codes other than known default values by winget" + }, + "ExpectedReturnCodes": { + "type": [ "array", "null" ], + "items": { + "type": "object", + "title": "ExpectedReturnCode", + "properties": { + "InstallerReturnCode": { + "$ref": "#/definitions/InstallerReturnCode" + }, + "ReturnResponse": { + "type": "string", + "enum": [ + "packageInUse", + "packageInUseByApplication", + "installInProgress", + "fileInUse", + "missingDependency", + "diskFull", + "insufficientMemory", + "invalidParameter", + "noNetwork", + "contactSupport", + "rebootRequiredToFinish", + "rebootRequiredForInstall", + "rebootInitiated", + "cancelledByUser", + "alreadyInstalled", + "downgrade", + "blockedByPolicy", + "systemNotSupported", + "custom" + ] + }, + "ReturnResponseUrl": { + "$ref": "#/definitions/Url", + "description": "The return response url to provide additional guidance for expected return codes" + } + } + }, + "maxItems": 128, + "description": "Installer exit codes for common errors" + }, + "UpgradeBehavior": { + "type": [ "string", "null" ], + "enum": [ + "install", + "uninstallPrevious", + "deny" + ], + "description": "The upgrade method" + }, + "Commands": { + "type": [ "array", "null" ], + "items": { + "type": "string", + "minLength": 1, + "maxLength": 40 + }, + "maxItems": 16, + "uniqueItems": true, + "description": "List of commands or aliases to run the package" + }, + "Protocols": { + "type": [ "array", "null" ], + "items": { + "type": "string", + "maxLength": 2048 + }, + "maxItems": 64, + "uniqueItems": true, + "description": "List of protocols the package provides a handler for" + }, + "FileExtensions": { + "type": [ "array", "null" ], + "items": { + "type": "string", + "pattern": "^[^\\\\/:\\*\\?\"<>\\|\\x01-\\x1f]+$", + "maxLength": 64 + }, + "maxItems": 512, + "uniqueItems": true, + "description": "List of file extensions the package could support" + }, + "Dependencies": { + "type": [ "object", "null" ], + "properties": { + "WindowsFeatures": { + "type": [ "array", "null" ], + "items": { + "type": "string", + "minLength": 1, + "maxLength": 128 + }, + "maxItems": 16, + "uniqueItems": true, + "description": "List of Windows feature dependencies" + }, + "WindowsLibraries": { + "type": [ "array", "null" ], + "items": { + "type": "string", + "minLength": 1, + "maxLength": 128 + }, + "maxItems": 16, + "uniqueItems": true, + "description": "List of Windows library dependencies" + }, + "PackageDependencies": { + "type": [ "array", "null" ], + "items": { + "type": "object", + "properties": { + "PackageIdentifier": { + "$ref": "#/definitions/PackageIdentifier" + }, + "MinimumVersion": { + "$ref": "#/definitions/PackageVersion" + } + }, + "required": [ "PackageIdentifier" ] + }, + "maxItems": 16, + "description": "List of package dependencies from current source" + }, + "ExternalDependencies": { + "type": [ "array", "null" ], + "items": { + "type": "string", + "minLength": 1, + "maxLength": 128 + }, + "maxItems": 16, + "uniqueItems": true, + "description": "List of external package dependencies" + } + } + }, + "PackageFamilyName": { + "type": [ "string", "null" ], + "pattern": "^[A-Za-z0-9][-\\.A-Za-z0-9]+_[A-Za-z0-9]{13}$", + "maxLength": 255, + "description": "PackageFamilyName for appx or msix installer. Could be used for correlation of packages across sources" + }, + "ProductCode": { + "type": [ "string", "null" ], + "minLength": 1, + "maxLength": 255, + "description": "ProductCode could be used for correlation of packages across sources" + }, + "Capabilities": { + "type": [ "array", "null" ], + "items": { + "type": "string", + "minLength": 1, + "maxLength": 40 + }, + "maxItems": 1000, + "uniqueItems": true, + "description": "List of appx or msix installer capabilities" + }, + "RestrictedCapabilities": { + "type": [ "array", "null" ], + "items": { + "type": "string", + "minLength": 1, + "maxLength": 40 + }, + "maxItems": 1000, + "uniqueItems": true, + "description": "List of appx or msix installer restricted capabilities" + }, + "Market": { + "type": "string", + "pattern": "^[A-Z]{2}$", + "description": "The installer target market" + }, + "MarketArray": { + "type": [ "array", "null" ], + "uniqueItems": true, + "maxItems": 256, + "items": { + "$ref": "#/definitions/Market" + }, + "description": "Array of markets" + }, + "Markets": { + "description": "The installer markets", + "type": [ "object", "null" ], + "oneOf": [ + { + "properties": { + "AllowedMarkets": { + "$ref": "#/definitions/MarketArray" + } + }, + "required": [ "AllowedMarkets" ] + }, + { + "properties": { + "ExcludedMarkets": { + "$ref": "#/definitions/MarketArray" + } + }, + "required": [ "ExcludedMarkets" ] + } + ] + }, + "InstallerAbortsTerminal": { + "type": [ "boolean", "null" ], + "description": "Indicates whether the installer will abort terminal. Default is false" + }, + "ReleaseDate": { + "type": [ "string", "null" ], + "format": "date", + "description": "The installer release date" + }, + "InstallLocationRequired": { + "type": [ "boolean", "null" ], + "description": "Indicates whether the installer requires an install location provided" + }, + "RequireExplicitUpgrade": { + "type": [ "boolean", "null" ], + "description": "Indicates whether the installer should be pinned by default from upgrade" + }, + "DisplayInstallWarnings": { + "type": [ "boolean", "null" ], + "description": "Indicates whether winget should display a warning message if the install or upgrade is known to interfere with running applications." + }, + "UnsupportedOSArchitectures": { + "type": [ "array", "null" ], + "uniqueItems": true, + "items": { + "type": "string", + "title": "UnsupportedOSArchitecture", + "enum": [ + "x86", + "x64", + "arm", + "arm64" + ] + }, + "description": "List of OS architectures the installer does not support" + }, + "UnsupportedArguments": { + "type": [ "array", "null" ], + "uniqueItems": true, + "items": { + "type": "string", + "title": "UnsupportedArgument", + "enum": [ + "log", + "location" + ] + }, + "description": "List of winget arguments the installer does not support" + }, + "AppsAndFeaturesEntry": { + "type": "object", + "properties": { + "DisplayName": { + "type": [ "string", "null" ], + "minLength": 1, + "maxLength": 256, + "description": "The DisplayName registry value" + }, + "Publisher": { + "type": [ "string", "null" ], + "minLength": 1, + "maxLength": 256, + "description": "The Publisher registry value" + }, + "DisplayVersion": { + "type": [ "string", "null" ], + "minLength": 1, + "maxLength": 128, + "description": "The DisplayVersion registry value" + }, + "ProductCode": { + "$ref": "#/definitions/ProductCode" + }, + "UpgradeCode": { + "$ref": "#/definitions/ProductCode" + }, + "InstallerType": { + "$ref": "#/definitions/InstallerType" + } + }, + "description": "Various key values under installer's ARP entry" + }, + "AppsAndFeaturesEntries": { + "type": [ "array", "null" ], + "uniqueItems": true, + "maxItems": 128, + "items": { + "$ref": "#/definitions/AppsAndFeaturesEntry" + }, + "description": "List of ARP entries." + }, + "ElevationRequirement": { + "type": [ "string", "null" ], + "enum": [ + "elevationRequired", + "elevationProhibited", + "elevatesSelf" + ], + "description": "The installer's elevation requirement" + }, + "InstallationMetadata": { + "type": "object", + "title": "InstallationMetadata", + "properties": { + "DefaultInstallLocation": { + "type": [ "string", "null" ], + "minLength": 1, + "maxLength": 2048, + "description": "Represents the default installed package location. Used for deeper installation detection." + }, + "Files": { + "type": [ "array", "null" ], + "uniqueItems": true, + "maxItems": 2048, + "items": { + "type": "object", + "title": "InstalledFile", + "properties": { + "RelativeFilePath": { + "type": "string", + "minLength": 1, + "maxLength": 2048, + "description": "The relative path to the installed file." + }, + "FileSha256": { + "type": [ "string", "null" ], + "pattern": "^[A-Fa-f0-9]{64}$", + "description": "Optional Sha256 of the installed file." + }, + "FileType": { + "type": [ "string", "null" ], + "enum": [ + "launch", + "uninstall", + "other" + ], + "description": "The optional installed file type. If not specified, the file is treated as other." + }, + "InvocationParameter": { + "type": [ "string", "null" ], + "minLength": 1, + "maxLength": 2048, + "description": "Optional parameter for invocable files." + }, + "DisplayName": { + "type": [ "string", "null" ], + "minLength": 1, + "maxLength": 256, + "description": "Optional display name for invocable files." + } + }, + "required": [ "RelativeFilePath" ], + "description": "Represents an installed file." + }, + "description": "List of installed files." + } + }, + "description": "Details about the installation. Used for deeper installation detection." + }, + "DownloadCommandProhibited": { + "type": [ "boolean", "null" ], + "description": "Indicates whether the installer is prohibited from being downloaded for offline installation." + }, + "RepairBehavior": { + "type": [ "string", "null" ], + "enum": [ + "modify", + "uninstaller", + "installer" + ], + "description": "The repair method" + }, + "ArchiveBinariesDependOnPath": { + "type": [ "boolean", "null" ], + "description": "Indicates whether the install location should be added directly to the PATH environment variable. Only applies to an archive containing portable packages." + }, + "Installer": { + "type": "object", + "properties": { + "InstallerLocale": { + "$ref": "#/definitions/Locale" + }, + "Platform": { + "$ref": "#/definitions/Platform" + }, + "MinimumOSVersion": { + "$ref": "#/definitions/MinimumOSVersion" + }, + "Architecture": { + "$ref": "#/definitions/Architecture" + }, + "InstallerType": { + "$ref": "#/definitions/InstallerType" + }, + "NestedInstallerType": { + "$ref": "#/definitions/NestedInstallerType" + }, + "NestedInstallerFiles": { + "$ref": "#/definitions/NestedInstallerFiles" + }, + "Scope": { + "$ref": "#/definitions/Scope" + }, + "InstallerUrl": { + "type": "string", + "pattern": "^([Hh][Tt][Tt][Pp][Ss]?)://.+$", + "maxLength": 2048, + "description": "The installer Url" + }, + "InstallerSha256": { + "type": "string", + "pattern": "^[A-Fa-f0-9]{64}$", + "description": "Sha256 is required. Sha256 of the installer" + }, + "SignatureSha256": { + "type": [ "string", "null" ], + "pattern": "^[A-Fa-f0-9]{64}$", + "description": "SignatureSha256 is recommended for appx or msix. It is the sha256 of signature file inside appx or msix. Could be used during streaming install if applicable" + }, + "InstallModes": { + "$ref": "#/definitions/InstallModes" + }, + "InstallerSwitches": { + "$ref": "#/definitions/InstallerSwitches" + }, + "InstallerSuccessCodes": { + "$ref": "#/definitions/InstallerSuccessCodes" + }, + "ExpectedReturnCodes": { + "$ref": "#/definitions/ExpectedReturnCodes" + }, + "UpgradeBehavior": { + "$ref": "#/definitions/UpgradeBehavior" + }, + "Commands": { + "$ref": "#/definitions/Commands" + }, + "Protocols": { + "$ref": "#/definitions/Protocols" + }, + "FileExtensions": { + "$ref": "#/definitions/FileExtensions" + }, + "Dependencies": { + "$ref": "#/definitions/Dependencies" + }, + "PackageFamilyName": { + "$ref": "#/definitions/PackageFamilyName" + }, + "ProductCode": { + "$ref": "#/definitions/ProductCode" + }, + "Capabilities": { + "$ref": "#/definitions/Capabilities" + }, + "RestrictedCapabilities": { + "$ref": "#/definitions/RestrictedCapabilities" + }, + "Markets": { + "$ref": "#/definitions/Markets" + }, + "InstallerAbortsTerminal": { + "$ref": "#/definitions/InstallerAbortsTerminal" + }, + "ReleaseDate": { + "$ref": "#/definitions/ReleaseDate" + }, + "InstallLocationRequired": { + "$ref": "#/definitions/InstallLocationRequired" + }, + "RequireExplicitUpgrade": { + "$ref": "#/definitions/RequireExplicitUpgrade" + }, + "DisplayInstallWarnings": { + "$ref": "#/definitions/DisplayInstallWarnings" + }, + "UnsupportedOSArchitectures": { + "$ref": "#/definitions/UnsupportedOSArchitectures" + }, + "UnsupportedArguments": { + "$ref": "#/definitions/UnsupportedArguments" + }, + "AppsAndFeaturesEntries": { + "$ref": "#/definitions/AppsAndFeaturesEntries" + }, + "ElevationRequirement": { + "$ref": "#/definitions/ElevationRequirement" + }, + "InstallationMetadata": { + "$ref": "#/definitions/InstallationMetadata" + }, + "DownloadCommandProhibited": { + "$ref": "#/definitions/DownloadCommandProhibited" + }, + "RepairBehavior": { + "$ref": "#/definitions/RepairBehavior" + }, + "ArchiveBinariesDependOnPath": { + "$ref": "#/definitions/ArchiveBinariesDependOnPath" + } + }, + "required": [ + "Architecture", + "InstallerUrl", + "InstallerSha256" + ] + } + }, + "type": "object", + "properties": { + "PackageIdentifier": { + "$ref": "#/definitions/PackageIdentifier" + }, + "PackageVersion": { + "$ref": "#/definitions/PackageVersion" + }, + "PackageLocale": { + "$ref": "#/definitions/Locale" + }, + "Publisher": { + "type": "string", + "minLength": 2, + "maxLength": 256, + "description": "The publisher name" + }, + "PublisherUrl": { + "$ref": "#/definitions/Url", + "description": "The publisher home page" + }, + "PublisherSupportUrl": { + "$ref": "#/definitions/Url", + "description": "The publisher support page" + }, + "PrivacyUrl": { + "$ref": "#/definitions/Url", + "description": "The publisher privacy page or the package privacy page" + }, + "Author": { + "type": [ "string", "null" ], + "minLength": 2, + "maxLength": 256, + "description": "The package author" + }, + "PackageName": { + "type": "string", + "minLength": 2, + "maxLength": 256, + "description": "The package name" + }, + "PackageUrl": { + "$ref": "#/definitions/Url", + "description": "The package home page" + }, + "License": { + "type": "string", + "minLength": 3, + "maxLength": 512, + "description": "The package license" + }, + "LicenseUrl": { + "$ref": "#/definitions/Url", + "description": "The license page" + }, + "Copyright": { + "type": [ "string", "null" ], + "minLength": 3, + "maxLength": 512, + "description": "The package copyright" + }, + "CopyrightUrl": { + "$ref": "#/definitions/Url", + "description": "The package copyright page" + }, + "ShortDescription": { + "type": "string", + "minLength": 3, + "maxLength": 256, + "description": "The short package description" + }, + "Description": { + "type": [ "string", "null" ], + "minLength": 3, + "maxLength": 10000, + "description": "The full package description" + }, + "Moniker": { + "$ref": "#/definitions/Tag", + "description": "The most common package term" + }, + "Tags": { + "type": [ "array", "null" ], + "items": { + "$ref": "#/definitions/Tag" + }, + "maxItems": 16, + "uniqueItems": true, + "description": "List of additional package search terms" + }, + "Agreements": { + "type": [ "array", "null" ], + "items": { + "$ref": "#/definitions/Agreement" + }, + "maxItems": 128 + }, + "ReleaseNotes": { + "type": [ "string", "null" ], + "minLength": 1, + "maxLength": 10000, + "description": "The package release notes" + }, + "ReleaseNotesUrl": { + "$ref": "#/definitions/Url", + "description": "The package release notes url" + }, + "PurchaseUrl": { + "$ref": "#/definitions/Url", + "description": "The purchase url for acquiring entitlement for the package." + }, + "InstallationNotes": { + "type": [ "string", "null" ], + "minLength": 1, + "maxLength": 10000, + "description": "The notes displayed to the user upon completion of a package installation." + }, + "Documentations": { + "type": [ "array", "null" ], + "items": { + "$ref": "#/definitions/Documentation" + }, + "maxItems": 256 + }, + "Icons": { + "type": [ "array", "null" ], + "items": { + "$ref": "#/definitions/Icon" + }, + "maxItems": 1024 + }, + "Channel": { + "$ref": "#/definitions/Channel" + }, + "InstallerLocale": { + "$ref": "#/definitions/Locale" + }, + "Platform": { + "$ref": "#/definitions/Platform" + }, + "MinimumOSVersion": { + "$ref": "#/definitions/MinimumOSVersion" + }, + "InstallerType": { + "$ref": "#/definitions/InstallerType" + }, + "NestedInstallerType": { + "$ref": "#/definitions/NestedInstallerType" + }, + "NestedInstallerFiles": { + "$ref": "#/definitions/NestedInstallerFiles" + }, + "Scope": { + "$ref": "#/definitions/Scope" + }, + "InstallModes": { + "$ref": "#/definitions/InstallModes" + }, + "InstallerSwitches": { + "$ref": "#/definitions/InstallerSwitches" + }, + "InstallerSuccessCodes": { + "$ref": "#/definitions/InstallerSuccessCodes" + }, + "ExpectedReturnCodes": { + "$ref": "#/definitions/ExpectedReturnCodes" + }, + "UpgradeBehavior": { + "$ref": "#/definitions/UpgradeBehavior" + }, + "Commands": { + "$ref": "#/definitions/Commands" + }, + "Protocols": { + "$ref": "#/definitions/Protocols" + }, + "FileExtensions": { + "$ref": "#/definitions/FileExtensions" + }, + "Dependencies": { + "$ref": "#/definitions/Dependencies" + }, + "PackageFamilyName": { + "$ref": "#/definitions/PackageFamilyName" + }, + "ProductCode": { + "$ref": "#/definitions/ProductCode" + }, + "Capabilities": { + "$ref": "#/definitions/Capabilities" + }, + "RestrictedCapabilities": { + "$ref": "#/definitions/RestrictedCapabilities" + }, + "Markets": { + "$ref": "#/definitions/Markets" + }, + "InstallerAbortsTerminal": { + "$ref": "#/definitions/InstallerAbortsTerminal" + }, + "ReleaseDate": { + "$ref": "#/definitions/ReleaseDate" + }, + "InstallLocationRequired": { + "$ref": "#/definitions/InstallLocationRequired" + }, + "RequireExplicitUpgrade": { + "$ref": "#/definitions/RequireExplicitUpgrade" + }, + "DisplayInstallWarnings": { + "$ref": "#/definitions/DisplayInstallWarnings" + }, + "UnsupportedOSArchitectures": { + "$ref": "#/definitions/UnsupportedOSArchitectures" + }, + "UnsupportedArguments": { + "$ref": "#/definitions/UnsupportedArguments" + }, + "AppsAndFeaturesEntries": { + "$ref": "#/definitions/AppsAndFeaturesEntries" + }, + "ElevationRequirement": { + "$ref": "#/definitions/ElevationRequirement" + }, + "InstallationMetadata": { + "$ref": "#/definitions/InstallationMetadata" + }, + "DownloadCommandProhibited": { + "$ref": "#/definitions/DownloadCommandProhibited" + }, + "RepairBehavior": { + "$ref": "#/definitions/RepairBehavior" + }, + "ArchiveBinariesDependOnPath": { + "$ref": "#/definitions/ArchiveBinariesDependOnPath" + }, + "Installers": { + "type": "array", + "items": { + "$ref": "#/definitions/Installer" + }, + "minItems": 1, + "maxItems": 1 + }, + "ManifestType": { + "type": "string", + "default": "singleton", + "const": "singleton", + "description": "The manifest type" + }, + "ManifestVersion": { + "type": "string", + "default": "1.9.0", + "pattern": "^(0|[1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])(\\.(0|[1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])){2}$", + "description": "The manifest syntax version" + } + }, + "required": [ + "PackageIdentifier", + "PackageVersion", + "PackageLocale", + "Publisher", + "PackageName", + "License", + "ShortDescription", + "Installers", + "ManifestType", + "ManifestVersion" + ] +} diff --git a/schemas/JSON/manifests/v1.9.0/manifest.version.1.9.0.json b/schemas/JSON/manifests/v1.9.0/manifest.version.1.9.0.json new file mode 100644 index 0000000000..743ea68153 --- /dev/null +++ b/schemas/JSON/manifests/v1.9.0/manifest.version.1.9.0.json @@ -0,0 +1,46 @@ +{ + "$id": "https://aka.ms/winget-manifest.version.1.9.0.schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "description": "A representation of a multi-file manifest representing an app version in the OWC. v1.9.0", + "type": "object", + "properties": { + "PackageIdentifier": { + "type": "string", + "pattern": "^[^\\.\\s\\\\/:\\*\\?\"<>\\|\\x01-\\x1f]{1,32}(\\.[^\\.\\s\\\\/:\\*\\?\"<>\\|\\x01-\\x1f]{1,32}){1,7}$", + "maxLength": 128, + "description": "The package unique identifier" + }, + "PackageVersion": { + "type": "string", + "pattern": "^[^\\\\/:\\*\\?\"<>\\|\\x01-\\x1f]+$", + "maxLength": 128, + "description": "The package version" + }, + "DefaultLocale": { + "type": "string", + "default": "en-US", + "pattern": "^([a-zA-Z]{2,3}|[iI]-[a-zA-Z]+|[xX]-[a-zA-Z]{1,8})(-[a-zA-Z]{1,8})*$", + "maxLength": 20, + "description": "The default package meta-data locale" + }, + "ManifestType": { + "type": "string", + "default": "version", + "const": "version", + "description": "The manifest type" + }, + "ManifestVersion": { + "type": "string", + "default": "1.9.0", + "pattern": "^(0|[1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])(\\.(0|[1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])){2}$", + "description": "The manifest syntax version" + } + }, + "required": [ + "PackageIdentifier", + "PackageVersion", + "DefaultLocale", + "ManifestType", + "ManifestVersion" + ] +} \ No newline at end of file diff --git a/src/AppInstallerCLI.sln b/src/AppInstallerCLI.sln index f0c58f3b37..401dcd98b3 100644 --- a/src/AppInstallerCLI.sln +++ b/src/AppInstallerCLI.sln @@ -211,31 +211,30 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Internal", "Internal", "{A6 EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "UriValidation", "Internal\UriValidation\UriValidation.vcxproj", "{98920AB6-27B0-4C0F-B336-FA49DE57A1BA}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Microsoft.Management.Deployment.OutOfProc", "Microsoft.Management.Deployment.OutOfProc\Microsoft.Management.Deployment.OutOfProc.vcxproj", "{0BA531C8-CF0C-405B-8221-0FE51BA529D1}" + ProjectSection(ProjectDependencies) = postProject + {2B00D362-AC92-41F3-A8D2-5B1599BDCA01} = {2B00D362-AC92-41F3-A8D2-5B1599BDCA01} + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU Debug|ARM64 = Debug|ARM64 Debug|x64 = Debug|x64 Debug|x86 = Debug|x86 - Fuzzing|Any CPU = Fuzzing|Any CPU Fuzzing|ARM64 = Fuzzing|ARM64 Fuzzing|x64 = Fuzzing|x64 Fuzzing|x86 = Fuzzing|x86 - PowerShell|Any CPU = PowerShell|Any CPU - PowerShell|ARM64 = PowerShell|ARM64 - PowerShell|x64 = PowerShell|x64 - PowerShell|x86 = PowerShell|x86 - Release|Any CPU = Release|Any CPU Release|ARM64 = Release|ARM64 Release|x64 = Release|x64 Release|x86 = Release|x86 - TestRelease|Any CPU = TestRelease|Any CPU + ReleaseStatic|ARM64 = ReleaseStatic|ARM64 + ReleaseStatic|x64 = ReleaseStatic|x64 + ReleaseStatic|x86 = ReleaseStatic|x86 TestRelease|ARM64 = TestRelease|ARM64 TestRelease|x64 = TestRelease|x64 TestRelease|x86 = TestRelease|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {6AA3791A-0713-4548-A357-87A323E7AC3A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {6AA3791A-0713-4548-A357-87A323E7AC3A}.Debug|ARM64.ActiveCfg = Debug|ARM64 {6AA3791A-0713-4548-A357-87A323E7AC3A}.Debug|ARM64.Build.0 = Debug|ARM64 {6AA3791A-0713-4548-A357-87A323E7AC3A}.Debug|ARM64.Deploy.0 = Debug|ARM64 @@ -245,15 +244,9 @@ Global {6AA3791A-0713-4548-A357-87A323E7AC3A}.Debug|x86.ActiveCfg = Debug|x86 {6AA3791A-0713-4548-A357-87A323E7AC3A}.Debug|x86.Build.0 = Debug|x86 {6AA3791A-0713-4548-A357-87A323E7AC3A}.Debug|x86.Deploy.0 = Debug|x86 - {6AA3791A-0713-4548-A357-87A323E7AC3A}.Fuzzing|Any CPU.ActiveCfg = Release|Any CPU {6AA3791A-0713-4548-A357-87A323E7AC3A}.Fuzzing|ARM64.ActiveCfg = Release|ARM64 {6AA3791A-0713-4548-A357-87A323E7AC3A}.Fuzzing|x64.ActiveCfg = Release|x64 {6AA3791A-0713-4548-A357-87A323E7AC3A}.Fuzzing|x86.ActiveCfg = Release|x86 - {6AA3791A-0713-4548-A357-87A323E7AC3A}.PowerShell|Any CPU.ActiveCfg = Release|Any CPU - {6AA3791A-0713-4548-A357-87A323E7AC3A}.PowerShell|ARM64.ActiveCfg = Release|ARM64 - {6AA3791A-0713-4548-A357-87A323E7AC3A}.PowerShell|x64.ActiveCfg = Release|x64 - {6AA3791A-0713-4548-A357-87A323E7AC3A}.PowerShell|x86.ActiveCfg = Release|x86 - {6AA3791A-0713-4548-A357-87A323E7AC3A}.Release|Any CPU.ActiveCfg = Release|Any CPU {6AA3791A-0713-4548-A357-87A323E7AC3A}.Release|ARM64.ActiveCfg = Release|ARM64 {6AA3791A-0713-4548-A357-87A323E7AC3A}.Release|ARM64.Build.0 = Release|ARM64 {6AA3791A-0713-4548-A357-87A323E7AC3A}.Release|ARM64.Deploy.0 = Release|ARM64 @@ -263,271 +256,227 @@ Global {6AA3791A-0713-4548-A357-87A323E7AC3A}.Release|x86.ActiveCfg = Release|x86 {6AA3791A-0713-4548-A357-87A323E7AC3A}.Release|x86.Build.0 = Release|x86 {6AA3791A-0713-4548-A357-87A323E7AC3A}.Release|x86.Deploy.0 = Release|x86 - {6AA3791A-0713-4548-A357-87A323E7AC3A}.TestRelease|Any CPU.ActiveCfg = Release|Any CPU + {6AA3791A-0713-4548-A357-87A323E7AC3A}.ReleaseStatic|ARM64.ActiveCfg = Release|ARM64 + {6AA3791A-0713-4548-A357-87A323E7AC3A}.ReleaseStatic|x64.ActiveCfg = Release|x64 + {6AA3791A-0713-4548-A357-87A323E7AC3A}.ReleaseStatic|x86.ActiveCfg = Release|x86 {6AA3791A-0713-4548-A357-87A323E7AC3A}.TestRelease|ARM64.ActiveCfg = Release|ARM64 {6AA3791A-0713-4548-A357-87A323E7AC3A}.TestRelease|x64.ActiveCfg = Release|x64 {6AA3791A-0713-4548-A357-87A323E7AC3A}.TestRelease|x86.ActiveCfg = Release|x86 - {5B6F90DF-FD19-4BAE-83D9-24DAD128E777}.Debug|Any CPU.ActiveCfg = Debug|x64 {5B6F90DF-FD19-4BAE-83D9-24DAD128E777}.Debug|ARM64.ActiveCfg = Debug|ARM64 {5B6F90DF-FD19-4BAE-83D9-24DAD128E777}.Debug|ARM64.Build.0 = Debug|ARM64 {5B6F90DF-FD19-4BAE-83D9-24DAD128E777}.Debug|x64.ActiveCfg = Debug|x64 {5B6F90DF-FD19-4BAE-83D9-24DAD128E777}.Debug|x64.Build.0 = Debug|x64 {5B6F90DF-FD19-4BAE-83D9-24DAD128E777}.Debug|x86.ActiveCfg = Debug|Win32 {5B6F90DF-FD19-4BAE-83D9-24DAD128E777}.Debug|x86.Build.0 = Debug|Win32 - {5B6F90DF-FD19-4BAE-83D9-24DAD128E777}.Fuzzing|Any CPU.ActiveCfg = Release|x64 {5B6F90DF-FD19-4BAE-83D9-24DAD128E777}.Fuzzing|ARM64.ActiveCfg = Release|ARM64 {5B6F90DF-FD19-4BAE-83D9-24DAD128E777}.Fuzzing|x64.ActiveCfg = Release|x64 {5B6F90DF-FD19-4BAE-83D9-24DAD128E777}.Fuzzing|x86.ActiveCfg = Release|Win32 - {5B6F90DF-FD19-4BAE-83D9-24DAD128E777}.PowerShell|Any CPU.ActiveCfg = Release|x64 - {5B6F90DF-FD19-4BAE-83D9-24DAD128E777}.PowerShell|ARM64.ActiveCfg = Release|ARM64 - {5B6F90DF-FD19-4BAE-83D9-24DAD128E777}.PowerShell|x64.ActiveCfg = Release|x64 - {5B6F90DF-FD19-4BAE-83D9-24DAD128E777}.PowerShell|x86.ActiveCfg = Release|Win32 - {5B6F90DF-FD19-4BAE-83D9-24DAD128E777}.Release|Any CPU.ActiveCfg = Release|x64 {5B6F90DF-FD19-4BAE-83D9-24DAD128E777}.Release|ARM64.ActiveCfg = Release|ARM64 {5B6F90DF-FD19-4BAE-83D9-24DAD128E777}.Release|ARM64.Build.0 = Release|ARM64 {5B6F90DF-FD19-4BAE-83D9-24DAD128E777}.Release|x64.ActiveCfg = Release|x64 {5B6F90DF-FD19-4BAE-83D9-24DAD128E777}.Release|x64.Build.0 = Release|x64 {5B6F90DF-FD19-4BAE-83D9-24DAD128E777}.Release|x86.ActiveCfg = Release|Win32 {5B6F90DF-FD19-4BAE-83D9-24DAD128E777}.Release|x86.Build.0 = Release|Win32 - {5B6F90DF-FD19-4BAE-83D9-24DAD128E777}.TestRelease|Any CPU.ActiveCfg = Release|x64 + {5B6F90DF-FD19-4BAE-83D9-24DAD128E777}.ReleaseStatic|ARM64.ActiveCfg = Release|ARM64 + {5B6F90DF-FD19-4BAE-83D9-24DAD128E777}.ReleaseStatic|x64.ActiveCfg = Release|x64 + {5B6F90DF-FD19-4BAE-83D9-24DAD128E777}.ReleaseStatic|x86.ActiveCfg = Release|Win32 {5B6F90DF-FD19-4BAE-83D9-24DAD128E777}.TestRelease|ARM64.ActiveCfg = Release|ARM64 {5B6F90DF-FD19-4BAE-83D9-24DAD128E777}.TestRelease|x64.ActiveCfg = Release|x64 {5B6F90DF-FD19-4BAE-83D9-24DAD128E777}.TestRelease|x86.ActiveCfg = Release|Win32 - {1C6E0108-2860-4B17-9F7E-FA5C6C1F3D3D}.Debug|Any CPU.ActiveCfg = Debug|x64 {1C6E0108-2860-4B17-9F7E-FA5C6C1F3D3D}.Debug|ARM64.ActiveCfg = Debug|ARM64 {1C6E0108-2860-4B17-9F7E-FA5C6C1F3D3D}.Debug|ARM64.Build.0 = Debug|ARM64 {1C6E0108-2860-4B17-9F7E-FA5C6C1F3D3D}.Debug|x64.ActiveCfg = Debug|x64 {1C6E0108-2860-4B17-9F7E-FA5C6C1F3D3D}.Debug|x64.Build.0 = Debug|x64 {1C6E0108-2860-4B17-9F7E-FA5C6C1F3D3D}.Debug|x86.ActiveCfg = Debug|Win32 {1C6E0108-2860-4B17-9F7E-FA5C6C1F3D3D}.Debug|x86.Build.0 = Debug|Win32 - {1C6E0108-2860-4B17-9F7E-FA5C6C1F3D3D}.Fuzzing|Any CPU.ActiveCfg = Release|x64 {1C6E0108-2860-4B17-9F7E-FA5C6C1F3D3D}.Fuzzing|ARM64.ActiveCfg = Release|ARM64 {1C6E0108-2860-4B17-9F7E-FA5C6C1F3D3D}.Fuzzing|x64.ActiveCfg = Release|x64 {1C6E0108-2860-4B17-9F7E-FA5C6C1F3D3D}.Fuzzing|x86.ActiveCfg = Release|Win32 - {1C6E0108-2860-4B17-9F7E-FA5C6C1F3D3D}.PowerShell|Any CPU.ActiveCfg = ReleaseStatic|x64 - {1C6E0108-2860-4B17-9F7E-FA5C6C1F3D3D}.PowerShell|ARM64.ActiveCfg = ReleaseStatic|ARM64 - {1C6E0108-2860-4B17-9F7E-FA5C6C1F3D3D}.PowerShell|ARM64.Build.0 = ReleaseStatic|ARM64 - {1C6E0108-2860-4B17-9F7E-FA5C6C1F3D3D}.PowerShell|x64.ActiveCfg = ReleaseStatic|x64 - {1C6E0108-2860-4B17-9F7E-FA5C6C1F3D3D}.PowerShell|x64.Build.0 = ReleaseStatic|x64 - {1C6E0108-2860-4B17-9F7E-FA5C6C1F3D3D}.PowerShell|x86.ActiveCfg = ReleaseStatic|Win32 - {1C6E0108-2860-4B17-9F7E-FA5C6C1F3D3D}.PowerShell|x86.Build.0 = ReleaseStatic|Win32 - {1C6E0108-2860-4B17-9F7E-FA5C6C1F3D3D}.Release|Any CPU.ActiveCfg = Release|x64 {1C6E0108-2860-4B17-9F7E-FA5C6C1F3D3D}.Release|ARM64.ActiveCfg = Release|ARM64 {1C6E0108-2860-4B17-9F7E-FA5C6C1F3D3D}.Release|ARM64.Build.0 = Release|ARM64 {1C6E0108-2860-4B17-9F7E-FA5C6C1F3D3D}.Release|x64.ActiveCfg = Release|x64 {1C6E0108-2860-4B17-9F7E-FA5C6C1F3D3D}.Release|x64.Build.0 = Release|x64 {1C6E0108-2860-4B17-9F7E-FA5C6C1F3D3D}.Release|x86.ActiveCfg = Release|Win32 {1C6E0108-2860-4B17-9F7E-FA5C6C1F3D3D}.Release|x86.Build.0 = Release|Win32 - {1C6E0108-2860-4B17-9F7E-FA5C6C1F3D3D}.TestRelease|Any CPU.ActiveCfg = Release|x64 + {1C6E0108-2860-4B17-9F7E-FA5C6C1F3D3D}.ReleaseStatic|ARM64.ActiveCfg = ReleaseStatic|ARM64 + {1C6E0108-2860-4B17-9F7E-FA5C6C1F3D3D}.ReleaseStatic|ARM64.Build.0 = ReleaseStatic|ARM64 + {1C6E0108-2860-4B17-9F7E-FA5C6C1F3D3D}.ReleaseStatic|x64.ActiveCfg = ReleaseStatic|x64 + {1C6E0108-2860-4B17-9F7E-FA5C6C1F3D3D}.ReleaseStatic|x64.Build.0 = ReleaseStatic|x64 + {1C6E0108-2860-4B17-9F7E-FA5C6C1F3D3D}.ReleaseStatic|x86.ActiveCfg = ReleaseStatic|Win32 + {1C6E0108-2860-4B17-9F7E-FA5C6C1F3D3D}.ReleaseStatic|x86.Build.0 = ReleaseStatic|Win32 {1C6E0108-2860-4B17-9F7E-FA5C6C1F3D3D}.TestRelease|ARM64.ActiveCfg = Release|ARM64 {1C6E0108-2860-4B17-9F7E-FA5C6C1F3D3D}.TestRelease|ARM64.Build.0 = Release|ARM64 {1C6E0108-2860-4B17-9F7E-FA5C6C1F3D3D}.TestRelease|x64.ActiveCfg = Release|x64 {1C6E0108-2860-4B17-9F7E-FA5C6C1F3D3D}.TestRelease|x64.Build.0 = Release|x64 {1C6E0108-2860-4B17-9F7E-FA5C6C1F3D3D}.TestRelease|x86.ActiveCfg = Release|Win32 {1C6E0108-2860-4B17-9F7E-FA5C6C1F3D3D}.TestRelease|x86.Build.0 = Release|Win32 - {89B1AAB4-2BBC-4B65-9ED7-A01D5CF88230}.Debug|Any CPU.ActiveCfg = Debug|x64 {89B1AAB4-2BBC-4B65-9ED7-A01D5CF88230}.Debug|ARM64.ActiveCfg = Debug|ARM64 {89B1AAB4-2BBC-4B65-9ED7-A01D5CF88230}.Debug|ARM64.Build.0 = Debug|ARM64 {89B1AAB4-2BBC-4B65-9ED7-A01D5CF88230}.Debug|x64.ActiveCfg = Debug|x64 {89B1AAB4-2BBC-4B65-9ED7-A01D5CF88230}.Debug|x64.Build.0 = Debug|x64 {89B1AAB4-2BBC-4B65-9ED7-A01D5CF88230}.Debug|x86.ActiveCfg = Debug|Win32 {89B1AAB4-2BBC-4B65-9ED7-A01D5CF88230}.Debug|x86.Build.0 = Debug|Win32 - {89B1AAB4-2BBC-4B65-9ED7-A01D5CF88230}.Fuzzing|Any CPU.ActiveCfg = Release|x64 {89B1AAB4-2BBC-4B65-9ED7-A01D5CF88230}.Fuzzing|ARM64.ActiveCfg = Release|x64 {89B1AAB4-2BBC-4B65-9ED7-A01D5CF88230}.Fuzzing|x64.ActiveCfg = Release|x64 {89B1AAB4-2BBC-4B65-9ED7-A01D5CF88230}.Fuzzing|x86.ActiveCfg = Release|Win32 - {89B1AAB4-2BBC-4B65-9ED7-A01D5CF88230}.PowerShell|Any CPU.ActiveCfg = Release|x64 - {89B1AAB4-2BBC-4B65-9ED7-A01D5CF88230}.PowerShell|ARM64.ActiveCfg = Release|x64 - {89B1AAB4-2BBC-4B65-9ED7-A01D5CF88230}.PowerShell|x64.ActiveCfg = Release|x64 - {89B1AAB4-2BBC-4B65-9ED7-A01D5CF88230}.PowerShell|x86.ActiveCfg = Release|Win32 - {89B1AAB4-2BBC-4B65-9ED7-A01D5CF88230}.Release|Any CPU.ActiveCfg = Release|x64 {89B1AAB4-2BBC-4B65-9ED7-A01D5CF88230}.Release|ARM64.ActiveCfg = Release|ARM64 {89B1AAB4-2BBC-4B65-9ED7-A01D5CF88230}.Release|ARM64.Build.0 = Release|ARM64 {89B1AAB4-2BBC-4B65-9ED7-A01D5CF88230}.Release|x64.ActiveCfg = Release|x64 {89B1AAB4-2BBC-4B65-9ED7-A01D5CF88230}.Release|x64.Build.0 = Release|x64 {89B1AAB4-2BBC-4B65-9ED7-A01D5CF88230}.Release|x86.ActiveCfg = Release|Win32 {89B1AAB4-2BBC-4B65-9ED7-A01D5CF88230}.Release|x86.Build.0 = Release|Win32 - {89B1AAB4-2BBC-4B65-9ED7-A01D5CF88230}.TestRelease|Any CPU.ActiveCfg = Release|x64 + {89B1AAB4-2BBC-4B65-9ED7-A01D5CF88230}.ReleaseStatic|ARM64.ActiveCfg = Release|x64 + {89B1AAB4-2BBC-4B65-9ED7-A01D5CF88230}.ReleaseStatic|x64.ActiveCfg = Release|x64 + {89B1AAB4-2BBC-4B65-9ED7-A01D5CF88230}.ReleaseStatic|x86.ActiveCfg = Release|Win32 {89B1AAB4-2BBC-4B65-9ED7-A01D5CF88230}.TestRelease|ARM64.ActiveCfg = Release|x64 {89B1AAB4-2BBC-4B65-9ED7-A01D5CF88230}.TestRelease|x64.ActiveCfg = Release|x64 {89B1AAB4-2BBC-4B65-9ED7-A01D5CF88230}.TestRelease|x86.ActiveCfg = Release|Win32 - {5EB88068-5FB9-4E69-89B2-72DBC5E068F9}.Debug|Any CPU.ActiveCfg = Debug|x64 {5EB88068-5FB9-4E69-89B2-72DBC5E068F9}.Debug|ARM64.ActiveCfg = Debug|ARM64 {5EB88068-5FB9-4E69-89B2-72DBC5E068F9}.Debug|ARM64.Build.0 = Debug|ARM64 {5EB88068-5FB9-4E69-89B2-72DBC5E068F9}.Debug|x64.ActiveCfg = Debug|x64 {5EB88068-5FB9-4E69-89B2-72DBC5E068F9}.Debug|x64.Build.0 = Debug|x64 {5EB88068-5FB9-4E69-89B2-72DBC5E068F9}.Debug|x86.ActiveCfg = Debug|Win32 {5EB88068-5FB9-4E69-89B2-72DBC5E068F9}.Debug|x86.Build.0 = Debug|Win32 - {5EB88068-5FB9-4E69-89B2-72DBC5E068F9}.Fuzzing|Any CPU.ActiveCfg = Release|x64 {5EB88068-5FB9-4E69-89B2-72DBC5E068F9}.Fuzzing|ARM64.ActiveCfg = Release|ARM64 {5EB88068-5FB9-4E69-89B2-72DBC5E068F9}.Fuzzing|x64.ActiveCfg = Release|x64 {5EB88068-5FB9-4E69-89B2-72DBC5E068F9}.Fuzzing|x86.ActiveCfg = Release|Win32 - {5EB88068-5FB9-4E69-89B2-72DBC5E068F9}.PowerShell|Any CPU.ActiveCfg = ReleaseStatic|x64 - {5EB88068-5FB9-4E69-89B2-72DBC5E068F9}.PowerShell|ARM64.ActiveCfg = ReleaseStatic|ARM64 - {5EB88068-5FB9-4E69-89B2-72DBC5E068F9}.PowerShell|ARM64.Build.0 = ReleaseStatic|ARM64 - {5EB88068-5FB9-4E69-89B2-72DBC5E068F9}.PowerShell|x64.ActiveCfg = ReleaseStatic|x64 - {5EB88068-5FB9-4E69-89B2-72DBC5E068F9}.PowerShell|x64.Build.0 = ReleaseStatic|x64 - {5EB88068-5FB9-4E69-89B2-72DBC5E068F9}.PowerShell|x86.ActiveCfg = ReleaseStatic|Win32 - {5EB88068-5FB9-4E69-89B2-72DBC5E068F9}.PowerShell|x86.Build.0 = ReleaseStatic|Win32 - {5EB88068-5FB9-4E69-89B2-72DBC5E068F9}.Release|Any CPU.ActiveCfg = Release|x64 {5EB88068-5FB9-4E69-89B2-72DBC5E068F9}.Release|ARM64.ActiveCfg = Release|ARM64 {5EB88068-5FB9-4E69-89B2-72DBC5E068F9}.Release|ARM64.Build.0 = Release|ARM64 {5EB88068-5FB9-4E69-89B2-72DBC5E068F9}.Release|x64.ActiveCfg = Release|x64 {5EB88068-5FB9-4E69-89B2-72DBC5E068F9}.Release|x64.Build.0 = Release|x64 {5EB88068-5FB9-4E69-89B2-72DBC5E068F9}.Release|x86.ActiveCfg = Release|Win32 {5EB88068-5FB9-4E69-89B2-72DBC5E068F9}.Release|x86.Build.0 = Release|Win32 - {5EB88068-5FB9-4E69-89B2-72DBC5E068F9}.TestRelease|Any CPU.ActiveCfg = Release|x64 + {5EB88068-5FB9-4E69-89B2-72DBC5E068F9}.ReleaseStatic|ARM64.ActiveCfg = ReleaseStatic|ARM64 + {5EB88068-5FB9-4E69-89B2-72DBC5E068F9}.ReleaseStatic|ARM64.Build.0 = ReleaseStatic|ARM64 + {5EB88068-5FB9-4E69-89B2-72DBC5E068F9}.ReleaseStatic|x64.ActiveCfg = ReleaseStatic|x64 + {5EB88068-5FB9-4E69-89B2-72DBC5E068F9}.ReleaseStatic|x64.Build.0 = ReleaseStatic|x64 + {5EB88068-5FB9-4E69-89B2-72DBC5E068F9}.ReleaseStatic|x86.ActiveCfg = ReleaseStatic|Win32 + {5EB88068-5FB9-4E69-89B2-72DBC5E068F9}.ReleaseStatic|x86.Build.0 = ReleaseStatic|Win32 {5EB88068-5FB9-4E69-89B2-72DBC5E068F9}.TestRelease|ARM64.ActiveCfg = Release|ARM64 {5EB88068-5FB9-4E69-89B2-72DBC5E068F9}.TestRelease|ARM64.Build.0 = Release|ARM64 {5EB88068-5FB9-4E69-89B2-72DBC5E068F9}.TestRelease|x64.ActiveCfg = Release|x64 {5EB88068-5FB9-4E69-89B2-72DBC5E068F9}.TestRelease|x64.Build.0 = Release|x64 {5EB88068-5FB9-4E69-89B2-72DBC5E068F9}.TestRelease|x86.ActiveCfg = Release|Win32 {5EB88068-5FB9-4E69-89B2-72DBC5E068F9}.TestRelease|x86.Build.0 = Release|Win32 - {8BB94BB8-374F-4294-BCA1-C7811514A6B7}.Debug|Any CPU.ActiveCfg = Debug|x64 {8BB94BB8-374F-4294-BCA1-C7811514A6B7}.Debug|ARM64.ActiveCfg = Debug|ARM64 {8BB94BB8-374F-4294-BCA1-C7811514A6B7}.Debug|ARM64.Build.0 = Debug|ARM64 {8BB94BB8-374F-4294-BCA1-C7811514A6B7}.Debug|x64.ActiveCfg = Debug|x64 {8BB94BB8-374F-4294-BCA1-C7811514A6B7}.Debug|x64.Build.0 = Debug|x64 {8BB94BB8-374F-4294-BCA1-C7811514A6B7}.Debug|x86.ActiveCfg = Debug|Win32 {8BB94BB8-374F-4294-BCA1-C7811514A6B7}.Debug|x86.Build.0 = Debug|Win32 - {8BB94BB8-374F-4294-BCA1-C7811514A6B7}.Fuzzing|Any CPU.ActiveCfg = Fuzzing|x64 {8BB94BB8-374F-4294-BCA1-C7811514A6B7}.Fuzzing|ARM64.ActiveCfg = Fuzzing|ARM64 {8BB94BB8-374F-4294-BCA1-C7811514A6B7}.Fuzzing|x64.ActiveCfg = Fuzzing|x64 {8BB94BB8-374F-4294-BCA1-C7811514A6B7}.Fuzzing|x64.Build.0 = Fuzzing|x64 {8BB94BB8-374F-4294-BCA1-C7811514A6B7}.Fuzzing|x86.ActiveCfg = Fuzzing|Win32 {8BB94BB8-374F-4294-BCA1-C7811514A6B7}.Fuzzing|x86.Build.0 = Fuzzing|Win32 - {8BB94BB8-374F-4294-BCA1-C7811514A6B7}.PowerShell|Any CPU.ActiveCfg = ReleaseStatic|x64 - {8BB94BB8-374F-4294-BCA1-C7811514A6B7}.PowerShell|ARM64.ActiveCfg = ReleaseStatic|ARM64 - {8BB94BB8-374F-4294-BCA1-C7811514A6B7}.PowerShell|ARM64.Build.0 = ReleaseStatic|ARM64 - {8BB94BB8-374F-4294-BCA1-C7811514A6B7}.PowerShell|x64.ActiveCfg = ReleaseStatic|x64 - {8BB94BB8-374F-4294-BCA1-C7811514A6B7}.PowerShell|x64.Build.0 = ReleaseStatic|x64 - {8BB94BB8-374F-4294-BCA1-C7811514A6B7}.PowerShell|x86.ActiveCfg = ReleaseStatic|Win32 - {8BB94BB8-374F-4294-BCA1-C7811514A6B7}.PowerShell|x86.Build.0 = ReleaseStatic|Win32 - {8BB94BB8-374F-4294-BCA1-C7811514A6B7}.Release|Any CPU.ActiveCfg = Release|x64 {8BB94BB8-374F-4294-BCA1-C7811514A6B7}.Release|ARM64.ActiveCfg = Release|ARM64 {8BB94BB8-374F-4294-BCA1-C7811514A6B7}.Release|ARM64.Build.0 = Release|ARM64 {8BB94BB8-374F-4294-BCA1-C7811514A6B7}.Release|x64.ActiveCfg = Release|x64 {8BB94BB8-374F-4294-BCA1-C7811514A6B7}.Release|x64.Build.0 = Release|x64 {8BB94BB8-374F-4294-BCA1-C7811514A6B7}.Release|x86.ActiveCfg = Release|Win32 {8BB94BB8-374F-4294-BCA1-C7811514A6B7}.Release|x86.Build.0 = Release|Win32 - {8BB94BB8-374F-4294-BCA1-C7811514A6B7}.TestRelease|Any CPU.ActiveCfg = Release|x64 + {8BB94BB8-374F-4294-BCA1-C7811514A6B7}.ReleaseStatic|ARM64.ActiveCfg = ReleaseStatic|ARM64 + {8BB94BB8-374F-4294-BCA1-C7811514A6B7}.ReleaseStatic|ARM64.Build.0 = ReleaseStatic|ARM64 + {8BB94BB8-374F-4294-BCA1-C7811514A6B7}.ReleaseStatic|x64.ActiveCfg = ReleaseStatic|x64 + {8BB94BB8-374F-4294-BCA1-C7811514A6B7}.ReleaseStatic|x64.Build.0 = ReleaseStatic|x64 + {8BB94BB8-374F-4294-BCA1-C7811514A6B7}.ReleaseStatic|x86.ActiveCfg = ReleaseStatic|Win32 + {8BB94BB8-374F-4294-BCA1-C7811514A6B7}.ReleaseStatic|x86.Build.0 = ReleaseStatic|Win32 {8BB94BB8-374F-4294-BCA1-C7811514A6B7}.TestRelease|ARM64.ActiveCfg = Release|ARM64 {8BB94BB8-374F-4294-BCA1-C7811514A6B7}.TestRelease|ARM64.Build.0 = Release|ARM64 {8BB94BB8-374F-4294-BCA1-C7811514A6B7}.TestRelease|x64.ActiveCfg = Release|x64 {8BB94BB8-374F-4294-BCA1-C7811514A6B7}.TestRelease|x64.Build.0 = Release|x64 {8BB94BB8-374F-4294-BCA1-C7811514A6B7}.TestRelease|x86.ActiveCfg = Release|Win32 {8BB94BB8-374F-4294-BCA1-C7811514A6B7}.TestRelease|x86.Build.0 = Release|Win32 - {5890D6ED-7C3B-40F3-B436-B54F640D9E65}.Debug|Any CPU.ActiveCfg = Debug|x64 {5890D6ED-7C3B-40F3-B436-B54F640D9E65}.Debug|ARM64.ActiveCfg = Debug|ARM64 {5890D6ED-7C3B-40F3-B436-B54F640D9E65}.Debug|ARM64.Build.0 = Debug|ARM64 {5890D6ED-7C3B-40F3-B436-B54F640D9E65}.Debug|x64.ActiveCfg = Debug|x64 {5890D6ED-7C3B-40F3-B436-B54F640D9E65}.Debug|x64.Build.0 = Debug|x64 {5890D6ED-7C3B-40F3-B436-B54F640D9E65}.Debug|x86.ActiveCfg = Debug|Win32 {5890D6ED-7C3B-40F3-B436-B54F640D9E65}.Debug|x86.Build.0 = Debug|Win32 - {5890D6ED-7C3B-40F3-B436-B54F640D9E65}.Fuzzing|Any CPU.ActiveCfg = Fuzzing|x64 {5890D6ED-7C3B-40F3-B436-B54F640D9E65}.Fuzzing|ARM64.ActiveCfg = Release|ARM64 {5890D6ED-7C3B-40F3-B436-B54F640D9E65}.Fuzzing|x64.ActiveCfg = Fuzzing|x64 {5890D6ED-7C3B-40F3-B436-B54F640D9E65}.Fuzzing|x64.Build.0 = Fuzzing|x64 {5890D6ED-7C3B-40F3-B436-B54F640D9E65}.Fuzzing|x86.ActiveCfg = Fuzzing|Win32 {5890D6ED-7C3B-40F3-B436-B54F640D9E65}.Fuzzing|x86.Build.0 = Fuzzing|Win32 - {5890D6ED-7C3B-40F3-B436-B54F640D9E65}.PowerShell|Any CPU.ActiveCfg = ReleaseStatic|x64 - {5890D6ED-7C3B-40F3-B436-B54F640D9E65}.PowerShell|ARM64.ActiveCfg = ReleaseStatic|ARM64 - {5890D6ED-7C3B-40F3-B436-B54F640D9E65}.PowerShell|ARM64.Build.0 = ReleaseStatic|ARM64 - {5890D6ED-7C3B-40F3-B436-B54F640D9E65}.PowerShell|x64.ActiveCfg = ReleaseStatic|x64 - {5890D6ED-7C3B-40F3-B436-B54F640D9E65}.PowerShell|x64.Build.0 = ReleaseStatic|x64 - {5890D6ED-7C3B-40F3-B436-B54F640D9E65}.PowerShell|x86.ActiveCfg = ReleaseStatic|Win32 - {5890D6ED-7C3B-40F3-B436-B54F640D9E65}.PowerShell|x86.Build.0 = ReleaseStatic|Win32 - {5890D6ED-7C3B-40F3-B436-B54F640D9E65}.Release|Any CPU.ActiveCfg = Release|x64 {5890D6ED-7C3B-40F3-B436-B54F640D9E65}.Release|ARM64.ActiveCfg = Release|ARM64 {5890D6ED-7C3B-40F3-B436-B54F640D9E65}.Release|ARM64.Build.0 = Release|ARM64 {5890D6ED-7C3B-40F3-B436-B54F640D9E65}.Release|x64.ActiveCfg = Release|x64 {5890D6ED-7C3B-40F3-B436-B54F640D9E65}.Release|x64.Build.0 = Release|x64 {5890D6ED-7C3B-40F3-B436-B54F640D9E65}.Release|x86.ActiveCfg = Release|Win32 {5890D6ED-7C3B-40F3-B436-B54F640D9E65}.Release|x86.Build.0 = Release|Win32 - {5890D6ED-7C3B-40F3-B436-B54F640D9E65}.TestRelease|Any CPU.ActiveCfg = Release|x64 + {5890D6ED-7C3B-40F3-B436-B54F640D9E65}.ReleaseStatic|ARM64.ActiveCfg = ReleaseStatic|ARM64 + {5890D6ED-7C3B-40F3-B436-B54F640D9E65}.ReleaseStatic|ARM64.Build.0 = ReleaseStatic|ARM64 + {5890D6ED-7C3B-40F3-B436-B54F640D9E65}.ReleaseStatic|x64.ActiveCfg = ReleaseStatic|x64 + {5890D6ED-7C3B-40F3-B436-B54F640D9E65}.ReleaseStatic|x64.Build.0 = ReleaseStatic|x64 + {5890D6ED-7C3B-40F3-B436-B54F640D9E65}.ReleaseStatic|x86.ActiveCfg = ReleaseStatic|Win32 + {5890D6ED-7C3B-40F3-B436-B54F640D9E65}.ReleaseStatic|x86.Build.0 = ReleaseStatic|Win32 {5890D6ED-7C3B-40F3-B436-B54F640D9E65}.TestRelease|ARM64.ActiveCfg = Release|ARM64 {5890D6ED-7C3B-40F3-B436-B54F640D9E65}.TestRelease|ARM64.Build.0 = Release|ARM64 {5890D6ED-7C3B-40F3-B436-B54F640D9E65}.TestRelease|x64.ActiveCfg = Release|x64 {5890D6ED-7C3B-40F3-B436-B54F640D9E65}.TestRelease|x64.Build.0 = Release|x64 {5890D6ED-7C3B-40F3-B436-B54F640D9E65}.TestRelease|x86.ActiveCfg = Release|Win32 {5890D6ED-7C3B-40F3-B436-B54F640D9E65}.TestRelease|x86.Build.0 = Release|Win32 - {FB313532-38B0-4676-9303-AB200AA13576}.Debug|Any CPU.ActiveCfg = Debug|x64 {FB313532-38B0-4676-9303-AB200AA13576}.Debug|ARM64.ActiveCfg = Debug|ARM64 {FB313532-38B0-4676-9303-AB200AA13576}.Debug|ARM64.Build.0 = Debug|ARM64 {FB313532-38B0-4676-9303-AB200AA13576}.Debug|x64.ActiveCfg = Debug|x64 {FB313532-38B0-4676-9303-AB200AA13576}.Debug|x64.Build.0 = Debug|x64 {FB313532-38B0-4676-9303-AB200AA13576}.Debug|x86.ActiveCfg = Debug|Win32 {FB313532-38B0-4676-9303-AB200AA13576}.Debug|x86.Build.0 = Debug|Win32 - {FB313532-38B0-4676-9303-AB200AA13576}.Fuzzing|Any CPU.ActiveCfg = Release|x64 {FB313532-38B0-4676-9303-AB200AA13576}.Fuzzing|ARM64.ActiveCfg = Release|ARM64 {FB313532-38B0-4676-9303-AB200AA13576}.Fuzzing|x64.ActiveCfg = Release|x64 {FB313532-38B0-4676-9303-AB200AA13576}.Fuzzing|x86.ActiveCfg = Release|Win32 - {FB313532-38B0-4676-9303-AB200AA13576}.PowerShell|Any CPU.ActiveCfg = Release|x64 - {FB313532-38B0-4676-9303-AB200AA13576}.PowerShell|ARM64.ActiveCfg = Release|ARM64 - {FB313532-38B0-4676-9303-AB200AA13576}.PowerShell|x64.ActiveCfg = Release|x64 - {FB313532-38B0-4676-9303-AB200AA13576}.PowerShell|x86.ActiveCfg = Release|Win32 - {FB313532-38B0-4676-9303-AB200AA13576}.Release|Any CPU.ActiveCfg = Release|x64 {FB313532-38B0-4676-9303-AB200AA13576}.Release|ARM64.ActiveCfg = Release|ARM64 {FB313532-38B0-4676-9303-AB200AA13576}.Release|ARM64.Build.0 = Release|ARM64 {FB313532-38B0-4676-9303-AB200AA13576}.Release|x64.ActiveCfg = Release|x64 {FB313532-38B0-4676-9303-AB200AA13576}.Release|x64.Build.0 = Release|x64 {FB313532-38B0-4676-9303-AB200AA13576}.Release|x86.ActiveCfg = Release|Win32 {FB313532-38B0-4676-9303-AB200AA13576}.Release|x86.Build.0 = Release|Win32 - {FB313532-38B0-4676-9303-AB200AA13576}.TestRelease|Any CPU.ActiveCfg = Release|x64 + {FB313532-38B0-4676-9303-AB200AA13576}.ReleaseStatic|ARM64.ActiveCfg = Release|ARM64 + {FB313532-38B0-4676-9303-AB200AA13576}.ReleaseStatic|x64.ActiveCfg = Release|x64 + {FB313532-38B0-4676-9303-AB200AA13576}.ReleaseStatic|x86.ActiveCfg = Release|Win32 {FB313532-38B0-4676-9303-AB200AA13576}.TestRelease|ARM64.ActiveCfg = Release|ARM64 {FB313532-38B0-4676-9303-AB200AA13576}.TestRelease|x64.ActiveCfg = Release|x64 {FB313532-38B0-4676-9303-AB200AA13576}.TestRelease|x86.ActiveCfg = Release|Win32 - {6CB84692-5994-407D-B9BD-9216AF77FE83}.Debug|Any CPU.ActiveCfg = Debug|x64 {6CB84692-5994-407D-B9BD-9216AF77FE83}.Debug|ARM64.ActiveCfg = Debug|ARM64 {6CB84692-5994-407D-B9BD-9216AF77FE83}.Debug|ARM64.Build.0 = Debug|ARM64 {6CB84692-5994-407D-B9BD-9216AF77FE83}.Debug|x64.ActiveCfg = Debug|x64 {6CB84692-5994-407D-B9BD-9216AF77FE83}.Debug|x64.Build.0 = Debug|x64 {6CB84692-5994-407D-B9BD-9216AF77FE83}.Debug|x86.ActiveCfg = Debug|Win32 {6CB84692-5994-407D-B9BD-9216AF77FE83}.Debug|x86.Build.0 = Debug|Win32 - {6CB84692-5994-407D-B9BD-9216AF77FE83}.Fuzzing|Any CPU.ActiveCfg = Release|x64 {6CB84692-5994-407D-B9BD-9216AF77FE83}.Fuzzing|ARM64.ActiveCfg = Release|ARM64 {6CB84692-5994-407D-B9BD-9216AF77FE83}.Fuzzing|x64.ActiveCfg = Release|x64 {6CB84692-5994-407D-B9BD-9216AF77FE83}.Fuzzing|x86.ActiveCfg = Release|Win32 - {6CB84692-5994-407D-B9BD-9216AF77FE83}.PowerShell|Any CPU.ActiveCfg = Release|x64 - {6CB84692-5994-407D-B9BD-9216AF77FE83}.PowerShell|ARM64.ActiveCfg = Release|ARM64 - {6CB84692-5994-407D-B9BD-9216AF77FE83}.PowerShell|x64.ActiveCfg = Release|x64 - {6CB84692-5994-407D-B9BD-9216AF77FE83}.PowerShell|x86.ActiveCfg = Release|Win32 - {6CB84692-5994-407D-B9BD-9216AF77FE83}.Release|Any CPU.ActiveCfg = Release|x64 {6CB84692-5994-407D-B9BD-9216AF77FE83}.Release|ARM64.ActiveCfg = Release|ARM64 {6CB84692-5994-407D-B9BD-9216AF77FE83}.Release|ARM64.Build.0 = Release|ARM64 {6CB84692-5994-407D-B9BD-9216AF77FE83}.Release|x64.ActiveCfg = Release|x64 {6CB84692-5994-407D-B9BD-9216AF77FE83}.Release|x64.Build.0 = Release|x64 {6CB84692-5994-407D-B9BD-9216AF77FE83}.Release|x86.ActiveCfg = Release|Win32 {6CB84692-5994-407D-B9BD-9216AF77FE83}.Release|x86.Build.0 = Release|Win32 - {6CB84692-5994-407D-B9BD-9216AF77FE83}.TestRelease|Any CPU.ActiveCfg = Release|x64 + {6CB84692-5994-407D-B9BD-9216AF77FE83}.ReleaseStatic|ARM64.ActiveCfg = Release|ARM64 + {6CB84692-5994-407D-B9BD-9216AF77FE83}.ReleaseStatic|x64.ActiveCfg = Release|x64 + {6CB84692-5994-407D-B9BD-9216AF77FE83}.ReleaseStatic|x86.ActiveCfg = Release|Win32 {6CB84692-5994-407D-B9BD-9216AF77FE83}.TestRelease|ARM64.ActiveCfg = Release|ARM64 {6CB84692-5994-407D-B9BD-9216AF77FE83}.TestRelease|x64.ActiveCfg = Release|x64 {6CB84692-5994-407D-B9BD-9216AF77FE83}.TestRelease|x86.ActiveCfg = Release|Win32 - {3C0269FA-E582-4CA7-9E33-3881A005CA0C}.Debug|Any CPU.ActiveCfg = Debug|x64 {3C0269FA-E582-4CA7-9E33-3881A005CA0C}.Debug|ARM64.ActiveCfg = Debug|x64 {3C0269FA-E582-4CA7-9E33-3881A005CA0C}.Debug|x64.ActiveCfg = Debug|x64 {3C0269FA-E582-4CA7-9E33-3881A005CA0C}.Debug|x64.Build.0 = Debug|x64 {3C0269FA-E582-4CA7-9E33-3881A005CA0C}.Debug|x86.ActiveCfg = Debug|x86 {3C0269FA-E582-4CA7-9E33-3881A005CA0C}.Debug|x86.Build.0 = Debug|x86 - {3C0269FA-E582-4CA7-9E33-3881A005CA0C}.Fuzzing|Any CPU.ActiveCfg = Release|x64 {3C0269FA-E582-4CA7-9E33-3881A005CA0C}.Fuzzing|ARM64.ActiveCfg = Release|x64 {3C0269FA-E582-4CA7-9E33-3881A005CA0C}.Fuzzing|x64.ActiveCfg = Release|x64 {3C0269FA-E582-4CA7-9E33-3881A005CA0C}.Fuzzing|x86.ActiveCfg = Release|x86 - {3C0269FA-E582-4CA7-9E33-3881A005CA0C}.PowerShell|Any CPU.ActiveCfg = Release|x64 - {3C0269FA-E582-4CA7-9E33-3881A005CA0C}.PowerShell|ARM64.ActiveCfg = Release|x86 - {3C0269FA-E582-4CA7-9E33-3881A005CA0C}.PowerShell|x64.ActiveCfg = Release|x64 - {3C0269FA-E582-4CA7-9E33-3881A005CA0C}.PowerShell|x86.ActiveCfg = Release|x86 - {3C0269FA-E582-4CA7-9E33-3881A005CA0C}.Release|Any CPU.ActiveCfg = Release|x64 {3C0269FA-E582-4CA7-9E33-3881A005CA0C}.Release|ARM64.ActiveCfg = Release|x64 {3C0269FA-E582-4CA7-9E33-3881A005CA0C}.Release|x64.ActiveCfg = Release|x64 {3C0269FA-E582-4CA7-9E33-3881A005CA0C}.Release|x64.Build.0 = Release|x64 {3C0269FA-E582-4CA7-9E33-3881A005CA0C}.Release|x86.ActiveCfg = Release|x86 {3C0269FA-E582-4CA7-9E33-3881A005CA0C}.Release|x86.Build.0 = Release|x86 - {3C0269FA-E582-4CA7-9E33-3881A005CA0C}.TestRelease|Any CPU.ActiveCfg = Release|x64 + {3C0269FA-E582-4CA7-9E33-3881A005CA0C}.ReleaseStatic|ARM64.ActiveCfg = Release|x86 + {3C0269FA-E582-4CA7-9E33-3881A005CA0C}.ReleaseStatic|x64.ActiveCfg = Release|x64 + {3C0269FA-E582-4CA7-9E33-3881A005CA0C}.ReleaseStatic|x86.ActiveCfg = Release|x86 {3C0269FA-E582-4CA7-9E33-3881A005CA0C}.TestRelease|ARM64.ActiveCfg = Release|x64 {3C0269FA-E582-4CA7-9E33-3881A005CA0C}.TestRelease|x64.ActiveCfg = Release|x64 {3C0269FA-E582-4CA7-9E33-3881A005CA0C}.TestRelease|x86.ActiveCfg = Release|x86 - {3E2CBA31-CEBA-4D63-BF52-49C0718E19EA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {3E2CBA31-CEBA-4D63-BF52-49C0718E19EA}.Debug|ARM64.ActiveCfg = Debug|ARM64 {3E2CBA31-CEBA-4D63-BF52-49C0718E19EA}.Debug|ARM64.Build.0 = Debug|ARM64 {3E2CBA31-CEBA-4D63-BF52-49C0718E19EA}.Debug|ARM64.Deploy.0 = Debug|ARM64 @@ -537,15 +486,9 @@ Global {3E2CBA31-CEBA-4D63-BF52-49C0718E19EA}.Debug|x86.ActiveCfg = Debug|x86 {3E2CBA31-CEBA-4D63-BF52-49C0718E19EA}.Debug|x86.Build.0 = Debug|x86 {3E2CBA31-CEBA-4D63-BF52-49C0718E19EA}.Debug|x86.Deploy.0 = Debug|x86 - {3E2CBA31-CEBA-4D63-BF52-49C0718E19EA}.Fuzzing|Any CPU.ActiveCfg = Release|Any CPU {3E2CBA31-CEBA-4D63-BF52-49C0718E19EA}.Fuzzing|ARM64.ActiveCfg = Release|ARM64 {3E2CBA31-CEBA-4D63-BF52-49C0718E19EA}.Fuzzing|x64.ActiveCfg = Release|x64 {3E2CBA31-CEBA-4D63-BF52-49C0718E19EA}.Fuzzing|x86.ActiveCfg = Release|x86 - {3E2CBA31-CEBA-4D63-BF52-49C0718E19EA}.PowerShell|Any CPU.ActiveCfg = Release|Any CPU - {3E2CBA31-CEBA-4D63-BF52-49C0718E19EA}.PowerShell|ARM64.ActiveCfg = Release|ARM64 - {3E2CBA31-CEBA-4D63-BF52-49C0718E19EA}.PowerShell|x64.ActiveCfg = Release|x64 - {3E2CBA31-CEBA-4D63-BF52-49C0718E19EA}.PowerShell|x86.ActiveCfg = Release|x86 - {3E2CBA31-CEBA-4D63-BF52-49C0718E19EA}.Release|Any CPU.ActiveCfg = Release|Any CPU {3E2CBA31-CEBA-4D63-BF52-49C0718E19EA}.Release|ARM64.ActiveCfg = Release|ARM64 {3E2CBA31-CEBA-4D63-BF52-49C0718E19EA}.Release|ARM64.Build.0 = Release|ARM64 {3E2CBA31-CEBA-4D63-BF52-49C0718E19EA}.Release|ARM64.Deploy.0 = Release|ARM64 @@ -555,916 +498,785 @@ Global {3E2CBA31-CEBA-4D63-BF52-49C0718E19EA}.Release|x86.ActiveCfg = Release|x86 {3E2CBA31-CEBA-4D63-BF52-49C0718E19EA}.Release|x86.Build.0 = Release|x86 {3E2CBA31-CEBA-4D63-BF52-49C0718E19EA}.Release|x86.Deploy.0 = Release|x86 - {3E2CBA31-CEBA-4D63-BF52-49C0718E19EA}.TestRelease|Any CPU.ActiveCfg = Release|Any CPU + {3E2CBA31-CEBA-4D63-BF52-49C0718E19EA}.ReleaseStatic|ARM64.ActiveCfg = Release|ARM64 + {3E2CBA31-CEBA-4D63-BF52-49C0718E19EA}.ReleaseStatic|x64.ActiveCfg = Release|x64 + {3E2CBA31-CEBA-4D63-BF52-49C0718E19EA}.ReleaseStatic|x86.ActiveCfg = Release|x86 {3E2CBA31-CEBA-4D63-BF52-49C0718E19EA}.TestRelease|ARM64.ActiveCfg = Release|ARM64 {3E2CBA31-CEBA-4D63-BF52-49C0718E19EA}.TestRelease|x64.ActiveCfg = Release|x64 {3E2CBA31-CEBA-4D63-BF52-49C0718E19EA}.TestRelease|x86.ActiveCfg = Release|x86 - {C1624B2F-2BF6-4E28-92FA-1BF85C6B62A8}.Debug|Any CPU.ActiveCfg = Debug {C1624B2F-2BF6-4E28-92FA-1BF85C6B62A8}.Debug|ARM64.ActiveCfg = Debug {C1624B2F-2BF6-4E28-92FA-1BF85C6B62A8}.Debug|x64.ActiveCfg = Debug {C1624B2F-2BF6-4E28-92FA-1BF85C6B62A8}.Debug|x86.ActiveCfg = Debug - {C1624B2F-2BF6-4E28-92FA-1BF85C6B62A8}.Fuzzing|Any CPU.ActiveCfg = Release {C1624B2F-2BF6-4E28-92FA-1BF85C6B62A8}.Fuzzing|ARM64.ActiveCfg = Release {C1624B2F-2BF6-4E28-92FA-1BF85C6B62A8}.Fuzzing|x64.ActiveCfg = Release {C1624B2F-2BF6-4E28-92FA-1BF85C6B62A8}.Fuzzing|x86.ActiveCfg = Release - {C1624B2F-2BF6-4E28-92FA-1BF85C6B62A8}.PowerShell|Any CPU.ActiveCfg = Release - {C1624B2F-2BF6-4E28-92FA-1BF85C6B62A8}.PowerShell|ARM64.ActiveCfg = Release - {C1624B2F-2BF6-4E28-92FA-1BF85C6B62A8}.PowerShell|x64.ActiveCfg = Release - {C1624B2F-2BF6-4E28-92FA-1BF85C6B62A8}.PowerShell|x86.ActiveCfg = Release - {C1624B2F-2BF6-4E28-92FA-1BF85C6B62A8}.Release|Any CPU.ActiveCfg = Release {C1624B2F-2BF6-4E28-92FA-1BF85C6B62A8}.Release|ARM64.ActiveCfg = Release {C1624B2F-2BF6-4E28-92FA-1BF85C6B62A8}.Release|x64.ActiveCfg = Release {C1624B2F-2BF6-4E28-92FA-1BF85C6B62A8}.Release|x86.ActiveCfg = Release - {C1624B2F-2BF6-4E28-92FA-1BF85C6B62A8}.TestRelease|Any CPU.ActiveCfg = Release + {C1624B2F-2BF6-4E28-92FA-1BF85C6B62A8}.ReleaseStatic|ARM64.ActiveCfg = Release + {C1624B2F-2BF6-4E28-92FA-1BF85C6B62A8}.ReleaseStatic|x64.ActiveCfg = Release + {C1624B2F-2BF6-4E28-92FA-1BF85C6B62A8}.ReleaseStatic|x86.ActiveCfg = Release {C1624B2F-2BF6-4E28-92FA-1BF85C6B62A8}.TestRelease|ARM64.ActiveCfg = Release {C1624B2F-2BF6-4E28-92FA-1BF85C6B62A8}.TestRelease|x64.ActiveCfg = Release {C1624B2F-2BF6-4E28-92FA-1BF85C6B62A8}.TestRelease|x86.ActiveCfg = Release - {3B8466CF-4FDD-4329-9C80-91321C4AAC99}.Debug|Any CPU.ActiveCfg = Debug|x64 {3B8466CF-4FDD-4329-9C80-91321C4AAC99}.Debug|ARM64.ActiveCfg = Debug|x64 {3B8466CF-4FDD-4329-9C80-91321C4AAC99}.Debug|x64.ActiveCfg = Debug|x64 {3B8466CF-4FDD-4329-9C80-91321C4AAC99}.Debug|x64.Build.0 = Debug|x64 {3B8466CF-4FDD-4329-9C80-91321C4AAC99}.Debug|x86.ActiveCfg = Debug|x86 {3B8466CF-4FDD-4329-9C80-91321C4AAC99}.Debug|x86.Build.0 = Debug|x86 - {3B8466CF-4FDD-4329-9C80-91321C4AAC99}.Fuzzing|Any CPU.ActiveCfg = Release|x64 {3B8466CF-4FDD-4329-9C80-91321C4AAC99}.Fuzzing|ARM64.ActiveCfg = Release|x64 {3B8466CF-4FDD-4329-9C80-91321C4AAC99}.Fuzzing|x64.ActiveCfg = Release|x64 {3B8466CF-4FDD-4329-9C80-91321C4AAC99}.Fuzzing|x86.ActiveCfg = Release|x86 - {3B8466CF-4FDD-4329-9C80-91321C4AAC99}.PowerShell|Any CPU.ActiveCfg = Release|x64 - {3B8466CF-4FDD-4329-9C80-91321C4AAC99}.PowerShell|ARM64.ActiveCfg = Release|x64 - {3B8466CF-4FDD-4329-9C80-91321C4AAC99}.PowerShell|x64.ActiveCfg = Release|x64 - {3B8466CF-4FDD-4329-9C80-91321C4AAC99}.PowerShell|x86.ActiveCfg = Release|x86 - {3B8466CF-4FDD-4329-9C80-91321C4AAC99}.Release|Any CPU.ActiveCfg = Release|x64 {3B8466CF-4FDD-4329-9C80-91321C4AAC99}.Release|ARM64.ActiveCfg = Release|x64 {3B8466CF-4FDD-4329-9C80-91321C4AAC99}.Release|x64.ActiveCfg = Release|x64 {3B8466CF-4FDD-4329-9C80-91321C4AAC99}.Release|x64.Build.0 = Release|x64 {3B8466CF-4FDD-4329-9C80-91321C4AAC99}.Release|x86.ActiveCfg = Release|x86 {3B8466CF-4FDD-4329-9C80-91321C4AAC99}.Release|x86.Build.0 = Release|x86 - {3B8466CF-4FDD-4329-9C80-91321C4AAC99}.TestRelease|Any CPU.ActiveCfg = Release|x64 + {3B8466CF-4FDD-4329-9C80-91321C4AAC99}.ReleaseStatic|ARM64.ActiveCfg = Release|x64 + {3B8466CF-4FDD-4329-9C80-91321C4AAC99}.ReleaseStatic|x64.ActiveCfg = Release|x64 + {3B8466CF-4FDD-4329-9C80-91321C4AAC99}.ReleaseStatic|x86.ActiveCfg = Release|x86 {3B8466CF-4FDD-4329-9C80-91321C4AAC99}.TestRelease|ARM64.ActiveCfg = Release|x64 {3B8466CF-4FDD-4329-9C80-91321C4AAC99}.TestRelease|x64.ActiveCfg = Release|x64 {3B8466CF-4FDD-4329-9C80-91321C4AAC99}.TestRelease|x86.ActiveCfg = Release|x86 - {82B39FDA-E86B-4713-A873-9D56DE00247A}.Debug|Any CPU.ActiveCfg = Debug|x64 {82B39FDA-E86B-4713-A873-9D56DE00247A}.Debug|ARM64.ActiveCfg = Debug|ARM64 {82B39FDA-E86B-4713-A873-9D56DE00247A}.Debug|ARM64.Build.0 = Debug|ARM64 {82B39FDA-E86B-4713-A873-9D56DE00247A}.Debug|x64.ActiveCfg = Debug|x64 {82B39FDA-E86B-4713-A873-9D56DE00247A}.Debug|x64.Build.0 = Debug|x64 {82B39FDA-E86B-4713-A873-9D56DE00247A}.Debug|x86.ActiveCfg = Debug|Win32 {82B39FDA-E86B-4713-A873-9D56DE00247A}.Debug|x86.Build.0 = Debug|Win32 - {82B39FDA-E86B-4713-A873-9D56DE00247A}.Fuzzing|Any CPU.ActiveCfg = Fuzzing|x64 {82B39FDA-E86B-4713-A873-9D56DE00247A}.Fuzzing|ARM64.ActiveCfg = Release|ARM64 {82B39FDA-E86B-4713-A873-9D56DE00247A}.Fuzzing|x64.ActiveCfg = Fuzzing|x64 {82B39FDA-E86B-4713-A873-9D56DE00247A}.Fuzzing|x64.Build.0 = Fuzzing|x64 {82B39FDA-E86B-4713-A873-9D56DE00247A}.Fuzzing|x86.ActiveCfg = Fuzzing|Win32 {82B39FDA-E86B-4713-A873-9D56DE00247A}.Fuzzing|x86.Build.0 = Fuzzing|Win32 - {82B39FDA-E86B-4713-A873-9D56DE00247A}.PowerShell|Any CPU.ActiveCfg = ReleaseStatic|x64 - {82B39FDA-E86B-4713-A873-9D56DE00247A}.PowerShell|ARM64.ActiveCfg = ReleaseStatic|ARM64 - {82B39FDA-E86B-4713-A873-9D56DE00247A}.PowerShell|ARM64.Build.0 = ReleaseStatic|ARM64 - {82B39FDA-E86B-4713-A873-9D56DE00247A}.PowerShell|x64.ActiveCfg = ReleaseStatic|x64 - {82B39FDA-E86B-4713-A873-9D56DE00247A}.PowerShell|x64.Build.0 = ReleaseStatic|x64 - {82B39FDA-E86B-4713-A873-9D56DE00247A}.PowerShell|x86.ActiveCfg = ReleaseStatic|Win32 - {82B39FDA-E86B-4713-A873-9D56DE00247A}.PowerShell|x86.Build.0 = ReleaseStatic|Win32 - {82B39FDA-E86B-4713-A873-9D56DE00247A}.Release|Any CPU.ActiveCfg = Release|x64 {82B39FDA-E86B-4713-A873-9D56DE00247A}.Release|ARM64.ActiveCfg = Release|ARM64 {82B39FDA-E86B-4713-A873-9D56DE00247A}.Release|ARM64.Build.0 = Release|ARM64 {82B39FDA-E86B-4713-A873-9D56DE00247A}.Release|x64.ActiveCfg = Release|x64 {82B39FDA-E86B-4713-A873-9D56DE00247A}.Release|x64.Build.0 = Release|x64 {82B39FDA-E86B-4713-A873-9D56DE00247A}.Release|x86.ActiveCfg = Release|Win32 {82B39FDA-E86B-4713-A873-9D56DE00247A}.Release|x86.Build.0 = Release|Win32 - {82B39FDA-E86B-4713-A873-9D56DE00247A}.TestRelease|Any CPU.ActiveCfg = Release|x64 + {82B39FDA-E86B-4713-A873-9D56DE00247A}.ReleaseStatic|ARM64.ActiveCfg = ReleaseStatic|ARM64 + {82B39FDA-E86B-4713-A873-9D56DE00247A}.ReleaseStatic|ARM64.Build.0 = ReleaseStatic|ARM64 + {82B39FDA-E86B-4713-A873-9D56DE00247A}.ReleaseStatic|x64.ActiveCfg = ReleaseStatic|x64 + {82B39FDA-E86B-4713-A873-9D56DE00247A}.ReleaseStatic|x64.Build.0 = ReleaseStatic|x64 + {82B39FDA-E86B-4713-A873-9D56DE00247A}.ReleaseStatic|x86.ActiveCfg = ReleaseStatic|Win32 + {82B39FDA-E86B-4713-A873-9D56DE00247A}.ReleaseStatic|x86.Build.0 = ReleaseStatic|Win32 {82B39FDA-E86B-4713-A873-9D56DE00247A}.TestRelease|ARM64.ActiveCfg = Release|ARM64 {82B39FDA-E86B-4713-A873-9D56DE00247A}.TestRelease|ARM64.Build.0 = Release|ARM64 {82B39FDA-E86B-4713-A873-9D56DE00247A}.TestRelease|x64.ActiveCfg = Release|x64 {82B39FDA-E86B-4713-A873-9D56DE00247A}.TestRelease|x64.Build.0 = Release|x64 {82B39FDA-E86B-4713-A873-9D56DE00247A}.TestRelease|x86.ActiveCfg = Release|Win32 {82B39FDA-E86B-4713-A873-9D56DE00247A}.TestRelease|x86.Build.0 = Release|Win32 - {1622DA16-914F-4F57-A259-D5169003CC8C}.Debug|Any CPU.ActiveCfg = Debug|x64 {1622DA16-914F-4F57-A259-D5169003CC8C}.Debug|ARM64.ActiveCfg = Debug|x64 {1622DA16-914F-4F57-A259-D5169003CC8C}.Debug|x64.ActiveCfg = Debug|x64 {1622DA16-914F-4F57-A259-D5169003CC8C}.Debug|x86.ActiveCfg = Fuzzing|Win32 - {1622DA16-914F-4F57-A259-D5169003CC8C}.Fuzzing|Any CPU.ActiveCfg = Fuzzing|x64 {1622DA16-914F-4F57-A259-D5169003CC8C}.Fuzzing|ARM64.ActiveCfg = Fuzzing|x64 {1622DA16-914F-4F57-A259-D5169003CC8C}.Fuzzing|x64.ActiveCfg = Fuzzing|x64 {1622DA16-914F-4F57-A259-D5169003CC8C}.Fuzzing|x64.Build.0 = Fuzzing|x64 {1622DA16-914F-4F57-A259-D5169003CC8C}.Fuzzing|x86.ActiveCfg = Fuzzing|Win32 {1622DA16-914F-4F57-A259-D5169003CC8C}.Fuzzing|x86.Build.0 = Fuzzing|Win32 - {1622DA16-914F-4F57-A259-D5169003CC8C}.PowerShell|Any CPU.ActiveCfg = Fuzzing|x64 - {1622DA16-914F-4F57-A259-D5169003CC8C}.PowerShell|ARM64.ActiveCfg = Fuzzing|x64 - {1622DA16-914F-4F57-A259-D5169003CC8C}.PowerShell|x64.ActiveCfg = Fuzzing|x64 - {1622DA16-914F-4F57-A259-D5169003CC8C}.PowerShell|x86.ActiveCfg = Fuzzing|Win32 - {1622DA16-914F-4F57-A259-D5169003CC8C}.Release|Any CPU.ActiveCfg = Debug|x64 {1622DA16-914F-4F57-A259-D5169003CC8C}.Release|ARM64.ActiveCfg = Fuzzing|x64 {1622DA16-914F-4F57-A259-D5169003CC8C}.Release|x64.ActiveCfg = Fuzzing|x64 {1622DA16-914F-4F57-A259-D5169003CC8C}.Release|x86.ActiveCfg = Fuzzing|Win32 - {1622DA16-914F-4F57-A259-D5169003CC8C}.TestRelease|Any CPU.ActiveCfg = Fuzzing|x64 + {1622DA16-914F-4F57-A259-D5169003CC8C}.ReleaseStatic|ARM64.ActiveCfg = Fuzzing|x64 + {1622DA16-914F-4F57-A259-D5169003CC8C}.ReleaseStatic|x64.ActiveCfg = Fuzzing|x64 + {1622DA16-914F-4F57-A259-D5169003CC8C}.ReleaseStatic|x86.ActiveCfg = Fuzzing|Win32 {1622DA16-914F-4F57-A259-D5169003CC8C}.TestRelease|ARM64.ActiveCfg = Fuzzing|x64 {1622DA16-914F-4F57-A259-D5169003CC8C}.TestRelease|x64.ActiveCfg = Fuzzing|x64 {1622DA16-914F-4F57-A259-D5169003CC8C}.TestRelease|x86.ActiveCfg = Fuzzing|Win32 - {3BAF989F-7F65-465B-ACE8-BAFE42D1017E}.Debug|Any CPU.ActiveCfg = Debug|x64 {3BAF989F-7F65-465B-ACE8-BAFE42D1017E}.Debug|ARM64.ActiveCfg = Debug|x64 {3BAF989F-7F65-465B-ACE8-BAFE42D1017E}.Debug|x64.ActiveCfg = Debug|x64 {3BAF989F-7F65-465B-ACE8-BAFE42D1017E}.Debug|x64.Build.0 = Debug|x64 {3BAF989F-7F65-465B-ACE8-BAFE42D1017E}.Debug|x86.ActiveCfg = Debug|x86 {3BAF989F-7F65-465B-ACE8-BAFE42D1017E}.Debug|x86.Build.0 = Debug|x86 - {3BAF989F-7F65-465B-ACE8-BAFE42D1017E}.Fuzzing|Any CPU.ActiveCfg = Release|x64 {3BAF989F-7F65-465B-ACE8-BAFE42D1017E}.Fuzzing|ARM64.ActiveCfg = Release|x64 {3BAF989F-7F65-465B-ACE8-BAFE42D1017E}.Fuzzing|x64.ActiveCfg = Release|x64 {3BAF989F-7F65-465B-ACE8-BAFE42D1017E}.Fuzzing|x86.ActiveCfg = Release|x86 - {3BAF989F-7F65-465B-ACE8-BAFE42D1017E}.PowerShell|Any CPU.ActiveCfg = Release|x64 - {3BAF989F-7F65-465B-ACE8-BAFE42D1017E}.PowerShell|ARM64.ActiveCfg = Release|x64 - {3BAF989F-7F65-465B-ACE8-BAFE42D1017E}.PowerShell|x64.ActiveCfg = Release|x64 - {3BAF989F-7F65-465B-ACE8-BAFE42D1017E}.PowerShell|x86.ActiveCfg = Release|x86 - {3BAF989F-7F65-465B-ACE8-BAFE42D1017E}.Release|Any CPU.ActiveCfg = Release|x64 {3BAF989F-7F65-465B-ACE8-BAFE42D1017E}.Release|ARM64.ActiveCfg = Release|x64 {3BAF989F-7F65-465B-ACE8-BAFE42D1017E}.Release|x64.ActiveCfg = Release|x64 {3BAF989F-7F65-465B-ACE8-BAFE42D1017E}.Release|x64.Build.0 = Release|x64 {3BAF989F-7F65-465B-ACE8-BAFE42D1017E}.Release|x86.ActiveCfg = Release|x86 {3BAF989F-7F65-465B-ACE8-BAFE42D1017E}.Release|x86.Build.0 = Release|x86 - {3BAF989F-7F65-465B-ACE8-BAFE42D1017E}.TestRelease|Any CPU.ActiveCfg = Release|x64 + {3BAF989F-7F65-465B-ACE8-BAFE42D1017E}.ReleaseStatic|ARM64.ActiveCfg = Release|x64 + {3BAF989F-7F65-465B-ACE8-BAFE42D1017E}.ReleaseStatic|x64.ActiveCfg = Release|x64 + {3BAF989F-7F65-465B-ACE8-BAFE42D1017E}.ReleaseStatic|x86.ActiveCfg = Release|x86 {3BAF989F-7F65-465B-ACE8-BAFE42D1017E}.TestRelease|ARM64.ActiveCfg = Release|x64 {3BAF989F-7F65-465B-ACE8-BAFE42D1017E}.TestRelease|x64.ActiveCfg = Release|x64 {3BAF989F-7F65-465B-ACE8-BAFE42D1017E}.TestRelease|x86.ActiveCfg = Release|x86 - {866C3F06-636F-4BE8-BC24-5F86ECC606A1}.Debug|Any CPU.ActiveCfg = Debug|x64 {866C3F06-636F-4BE8-BC24-5F86ECC606A1}.Debug|ARM64.ActiveCfg = Debug|ARM64 {866C3F06-636F-4BE8-BC24-5F86ECC606A1}.Debug|ARM64.Build.0 = Debug|ARM64 {866C3F06-636F-4BE8-BC24-5F86ECC606A1}.Debug|x64.ActiveCfg = Debug|x64 {866C3F06-636F-4BE8-BC24-5F86ECC606A1}.Debug|x64.Build.0 = Debug|x64 {866C3F06-636F-4BE8-BC24-5F86ECC606A1}.Debug|x86.ActiveCfg = Debug|Win32 {866C3F06-636F-4BE8-BC24-5F86ECC606A1}.Debug|x86.Build.0 = Debug|Win32 - {866C3F06-636F-4BE8-BC24-5F86ECC606A1}.Fuzzing|Any CPU.ActiveCfg = Release|x64 {866C3F06-636F-4BE8-BC24-5F86ECC606A1}.Fuzzing|ARM64.ActiveCfg = Release|ARM64 {866C3F06-636F-4BE8-BC24-5F86ECC606A1}.Fuzzing|x64.ActiveCfg = Release|x64 {866C3F06-636F-4BE8-BC24-5F86ECC606A1}.Fuzzing|x86.ActiveCfg = Release|Win32 - {866C3F06-636F-4BE8-BC24-5F86ECC606A1}.PowerShell|Any CPU.ActiveCfg = ReleaseStatic|x64 - {866C3F06-636F-4BE8-BC24-5F86ECC606A1}.PowerShell|ARM64.ActiveCfg = ReleaseStatic|ARM64 - {866C3F06-636F-4BE8-BC24-5F86ECC606A1}.PowerShell|ARM64.Build.0 = ReleaseStatic|ARM64 - {866C3F06-636F-4BE8-BC24-5F86ECC606A1}.PowerShell|x64.ActiveCfg = ReleaseStatic|x64 - {866C3F06-636F-4BE8-BC24-5F86ECC606A1}.PowerShell|x64.Build.0 = ReleaseStatic|x64 - {866C3F06-636F-4BE8-BC24-5F86ECC606A1}.PowerShell|x86.ActiveCfg = ReleaseStatic|Win32 - {866C3F06-636F-4BE8-BC24-5F86ECC606A1}.PowerShell|x86.Build.0 = ReleaseStatic|Win32 - {866C3F06-636F-4BE8-BC24-5F86ECC606A1}.Release|Any CPU.ActiveCfg = Release|x64 {866C3F06-636F-4BE8-BC24-5F86ECC606A1}.Release|ARM64.ActiveCfg = Release|ARM64 {866C3F06-636F-4BE8-BC24-5F86ECC606A1}.Release|ARM64.Build.0 = Release|ARM64 {866C3F06-636F-4BE8-BC24-5F86ECC606A1}.Release|x64.ActiveCfg = Release|x64 {866C3F06-636F-4BE8-BC24-5F86ECC606A1}.Release|x64.Build.0 = Release|x64 {866C3F06-636F-4BE8-BC24-5F86ECC606A1}.Release|x86.ActiveCfg = Release|Win32 {866C3F06-636F-4BE8-BC24-5F86ECC606A1}.Release|x86.Build.0 = Release|Win32 - {866C3F06-636F-4BE8-BC24-5F86ECC606A1}.TestRelease|Any CPU.ActiveCfg = Release|x64 + {866C3F06-636F-4BE8-BC24-5F86ECC606A1}.ReleaseStatic|ARM64.ActiveCfg = ReleaseStatic|ARM64 + {866C3F06-636F-4BE8-BC24-5F86ECC606A1}.ReleaseStatic|ARM64.Build.0 = ReleaseStatic|ARM64 + {866C3F06-636F-4BE8-BC24-5F86ECC606A1}.ReleaseStatic|x64.ActiveCfg = ReleaseStatic|x64 + {866C3F06-636F-4BE8-BC24-5F86ECC606A1}.ReleaseStatic|x64.Build.0 = ReleaseStatic|x64 + {866C3F06-636F-4BE8-BC24-5F86ECC606A1}.ReleaseStatic|x86.ActiveCfg = ReleaseStatic|Win32 + {866C3F06-636F-4BE8-BC24-5F86ECC606A1}.ReleaseStatic|x86.Build.0 = ReleaseStatic|Win32 {866C3F06-636F-4BE8-BC24-5F86ECC606A1}.TestRelease|ARM64.ActiveCfg = Release|ARM64 {866C3F06-636F-4BE8-BC24-5F86ECC606A1}.TestRelease|ARM64.Build.0 = Release|ARM64 {866C3F06-636F-4BE8-BC24-5F86ECC606A1}.TestRelease|x64.ActiveCfg = Release|x64 {866C3F06-636F-4BE8-BC24-5F86ECC606A1}.TestRelease|x64.Build.0 = Release|x64 {866C3F06-636F-4BE8-BC24-5F86ECC606A1}.TestRelease|x86.ActiveCfg = Release|Win32 {866C3F06-636F-4BE8-BC24-5F86ECC606A1}.TestRelease|x86.Build.0 = Release|Win32 - {1CC41A9A-AE66-459D-9210-1E572DD7BE69}.Debug|Any CPU.ActiveCfg = Debug|x64 {1CC41A9A-AE66-459D-9210-1E572DD7BE69}.Debug|ARM64.ActiveCfg = Debug|ARM64 {1CC41A9A-AE66-459D-9210-1E572DD7BE69}.Debug|ARM64.Build.0 = Debug|ARM64 {1CC41A9A-AE66-459D-9210-1E572DD7BE69}.Debug|x64.ActiveCfg = Debug|x64 {1CC41A9A-AE66-459D-9210-1E572DD7BE69}.Debug|x64.Build.0 = Debug|x64 {1CC41A9A-AE66-459D-9210-1E572DD7BE69}.Debug|x86.ActiveCfg = Debug|Win32 {1CC41A9A-AE66-459D-9210-1E572DD7BE69}.Debug|x86.Build.0 = Debug|Win32 - {1CC41A9A-AE66-459D-9210-1E572DD7BE69}.Fuzzing|Any CPU.ActiveCfg = Release|x64 {1CC41A9A-AE66-459D-9210-1E572DD7BE69}.Fuzzing|ARM64.ActiveCfg = Release|ARM64 {1CC41A9A-AE66-459D-9210-1E572DD7BE69}.Fuzzing|x64.ActiveCfg = Release|x64 {1CC41A9A-AE66-459D-9210-1E572DD7BE69}.Fuzzing|x86.ActiveCfg = Release|Win32 - {1CC41A9A-AE66-459D-9210-1E572DD7BE69}.PowerShell|Any CPU.ActiveCfg = ReleaseStatic|x64 - {1CC41A9A-AE66-459D-9210-1E572DD7BE69}.PowerShell|ARM64.ActiveCfg = ReleaseStatic|ARM64 - {1CC41A9A-AE66-459D-9210-1E572DD7BE69}.PowerShell|ARM64.Build.0 = ReleaseStatic|ARM64 - {1CC41A9A-AE66-459D-9210-1E572DD7BE69}.PowerShell|x64.ActiveCfg = ReleaseStatic|x64 - {1CC41A9A-AE66-459D-9210-1E572DD7BE69}.PowerShell|x64.Build.0 = ReleaseStatic|x64 - {1CC41A9A-AE66-459D-9210-1E572DD7BE69}.PowerShell|x86.ActiveCfg = ReleaseStatic|Win32 - {1CC41A9A-AE66-459D-9210-1E572DD7BE69}.PowerShell|x86.Build.0 = ReleaseStatic|Win32 - {1CC41A9A-AE66-459D-9210-1E572DD7BE69}.Release|Any CPU.ActiveCfg = Release|x64 {1CC41A9A-AE66-459D-9210-1E572DD7BE69}.Release|ARM64.ActiveCfg = Release|ARM64 {1CC41A9A-AE66-459D-9210-1E572DD7BE69}.Release|ARM64.Build.0 = Release|ARM64 {1CC41A9A-AE66-459D-9210-1E572DD7BE69}.Release|x64.ActiveCfg = Release|x64 {1CC41A9A-AE66-459D-9210-1E572DD7BE69}.Release|x64.Build.0 = Release|x64 {1CC41A9A-AE66-459D-9210-1E572DD7BE69}.Release|x86.ActiveCfg = Release|Win32 {1CC41A9A-AE66-459D-9210-1E572DD7BE69}.Release|x86.Build.0 = Release|Win32 - {1CC41A9A-AE66-459D-9210-1E572DD7BE69}.TestRelease|Any CPU.ActiveCfg = Release|x64 + {1CC41A9A-AE66-459D-9210-1E572DD7BE69}.ReleaseStatic|ARM64.ActiveCfg = ReleaseStatic|ARM64 + {1CC41A9A-AE66-459D-9210-1E572DD7BE69}.ReleaseStatic|ARM64.Build.0 = ReleaseStatic|ARM64 + {1CC41A9A-AE66-459D-9210-1E572DD7BE69}.ReleaseStatic|x64.ActiveCfg = ReleaseStatic|x64 + {1CC41A9A-AE66-459D-9210-1E572DD7BE69}.ReleaseStatic|x64.Build.0 = ReleaseStatic|x64 + {1CC41A9A-AE66-459D-9210-1E572DD7BE69}.ReleaseStatic|x86.ActiveCfg = ReleaseStatic|Win32 + {1CC41A9A-AE66-459D-9210-1E572DD7BE69}.ReleaseStatic|x86.Build.0 = ReleaseStatic|Win32 {1CC41A9A-AE66-459D-9210-1E572DD7BE69}.TestRelease|ARM64.ActiveCfg = Release|ARM64 {1CC41A9A-AE66-459D-9210-1E572DD7BE69}.TestRelease|ARM64.Build.0 = Release|ARM64 {1CC41A9A-AE66-459D-9210-1E572DD7BE69}.TestRelease|x64.ActiveCfg = Release|x64 {1CC41A9A-AE66-459D-9210-1E572DD7BE69}.TestRelease|x64.Build.0 = Release|x64 {1CC41A9A-AE66-459D-9210-1E572DD7BE69}.TestRelease|x86.ActiveCfg = Release|Win32 {1CC41A9A-AE66-459D-9210-1E572DD7BE69}.TestRelease|x86.Build.0 = Release|Win32 - {2B00D362-AC92-41F3-A8D2-5B1599BDCA01}.Debug|Any CPU.ActiveCfg = Debug|x64 {2B00D362-AC92-41F3-A8D2-5B1599BDCA01}.Debug|ARM64.ActiveCfg = Debug|ARM64 {2B00D362-AC92-41F3-A8D2-5B1599BDCA01}.Debug|ARM64.Build.0 = Debug|ARM64 {2B00D362-AC92-41F3-A8D2-5B1599BDCA01}.Debug|x64.ActiveCfg = Debug|x64 {2B00D362-AC92-41F3-A8D2-5B1599BDCA01}.Debug|x64.Build.0 = Debug|x64 {2B00D362-AC92-41F3-A8D2-5B1599BDCA01}.Debug|x86.ActiveCfg = Debug|Win32 {2B00D362-AC92-41F3-A8D2-5B1599BDCA01}.Debug|x86.Build.0 = Debug|Win32 - {2B00D362-AC92-41F3-A8D2-5B1599BDCA01}.Fuzzing|Any CPU.ActiveCfg = Release|x64 {2B00D362-AC92-41F3-A8D2-5B1599BDCA01}.Fuzzing|ARM64.ActiveCfg = Release|ARM64 {2B00D362-AC92-41F3-A8D2-5B1599BDCA01}.Fuzzing|x64.ActiveCfg = Release|x64 {2B00D362-AC92-41F3-A8D2-5B1599BDCA01}.Fuzzing|x86.ActiveCfg = Release|Win32 - {2B00D362-AC92-41F3-A8D2-5B1599BDCA01}.PowerShell|Any CPU.ActiveCfg = Release|x64 - {2B00D362-AC92-41F3-A8D2-5B1599BDCA01}.PowerShell|ARM64.ActiveCfg = Release|ARM64 - {2B00D362-AC92-41F3-A8D2-5B1599BDCA01}.PowerShell|ARM64.Build.0 = Release|ARM64 - {2B00D362-AC92-41F3-A8D2-5B1599BDCA01}.PowerShell|x64.ActiveCfg = Release|x64 - {2B00D362-AC92-41F3-A8D2-5B1599BDCA01}.PowerShell|x64.Build.0 = Release|x64 - {2B00D362-AC92-41F3-A8D2-5B1599BDCA01}.PowerShell|x86.ActiveCfg = Release|Win32 - {2B00D362-AC92-41F3-A8D2-5B1599BDCA01}.PowerShell|x86.Build.0 = Release|Win32 - {2B00D362-AC92-41F3-A8D2-5B1599BDCA01}.Release|Any CPU.ActiveCfg = Release|x64 {2B00D362-AC92-41F3-A8D2-5B1599BDCA01}.Release|ARM64.ActiveCfg = Release|ARM64 {2B00D362-AC92-41F3-A8D2-5B1599BDCA01}.Release|ARM64.Build.0 = Release|ARM64 {2B00D362-AC92-41F3-A8D2-5B1599BDCA01}.Release|x64.ActiveCfg = Release|x64 {2B00D362-AC92-41F3-A8D2-5B1599BDCA01}.Release|x64.Build.0 = Release|x64 {2B00D362-AC92-41F3-A8D2-5B1599BDCA01}.Release|x86.ActiveCfg = Release|Win32 {2B00D362-AC92-41F3-A8D2-5B1599BDCA01}.Release|x86.Build.0 = Release|Win32 - {2B00D362-AC92-41F3-A8D2-5B1599BDCA01}.TestRelease|Any CPU.ActiveCfg = Release|x64 + {2B00D362-AC92-41F3-A8D2-5B1599BDCA01}.ReleaseStatic|ARM64.ActiveCfg = Release|ARM64 + {2B00D362-AC92-41F3-A8D2-5B1599BDCA01}.ReleaseStatic|ARM64.Build.0 = Release|ARM64 + {2B00D362-AC92-41F3-A8D2-5B1599BDCA01}.ReleaseStatic|x64.ActiveCfg = Release|x64 + {2B00D362-AC92-41F3-A8D2-5B1599BDCA01}.ReleaseStatic|x64.Build.0 = Release|x64 + {2B00D362-AC92-41F3-A8D2-5B1599BDCA01}.ReleaseStatic|x86.ActiveCfg = Release|Win32 + {2B00D362-AC92-41F3-A8D2-5B1599BDCA01}.ReleaseStatic|x86.Build.0 = Release|Win32 {2B00D362-AC92-41F3-A8D2-5B1599BDCA01}.TestRelease|ARM64.ActiveCfg = Release|ARM64 {2B00D362-AC92-41F3-A8D2-5B1599BDCA01}.TestRelease|x64.ActiveCfg = Release|x64 {2B00D362-AC92-41F3-A8D2-5B1599BDCA01}.TestRelease|x86.ActiveCfg = Release|Win32 - {846FB88B-BF1B-4F33-9883-E589CEC99739}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {846FB88B-BF1B-4F33-9883-E589CEC99739}.Debug|ARM64.ActiveCfg = Debug|Any CPU {846FB88B-BF1B-4F33-9883-E589CEC99739}.Debug|ARM64.Build.0 = Debug|Any CPU {846FB88B-BF1B-4F33-9883-E589CEC99739}.Debug|x64.ActiveCfg = Debug|Any CPU {846FB88B-BF1B-4F33-9883-E589CEC99739}.Debug|x64.Build.0 = Debug|Any CPU {846FB88B-BF1B-4F33-9883-E589CEC99739}.Debug|x86.ActiveCfg = Debug|Any CPU {846FB88B-BF1B-4F33-9883-E589CEC99739}.Debug|x86.Build.0 = Debug|Any CPU - {846FB88B-BF1B-4F33-9883-E589CEC99739}.Fuzzing|Any CPU.ActiveCfg = Release|Any CPU {846FB88B-BF1B-4F33-9883-E589CEC99739}.Fuzzing|ARM64.ActiveCfg = Release|Any CPU {846FB88B-BF1B-4F33-9883-E589CEC99739}.Fuzzing|x64.ActiveCfg = Release|Any CPU {846FB88B-BF1B-4F33-9883-E589CEC99739}.Fuzzing|x86.ActiveCfg = Release|Any CPU - {846FB88B-BF1B-4F33-9883-E589CEC99739}.PowerShell|Any CPU.ActiveCfg = Release|Any CPU - {846FB88B-BF1B-4F33-9883-E589CEC99739}.PowerShell|ARM64.ActiveCfg = Release|Any CPU - {846FB88B-BF1B-4F33-9883-E589CEC99739}.PowerShell|x64.ActiveCfg = Release|Any CPU - {846FB88B-BF1B-4F33-9883-E589CEC99739}.PowerShell|x86.ActiveCfg = Release|Any CPU - {846FB88B-BF1B-4F33-9883-E589CEC99739}.Release|Any CPU.ActiveCfg = Release|Any CPU {846FB88B-BF1B-4F33-9883-E589CEC99739}.Release|ARM64.ActiveCfg = Release|Any CPU {846FB88B-BF1B-4F33-9883-E589CEC99739}.Release|ARM64.Build.0 = Release|Any CPU {846FB88B-BF1B-4F33-9883-E589CEC99739}.Release|x64.ActiveCfg = Release|Any CPU {846FB88B-BF1B-4F33-9883-E589CEC99739}.Release|x64.Build.0 = Release|Any CPU {846FB88B-BF1B-4F33-9883-E589CEC99739}.Release|x86.ActiveCfg = Release|Any CPU {846FB88B-BF1B-4F33-9883-E589CEC99739}.Release|x86.Build.0 = Release|Any CPU - {846FB88B-BF1B-4F33-9883-E589CEC99739}.TestRelease|Any CPU.ActiveCfg = Release|Any CPU + {846FB88B-BF1B-4F33-9883-E589CEC99739}.ReleaseStatic|ARM64.ActiveCfg = Release|Any CPU + {846FB88B-BF1B-4F33-9883-E589CEC99739}.ReleaseStatic|x64.ActiveCfg = Release|Any CPU + {846FB88B-BF1B-4F33-9883-E589CEC99739}.ReleaseStatic|x86.ActiveCfg = Release|Any CPU {846FB88B-BF1B-4F33-9883-E589CEC99739}.TestRelease|ARM64.ActiveCfg = Release|Any CPU {846FB88B-BF1B-4F33-9883-E589CEC99739}.TestRelease|x64.ActiveCfg = Release|Any CPU {846FB88B-BF1B-4F33-9883-E589CEC99739}.TestRelease|x86.ActiveCfg = Release|Any CPU - {68808357-902B-406C-8C19-E8E26A69DE8A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {68808357-902B-406C-8C19-E8E26A69DE8A}.Debug|ARM64.ActiveCfg = Debug|ARM64 {68808357-902B-406C-8C19-E8E26A69DE8A}.Debug|x64.ActiveCfg = Debug|x64 {68808357-902B-406C-8C19-E8E26A69DE8A}.Debug|x64.Build.0 = Debug|x64 {68808357-902B-406C-8C19-E8E26A69DE8A}.Debug|x86.ActiveCfg = Debug|x86 {68808357-902B-406C-8C19-E8E26A69DE8A}.Debug|x86.Build.0 = Debug|x86 - {68808357-902B-406C-8C19-E8E26A69DE8A}.Fuzzing|Any CPU.ActiveCfg = Release|Any CPU {68808357-902B-406C-8C19-E8E26A69DE8A}.Fuzzing|ARM64.ActiveCfg = Release|Any CPU {68808357-902B-406C-8C19-E8E26A69DE8A}.Fuzzing|x64.ActiveCfg = Release|Any CPU {68808357-902B-406C-8C19-E8E26A69DE8A}.Fuzzing|x86.ActiveCfg = Release|x86 - {68808357-902B-406C-8C19-E8E26A69DE8A}.PowerShell|Any CPU.ActiveCfg = Release|Any CPU - {68808357-902B-406C-8C19-E8E26A69DE8A}.PowerShell|ARM64.ActiveCfg = Release|Any CPU - {68808357-902B-406C-8C19-E8E26A69DE8A}.PowerShell|x64.ActiveCfg = Release|Any CPU - {68808357-902B-406C-8C19-E8E26A69DE8A}.PowerShell|x86.ActiveCfg = Release|x86 - {68808357-902B-406C-8C19-E8E26A69DE8A}.Release|Any CPU.ActiveCfg = Release|Any CPU {68808357-902B-406C-8C19-E8E26A69DE8A}.Release|ARM64.ActiveCfg = Release|ARM64 {68808357-902B-406C-8C19-E8E26A69DE8A}.Release|x64.ActiveCfg = Release|x64 {68808357-902B-406C-8C19-E8E26A69DE8A}.Release|x64.Build.0 = Release|x64 {68808357-902B-406C-8C19-E8E26A69DE8A}.Release|x86.ActiveCfg = Release|x86 {68808357-902B-406C-8C19-E8E26A69DE8A}.Release|x86.Build.0 = Release|x86 - {68808357-902B-406C-8C19-E8E26A69DE8A}.TestRelease|Any CPU.ActiveCfg = Release|Any CPU + {68808357-902B-406C-8C19-E8E26A69DE8A}.ReleaseStatic|ARM64.ActiveCfg = Release|Any CPU + {68808357-902B-406C-8C19-E8E26A69DE8A}.ReleaseStatic|x64.ActiveCfg = Release|Any CPU + {68808357-902B-406C-8C19-E8E26A69DE8A}.ReleaseStatic|x86.ActiveCfg = Release|x86 {68808357-902B-406C-8C19-E8E26A69DE8A}.TestRelease|ARM64.ActiveCfg = Release|ARM64 {68808357-902B-406C-8C19-E8E26A69DE8A}.TestRelease|x64.ActiveCfg = Release|x64 {68808357-902B-406C-8C19-E8E26A69DE8A}.TestRelease|x86.ActiveCfg = Release|x86 - {2046B5AF-666D-4CE8-8D3E-C32C57908A56}.Debug|Any CPU.ActiveCfg = Debug|x64 {2046B5AF-666D-4CE8-8D3E-C32C57908A56}.Debug|ARM64.ActiveCfg = Debug|ARM64 {2046B5AF-666D-4CE8-8D3E-C32C57908A56}.Debug|ARM64.Build.0 = Debug|ARM64 {2046B5AF-666D-4CE8-8D3E-C32C57908A56}.Debug|x64.ActiveCfg = Debug|x64 {2046B5AF-666D-4CE8-8D3E-C32C57908A56}.Debug|x64.Build.0 = Debug|x64 {2046B5AF-666D-4CE8-8D3E-C32C57908A56}.Debug|x86.ActiveCfg = Debug|Win32 {2046B5AF-666D-4CE8-8D3E-C32C57908A56}.Debug|x86.Build.0 = Debug|Win32 - {2046B5AF-666D-4CE8-8D3E-C32C57908A56}.Fuzzing|Any CPU.ActiveCfg = Release|x64 {2046B5AF-666D-4CE8-8D3E-C32C57908A56}.Fuzzing|ARM64.ActiveCfg = Release|ARM64 {2046B5AF-666D-4CE8-8D3E-C32C57908A56}.Fuzzing|x64.ActiveCfg = Release|x64 {2046B5AF-666D-4CE8-8D3E-C32C57908A56}.Fuzzing|x86.ActiveCfg = Release|Win32 - {2046B5AF-666D-4CE8-8D3E-C32C57908A56}.PowerShell|Any CPU.ActiveCfg = ReleaseStatic|x64 - {2046B5AF-666D-4CE8-8D3E-C32C57908A56}.PowerShell|ARM64.ActiveCfg = ReleaseStatic|ARM64 - {2046B5AF-666D-4CE8-8D3E-C32C57908A56}.PowerShell|ARM64.Build.0 = ReleaseStatic|ARM64 - {2046B5AF-666D-4CE8-8D3E-C32C57908A56}.PowerShell|x64.ActiveCfg = ReleaseStatic|x64 - {2046B5AF-666D-4CE8-8D3E-C32C57908A56}.PowerShell|x64.Build.0 = ReleaseStatic|x64 - {2046B5AF-666D-4CE8-8D3E-C32C57908A56}.PowerShell|x86.ActiveCfg = ReleaseStatic|Win32 - {2046B5AF-666D-4CE8-8D3E-C32C57908A56}.PowerShell|x86.Build.0 = ReleaseStatic|Win32 - {2046B5AF-666D-4CE8-8D3E-C32C57908A56}.Release|Any CPU.ActiveCfg = Release|x64 {2046B5AF-666D-4CE8-8D3E-C32C57908A56}.Release|ARM64.ActiveCfg = Release|ARM64 {2046B5AF-666D-4CE8-8D3E-C32C57908A56}.Release|ARM64.Build.0 = Release|ARM64 {2046B5AF-666D-4CE8-8D3E-C32C57908A56}.Release|x64.ActiveCfg = Release|x64 {2046B5AF-666D-4CE8-8D3E-C32C57908A56}.Release|x64.Build.0 = Release|x64 {2046B5AF-666D-4CE8-8D3E-C32C57908A56}.Release|x86.ActiveCfg = Release|Win32 {2046B5AF-666D-4CE8-8D3E-C32C57908A56}.Release|x86.Build.0 = Release|Win32 - {2046B5AF-666D-4CE8-8D3E-C32C57908A56}.TestRelease|Any CPU.ActiveCfg = Release|x64 + {2046B5AF-666D-4CE8-8D3E-C32C57908A56}.ReleaseStatic|ARM64.ActiveCfg = ReleaseStatic|ARM64 + {2046B5AF-666D-4CE8-8D3E-C32C57908A56}.ReleaseStatic|ARM64.Build.0 = ReleaseStatic|ARM64 + {2046B5AF-666D-4CE8-8D3E-C32C57908A56}.ReleaseStatic|x64.ActiveCfg = ReleaseStatic|x64 + {2046B5AF-666D-4CE8-8D3E-C32C57908A56}.ReleaseStatic|x64.Build.0 = ReleaseStatic|x64 + {2046B5AF-666D-4CE8-8D3E-C32C57908A56}.ReleaseStatic|x86.ActiveCfg = ReleaseStatic|Win32 + {2046B5AF-666D-4CE8-8D3E-C32C57908A56}.ReleaseStatic|x86.Build.0 = ReleaseStatic|Win32 {2046B5AF-666D-4CE8-8D3E-C32C57908A56}.TestRelease|ARM64.ActiveCfg = Release|ARM64 {2046B5AF-666D-4CE8-8D3E-C32C57908A56}.TestRelease|ARM64.Build.0 = Release|ARM64 {2046B5AF-666D-4CE8-8D3E-C32C57908A56}.TestRelease|x64.ActiveCfg = Release|x64 {2046B5AF-666D-4CE8-8D3E-C32C57908A56}.TestRelease|x64.Build.0 = Release|x64 {2046B5AF-666D-4CE8-8D3E-C32C57908A56}.TestRelease|x86.ActiveCfg = Release|Win32 {2046B5AF-666D-4CE8-8D3E-C32C57908A56}.TestRelease|x86.Build.0 = Release|Win32 - {9AC3C6A4-1875-4D3E-BF9C-C31E81EFF6B4}.Debug|Any CPU.ActiveCfg = Debug|x64 {9AC3C6A4-1875-4D3E-BF9C-C31E81EFF6B4}.Debug|ARM64.ActiveCfg = Debug|ARM64 {9AC3C6A4-1875-4D3E-BF9C-C31E81EFF6B4}.Debug|ARM64.Build.0 = Debug|ARM64 {9AC3C6A4-1875-4D3E-BF9C-C31E81EFF6B4}.Debug|x64.ActiveCfg = Debug|x64 {9AC3C6A4-1875-4D3E-BF9C-C31E81EFF6B4}.Debug|x64.Build.0 = Debug|x64 {9AC3C6A4-1875-4D3E-BF9C-C31E81EFF6B4}.Debug|x86.ActiveCfg = Debug|Win32 {9AC3C6A4-1875-4D3E-BF9C-C31E81EFF6B4}.Debug|x86.Build.0 = Debug|Win32 - {9AC3C6A4-1875-4D3E-BF9C-C31E81EFF6B4}.Fuzzing|Any CPU.ActiveCfg = Release|x64 {9AC3C6A4-1875-4D3E-BF9C-C31E81EFF6B4}.Fuzzing|ARM64.ActiveCfg = Release|ARM64 {9AC3C6A4-1875-4D3E-BF9C-C31E81EFF6B4}.Fuzzing|x64.ActiveCfg = Release|x64 {9AC3C6A4-1875-4D3E-BF9C-C31E81EFF6B4}.Fuzzing|x86.ActiveCfg = Release|Win32 - {9AC3C6A4-1875-4D3E-BF9C-C31E81EFF6B4}.PowerShell|Any CPU.ActiveCfg = ReleaseStatic|x64 - {9AC3C6A4-1875-4D3E-BF9C-C31E81EFF6B4}.PowerShell|ARM64.ActiveCfg = ReleaseStatic|ARM64 - {9AC3C6A4-1875-4D3E-BF9C-C31E81EFF6B4}.PowerShell|ARM64.Build.0 = ReleaseStatic|ARM64 - {9AC3C6A4-1875-4D3E-BF9C-C31E81EFF6B4}.PowerShell|x64.ActiveCfg = ReleaseStatic|x64 - {9AC3C6A4-1875-4D3E-BF9C-C31E81EFF6B4}.PowerShell|x64.Build.0 = ReleaseStatic|x64 - {9AC3C6A4-1875-4D3E-BF9C-C31E81EFF6B4}.PowerShell|x86.ActiveCfg = ReleaseStatic|Win32 - {9AC3C6A4-1875-4D3E-BF9C-C31E81EFF6B4}.PowerShell|x86.Build.0 = ReleaseStatic|Win32 - {9AC3C6A4-1875-4D3E-BF9C-C31E81EFF6B4}.Release|Any CPU.ActiveCfg = Release|x64 {9AC3C6A4-1875-4D3E-BF9C-C31E81EFF6B4}.Release|ARM64.ActiveCfg = Release|ARM64 {9AC3C6A4-1875-4D3E-BF9C-C31E81EFF6B4}.Release|x64.ActiveCfg = Release|x64 {9AC3C6A4-1875-4D3E-BF9C-C31E81EFF6B4}.Release|x64.Build.0 = Release|x64 {9AC3C6A4-1875-4D3E-BF9C-C31E81EFF6B4}.Release|x86.ActiveCfg = Release|Win32 {9AC3C6A4-1875-4D3E-BF9C-C31E81EFF6B4}.Release|x86.Build.0 = Release|Win32 - {9AC3C6A4-1875-4D3E-BF9C-C31E81EFF6B4}.TestRelease|Any CPU.ActiveCfg = Release|x64 + {9AC3C6A4-1875-4D3E-BF9C-C31E81EFF6B4}.ReleaseStatic|ARM64.ActiveCfg = ReleaseStatic|ARM64 + {9AC3C6A4-1875-4D3E-BF9C-C31E81EFF6B4}.ReleaseStatic|ARM64.Build.0 = ReleaseStatic|ARM64 + {9AC3C6A4-1875-4D3E-BF9C-C31E81EFF6B4}.ReleaseStatic|x64.ActiveCfg = ReleaseStatic|x64 + {9AC3C6A4-1875-4D3E-BF9C-C31E81EFF6B4}.ReleaseStatic|x64.Build.0 = ReleaseStatic|x64 + {9AC3C6A4-1875-4D3E-BF9C-C31E81EFF6B4}.ReleaseStatic|x86.ActiveCfg = ReleaseStatic|Win32 + {9AC3C6A4-1875-4D3E-BF9C-C31E81EFF6B4}.ReleaseStatic|x86.Build.0 = ReleaseStatic|Win32 {9AC3C6A4-1875-4D3E-BF9C-C31E81EFF6B4}.TestRelease|ARM64.ActiveCfg = Release|x64 {9AC3C6A4-1875-4D3E-BF9C-C31E81EFF6B4}.TestRelease|x64.ActiveCfg = Release|x64 {9AC3C6A4-1875-4D3E-BF9C-C31E81EFF6B4}.TestRelease|x86.ActiveCfg = Release|Win32 - {463C0EF3-DF38-4C3D-8E7E-D4901E0CDC6C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {463C0EF3-DF38-4C3D-8E7E-D4901E0CDC6C}.Debug|ARM64.ActiveCfg = Debug|Any CPU {463C0EF3-DF38-4C3D-8E7E-D4901E0CDC6C}.Debug|ARM64.Build.0 = Debug|Any CPU {463C0EF3-DF38-4C3D-8E7E-D4901E0CDC6C}.Debug|x64.ActiveCfg = Debug|Any CPU {463C0EF3-DF38-4C3D-8E7E-D4901E0CDC6C}.Debug|x64.Build.0 = Debug|Any CPU {463C0EF3-DF38-4C3D-8E7E-D4901E0CDC6C}.Debug|x86.ActiveCfg = Debug|Any CPU {463C0EF3-DF38-4C3D-8E7E-D4901E0CDC6C}.Debug|x86.Build.0 = Debug|Any CPU - {463C0EF3-DF38-4C3D-8E7E-D4901E0CDC6C}.Fuzzing|Any CPU.ActiveCfg = Release|Any CPU {463C0EF3-DF38-4C3D-8E7E-D4901E0CDC6C}.Fuzzing|ARM64.ActiveCfg = Release|Any CPU {463C0EF3-DF38-4C3D-8E7E-D4901E0CDC6C}.Fuzzing|x64.ActiveCfg = Release|Any CPU {463C0EF3-DF38-4C3D-8E7E-D4901E0CDC6C}.Fuzzing|x86.ActiveCfg = Release|Any CPU - {463C0EF3-DF38-4C3D-8E7E-D4901E0CDC6C}.PowerShell|Any CPU.ActiveCfg = ReleaseStatic|Any CPU - {463C0EF3-DF38-4C3D-8E7E-D4901E0CDC6C}.PowerShell|ARM64.ActiveCfg = Release|Any CPU - {463C0EF3-DF38-4C3D-8E7E-D4901E0CDC6C}.PowerShell|x64.ActiveCfg = ReleaseStatic|Any CPU - {463C0EF3-DF38-4C3D-8E7E-D4901E0CDC6C}.PowerShell|x64.Build.0 = ReleaseStatic|Any CPU - {463C0EF3-DF38-4C3D-8E7E-D4901E0CDC6C}.PowerShell|x86.ActiveCfg = ReleaseStatic|Any CPU - {463C0EF3-DF38-4C3D-8E7E-D4901E0CDC6C}.PowerShell|x86.Build.0 = ReleaseStatic|Any CPU - {463C0EF3-DF38-4C3D-8E7E-D4901E0CDC6C}.Release|Any CPU.ActiveCfg = Release|Any CPU {463C0EF3-DF38-4C3D-8E7E-D4901E0CDC6C}.Release|ARM64.ActiveCfg = Release|Any CPU {463C0EF3-DF38-4C3D-8E7E-D4901E0CDC6C}.Release|ARM64.Build.0 = Release|Any CPU {463C0EF3-DF38-4C3D-8E7E-D4901E0CDC6C}.Release|x64.ActiveCfg = Release|Any CPU {463C0EF3-DF38-4C3D-8E7E-D4901E0CDC6C}.Release|x64.Build.0 = Release|Any CPU {463C0EF3-DF38-4C3D-8E7E-D4901E0CDC6C}.Release|x86.ActiveCfg = Release|Any CPU {463C0EF3-DF38-4C3D-8E7E-D4901E0CDC6C}.Release|x86.Build.0 = Release|Any CPU - {463C0EF3-DF38-4C3D-8E7E-D4901E0CDC6C}.TestRelease|Any CPU.ActiveCfg = Release|Any CPU + {463C0EF3-DF38-4C3D-8E7E-D4901E0CDC6C}.ReleaseStatic|ARM64.ActiveCfg = Release|Any CPU + {463C0EF3-DF38-4C3D-8E7E-D4901E0CDC6C}.ReleaseStatic|x64.ActiveCfg = ReleaseStatic|Any CPU + {463C0EF3-DF38-4C3D-8E7E-D4901E0CDC6C}.ReleaseStatic|x64.Build.0 = ReleaseStatic|Any CPU + {463C0EF3-DF38-4C3D-8E7E-D4901E0CDC6C}.ReleaseStatic|x86.ActiveCfg = ReleaseStatic|Any CPU + {463C0EF3-DF38-4C3D-8E7E-D4901E0CDC6C}.ReleaseStatic|x86.Build.0 = ReleaseStatic|Any CPU {463C0EF3-DF38-4C3D-8E7E-D4901E0CDC6C}.TestRelease|ARM64.ActiveCfg = Release|Any CPU {463C0EF3-DF38-4C3D-8E7E-D4901E0CDC6C}.TestRelease|x64.ActiveCfg = Release|Any CPU {463C0EF3-DF38-4C3D-8E7E-D4901E0CDC6C}.TestRelease|x86.ActiveCfg = Release|Any CPU - {0B104762-5CD8-47EE-A904-71C1C3F84DCD}.Debug|Any CPU.ActiveCfg = Debug|x64 {0B104762-5CD8-47EE-A904-71C1C3F84DCD}.Debug|ARM64.ActiveCfg = Debug|arm64 {0B104762-5CD8-47EE-A904-71C1C3F84DCD}.Debug|x64.ActiveCfg = Debug|x64 {0B104762-5CD8-47EE-A904-71C1C3F84DCD}.Debug|x64.Build.0 = Debug|x64 {0B104762-5CD8-47EE-A904-71C1C3F84DCD}.Debug|x86.ActiveCfg = Debug|x86 {0B104762-5CD8-47EE-A904-71C1C3F84DCD}.Debug|x86.Build.0 = Debug|x86 - {0B104762-5CD8-47EE-A904-71C1C3F84DCD}.Fuzzing|Any CPU.ActiveCfg = Release|x64 {0B104762-5CD8-47EE-A904-71C1C3F84DCD}.Fuzzing|ARM64.ActiveCfg = Release|arm64 {0B104762-5CD8-47EE-A904-71C1C3F84DCD}.Fuzzing|x64.ActiveCfg = Release|x64 {0B104762-5CD8-47EE-A904-71C1C3F84DCD}.Fuzzing|x86.ActiveCfg = Release|x86 - {0B104762-5CD8-47EE-A904-71C1C3F84DCD}.PowerShell|Any CPU.ActiveCfg = ReleaseStatic|x64 - {0B104762-5CD8-47EE-A904-71C1C3F84DCD}.PowerShell|ARM64.ActiveCfg = ReleaseStatic|arm64 - {0B104762-5CD8-47EE-A904-71C1C3F84DCD}.PowerShell|ARM64.Build.0 = ReleaseStatic|arm64 - {0B104762-5CD8-47EE-A904-71C1C3F84DCD}.PowerShell|x64.ActiveCfg = ReleaseStatic|x64 - {0B104762-5CD8-47EE-A904-71C1C3F84DCD}.PowerShell|x64.Build.0 = ReleaseStatic|x64 - {0B104762-5CD8-47EE-A904-71C1C3F84DCD}.PowerShell|x86.ActiveCfg = ReleaseStatic|x86 - {0B104762-5CD8-47EE-A904-71C1C3F84DCD}.PowerShell|x86.Build.0 = ReleaseStatic|x86 - {0B104762-5CD8-47EE-A904-71C1C3F84DCD}.Release|Any CPU.ActiveCfg = Release|x64 {0B104762-5CD8-47EE-A904-71C1C3F84DCD}.Release|ARM64.ActiveCfg = Release|arm64 {0B104762-5CD8-47EE-A904-71C1C3F84DCD}.Release|x64.ActiveCfg = Release|x64 {0B104762-5CD8-47EE-A904-71C1C3F84DCD}.Release|x64.Build.0 = Release|x64 {0B104762-5CD8-47EE-A904-71C1C3F84DCD}.Release|x86.ActiveCfg = Release|x86 {0B104762-5CD8-47EE-A904-71C1C3F84DCD}.Release|x86.Build.0 = Release|x86 - {0B104762-5CD8-47EE-A904-71C1C3F84DCD}.TestRelease|Any CPU.ActiveCfg = Release|x64 + {0B104762-5CD8-47EE-A904-71C1C3F84DCD}.ReleaseStatic|ARM64.ActiveCfg = ReleaseStatic|arm64 + {0B104762-5CD8-47EE-A904-71C1C3F84DCD}.ReleaseStatic|ARM64.Build.0 = ReleaseStatic|arm64 + {0B104762-5CD8-47EE-A904-71C1C3F84DCD}.ReleaseStatic|x64.ActiveCfg = ReleaseStatic|x64 + {0B104762-5CD8-47EE-A904-71C1C3F84DCD}.ReleaseStatic|x64.Build.0 = ReleaseStatic|x64 + {0B104762-5CD8-47EE-A904-71C1C3F84DCD}.ReleaseStatic|x86.ActiveCfg = ReleaseStatic|x86 + {0B104762-5CD8-47EE-A904-71C1C3F84DCD}.ReleaseStatic|x86.Build.0 = ReleaseStatic|x86 {0B104762-5CD8-47EE-A904-71C1C3F84DCD}.TestRelease|ARM64.ActiveCfg = Release|x64 {0B104762-5CD8-47EE-A904-71C1C3F84DCD}.TestRelease|x64.ActiveCfg = Release|x64 {0B104762-5CD8-47EE-A904-71C1C3F84DCD}.TestRelease|x86.ActiveCfg = Release|x86 - {31ED69A8-5310-45A9-953F-56C351D2C3E1}.Debug|Any CPU.ActiveCfg = Debug|x64 {31ED69A8-5310-45A9-953F-56C351D2C3E1}.Debug|ARM64.ActiveCfg = Debug|ARM64 {31ED69A8-5310-45A9-953F-56C351D2C3E1}.Debug|ARM64.Build.0 = Debug|ARM64 {31ED69A8-5310-45A9-953F-56C351D2C3E1}.Debug|x64.ActiveCfg = Debug|x64 {31ED69A8-5310-45A9-953F-56C351D2C3E1}.Debug|x64.Build.0 = Debug|x64 {31ED69A8-5310-45A9-953F-56C351D2C3E1}.Debug|x86.ActiveCfg = Debug|Win32 {31ED69A8-5310-45A9-953F-56C351D2C3E1}.Debug|x86.Build.0 = Debug|Win32 - {31ED69A8-5310-45A9-953F-56C351D2C3E1}.Fuzzing|Any CPU.ActiveCfg = Release|x64 {31ED69A8-5310-45A9-953F-56C351D2C3E1}.Fuzzing|ARM64.ActiveCfg = Release|ARM64 {31ED69A8-5310-45A9-953F-56C351D2C3E1}.Fuzzing|x64.ActiveCfg = Release|x64 {31ED69A8-5310-45A9-953F-56C351D2C3E1}.Fuzzing|x86.ActiveCfg = Release|Win32 - {31ED69A8-5310-45A9-953F-56C351D2C3E1}.PowerShell|Any CPU.ActiveCfg = ReleaseStatic|x64 - {31ED69A8-5310-45A9-953F-56C351D2C3E1}.PowerShell|ARM64.ActiveCfg = ReleaseStatic|ARM64 - {31ED69A8-5310-45A9-953F-56C351D2C3E1}.PowerShell|ARM64.Build.0 = ReleaseStatic|ARM64 - {31ED69A8-5310-45A9-953F-56C351D2C3E1}.PowerShell|x64.ActiveCfg = ReleaseStatic|x64 - {31ED69A8-5310-45A9-953F-56C351D2C3E1}.PowerShell|x64.Build.0 = ReleaseStatic|x64 - {31ED69A8-5310-45A9-953F-56C351D2C3E1}.PowerShell|x86.ActiveCfg = ReleaseStatic|Win32 - {31ED69A8-5310-45A9-953F-56C351D2C3E1}.PowerShell|x86.Build.0 = ReleaseStatic|Win32 - {31ED69A8-5310-45A9-953F-56C351D2C3E1}.Release|Any CPU.ActiveCfg = Release|x64 {31ED69A8-5310-45A9-953F-56C351D2C3E1}.Release|ARM64.ActiveCfg = Release|ARM64 {31ED69A8-5310-45A9-953F-56C351D2C3E1}.Release|ARM64.Build.0 = Release|ARM64 {31ED69A8-5310-45A9-953F-56C351D2C3E1}.Release|x64.ActiveCfg = Release|x64 {31ED69A8-5310-45A9-953F-56C351D2C3E1}.Release|x64.Build.0 = Release|x64 {31ED69A8-5310-45A9-953F-56C351D2C3E1}.Release|x86.ActiveCfg = Release|Win32 {31ED69A8-5310-45A9-953F-56C351D2C3E1}.Release|x86.Build.0 = Release|Win32 - {31ED69A8-5310-45A9-953F-56C351D2C3E1}.TestRelease|Any CPU.ActiveCfg = Release|x64 + {31ED69A8-5310-45A9-953F-56C351D2C3E1}.ReleaseStatic|ARM64.ActiveCfg = ReleaseStatic|ARM64 + {31ED69A8-5310-45A9-953F-56C351D2C3E1}.ReleaseStatic|ARM64.Build.0 = ReleaseStatic|ARM64 + {31ED69A8-5310-45A9-953F-56C351D2C3E1}.ReleaseStatic|x64.ActiveCfg = ReleaseStatic|x64 + {31ED69A8-5310-45A9-953F-56C351D2C3E1}.ReleaseStatic|x64.Build.0 = ReleaseStatic|x64 + {31ED69A8-5310-45A9-953F-56C351D2C3E1}.ReleaseStatic|x86.ActiveCfg = ReleaseStatic|Win32 + {31ED69A8-5310-45A9-953F-56C351D2C3E1}.ReleaseStatic|x86.Build.0 = ReleaseStatic|Win32 {31ED69A8-5310-45A9-953F-56C351D2C3E1}.TestRelease|ARM64.ActiveCfg = Release|ARM64 {31ED69A8-5310-45A9-953F-56C351D2C3E1}.TestRelease|ARM64.Build.0 = Release|ARM64 {31ED69A8-5310-45A9-953F-56C351D2C3E1}.TestRelease|x64.ActiveCfg = Release|x64 {31ED69A8-5310-45A9-953F-56C351D2C3E1}.TestRelease|x64.Build.0 = Release|x64 {31ED69A8-5310-45A9-953F-56C351D2C3E1}.TestRelease|x86.ActiveCfg = Release|Win32 {31ED69A8-5310-45A9-953F-56C351D2C3E1}.TestRelease|x86.Build.0 = Release|Win32 - {787EC629-C0FB-4BA9-9746-4A82CD06B73E}.Debug|Any CPU.ActiveCfg = Debug|x64 {787EC629-C0FB-4BA9-9746-4A82CD06B73E}.Debug|ARM64.ActiveCfg = Debug|ARM64 {787EC629-C0FB-4BA9-9746-4A82CD06B73E}.Debug|ARM64.Build.0 = Debug|ARM64 {787EC629-C0FB-4BA9-9746-4A82CD06B73E}.Debug|x64.ActiveCfg = Debug|x64 {787EC629-C0FB-4BA9-9746-4A82CD06B73E}.Debug|x64.Build.0 = Debug|x64 {787EC629-C0FB-4BA9-9746-4A82CD06B73E}.Debug|x86.ActiveCfg = Debug|Win32 {787EC629-C0FB-4BA9-9746-4A82CD06B73E}.Debug|x86.Build.0 = Debug|Win32 - {787EC629-C0FB-4BA9-9746-4A82CD06B73E}.Fuzzing|Any CPU.ActiveCfg = Release|x64 {787EC629-C0FB-4BA9-9746-4A82CD06B73E}.Fuzzing|ARM64.ActiveCfg = Release|ARM64 {787EC629-C0FB-4BA9-9746-4A82CD06B73E}.Fuzzing|x64.ActiveCfg = Release|x64 {787EC629-C0FB-4BA9-9746-4A82CD06B73E}.Fuzzing|x86.ActiveCfg = Release|Win32 - {787EC629-C0FB-4BA9-9746-4A82CD06B73E}.PowerShell|Any CPU.ActiveCfg = ReleaseStatic|x64 - {787EC629-C0FB-4BA9-9746-4A82CD06B73E}.PowerShell|ARM64.ActiveCfg = ReleaseStatic|ARM64 - {787EC629-C0FB-4BA9-9746-4A82CD06B73E}.PowerShell|ARM64.Build.0 = ReleaseStatic|ARM64 - {787EC629-C0FB-4BA9-9746-4A82CD06B73E}.PowerShell|x64.ActiveCfg = ReleaseStatic|x64 - {787EC629-C0FB-4BA9-9746-4A82CD06B73E}.PowerShell|x64.Build.0 = ReleaseStatic|x64 - {787EC629-C0FB-4BA9-9746-4A82CD06B73E}.PowerShell|x86.ActiveCfg = ReleaseStatic|Win32 - {787EC629-C0FB-4BA9-9746-4A82CD06B73E}.PowerShell|x86.Build.0 = ReleaseStatic|Win32 - {787EC629-C0FB-4BA9-9746-4A82CD06B73E}.Release|Any CPU.ActiveCfg = Release|x64 {787EC629-C0FB-4BA9-9746-4A82CD06B73E}.Release|ARM64.ActiveCfg = Release|ARM64 {787EC629-C0FB-4BA9-9746-4A82CD06B73E}.Release|ARM64.Build.0 = Release|ARM64 {787EC629-C0FB-4BA9-9746-4A82CD06B73E}.Release|x64.ActiveCfg = Release|x64 {787EC629-C0FB-4BA9-9746-4A82CD06B73E}.Release|x64.Build.0 = Release|x64 {787EC629-C0FB-4BA9-9746-4A82CD06B73E}.Release|x86.ActiveCfg = Release|Win32 {787EC629-C0FB-4BA9-9746-4A82CD06B73E}.Release|x86.Build.0 = Release|Win32 - {787EC629-C0FB-4BA9-9746-4A82CD06B73E}.TestRelease|Any CPU.ActiveCfg = Release|x64 + {787EC629-C0FB-4BA9-9746-4A82CD06B73E}.ReleaseStatic|ARM64.ActiveCfg = ReleaseStatic|ARM64 + {787EC629-C0FB-4BA9-9746-4A82CD06B73E}.ReleaseStatic|ARM64.Build.0 = ReleaseStatic|ARM64 + {787EC629-C0FB-4BA9-9746-4A82CD06B73E}.ReleaseStatic|x64.ActiveCfg = ReleaseStatic|x64 + {787EC629-C0FB-4BA9-9746-4A82CD06B73E}.ReleaseStatic|x64.Build.0 = ReleaseStatic|x64 + {787EC629-C0FB-4BA9-9746-4A82CD06B73E}.ReleaseStatic|x86.ActiveCfg = ReleaseStatic|Win32 + {787EC629-C0FB-4BA9-9746-4A82CD06B73E}.ReleaseStatic|x86.Build.0 = ReleaseStatic|Win32 {787EC629-C0FB-4BA9-9746-4A82CD06B73E}.TestRelease|ARM64.ActiveCfg = Release|ARM64 {787EC629-C0FB-4BA9-9746-4A82CD06B73E}.TestRelease|ARM64.Build.0 = Release|ARM64 {787EC629-C0FB-4BA9-9746-4A82CD06B73E}.TestRelease|x64.ActiveCfg = Release|x64 {787EC629-C0FB-4BA9-9746-4A82CD06B73E}.TestRelease|x64.Build.0 = Release|x64 {787EC629-C0FB-4BA9-9746-4A82CD06B73E}.TestRelease|x86.ActiveCfg = Release|Win32 {787EC629-C0FB-4BA9-9746-4A82CD06B73E}.TestRelease|x86.Build.0 = Release|Win32 - {BB14D603-F44E-4415-8770-BF3E13F4C17F}.Debug|Any CPU.ActiveCfg = Debug|x64 {BB14D603-F44E-4415-8770-BF3E13F4C17F}.Debug|ARM64.ActiveCfg = Debug|ARM64 {BB14D603-F44E-4415-8770-BF3E13F4C17F}.Debug|ARM64.Build.0 = Debug|ARM64 {BB14D603-F44E-4415-8770-BF3E13F4C17F}.Debug|x64.ActiveCfg = Debug|x64 {BB14D603-F44E-4415-8770-BF3E13F4C17F}.Debug|x64.Build.0 = Debug|x64 {BB14D603-F44E-4415-8770-BF3E13F4C17F}.Debug|x86.ActiveCfg = Debug|Win32 {BB14D603-F44E-4415-8770-BF3E13F4C17F}.Debug|x86.Build.0 = Debug|Win32 - {BB14D603-F44E-4415-8770-BF3E13F4C17F}.Fuzzing|Any CPU.ActiveCfg = Release|x64 {BB14D603-F44E-4415-8770-BF3E13F4C17F}.Fuzzing|ARM64.ActiveCfg = Release|ARM64 {BB14D603-F44E-4415-8770-BF3E13F4C17F}.Fuzzing|x64.ActiveCfg = Release|x64 {BB14D603-F44E-4415-8770-BF3E13F4C17F}.Fuzzing|x86.ActiveCfg = Release|Win32 - {BB14D603-F44E-4415-8770-BF3E13F4C17F}.PowerShell|Any CPU.ActiveCfg = ReleaseStatic|x64 - {BB14D603-F44E-4415-8770-BF3E13F4C17F}.PowerShell|ARM64.ActiveCfg = ReleaseStatic|ARM64 - {BB14D603-F44E-4415-8770-BF3E13F4C17F}.PowerShell|ARM64.Build.0 = ReleaseStatic|ARM64 - {BB14D603-F44E-4415-8770-BF3E13F4C17F}.PowerShell|x64.ActiveCfg = ReleaseStatic|x64 - {BB14D603-F44E-4415-8770-BF3E13F4C17F}.PowerShell|x64.Build.0 = ReleaseStatic|x64 - {BB14D603-F44E-4415-8770-BF3E13F4C17F}.PowerShell|x86.ActiveCfg = ReleaseStatic|Win32 - {BB14D603-F44E-4415-8770-BF3E13F4C17F}.PowerShell|x86.Build.0 = ReleaseStatic|Win32 - {BB14D603-F44E-4415-8770-BF3E13F4C17F}.Release|Any CPU.ActiveCfg = Release|x64 {BB14D603-F44E-4415-8770-BF3E13F4C17F}.Release|ARM64.ActiveCfg = Release|ARM64 {BB14D603-F44E-4415-8770-BF3E13F4C17F}.Release|ARM64.Build.0 = Release|ARM64 {BB14D603-F44E-4415-8770-BF3E13F4C17F}.Release|x64.ActiveCfg = Release|x64 {BB14D603-F44E-4415-8770-BF3E13F4C17F}.Release|x64.Build.0 = Release|x64 {BB14D603-F44E-4415-8770-BF3E13F4C17F}.Release|x86.ActiveCfg = Release|Win32 {BB14D603-F44E-4415-8770-BF3E13F4C17F}.Release|x86.Build.0 = Release|Win32 - {BB14D603-F44E-4415-8770-BF3E13F4C17F}.TestRelease|Any CPU.ActiveCfg = Release|x64 + {BB14D603-F44E-4415-8770-BF3E13F4C17F}.ReleaseStatic|ARM64.ActiveCfg = ReleaseStatic|ARM64 + {BB14D603-F44E-4415-8770-BF3E13F4C17F}.ReleaseStatic|ARM64.Build.0 = ReleaseStatic|ARM64 + {BB14D603-F44E-4415-8770-BF3E13F4C17F}.ReleaseStatic|x64.ActiveCfg = ReleaseStatic|x64 + {BB14D603-F44E-4415-8770-BF3E13F4C17F}.ReleaseStatic|x64.Build.0 = ReleaseStatic|x64 + {BB14D603-F44E-4415-8770-BF3E13F4C17F}.ReleaseStatic|x86.ActiveCfg = ReleaseStatic|Win32 + {BB14D603-F44E-4415-8770-BF3E13F4C17F}.ReleaseStatic|x86.Build.0 = ReleaseStatic|Win32 {BB14D603-F44E-4415-8770-BF3E13F4C17F}.TestRelease|ARM64.ActiveCfg = Release|ARM64 {BB14D603-F44E-4415-8770-BF3E13F4C17F}.TestRelease|ARM64.Build.0 = Release|ARM64 {BB14D603-F44E-4415-8770-BF3E13F4C17F}.TestRelease|x64.ActiveCfg = Release|x64 {BB14D603-F44E-4415-8770-BF3E13F4C17F}.TestRelease|x64.Build.0 = Release|x64 {BB14D603-F44E-4415-8770-BF3E13F4C17F}.TestRelease|x86.ActiveCfg = Release|Win32 {BB14D603-F44E-4415-8770-BF3E13F4C17F}.TestRelease|x86.Build.0 = Release|Win32 - {F3F6E699-BC5D-4950-8A05-E49DD9EB0D51}.Debug|Any CPU.ActiveCfg = Debug|x64 {F3F6E699-BC5D-4950-8A05-E49DD9EB0D51}.Debug|ARM64.ActiveCfg = Debug|ARM64 {F3F6E699-BC5D-4950-8A05-E49DD9EB0D51}.Debug|ARM64.Build.0 = Debug|ARM64 {F3F6E699-BC5D-4950-8A05-E49DD9EB0D51}.Debug|x64.ActiveCfg = Debug|x64 {F3F6E699-BC5D-4950-8A05-E49DD9EB0D51}.Debug|x64.Build.0 = Debug|x64 {F3F6E699-BC5D-4950-8A05-E49DD9EB0D51}.Debug|x86.ActiveCfg = Debug|Win32 {F3F6E699-BC5D-4950-8A05-E49DD9EB0D51}.Debug|x86.Build.0 = Debug|Win32 - {F3F6E699-BC5D-4950-8A05-E49DD9EB0D51}.Fuzzing|Any CPU.ActiveCfg = Fuzzing|x64 {F3F6E699-BC5D-4950-8A05-E49DD9EB0D51}.Fuzzing|ARM64.ActiveCfg = Fuzzing|x64 {F3F6E699-BC5D-4950-8A05-E49DD9EB0D51}.Fuzzing|x64.ActiveCfg = Fuzzing|x64 {F3F6E699-BC5D-4950-8A05-E49DD9EB0D51}.Fuzzing|x64.Build.0 = Fuzzing|x64 {F3F6E699-BC5D-4950-8A05-E49DD9EB0D51}.Fuzzing|x86.ActiveCfg = Fuzzing|Win32 {F3F6E699-BC5D-4950-8A05-E49DD9EB0D51}.Fuzzing|x86.Build.0 = Fuzzing|Win32 - {F3F6E699-BC5D-4950-8A05-E49DD9EB0D51}.PowerShell|Any CPU.ActiveCfg = ReleaseStatic|x64 - {F3F6E699-BC5D-4950-8A05-E49DD9EB0D51}.PowerShell|ARM64.ActiveCfg = ReleaseStatic|ARM64 - {F3F6E699-BC5D-4950-8A05-E49DD9EB0D51}.PowerShell|ARM64.Build.0 = ReleaseStatic|ARM64 - {F3F6E699-BC5D-4950-8A05-E49DD9EB0D51}.PowerShell|x64.ActiveCfg = ReleaseStatic|x64 - {F3F6E699-BC5D-4950-8A05-E49DD9EB0D51}.PowerShell|x64.Build.0 = ReleaseStatic|x64 - {F3F6E699-BC5D-4950-8A05-E49DD9EB0D51}.PowerShell|x86.ActiveCfg = ReleaseStatic|Win32 - {F3F6E699-BC5D-4950-8A05-E49DD9EB0D51}.PowerShell|x86.Build.0 = ReleaseStatic|Win32 - {F3F6E699-BC5D-4950-8A05-E49DD9EB0D51}.Release|Any CPU.ActiveCfg = Release|x64 {F3F6E699-BC5D-4950-8A05-E49DD9EB0D51}.Release|ARM64.ActiveCfg = Release|ARM64 {F3F6E699-BC5D-4950-8A05-E49DD9EB0D51}.Release|ARM64.Build.0 = Release|ARM64 {F3F6E699-BC5D-4950-8A05-E49DD9EB0D51}.Release|x64.ActiveCfg = Release|x64 {F3F6E699-BC5D-4950-8A05-E49DD9EB0D51}.Release|x64.Build.0 = Release|x64 {F3F6E699-BC5D-4950-8A05-E49DD9EB0D51}.Release|x86.ActiveCfg = Release|Win32 {F3F6E699-BC5D-4950-8A05-E49DD9EB0D51}.Release|x86.Build.0 = Release|Win32 - {F3F6E699-BC5D-4950-8A05-E49DD9EB0D51}.TestRelease|Any CPU.ActiveCfg = Release|x64 + {F3F6E699-BC5D-4950-8A05-E49DD9EB0D51}.ReleaseStatic|ARM64.ActiveCfg = ReleaseStatic|ARM64 + {F3F6E699-BC5D-4950-8A05-E49DD9EB0D51}.ReleaseStatic|ARM64.Build.0 = ReleaseStatic|ARM64 + {F3F6E699-BC5D-4950-8A05-E49DD9EB0D51}.ReleaseStatic|x64.ActiveCfg = ReleaseStatic|x64 + {F3F6E699-BC5D-4950-8A05-E49DD9EB0D51}.ReleaseStatic|x64.Build.0 = ReleaseStatic|x64 + {F3F6E699-BC5D-4950-8A05-E49DD9EB0D51}.ReleaseStatic|x86.ActiveCfg = ReleaseStatic|Win32 + {F3F6E699-BC5D-4950-8A05-E49DD9EB0D51}.ReleaseStatic|x86.Build.0 = ReleaseStatic|Win32 {F3F6E699-BC5D-4950-8A05-E49DD9EB0D51}.TestRelease|ARM64.ActiveCfg = Release|ARM64 {F3F6E699-BC5D-4950-8A05-E49DD9EB0D51}.TestRelease|ARM64.Build.0 = Release|ARM64 {F3F6E699-BC5D-4950-8A05-E49DD9EB0D51}.TestRelease|x64.ActiveCfg = Release|x64 {F3F6E699-BC5D-4950-8A05-E49DD9EB0D51}.TestRelease|x64.Build.0 = Release|x64 {F3F6E699-BC5D-4950-8A05-E49DD9EB0D51}.TestRelease|x86.ActiveCfg = Release|Win32 {F3F6E699-BC5D-4950-8A05-E49DD9EB0D51}.TestRelease|x86.Build.0 = Release|Win32 - {CA460806-5E41-4E97-9A3D-1D74B433B663}.Debug|Any CPU.ActiveCfg = Debug|x64 {CA460806-5E41-4E97-9A3D-1D74B433B663}.Debug|ARM64.ActiveCfg = Debug|ARM64 {CA460806-5E41-4E97-9A3D-1D74B433B663}.Debug|ARM64.Build.0 = Debug|ARM64 {CA460806-5E41-4E97-9A3D-1D74B433B663}.Debug|x64.ActiveCfg = Debug|x64 {CA460806-5E41-4E97-9A3D-1D74B433B663}.Debug|x64.Build.0 = Debug|x64 {CA460806-5E41-4E97-9A3D-1D74B433B663}.Debug|x86.ActiveCfg = Debug|Win32 {CA460806-5E41-4E97-9A3D-1D74B433B663}.Debug|x86.Build.0 = Debug|Win32 - {CA460806-5E41-4E97-9A3D-1D74B433B663}.Fuzzing|Any CPU.ActiveCfg = Release|x64 {CA460806-5E41-4E97-9A3D-1D74B433B663}.Fuzzing|ARM64.ActiveCfg = Release|ARM64 {CA460806-5E41-4E97-9A3D-1D74B433B663}.Fuzzing|x64.ActiveCfg = Release|x64 {CA460806-5E41-4E97-9A3D-1D74B433B663}.Fuzzing|x86.ActiveCfg = Release|Win32 - {CA460806-5E41-4E97-9A3D-1D74B433B663}.PowerShell|Any CPU.ActiveCfg = ReleaseStatic|x64 - {CA460806-5E41-4E97-9A3D-1D74B433B663}.PowerShell|ARM64.ActiveCfg = ReleaseStatic|ARM64 - {CA460806-5E41-4E97-9A3D-1D74B433B663}.PowerShell|ARM64.Build.0 = ReleaseStatic|ARM64 - {CA460806-5E41-4E97-9A3D-1D74B433B663}.PowerShell|x64.ActiveCfg = ReleaseStatic|x64 - {CA460806-5E41-4E97-9A3D-1D74B433B663}.PowerShell|x64.Build.0 = ReleaseStatic|x64 - {CA460806-5E41-4E97-9A3D-1D74B433B663}.PowerShell|x86.ActiveCfg = ReleaseStatic|Win32 - {CA460806-5E41-4E97-9A3D-1D74B433B663}.PowerShell|x86.Build.0 = ReleaseStatic|Win32 - {CA460806-5E41-4E97-9A3D-1D74B433B663}.Release|Any CPU.ActiveCfg = Release|x64 {CA460806-5E41-4E97-9A3D-1D74B433B663}.Release|ARM64.ActiveCfg = Release|ARM64 {CA460806-5E41-4E97-9A3D-1D74B433B663}.Release|ARM64.Build.0 = Release|ARM64 {CA460806-5E41-4E97-9A3D-1D74B433B663}.Release|x64.ActiveCfg = Release|x64 {CA460806-5E41-4E97-9A3D-1D74B433B663}.Release|x64.Build.0 = Release|x64 {CA460806-5E41-4E97-9A3D-1D74B433B663}.Release|x86.ActiveCfg = Release|Win32 {CA460806-5E41-4E97-9A3D-1D74B433B663}.Release|x86.Build.0 = Release|Win32 - {CA460806-5E41-4E97-9A3D-1D74B433B663}.TestRelease|Any CPU.ActiveCfg = Release|x64 + {CA460806-5E41-4E97-9A3D-1D74B433B663}.ReleaseStatic|ARM64.ActiveCfg = ReleaseStatic|ARM64 + {CA460806-5E41-4E97-9A3D-1D74B433B663}.ReleaseStatic|ARM64.Build.0 = ReleaseStatic|ARM64 + {CA460806-5E41-4E97-9A3D-1D74B433B663}.ReleaseStatic|x64.ActiveCfg = ReleaseStatic|x64 + {CA460806-5E41-4E97-9A3D-1D74B433B663}.ReleaseStatic|x64.Build.0 = ReleaseStatic|x64 + {CA460806-5E41-4E97-9A3D-1D74B433B663}.ReleaseStatic|x86.ActiveCfg = ReleaseStatic|Win32 + {CA460806-5E41-4E97-9A3D-1D74B433B663}.ReleaseStatic|x86.Build.0 = ReleaseStatic|Win32 {CA460806-5E41-4E97-9A3D-1D74B433B663}.TestRelease|ARM64.ActiveCfg = Release|ARM64 {CA460806-5E41-4E97-9A3D-1D74B433B663}.TestRelease|ARM64.Build.0 = Release|ARM64 {CA460806-5E41-4E97-9A3D-1D74B433B663}.TestRelease|x64.ActiveCfg = Release|x64 {CA460806-5E41-4E97-9A3D-1D74B433B663}.TestRelease|x64.Build.0 = Release|x64 {CA460806-5E41-4E97-9A3D-1D74B433B663}.TestRelease|x86.ActiveCfg = Release|Win32 {CA460806-5E41-4E97-9A3D-1D74B433B663}.TestRelease|x86.Build.0 = Release|Win32 - {E8454BF1-2068-4513-A525-ABF55CC8742C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {E8454BF1-2068-4513-A525-ABF55CC8742C}.Debug|ARM64.ActiveCfg = Debug|Any CPU {E8454BF1-2068-4513-A525-ABF55CC8742C}.Debug|ARM64.Build.0 = Debug|Any CPU {E8454BF1-2068-4513-A525-ABF55CC8742C}.Debug|x64.ActiveCfg = Debug|Any CPU {E8454BF1-2068-4513-A525-ABF55CC8742C}.Debug|x64.Build.0 = Debug|Any CPU {E8454BF1-2068-4513-A525-ABF55CC8742C}.Debug|x86.ActiveCfg = Debug|Any CPU {E8454BF1-2068-4513-A525-ABF55CC8742C}.Debug|x86.Build.0 = Debug|Any CPU - {E8454BF1-2068-4513-A525-ABF55CC8742C}.Fuzzing|Any CPU.ActiveCfg = Release|Any CPU {E8454BF1-2068-4513-A525-ABF55CC8742C}.Fuzzing|ARM64.ActiveCfg = Release|Any CPU {E8454BF1-2068-4513-A525-ABF55CC8742C}.Fuzzing|x64.ActiveCfg = Release|Any CPU {E8454BF1-2068-4513-A525-ABF55CC8742C}.Fuzzing|x86.ActiveCfg = Release|Any CPU - {E8454BF1-2068-4513-A525-ABF55CC8742C}.PowerShell|Any CPU.ActiveCfg = ReleaseStatic|Any CPU - {E8454BF1-2068-4513-A525-ABF55CC8742C}.PowerShell|ARM64.ActiveCfg = ReleaseStatic|Any CPU - {E8454BF1-2068-4513-A525-ABF55CC8742C}.PowerShell|ARM64.Build.0 = ReleaseStatic|Any CPU - {E8454BF1-2068-4513-A525-ABF55CC8742C}.PowerShell|x64.ActiveCfg = ReleaseStatic|Any CPU - {E8454BF1-2068-4513-A525-ABF55CC8742C}.PowerShell|x64.Build.0 = ReleaseStatic|Any CPU - {E8454BF1-2068-4513-A525-ABF55CC8742C}.PowerShell|x86.ActiveCfg = ReleaseStatic|Any CPU - {E8454BF1-2068-4513-A525-ABF55CC8742C}.PowerShell|x86.Build.0 = ReleaseStatic|Any CPU - {E8454BF1-2068-4513-A525-ABF55CC8742C}.Release|Any CPU.ActiveCfg = Release|Any CPU {E8454BF1-2068-4513-A525-ABF55CC8742C}.Release|ARM64.ActiveCfg = Release|Any CPU {E8454BF1-2068-4513-A525-ABF55CC8742C}.Release|ARM64.Build.0 = Release|Any CPU {E8454BF1-2068-4513-A525-ABF55CC8742C}.Release|x64.ActiveCfg = Release|Any CPU {E8454BF1-2068-4513-A525-ABF55CC8742C}.Release|x64.Build.0 = Release|Any CPU {E8454BF1-2068-4513-A525-ABF55CC8742C}.Release|x86.ActiveCfg = Release|Any CPU {E8454BF1-2068-4513-A525-ABF55CC8742C}.Release|x86.Build.0 = Release|Any CPU - {E8454BF1-2068-4513-A525-ABF55CC8742C}.TestRelease|Any CPU.ActiveCfg = Release|Any CPU + {E8454BF1-2068-4513-A525-ABF55CC8742C}.ReleaseStatic|ARM64.ActiveCfg = ReleaseStatic|Any CPU + {E8454BF1-2068-4513-A525-ABF55CC8742C}.ReleaseStatic|ARM64.Build.0 = ReleaseStatic|Any CPU + {E8454BF1-2068-4513-A525-ABF55CC8742C}.ReleaseStatic|x64.ActiveCfg = ReleaseStatic|Any CPU + {E8454BF1-2068-4513-A525-ABF55CC8742C}.ReleaseStatic|x64.Build.0 = ReleaseStatic|Any CPU + {E8454BF1-2068-4513-A525-ABF55CC8742C}.ReleaseStatic|x86.ActiveCfg = ReleaseStatic|Any CPU + {E8454BF1-2068-4513-A525-ABF55CC8742C}.ReleaseStatic|x86.Build.0 = ReleaseStatic|Any CPU {E8454BF1-2068-4513-A525-ABF55CC8742C}.TestRelease|ARM64.ActiveCfg = Release|Any CPU {E8454BF1-2068-4513-A525-ABF55CC8742C}.TestRelease|ARM64.Build.0 = Release|Any CPU {E8454BF1-2068-4513-A525-ABF55CC8742C}.TestRelease|x64.ActiveCfg = Release|Any CPU {E8454BF1-2068-4513-A525-ABF55CC8742C}.TestRelease|x64.Build.0 = Release|Any CPU {E8454BF1-2068-4513-A525-ABF55CC8742C}.TestRelease|x86.ActiveCfg = Release|Any CPU {E8454BF1-2068-4513-A525-ABF55CC8742C}.TestRelease|x86.Build.0 = Release|Any CPU - {EE43C990-7789-4A60-B077-BF0ED3D093A1}.Debug|Any CPU.ActiveCfg = Debug|x64 {EE43C990-7789-4A60-B077-BF0ED3D093A1}.Debug|ARM64.ActiveCfg = Debug|arm64 {EE43C990-7789-4A60-B077-BF0ED3D093A1}.Debug|ARM64.Build.0 = Debug|arm64 {EE43C990-7789-4A60-B077-BF0ED3D093A1}.Debug|x64.ActiveCfg = Debug|x64 {EE43C990-7789-4A60-B077-BF0ED3D093A1}.Debug|x64.Build.0 = Debug|x64 {EE43C990-7789-4A60-B077-BF0ED3D093A1}.Debug|x86.ActiveCfg = Debug|x86 {EE43C990-7789-4A60-B077-BF0ED3D093A1}.Debug|x86.Build.0 = Debug|x86 - {EE43C990-7789-4A60-B077-BF0ED3D093A1}.Fuzzing|Any CPU.ActiveCfg = Release|x64 {EE43C990-7789-4A60-B077-BF0ED3D093A1}.Fuzzing|ARM64.ActiveCfg = Release|arm64 {EE43C990-7789-4A60-B077-BF0ED3D093A1}.Fuzzing|x64.ActiveCfg = Release|x64 {EE43C990-7789-4A60-B077-BF0ED3D093A1}.Fuzzing|x86.ActiveCfg = Release|x86 - {EE43C990-7789-4A60-B077-BF0ED3D093A1}.PowerShell|Any CPU.ActiveCfg = Release|x64 - {EE43C990-7789-4A60-B077-BF0ED3D093A1}.PowerShell|ARM64.ActiveCfg = Release|arm64 - {EE43C990-7789-4A60-B077-BF0ED3D093A1}.PowerShell|x64.ActiveCfg = Release|x64 - {EE43C990-7789-4A60-B077-BF0ED3D093A1}.PowerShell|x86.ActiveCfg = Release|x86 - {EE43C990-7789-4A60-B077-BF0ED3D093A1}.Release|Any CPU.ActiveCfg = Release|x64 {EE43C990-7789-4A60-B077-BF0ED3D093A1}.Release|ARM64.ActiveCfg = Release|arm64 {EE43C990-7789-4A60-B077-BF0ED3D093A1}.Release|ARM64.Build.0 = Release|arm64 {EE43C990-7789-4A60-B077-BF0ED3D093A1}.Release|x64.ActiveCfg = Release|x64 {EE43C990-7789-4A60-B077-BF0ED3D093A1}.Release|x64.Build.0 = Release|x64 {EE43C990-7789-4A60-B077-BF0ED3D093A1}.Release|x86.ActiveCfg = Release|x86 {EE43C990-7789-4A60-B077-BF0ED3D093A1}.Release|x86.Build.0 = Release|x86 - {EE43C990-7789-4A60-B077-BF0ED3D093A1}.TestRelease|Any CPU.ActiveCfg = Release|x64 + {EE43C990-7789-4A60-B077-BF0ED3D093A1}.ReleaseStatic|ARM64.ActiveCfg = Release|arm64 + {EE43C990-7789-4A60-B077-BF0ED3D093A1}.ReleaseStatic|x64.ActiveCfg = Release|x64 + {EE43C990-7789-4A60-B077-BF0ED3D093A1}.ReleaseStatic|x86.ActiveCfg = Release|x86 {EE43C990-7789-4A60-B077-BF0ED3D093A1}.TestRelease|ARM64.ActiveCfg = Release|arm64 {EE43C990-7789-4A60-B077-BF0ED3D093A1}.TestRelease|x64.ActiveCfg = Release|x64 {EE43C990-7789-4A60-B077-BF0ED3D093A1}.TestRelease|x86.ActiveCfg = Release|x86 - {71FA29AA-9035-468B-A11D-0F0B0F5D5AF4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {71FA29AA-9035-468B-A11D-0F0B0F5D5AF4}.Debug|ARM64.ActiveCfg = Debug|Any CPU {71FA29AA-9035-468B-A11D-0F0B0F5D5AF4}.Debug|ARM64.Build.0 = Debug|Any CPU {71FA29AA-9035-468B-A11D-0F0B0F5D5AF4}.Debug|x64.ActiveCfg = Debug|Any CPU {71FA29AA-9035-468B-A11D-0F0B0F5D5AF4}.Debug|x64.Build.0 = Debug|Any CPU {71FA29AA-9035-468B-A11D-0F0B0F5D5AF4}.Debug|x86.ActiveCfg = Debug|Any CPU {71FA29AA-9035-468B-A11D-0F0B0F5D5AF4}.Debug|x86.Build.0 = Debug|Any CPU - {71FA29AA-9035-468B-A11D-0F0B0F5D5AF4}.Fuzzing|Any CPU.ActiveCfg = Release|Any CPU {71FA29AA-9035-468B-A11D-0F0B0F5D5AF4}.Fuzzing|ARM64.ActiveCfg = Release|Any CPU {71FA29AA-9035-468B-A11D-0F0B0F5D5AF4}.Fuzzing|x64.ActiveCfg = Release|Any CPU {71FA29AA-9035-468B-A11D-0F0B0F5D5AF4}.Fuzzing|x86.ActiveCfg = Release|Any CPU - {71FA29AA-9035-468B-A11D-0F0B0F5D5AF4}.PowerShell|Any CPU.ActiveCfg = ReleaseStatic|Any CPU - {71FA29AA-9035-468B-A11D-0F0B0F5D5AF4}.PowerShell|ARM64.ActiveCfg = ReleaseStatic|Any CPU - {71FA29AA-9035-468B-A11D-0F0B0F5D5AF4}.PowerShell|ARM64.Build.0 = ReleaseStatic|Any CPU - {71FA29AA-9035-468B-A11D-0F0B0F5D5AF4}.PowerShell|x64.ActiveCfg = ReleaseStatic|Any CPU - {71FA29AA-9035-468B-A11D-0F0B0F5D5AF4}.PowerShell|x64.Build.0 = ReleaseStatic|Any CPU - {71FA29AA-9035-468B-A11D-0F0B0F5D5AF4}.PowerShell|x86.ActiveCfg = ReleaseStatic|Any CPU - {71FA29AA-9035-468B-A11D-0F0B0F5D5AF4}.PowerShell|x86.Build.0 = ReleaseStatic|Any CPU - {71FA29AA-9035-468B-A11D-0F0B0F5D5AF4}.Release|Any CPU.ActiveCfg = Release|Any CPU {71FA29AA-9035-468B-A11D-0F0B0F5D5AF4}.Release|ARM64.ActiveCfg = Release|Any CPU {71FA29AA-9035-468B-A11D-0F0B0F5D5AF4}.Release|ARM64.Build.0 = Release|Any CPU {71FA29AA-9035-468B-A11D-0F0B0F5D5AF4}.Release|x64.ActiveCfg = Release|Any CPU {71FA29AA-9035-468B-A11D-0F0B0F5D5AF4}.Release|x64.Build.0 = Release|Any CPU {71FA29AA-9035-468B-A11D-0F0B0F5D5AF4}.Release|x86.ActiveCfg = Release|Any CPU {71FA29AA-9035-468B-A11D-0F0B0F5D5AF4}.Release|x86.Build.0 = Release|Any CPU - {71FA29AA-9035-468B-A11D-0F0B0F5D5AF4}.TestRelease|Any CPU.ActiveCfg = Release|Any CPU + {71FA29AA-9035-468B-A11D-0F0B0F5D5AF4}.ReleaseStatic|ARM64.ActiveCfg = ReleaseStatic|Any CPU + {71FA29AA-9035-468B-A11D-0F0B0F5D5AF4}.ReleaseStatic|ARM64.Build.0 = ReleaseStatic|Any CPU + {71FA29AA-9035-468B-A11D-0F0B0F5D5AF4}.ReleaseStatic|x64.ActiveCfg = ReleaseStatic|Any CPU + {71FA29AA-9035-468B-A11D-0F0B0F5D5AF4}.ReleaseStatic|x64.Build.0 = ReleaseStatic|Any CPU + {71FA29AA-9035-468B-A11D-0F0B0F5D5AF4}.ReleaseStatic|x86.ActiveCfg = ReleaseStatic|Any CPU + {71FA29AA-9035-468B-A11D-0F0B0F5D5AF4}.ReleaseStatic|x86.Build.0 = ReleaseStatic|Any CPU {71FA29AA-9035-468B-A11D-0F0B0F5D5AF4}.TestRelease|ARM64.ActiveCfg = Release|Any CPU {71FA29AA-9035-468B-A11D-0F0B0F5D5AF4}.TestRelease|ARM64.Build.0 = Release|Any CPU {71FA29AA-9035-468B-A11D-0F0B0F5D5AF4}.TestRelease|x64.ActiveCfg = Release|Any CPU {71FA29AA-9035-468B-A11D-0F0B0F5D5AF4}.TestRelease|x64.Build.0 = Release|Any CPU {71FA29AA-9035-468B-A11D-0F0B0F5D5AF4}.TestRelease|x86.ActiveCfg = Release|Any CPU {71FA29AA-9035-468B-A11D-0F0B0F5D5AF4}.TestRelease|x86.Build.0 = Release|Any CPU - {6597EB04-D105-49A7-A5A3-D27FE1DF895E}.Debug|Any CPU.ActiveCfg = Debug|x64 {6597EB04-D105-49A7-A5A3-D27FE1DF895E}.Debug|ARM64.ActiveCfg = Debug|arm64 {6597EB04-D105-49A7-A5A3-D27FE1DF895E}.Debug|ARM64.Build.0 = Debug|arm64 {6597EB04-D105-49A7-A5A3-D27FE1DF895E}.Debug|x64.ActiveCfg = Debug|x64 {6597EB04-D105-49A7-A5A3-D27FE1DF895E}.Debug|x64.Build.0 = Debug|x64 {6597EB04-D105-49A7-A5A3-D27FE1DF895E}.Debug|x86.ActiveCfg = Debug|x86 {6597EB04-D105-49A7-A5A3-D27FE1DF895E}.Debug|x86.Build.0 = Debug|x86 - {6597EB04-D105-49A7-A5A3-D27FE1DF895E}.Fuzzing|Any CPU.ActiveCfg = Release|x64 {6597EB04-D105-49A7-A5A3-D27FE1DF895E}.Fuzzing|ARM64.ActiveCfg = Release|arm64 {6597EB04-D105-49A7-A5A3-D27FE1DF895E}.Fuzzing|x64.ActiveCfg = Release|x64 {6597EB04-D105-49A7-A5A3-D27FE1DF895E}.Fuzzing|x86.ActiveCfg = Release|x86 - {6597EB04-D105-49A7-A5A3-D27FE1DF895E}.PowerShell|Any CPU.ActiveCfg = Release|x64 - {6597EB04-D105-49A7-A5A3-D27FE1DF895E}.PowerShell|ARM64.ActiveCfg = Release|arm64 - {6597EB04-D105-49A7-A5A3-D27FE1DF895E}.PowerShell|x64.ActiveCfg = Release|x64 - {6597EB04-D105-49A7-A5A3-D27FE1DF895E}.PowerShell|x86.ActiveCfg = Release|x86 - {6597EB04-D105-49A7-A5A3-D27FE1DF895E}.Release|Any CPU.ActiveCfg = Release|x64 {6597EB04-D105-49A7-A5A3-D27FE1DF895E}.Release|ARM64.ActiveCfg = Release|arm64 {6597EB04-D105-49A7-A5A3-D27FE1DF895E}.Release|ARM64.Build.0 = Release|arm64 {6597EB04-D105-49A7-A5A3-D27FE1DF895E}.Release|x64.ActiveCfg = Release|x64 {6597EB04-D105-49A7-A5A3-D27FE1DF895E}.Release|x64.Build.0 = Release|x64 {6597EB04-D105-49A7-A5A3-D27FE1DF895E}.Release|x86.ActiveCfg = Release|x86 {6597EB04-D105-49A7-A5A3-D27FE1DF895E}.Release|x86.Build.0 = Release|x86 - {6597EB04-D105-49A7-A5A3-D27FE1DF895E}.TestRelease|Any CPU.ActiveCfg = Release|x64 + {6597EB04-D105-49A7-A5A3-D27FE1DF895E}.ReleaseStatic|ARM64.ActiveCfg = Release|arm64 + {6597EB04-D105-49A7-A5A3-D27FE1DF895E}.ReleaseStatic|x64.ActiveCfg = Release|x64 + {6597EB04-D105-49A7-A5A3-D27FE1DF895E}.ReleaseStatic|x86.ActiveCfg = Release|x86 {6597EB04-D105-49A7-A5A3-D27FE1DF895E}.TestRelease|ARM64.ActiveCfg = Release|arm64 {6597EB04-D105-49A7-A5A3-D27FE1DF895E}.TestRelease|ARM64.Build.0 = Release|arm64 {6597EB04-D105-49A7-A5A3-D27FE1DF895E}.TestRelease|x64.ActiveCfg = Release|x64 {6597EB04-D105-49A7-A5A3-D27FE1DF895E}.TestRelease|x64.Build.0 = Release|x64 {6597EB04-D105-49A7-A5A3-D27FE1DF895E}.TestRelease|x86.ActiveCfg = Release|x86 {6597EB04-D105-49A7-A5A3-D27FE1DF895E}.TestRelease|x86.Build.0 = Release|x86 - {1F56BECB-D65D-4BBA-8788-6671B251392A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {1F56BECB-D65D-4BBA-8788-6671B251392A}.Debug|ARM64.ActiveCfg = Debug|Any CPU {1F56BECB-D65D-4BBA-8788-6671B251392A}.Debug|ARM64.Build.0 = Debug|Any CPU {1F56BECB-D65D-4BBA-8788-6671B251392A}.Debug|x64.ActiveCfg = Debug|Any CPU {1F56BECB-D65D-4BBA-8788-6671B251392A}.Debug|x64.Build.0 = Debug|Any CPU {1F56BECB-D65D-4BBA-8788-6671B251392A}.Debug|x86.ActiveCfg = Debug|Any CPU {1F56BECB-D65D-4BBA-8788-6671B251392A}.Debug|x86.Build.0 = Debug|Any CPU - {1F56BECB-D65D-4BBA-8788-6671B251392A}.Fuzzing|Any CPU.ActiveCfg = Release|Any CPU {1F56BECB-D65D-4BBA-8788-6671B251392A}.Fuzzing|ARM64.ActiveCfg = Release|Any CPU {1F56BECB-D65D-4BBA-8788-6671B251392A}.Fuzzing|x64.ActiveCfg = Release|Any CPU {1F56BECB-D65D-4BBA-8788-6671B251392A}.Fuzzing|x86.ActiveCfg = Release|Any CPU - {1F56BECB-D65D-4BBA-8788-6671B251392A}.PowerShell|Any CPU.ActiveCfg = ReleaseStatic|Any CPU - {1F56BECB-D65D-4BBA-8788-6671B251392A}.PowerShell|ARM64.ActiveCfg = Release|Any CPU - {1F56BECB-D65D-4BBA-8788-6671B251392A}.PowerShell|x64.ActiveCfg = ReleaseStatic|Any CPU - {1F56BECB-D65D-4BBA-8788-6671B251392A}.PowerShell|x64.Build.0 = ReleaseStatic|Any CPU - {1F56BECB-D65D-4BBA-8788-6671B251392A}.PowerShell|x86.ActiveCfg = ReleaseStatic|Any CPU - {1F56BECB-D65D-4BBA-8788-6671B251392A}.PowerShell|x86.Build.0 = ReleaseStatic|Any CPU - {1F56BECB-D65D-4BBA-8788-6671B251392A}.Release|Any CPU.ActiveCfg = Release|Any CPU {1F56BECB-D65D-4BBA-8788-6671B251392A}.Release|ARM64.ActiveCfg = Release|Any CPU {1F56BECB-D65D-4BBA-8788-6671B251392A}.Release|ARM64.Build.0 = Release|Any CPU {1F56BECB-D65D-4BBA-8788-6671B251392A}.Release|x64.ActiveCfg = Release|Any CPU {1F56BECB-D65D-4BBA-8788-6671B251392A}.Release|x64.Build.0 = Release|Any CPU {1F56BECB-D65D-4BBA-8788-6671B251392A}.Release|x86.ActiveCfg = Release|Any CPU {1F56BECB-D65D-4BBA-8788-6671B251392A}.Release|x86.Build.0 = Release|Any CPU - {1F56BECB-D65D-4BBA-8788-6671B251392A}.TestRelease|Any CPU.ActiveCfg = Release|Any CPU + {1F56BECB-D65D-4BBA-8788-6671B251392A}.ReleaseStatic|ARM64.ActiveCfg = Release|Any CPU + {1F56BECB-D65D-4BBA-8788-6671B251392A}.ReleaseStatic|x64.ActiveCfg = ReleaseStatic|Any CPU + {1F56BECB-D65D-4BBA-8788-6671B251392A}.ReleaseStatic|x64.Build.0 = ReleaseStatic|Any CPU + {1F56BECB-D65D-4BBA-8788-6671B251392A}.ReleaseStatic|x86.ActiveCfg = ReleaseStatic|Any CPU + {1F56BECB-D65D-4BBA-8788-6671B251392A}.ReleaseStatic|x86.Build.0 = ReleaseStatic|Any CPU {1F56BECB-D65D-4BBA-8788-6671B251392A}.TestRelease|ARM64.ActiveCfg = Release|Any CPU {1F56BECB-D65D-4BBA-8788-6671B251392A}.TestRelease|x64.ActiveCfg = Release|Any CPU {1F56BECB-D65D-4BBA-8788-6671B251392A}.TestRelease|x86.ActiveCfg = Release|Any CPU - {167F634B-A3AD-494E-8E67-B888103E35FF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {167F634B-A3AD-494E-8E67-B888103E35FF}.Debug|ARM64.ActiveCfg = Debug|Any CPU {167F634B-A3AD-494E-8E67-B888103E35FF}.Debug|ARM64.Build.0 = Debug|Any CPU {167F634B-A3AD-494E-8E67-B888103E35FF}.Debug|x64.ActiveCfg = Debug|Any CPU {167F634B-A3AD-494E-8E67-B888103E35FF}.Debug|x64.Build.0 = Debug|Any CPU {167F634B-A3AD-494E-8E67-B888103E35FF}.Debug|x86.ActiveCfg = Debug|Any CPU {167F634B-A3AD-494E-8E67-B888103E35FF}.Debug|x86.Build.0 = Debug|Any CPU - {167F634B-A3AD-494E-8E67-B888103E35FF}.Fuzzing|Any CPU.ActiveCfg = Release|Any CPU {167F634B-A3AD-494E-8E67-B888103E35FF}.Fuzzing|ARM64.ActiveCfg = Release|Any CPU {167F634B-A3AD-494E-8E67-B888103E35FF}.Fuzzing|x64.ActiveCfg = Release|Any CPU {167F634B-A3AD-494E-8E67-B888103E35FF}.Fuzzing|x86.ActiveCfg = Release|Any CPU - {167F634B-A3AD-494E-8E67-B888103E35FF}.PowerShell|Any CPU.ActiveCfg = ReleaseStatic|Any CPU - {167F634B-A3AD-494E-8E67-B888103E35FF}.PowerShell|ARM64.ActiveCfg = Release|Any CPU - {167F634B-A3AD-494E-8E67-B888103E35FF}.PowerShell|x64.ActiveCfg = ReleaseStatic|Any CPU - {167F634B-A3AD-494E-8E67-B888103E35FF}.PowerShell|x64.Build.0 = ReleaseStatic|Any CPU - {167F634B-A3AD-494E-8E67-B888103E35FF}.PowerShell|x86.ActiveCfg = ReleaseStatic|Any CPU - {167F634B-A3AD-494E-8E67-B888103E35FF}.PowerShell|x86.Build.0 = ReleaseStatic|Any CPU - {167F634B-A3AD-494E-8E67-B888103E35FF}.Release|Any CPU.ActiveCfg = Release|Any CPU {167F634B-A3AD-494E-8E67-B888103E35FF}.Release|ARM64.ActiveCfg = Release|Any CPU {167F634B-A3AD-494E-8E67-B888103E35FF}.Release|ARM64.Build.0 = Release|Any CPU {167F634B-A3AD-494E-8E67-B888103E35FF}.Release|x64.ActiveCfg = Release|Any CPU {167F634B-A3AD-494E-8E67-B888103E35FF}.Release|x64.Build.0 = Release|Any CPU {167F634B-A3AD-494E-8E67-B888103E35FF}.Release|x86.ActiveCfg = Release|Any CPU {167F634B-A3AD-494E-8E67-B888103E35FF}.Release|x86.Build.0 = Release|Any CPU - {167F634B-A3AD-494E-8E67-B888103E35FF}.TestRelease|Any CPU.ActiveCfg = Release|Any CPU + {167F634B-A3AD-494E-8E67-B888103E35FF}.ReleaseStatic|ARM64.ActiveCfg = Release|Any CPU + {167F634B-A3AD-494E-8E67-B888103E35FF}.ReleaseStatic|x64.ActiveCfg = ReleaseStatic|Any CPU + {167F634B-A3AD-494E-8E67-B888103E35FF}.ReleaseStatic|x64.Build.0 = ReleaseStatic|Any CPU + {167F634B-A3AD-494E-8E67-B888103E35FF}.ReleaseStatic|x86.ActiveCfg = ReleaseStatic|Any CPU + {167F634B-A3AD-494E-8E67-B888103E35FF}.ReleaseStatic|x86.Build.0 = ReleaseStatic|Any CPU {167F634B-A3AD-494E-8E67-B888103E35FF}.TestRelease|ARM64.ActiveCfg = Release|Any CPU {167F634B-A3AD-494E-8E67-B888103E35FF}.TestRelease|x64.ActiveCfg = Release|Any CPU {167F634B-A3AD-494E-8E67-B888103E35FF}.TestRelease|x86.ActiveCfg = Release|Any CPU - {C54F80ED-B736-49B0-9BD3-662F57024D01}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {C54F80ED-B736-49B0-9BD3-662F57024D01}.Debug|ARM64.ActiveCfg = Debug|Any CPU {C54F80ED-B736-49B0-9BD3-662F57024D01}.Debug|ARM64.Build.0 = Debug|Any CPU {C54F80ED-B736-49B0-9BD3-662F57024D01}.Debug|x64.ActiveCfg = Debug|Any CPU {C54F80ED-B736-49B0-9BD3-662F57024D01}.Debug|x64.Build.0 = Debug|Any CPU {C54F80ED-B736-49B0-9BD3-662F57024D01}.Debug|x86.ActiveCfg = Debug|Any CPU {C54F80ED-B736-49B0-9BD3-662F57024D01}.Debug|x86.Build.0 = Debug|Any CPU - {C54F80ED-B736-49B0-9BD3-662F57024D01}.Fuzzing|Any CPU.ActiveCfg = Release|Any CPU {C54F80ED-B736-49B0-9BD3-662F57024D01}.Fuzzing|ARM64.ActiveCfg = Release|Any CPU {C54F80ED-B736-49B0-9BD3-662F57024D01}.Fuzzing|x64.ActiveCfg = Release|Any CPU {C54F80ED-B736-49B0-9BD3-662F57024D01}.Fuzzing|x86.ActiveCfg = Release|Any CPU - {C54F80ED-B736-49B0-9BD3-662F57024D01}.PowerShell|Any CPU.ActiveCfg = ReleaseStatic|Any CPU - {C54F80ED-B736-49B0-9BD3-662F57024D01}.PowerShell|ARM64.ActiveCfg = Release|Any CPU - {C54F80ED-B736-49B0-9BD3-662F57024D01}.PowerShell|x64.ActiveCfg = ReleaseStatic|Any CPU - {C54F80ED-B736-49B0-9BD3-662F57024D01}.PowerShell|x64.Build.0 = ReleaseStatic|Any CPU - {C54F80ED-B736-49B0-9BD3-662F57024D01}.PowerShell|x86.ActiveCfg = ReleaseStatic|Any CPU - {C54F80ED-B736-49B0-9BD3-662F57024D01}.PowerShell|x86.Build.0 = ReleaseStatic|Any CPU - {C54F80ED-B736-49B0-9BD3-662F57024D01}.Release|Any CPU.ActiveCfg = Release|Any CPU {C54F80ED-B736-49B0-9BD3-662F57024D01}.Release|ARM64.ActiveCfg = Release|Any CPU {C54F80ED-B736-49B0-9BD3-662F57024D01}.Release|ARM64.Build.0 = Release|Any CPU {C54F80ED-B736-49B0-9BD3-662F57024D01}.Release|x64.ActiveCfg = Release|Any CPU {C54F80ED-B736-49B0-9BD3-662F57024D01}.Release|x64.Build.0 = Release|Any CPU {C54F80ED-B736-49B0-9BD3-662F57024D01}.Release|x86.ActiveCfg = Release|Any CPU {C54F80ED-B736-49B0-9BD3-662F57024D01}.Release|x86.Build.0 = Release|Any CPU - {C54F80ED-B736-49B0-9BD3-662F57024D01}.TestRelease|Any CPU.ActiveCfg = Release|Any CPU + {C54F80ED-B736-49B0-9BD3-662F57024D01}.ReleaseStatic|ARM64.ActiveCfg = Release|Any CPU + {C54F80ED-B736-49B0-9BD3-662F57024D01}.ReleaseStatic|x64.ActiveCfg = ReleaseStatic|Any CPU + {C54F80ED-B736-49B0-9BD3-662F57024D01}.ReleaseStatic|x64.Build.0 = ReleaseStatic|Any CPU + {C54F80ED-B736-49B0-9BD3-662F57024D01}.ReleaseStatic|x86.ActiveCfg = ReleaseStatic|Any CPU + {C54F80ED-B736-49B0-9BD3-662F57024D01}.ReleaseStatic|x86.Build.0 = ReleaseStatic|Any CPU {C54F80ED-B736-49B0-9BD3-662F57024D01}.TestRelease|ARM64.ActiveCfg = Release|Any CPU {C54F80ED-B736-49B0-9BD3-662F57024D01}.TestRelease|x64.ActiveCfg = Release|Any CPU {C54F80ED-B736-49B0-9BD3-662F57024D01}.TestRelease|x86.ActiveCfg = Release|Any CPU - {2268D5AD-7F2A-485A-8C4B-C574497514C9}.Debug|Any CPU.ActiveCfg = Debug|x64 {2268D5AD-7F2A-485A-8C4B-C574497514C9}.Debug|ARM64.ActiveCfg = Debug|ARM64 {2268D5AD-7F2A-485A-8C4B-C574497514C9}.Debug|ARM64.Build.0 = Debug|ARM64 {2268D5AD-7F2A-485A-8C4B-C574497514C9}.Debug|x64.ActiveCfg = Debug|x64 {2268D5AD-7F2A-485A-8C4B-C574497514C9}.Debug|x64.Build.0 = Debug|x64 {2268D5AD-7F2A-485A-8C4B-C574497514C9}.Debug|x86.ActiveCfg = Debug|Win32 {2268D5AD-7F2A-485A-8C4B-C574497514C9}.Debug|x86.Build.0 = Debug|Win32 - {2268D5AD-7F2A-485A-8C4B-C574497514C9}.Fuzzing|Any CPU.ActiveCfg = Release|x64 {2268D5AD-7F2A-485A-8C4B-C574497514C9}.Fuzzing|ARM64.ActiveCfg = Release|ARM64 {2268D5AD-7F2A-485A-8C4B-C574497514C9}.Fuzzing|x64.ActiveCfg = Release|x64 {2268D5AD-7F2A-485A-8C4B-C574497514C9}.Fuzzing|x86.ActiveCfg = Release|Win32 - {2268D5AD-7F2A-485A-8C4B-C574497514C9}.PowerShell|Any CPU.ActiveCfg = ReleaseStatic|x64 - {2268D5AD-7F2A-485A-8C4B-C574497514C9}.PowerShell|ARM64.ActiveCfg = ReleaseStatic|ARM64 - {2268D5AD-7F2A-485A-8C4B-C574497514C9}.PowerShell|ARM64.Build.0 = ReleaseStatic|ARM64 - {2268D5AD-7F2A-485A-8C4B-C574497514C9}.PowerShell|x64.ActiveCfg = ReleaseStatic|x64 - {2268D5AD-7F2A-485A-8C4B-C574497514C9}.PowerShell|x64.Build.0 = ReleaseStatic|x64 - {2268D5AD-7F2A-485A-8C4B-C574497514C9}.PowerShell|x86.ActiveCfg = ReleaseStatic|Win32 - {2268D5AD-7F2A-485A-8C4B-C574497514C9}.PowerShell|x86.Build.0 = ReleaseStatic|Win32 - {2268D5AD-7F2A-485A-8C4B-C574497514C9}.Release|Any CPU.ActiveCfg = Release|x64 {2268D5AD-7F2A-485A-8C4B-C574497514C9}.Release|ARM64.ActiveCfg = Release|ARM64 {2268D5AD-7F2A-485A-8C4B-C574497514C9}.Release|ARM64.Build.0 = Release|ARM64 {2268D5AD-7F2A-485A-8C4B-C574497514C9}.Release|x64.ActiveCfg = Release|x64 {2268D5AD-7F2A-485A-8C4B-C574497514C9}.Release|x64.Build.0 = Release|x64 {2268D5AD-7F2A-485A-8C4B-C574497514C9}.Release|x86.ActiveCfg = Release|Win32 {2268D5AD-7F2A-485A-8C4B-C574497514C9}.Release|x86.Build.0 = Release|Win32 - {2268D5AD-7F2A-485A-8C4B-C574497514C9}.TestRelease|Any CPU.ActiveCfg = Release|x64 + {2268D5AD-7F2A-485A-8C4B-C574497514C9}.ReleaseStatic|ARM64.ActiveCfg = ReleaseStatic|ARM64 + {2268D5AD-7F2A-485A-8C4B-C574497514C9}.ReleaseStatic|ARM64.Build.0 = ReleaseStatic|ARM64 + {2268D5AD-7F2A-485A-8C4B-C574497514C9}.ReleaseStatic|x64.ActiveCfg = ReleaseStatic|x64 + {2268D5AD-7F2A-485A-8C4B-C574497514C9}.ReleaseStatic|x64.Build.0 = ReleaseStatic|x64 + {2268D5AD-7F2A-485A-8C4B-C574497514C9}.ReleaseStatic|x86.ActiveCfg = ReleaseStatic|Win32 + {2268D5AD-7F2A-485A-8C4B-C574497514C9}.ReleaseStatic|x86.Build.0 = ReleaseStatic|Win32 {2268D5AD-7F2A-485A-8C4B-C574497514C9}.TestRelease|ARM64.ActiveCfg = Release|ARM64 {2268D5AD-7F2A-485A-8C4B-C574497514C9}.TestRelease|ARM64.Build.0 = Release|ARM64 {2268D5AD-7F2A-485A-8C4B-C574497514C9}.TestRelease|x64.ActiveCfg = Release|x64 {2268D5AD-7F2A-485A-8C4B-C574497514C9}.TestRelease|x64.Build.0 = Release|x64 {2268D5AD-7F2A-485A-8C4B-C574497514C9}.TestRelease|x86.ActiveCfg = Release|Win32 {2268D5AD-7F2A-485A-8C4B-C574497514C9}.TestRelease|x86.Build.0 = Release|Win32 - {52EC37D6-088C-40D3-AD0B-BDE8F8DAF9EB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {52EC37D6-088C-40D3-AD0B-BDE8F8DAF9EB}.Debug|ARM64.ActiveCfg = Debug|Any CPU {52EC37D6-088C-40D3-AD0B-BDE8F8DAF9EB}.Debug|ARM64.Build.0 = Debug|Any CPU {52EC37D6-088C-40D3-AD0B-BDE8F8DAF9EB}.Debug|x64.ActiveCfg = Debug|Any CPU {52EC37D6-088C-40D3-AD0B-BDE8F8DAF9EB}.Debug|x64.Build.0 = Debug|Any CPU {52EC37D6-088C-40D3-AD0B-BDE8F8DAF9EB}.Debug|x86.ActiveCfg = Debug|Any CPU {52EC37D6-088C-40D3-AD0B-BDE8F8DAF9EB}.Debug|x86.Build.0 = Debug|Any CPU - {52EC37D6-088C-40D3-AD0B-BDE8F8DAF9EB}.Fuzzing|Any CPU.ActiveCfg = Release|Any CPU {52EC37D6-088C-40D3-AD0B-BDE8F8DAF9EB}.Fuzzing|ARM64.ActiveCfg = Release|Any CPU {52EC37D6-088C-40D3-AD0B-BDE8F8DAF9EB}.Fuzzing|x64.ActiveCfg = Release|Any CPU {52EC37D6-088C-40D3-AD0B-BDE8F8DAF9EB}.Fuzzing|x86.ActiveCfg = Release|Any CPU - {52EC37D6-088C-40D3-AD0B-BDE8F8DAF9EB}.PowerShell|Any CPU.ActiveCfg = Release|Any CPU - {52EC37D6-088C-40D3-AD0B-BDE8F8DAF9EB}.PowerShell|ARM64.ActiveCfg = Release|Any CPU - {52EC37D6-088C-40D3-AD0B-BDE8F8DAF9EB}.PowerShell|x64.ActiveCfg = Release|Any CPU - {52EC37D6-088C-40D3-AD0B-BDE8F8DAF9EB}.PowerShell|x86.ActiveCfg = Release|Any CPU - {52EC37D6-088C-40D3-AD0B-BDE8F8DAF9EB}.Release|Any CPU.ActiveCfg = Release|Any CPU {52EC37D6-088C-40D3-AD0B-BDE8F8DAF9EB}.Release|ARM64.ActiveCfg = Release|Any CPU {52EC37D6-088C-40D3-AD0B-BDE8F8DAF9EB}.Release|ARM64.Build.0 = Release|Any CPU {52EC37D6-088C-40D3-AD0B-BDE8F8DAF9EB}.Release|x64.ActiveCfg = Release|Any CPU {52EC37D6-088C-40D3-AD0B-BDE8F8DAF9EB}.Release|x64.Build.0 = Release|Any CPU {52EC37D6-088C-40D3-AD0B-BDE8F8DAF9EB}.Release|x86.ActiveCfg = Release|Any CPU {52EC37D6-088C-40D3-AD0B-BDE8F8DAF9EB}.Release|x86.Build.0 = Release|Any CPU - {52EC37D6-088C-40D3-AD0B-BDE8F8DAF9EB}.TestRelease|Any CPU.ActiveCfg = Release|Any CPU + {52EC37D6-088C-40D3-AD0B-BDE8F8DAF9EB}.ReleaseStatic|ARM64.ActiveCfg = Release|Any CPU + {52EC37D6-088C-40D3-AD0B-BDE8F8DAF9EB}.ReleaseStatic|x64.ActiveCfg = Release|Any CPU + {52EC37D6-088C-40D3-AD0B-BDE8F8DAF9EB}.ReleaseStatic|x86.ActiveCfg = Release|Any CPU {52EC37D6-088C-40D3-AD0B-BDE8F8DAF9EB}.TestRelease|ARM64.ActiveCfg = Release|Any CPU {52EC37D6-088C-40D3-AD0B-BDE8F8DAF9EB}.TestRelease|x64.ActiveCfg = Release|Any CPU {52EC37D6-088C-40D3-AD0B-BDE8F8DAF9EB}.TestRelease|x86.ActiveCfg = Release|Any CPU - {272B2B0E-40D4-4F0F-B187-519A6EF89B10}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {272B2B0E-40D4-4F0F-B187-519A6EF89B10}.Debug|ARM64.ActiveCfg = Debug|Any CPU {272B2B0E-40D4-4F0F-B187-519A6EF89B10}.Debug|ARM64.Build.0 = Debug|Any CPU {272B2B0E-40D4-4F0F-B187-519A6EF89B10}.Debug|x64.ActiveCfg = Debug|Any CPU {272B2B0E-40D4-4F0F-B187-519A6EF89B10}.Debug|x64.Build.0 = Debug|Any CPU {272B2B0E-40D4-4F0F-B187-519A6EF89B10}.Debug|x86.ActiveCfg = Debug|Any CPU {272B2B0E-40D4-4F0F-B187-519A6EF89B10}.Debug|x86.Build.0 = Debug|Any CPU - {272B2B0E-40D4-4F0F-B187-519A6EF89B10}.Fuzzing|Any CPU.ActiveCfg = Release|Any CPU {272B2B0E-40D4-4F0F-B187-519A6EF89B10}.Fuzzing|ARM64.ActiveCfg = Release|Any CPU {272B2B0E-40D4-4F0F-B187-519A6EF89B10}.Fuzzing|x64.ActiveCfg = Release|Any CPU {272B2B0E-40D4-4F0F-B187-519A6EF89B10}.Fuzzing|x86.ActiveCfg = Release|Any CPU - {272B2B0E-40D4-4F0F-B187-519A6EF89B10}.PowerShell|Any CPU.ActiveCfg = ReleaseStatic|Any CPU - {272B2B0E-40D4-4F0F-B187-519A6EF89B10}.PowerShell|ARM64.ActiveCfg = ReleaseStatic|Any CPU - {272B2B0E-40D4-4F0F-B187-519A6EF89B10}.PowerShell|ARM64.Build.0 = ReleaseStatic|Any CPU - {272B2B0E-40D4-4F0F-B187-519A6EF89B10}.PowerShell|x64.ActiveCfg = ReleaseStatic|Any CPU - {272B2B0E-40D4-4F0F-B187-519A6EF89B10}.PowerShell|x64.Build.0 = ReleaseStatic|Any CPU - {272B2B0E-40D4-4F0F-B187-519A6EF89B10}.PowerShell|x86.ActiveCfg = ReleaseStatic|Any CPU - {272B2B0E-40D4-4F0F-B187-519A6EF89B10}.PowerShell|x86.Build.0 = ReleaseStatic|Any CPU - {272B2B0E-40D4-4F0F-B187-519A6EF89B10}.Release|Any CPU.ActiveCfg = Release|Any CPU {272B2B0E-40D4-4F0F-B187-519A6EF89B10}.Release|ARM64.ActiveCfg = Release|Any CPU {272B2B0E-40D4-4F0F-B187-519A6EF89B10}.Release|ARM64.Build.0 = Release|Any CPU {272B2B0E-40D4-4F0F-B187-519A6EF89B10}.Release|x64.ActiveCfg = Release|Any CPU {272B2B0E-40D4-4F0F-B187-519A6EF89B10}.Release|x64.Build.0 = Release|Any CPU {272B2B0E-40D4-4F0F-B187-519A6EF89B10}.Release|x86.ActiveCfg = Release|Any CPU {272B2B0E-40D4-4F0F-B187-519A6EF89B10}.Release|x86.Build.0 = Release|Any CPU - {272B2B0E-40D4-4F0F-B187-519A6EF89B10}.TestRelease|Any CPU.ActiveCfg = Release|Any CPU + {272B2B0E-40D4-4F0F-B187-519A6EF89B10}.ReleaseStatic|ARM64.ActiveCfg = ReleaseStatic|Any CPU + {272B2B0E-40D4-4F0F-B187-519A6EF89B10}.ReleaseStatic|ARM64.Build.0 = ReleaseStatic|Any CPU + {272B2B0E-40D4-4F0F-B187-519A6EF89B10}.ReleaseStatic|x64.ActiveCfg = ReleaseStatic|Any CPU + {272B2B0E-40D4-4F0F-B187-519A6EF89B10}.ReleaseStatic|x64.Build.0 = ReleaseStatic|Any CPU + {272B2B0E-40D4-4F0F-B187-519A6EF89B10}.ReleaseStatic|x86.ActiveCfg = ReleaseStatic|Any CPU + {272B2B0E-40D4-4F0F-B187-519A6EF89B10}.ReleaseStatic|x86.Build.0 = ReleaseStatic|Any CPU {272B2B0E-40D4-4F0F-B187-519A6EF89B10}.TestRelease|ARM64.ActiveCfg = Release|Any CPU {272B2B0E-40D4-4F0F-B187-519A6EF89B10}.TestRelease|x64.ActiveCfg = Release|Any CPU {272B2B0E-40D4-4F0F-B187-519A6EF89B10}.TestRelease|x86.ActiveCfg = Release|Any CPU - {1B9077B3-8923-4ECD-8FC9-B3190FCBE4D4}.Debug|Any CPU.ActiveCfg = Debug|x64 {1B9077B3-8923-4ECD-8FC9-B3190FCBE4D4}.Debug|ARM64.ActiveCfg = Debug|ARM64 {1B9077B3-8923-4ECD-8FC9-B3190FCBE4D4}.Debug|ARM64.Build.0 = Debug|ARM64 {1B9077B3-8923-4ECD-8FC9-B3190FCBE4D4}.Debug|x64.ActiveCfg = Debug|x64 {1B9077B3-8923-4ECD-8FC9-B3190FCBE4D4}.Debug|x64.Build.0 = Debug|x64 {1B9077B3-8923-4ECD-8FC9-B3190FCBE4D4}.Debug|x86.ActiveCfg = Debug|Win32 {1B9077B3-8923-4ECD-8FC9-B3190FCBE4D4}.Debug|x86.Build.0 = Debug|Win32 - {1B9077B3-8923-4ECD-8FC9-B3190FCBE4D4}.Fuzzing|Any CPU.ActiveCfg = Release|x64 {1B9077B3-8923-4ECD-8FC9-B3190FCBE4D4}.Fuzzing|ARM64.ActiveCfg = Release|ARM64 {1B9077B3-8923-4ECD-8FC9-B3190FCBE4D4}.Fuzzing|x64.ActiveCfg = Release|x64 {1B9077B3-8923-4ECD-8FC9-B3190FCBE4D4}.Fuzzing|x86.ActiveCfg = Release|Win32 - {1B9077B3-8923-4ECD-8FC9-B3190FCBE4D4}.PowerShell|Any CPU.ActiveCfg = ReleaseStatic|x64 - {1B9077B3-8923-4ECD-8FC9-B3190FCBE4D4}.PowerShell|ARM64.ActiveCfg = ReleaseStatic|ARM64 - {1B9077B3-8923-4ECD-8FC9-B3190FCBE4D4}.PowerShell|ARM64.Build.0 = ReleaseStatic|ARM64 - {1B9077B3-8923-4ECD-8FC9-B3190FCBE4D4}.PowerShell|x64.ActiveCfg = ReleaseStatic|x64 - {1B9077B3-8923-4ECD-8FC9-B3190FCBE4D4}.PowerShell|x64.Build.0 = ReleaseStatic|x64 - {1B9077B3-8923-4ECD-8FC9-B3190FCBE4D4}.PowerShell|x86.ActiveCfg = ReleaseStatic|Win32 - {1B9077B3-8923-4ECD-8FC9-B3190FCBE4D4}.PowerShell|x86.Build.0 = ReleaseStatic|Win32 - {1B9077B3-8923-4ECD-8FC9-B3190FCBE4D4}.Release|Any CPU.ActiveCfg = Release|x64 {1B9077B3-8923-4ECD-8FC9-B3190FCBE4D4}.Release|ARM64.ActiveCfg = Release|ARM64 {1B9077B3-8923-4ECD-8FC9-B3190FCBE4D4}.Release|ARM64.Build.0 = Release|ARM64 {1B9077B3-8923-4ECD-8FC9-B3190FCBE4D4}.Release|x64.ActiveCfg = Release|x64 {1B9077B3-8923-4ECD-8FC9-B3190FCBE4D4}.Release|x64.Build.0 = Release|x64 {1B9077B3-8923-4ECD-8FC9-B3190FCBE4D4}.Release|x86.ActiveCfg = Release|Win32 {1B9077B3-8923-4ECD-8FC9-B3190FCBE4D4}.Release|x86.Build.0 = Release|Win32 - {1B9077B3-8923-4ECD-8FC9-B3190FCBE4D4}.TestRelease|Any CPU.ActiveCfg = Release|x64 + {1B9077B3-8923-4ECD-8FC9-B3190FCBE4D4}.ReleaseStatic|ARM64.ActiveCfg = ReleaseStatic|ARM64 + {1B9077B3-8923-4ECD-8FC9-B3190FCBE4D4}.ReleaseStatic|ARM64.Build.0 = ReleaseStatic|ARM64 + {1B9077B3-8923-4ECD-8FC9-B3190FCBE4D4}.ReleaseStatic|x64.ActiveCfg = ReleaseStatic|x64 + {1B9077B3-8923-4ECD-8FC9-B3190FCBE4D4}.ReleaseStatic|x64.Build.0 = ReleaseStatic|x64 + {1B9077B3-8923-4ECD-8FC9-B3190FCBE4D4}.ReleaseStatic|x86.ActiveCfg = ReleaseStatic|Win32 + {1B9077B3-8923-4ECD-8FC9-B3190FCBE4D4}.ReleaseStatic|x86.Build.0 = ReleaseStatic|Win32 {1B9077B3-8923-4ECD-8FC9-B3190FCBE4D4}.TestRelease|ARM64.ActiveCfg = Release|ARM64 {1B9077B3-8923-4ECD-8FC9-B3190FCBE4D4}.TestRelease|ARM64.Build.0 = Release|ARM64 {1B9077B3-8923-4ECD-8FC9-B3190FCBE4D4}.TestRelease|x64.ActiveCfg = Release|x64 {1B9077B3-8923-4ECD-8FC9-B3190FCBE4D4}.TestRelease|x64.Build.0 = Release|x64 {1B9077B3-8923-4ECD-8FC9-B3190FCBE4D4}.TestRelease|x86.ActiveCfg = Release|Win32 {1B9077B3-8923-4ECD-8FC9-B3190FCBE4D4}.TestRelease|x86.Build.0 = Release|Win32 - {98920AB6-27B0-4C0F-B336-FA49DE57A1BA}.Debug|Any CPU.ActiveCfg = Debug|x64 - {98920AB6-27B0-4C0F-B336-FA49DE57A1BA}.Debug|Any CPU.Build.0 = Debug|x64 {98920AB6-27B0-4C0F-B336-FA49DE57A1BA}.Debug|ARM64.ActiveCfg = Debug|x64 {98920AB6-27B0-4C0F-B336-FA49DE57A1BA}.Debug|ARM64.Build.0 = Debug|x64 {98920AB6-27B0-4C0F-B336-FA49DE57A1BA}.Debug|x64.ActiveCfg = Debug|x64 {98920AB6-27B0-4C0F-B336-FA49DE57A1BA}.Debug|x64.Build.0 = Debug|x64 {98920AB6-27B0-4C0F-B336-FA49DE57A1BA}.Debug|x86.ActiveCfg = Debug|Win32 {98920AB6-27B0-4C0F-B336-FA49DE57A1BA}.Debug|x86.Build.0 = Debug|Win32 - {98920AB6-27B0-4C0F-B336-FA49DE57A1BA}.Fuzzing|Any CPU.ActiveCfg = Debug|x64 - {98920AB6-27B0-4C0F-B336-FA49DE57A1BA}.Fuzzing|Any CPU.Build.0 = Debug|x64 {98920AB6-27B0-4C0F-B336-FA49DE57A1BA}.Fuzzing|ARM64.ActiveCfg = Debug|x64 {98920AB6-27B0-4C0F-B336-FA49DE57A1BA}.Fuzzing|ARM64.Build.0 = Debug|x64 {98920AB6-27B0-4C0F-B336-FA49DE57A1BA}.Fuzzing|x64.ActiveCfg = Debug|x64 {98920AB6-27B0-4C0F-B336-FA49DE57A1BA}.Fuzzing|x64.Build.0 = Debug|x64 {98920AB6-27B0-4C0F-B336-FA49DE57A1BA}.Fuzzing|x86.ActiveCfg = Debug|Win32 {98920AB6-27B0-4C0F-B336-FA49DE57A1BA}.Fuzzing|x86.Build.0 = Debug|Win32 - {98920AB6-27B0-4C0F-B336-FA49DE57A1BA}.PowerShell|Any CPU.ActiveCfg = Debug|x64 - {98920AB6-27B0-4C0F-B336-FA49DE57A1BA}.PowerShell|Any CPU.Build.0 = Debug|x64 - {98920AB6-27B0-4C0F-B336-FA49DE57A1BA}.PowerShell|ARM64.ActiveCfg = Debug|x64 - {98920AB6-27B0-4C0F-B336-FA49DE57A1BA}.PowerShell|ARM64.Build.0 = Debug|x64 - {98920AB6-27B0-4C0F-B336-FA49DE57A1BA}.PowerShell|x64.ActiveCfg = Debug|x64 - {98920AB6-27B0-4C0F-B336-FA49DE57A1BA}.PowerShell|x64.Build.0 = Debug|x64 - {98920AB6-27B0-4C0F-B336-FA49DE57A1BA}.PowerShell|x86.ActiveCfg = Debug|Win32 - {98920AB6-27B0-4C0F-B336-FA49DE57A1BA}.PowerShell|x86.Build.0 = Debug|Win32 - {98920AB6-27B0-4C0F-B336-FA49DE57A1BA}.Release|Any CPU.ActiveCfg = Release|x64 - {98920AB6-27B0-4C0F-B336-FA49DE57A1BA}.Release|Any CPU.Build.0 = Release|x64 {98920AB6-27B0-4C0F-B336-FA49DE57A1BA}.Release|ARM64.ActiveCfg = Release|x64 {98920AB6-27B0-4C0F-B336-FA49DE57A1BA}.Release|ARM64.Build.0 = Release|x64 {98920AB6-27B0-4C0F-B336-FA49DE57A1BA}.Release|x64.ActiveCfg = Release|x64 {98920AB6-27B0-4C0F-B336-FA49DE57A1BA}.Release|x64.Build.0 = Release|x64 {98920AB6-27B0-4C0F-B336-FA49DE57A1BA}.Release|x86.ActiveCfg = Release|Win32 {98920AB6-27B0-4C0F-B336-FA49DE57A1BA}.Release|x86.Build.0 = Release|Win32 - {98920AB6-27B0-4C0F-B336-FA49DE57A1BA}.TestRelease|Any CPU.ActiveCfg = Release|x64 - {98920AB6-27B0-4C0F-B336-FA49DE57A1BA}.TestRelease|Any CPU.Build.0 = Release|x64 + {98920AB6-27B0-4C0F-B336-FA49DE57A1BA}.ReleaseStatic|ARM64.ActiveCfg = Release|x64 + {98920AB6-27B0-4C0F-B336-FA49DE57A1BA}.ReleaseStatic|ARM64.Build.0 = Release|x64 + {98920AB6-27B0-4C0F-B336-FA49DE57A1BA}.ReleaseStatic|x64.ActiveCfg = Release|x64 + {98920AB6-27B0-4C0F-B336-FA49DE57A1BA}.ReleaseStatic|x64.Build.0 = Release|x64 + {98920AB6-27B0-4C0F-B336-FA49DE57A1BA}.ReleaseStatic|x86.ActiveCfg = Release|Win32 + {98920AB6-27B0-4C0F-B336-FA49DE57A1BA}.ReleaseStatic|x86.Build.0 = Release|Win32 {98920AB6-27B0-4C0F-B336-FA49DE57A1BA}.TestRelease|ARM64.ActiveCfg = Release|x64 {98920AB6-27B0-4C0F-B336-FA49DE57A1BA}.TestRelease|ARM64.Build.0 = Release|x64 {98920AB6-27B0-4C0F-B336-FA49DE57A1BA}.TestRelease|x64.ActiveCfg = Release|x64 {98920AB6-27B0-4C0F-B336-FA49DE57A1BA}.TestRelease|x64.Build.0 = Release|x64 {98920AB6-27B0-4C0F-B336-FA49DE57A1BA}.TestRelease|x86.ActiveCfg = Release|Win32 {98920AB6-27B0-4C0F-B336-FA49DE57A1BA}.TestRelease|x86.Build.0 = Release|Win32 + {0BA531C8-CF0C-405B-8221-0FE51BA529D1}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {0BA531C8-CF0C-405B-8221-0FE51BA529D1}.Debug|ARM64.Build.0 = Debug|ARM64 + {0BA531C8-CF0C-405B-8221-0FE51BA529D1}.Debug|x64.ActiveCfg = Debug|x64 + {0BA531C8-CF0C-405B-8221-0FE51BA529D1}.Debug|x64.Build.0 = Debug|x64 + {0BA531C8-CF0C-405B-8221-0FE51BA529D1}.Debug|x86.ActiveCfg = Debug|Win32 + {0BA531C8-CF0C-405B-8221-0FE51BA529D1}.Debug|x86.Build.0 = Debug|Win32 + {0BA531C8-CF0C-405B-8221-0FE51BA529D1}.Fuzzing|ARM64.ActiveCfg = Release|ARM64 + {0BA531C8-CF0C-405B-8221-0FE51BA529D1}.Fuzzing|x64.ActiveCfg = Release|x64 + {0BA531C8-CF0C-405B-8221-0FE51BA529D1}.Fuzzing|x86.ActiveCfg = Release|Win32 + {0BA531C8-CF0C-405B-8221-0FE51BA529D1}.Release|ARM64.ActiveCfg = Release|ARM64 + {0BA531C8-CF0C-405B-8221-0FE51BA529D1}.Release|ARM64.Build.0 = Release|ARM64 + {0BA531C8-CF0C-405B-8221-0FE51BA529D1}.Release|x64.ActiveCfg = Release|x64 + {0BA531C8-CF0C-405B-8221-0FE51BA529D1}.Release|x64.Build.0 = Release|x64 + {0BA531C8-CF0C-405B-8221-0FE51BA529D1}.Release|x86.ActiveCfg = Release|Win32 + {0BA531C8-CF0C-405B-8221-0FE51BA529D1}.Release|x86.Build.0 = Release|Win32 + {0BA531C8-CF0C-405B-8221-0FE51BA529D1}.ReleaseStatic|ARM64.ActiveCfg = ReleaseStatic|ARM64 + {0BA531C8-CF0C-405B-8221-0FE51BA529D1}.ReleaseStatic|ARM64.Build.0 = ReleaseStatic|ARM64 + {0BA531C8-CF0C-405B-8221-0FE51BA529D1}.ReleaseStatic|x64.ActiveCfg = ReleaseStatic|x64 + {0BA531C8-CF0C-405B-8221-0FE51BA529D1}.ReleaseStatic|x64.Build.0 = ReleaseStatic|x64 + {0BA531C8-CF0C-405B-8221-0FE51BA529D1}.ReleaseStatic|x86.ActiveCfg = ReleaseStatic|Win32 + {0BA531C8-CF0C-405B-8221-0FE51BA529D1}.ReleaseStatic|x86.Build.0 = ReleaseStatic|Win32 + {0BA531C8-CF0C-405B-8221-0FE51BA529D1}.TestRelease|ARM64.ActiveCfg = Release|ARM64 + {0BA531C8-CF0C-405B-8221-0FE51BA529D1}.TestRelease|ARM64.Build.0 = Release|ARM64 + {0BA531C8-CF0C-405B-8221-0FE51BA529D1}.TestRelease|x64.ActiveCfg = Release|x64 + {0BA531C8-CF0C-405B-8221-0FE51BA529D1}.TestRelease|x64.Build.0 = Release|x64 + {0BA531C8-CF0C-405B-8221-0FE51BA529D1}.TestRelease|x86.ActiveCfg = Release|Win32 + {0BA531C8-CF0C-405B-8221-0FE51BA529D1}.TestRelease|x86.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/AppInstallerCLICore/AppInstallerCLICore.vcxproj b/src/AppInstallerCLICore/AppInstallerCLICore.vcxproj index c4c54cdc30..fc4428adae 100644 --- a/src/AppInstallerCLICore/AppInstallerCLICore.vcxproj +++ b/src/AppInstallerCLICore/AppInstallerCLICore.vcxproj @@ -541,7 +541,8 @@ - $(OutputPath)..\Microsoft.Management.Configuration.Processor\Microsoft.Management.Configuration.Processor.winmd + + $(SolutionDir)\AnyCPU\$(Configuration)\Microsoft.Management.Configuration.Processor\Microsoft.Management.Configuration.Processor.winmd $(SolutionDir)\AnyCPU\$(Configuration)\Microsoft.Management.Configuration.Processor\net6.0-windows10.0.22000.0\win\Microsoft.Management.Configuration.Processor.winmd diff --git a/src/AppInstallerCLICore/Argument.cpp b/src/AppInstallerCLICore/Argument.cpp index 7c26b20cb2..a5334a2ceb 100644 --- a/src/AppInstallerCLICore/Argument.cpp +++ b/src/AppInstallerCLICore/Argument.cpp @@ -203,6 +203,8 @@ namespace AppInstaller::CLI return { type, "file"_liv, 'f', ArgTypeCategory::ConfigurationSetChoice, ArgTypeExclusiveSet::ConfigurationSetChoice }; case Execution::Args::Type::ConfigurationAcceptWarning: return { type, "accept-configuration-agreements"_liv }; + case Execution::Args::Type::ConfigurationSuppressPrologue: + return { type, "suppress-initial-details"_liv }; case Execution::Args::Type::ConfigurationEnable: return { type, "enable"_liv, ArgTypeCategory::None, ArgTypeExclusiveSet::StubType }; case Execution::Args::Type::ConfigurationDisable: @@ -219,6 +221,8 @@ namespace AppInstaller::CLI return { type, "history"_liv, 'h', ArgTypeCategory::ConfigurationSetChoice, ArgTypeExclusiveSet::ConfigurationSetChoice }; case Execution::Args::Type::ConfigurationHistoryRemove: return { type, "remove"_liv }; + case Execution::Args::Type::ConfigurationStatusWatch: + return { type, "live"_liv }; // Download command case Execution::Args::Type::DownloadDirectory: diff --git a/src/AppInstallerCLICore/Commands/ConfigureCommand.cpp b/src/AppInstallerCLICore/Commands/ConfigureCommand.cpp index 6388aefa32..8738a382eb 100644 --- a/src/AppInstallerCLICore/Commands/ConfigureCommand.cpp +++ b/src/AppInstallerCLICore/Commands/ConfigureCommand.cpp @@ -16,7 +16,7 @@ using namespace AppInstaller::CLI::Workflow; namespace AppInstaller::CLI { ConfigureCommand::ConfigureCommand(std::string_view parent) : - Command("configure", { "configuration" }, parent, Settings::TogglePolicy::Policy::Configuration) + Command("configure", { "configuration", "dsc"}, parent, Settings::TogglePolicy::Policy::Configuration) { SelectCurrentCommandIfUnrecognizedSubcommandFound(true); } @@ -39,6 +39,7 @@ namespace AppInstaller::CLI Argument{ Execution::Args::Type::ConfigurationModulePath, Resource::String::ConfigurationModulePath, ArgumentType::Positional }, Argument{ Execution::Args::Type::ConfigurationHistoryItem, Resource::String::ConfigurationHistoryItemArgumentDescription, ArgumentType::Standard, Argument::Visibility::Help }, Argument{ Execution::Args::Type::ConfigurationAcceptWarning, Resource::String::ConfigurationAcceptWarningArgumentDescription, ArgumentType::Flag }, + Argument{ Execution::Args::Type::ConfigurationSuppressPrologue, Resource::String::ConfigurationSuppressPrologueArgumentDescription, ArgumentType::Flag, Argument::Visibility::Help }, Argument{ Execution::Args::Type::ConfigurationEnable, Resource::String::ConfigurationEnableMessage, ArgumentType::Flag, Argument::Visibility::Help }, Argument{ Execution::Args::Type::ConfigurationDisable, Resource::String::ConfigurationDisableMessage, ArgumentType::Flag, Argument::Visibility::Help }, }; diff --git a/src/AppInstallerCLICore/Commands/ConfigureListCommand.cpp b/src/AppInstallerCLICore/Commands/ConfigureListCommand.cpp index 67306af606..9bfd9d9985 100644 --- a/src/AppInstallerCLICore/Commands/ConfigureListCommand.cpp +++ b/src/AppInstallerCLICore/Commands/ConfigureListCommand.cpp @@ -15,6 +15,7 @@ namespace AppInstaller::CLI Argument{ Execution::Args::Type::ConfigurationHistoryItem, Resource::String::ConfigurationHistoryItemArgumentDescription, ArgumentType::Standard }, Argument{ Execution::Args::Type::OutputFile, Resource::String::OutputFileArgumentDescription, ArgumentType::Standard, Argument::Visibility::Help }, Argument{ Execution::Args::Type::ConfigurationHistoryRemove, Resource::String::ConfigurationHistoryRemoveArgumentDescription, ArgumentType::Flag, Argument::Visibility::Help }, + Argument{ Execution::Args::Type::ConfigurationStatusWatch, Resource::String::ConfigurationStatusWatchArgumentDescription, ArgumentType::Flag, Argument::Visibility::Hidden }, }; } @@ -58,6 +59,10 @@ namespace AppInstaller::CLI context << ShowSingleConfigurationSetHistory; } } + else if (context.Args.Contains(Execution::Args::Type::ConfigurationStatusWatch)) + { + context << MonitorConfigurationStatus; + } else { context << ShowConfigurationSetHistory; diff --git a/src/AppInstallerCLICore/Commands/RepairCommand.h b/src/AppInstallerCLICore/Commands/RepairCommand.h index 09f876c5e7..58da8c80c5 100644 --- a/src/AppInstallerCLICore/Commands/RepairCommand.h +++ b/src/AppInstallerCLICore/Commands/RepairCommand.h @@ -7,7 +7,7 @@ namespace AppInstaller::CLI { struct RepairCommand final : public Command { - RepairCommand(std::string_view parent) : Command("repair", parent) {} + RepairCommand(std::string_view parent) : Command("repair", { "fix" }, parent) {} std::vector GetArguments() const override; diff --git a/src/AppInstallerCLICore/ConfigurationDynamicRuntimeFactory.cpp b/src/AppInstallerCLICore/ConfigurationDynamicRuntimeFactory.cpp index d710e14a8a..d9f1c4d849 100644 --- a/src/AppInstallerCLICore/ConfigurationDynamicRuntimeFactory.cpp +++ b/src/AppInstallerCLICore/ConfigurationDynamicRuntimeFactory.cpp @@ -36,17 +36,49 @@ namespace AppInstaller::CLI::ConfigurationRemoting } #endif + // This is implemented completely in the packaged context for now, if we want to make it more configurable, we will probably want to move it to configuration and + // have this implementation leverage that one with an event handler for the packaged specifics. + // TODO: Add SetProcessorFactory::IPwshConfigurationSetProcessorFactoryProperties and pass values along to sets on creation + // In turn, any properties must only be set via the command line (or eventual UI requests to the user). + struct DynamicFactory : winrt::implements>, WinRT::LifetimeWatcherBase + { + DynamicFactory(); + + IConfigurationSetProcessor CreateSetProcessor(const ConfigurationSet& configurationSet); + + winrt::event_token Diagnostics(const EventHandler& handler); + void Diagnostics(const winrt::event_token& token) noexcept; + + DiagnosticLevel MinimumLevel(); + void MinimumLevel(DiagnosticLevel value); + + HRESULT STDMETHODCALLTYPE SetLifetimeWatcher(IUnknown* watcher); + + IConfigurationSetProcessorFactory& DefaultFactory(); + + void SendDiagnostics(const IDiagnosticInformation& information); + + private: + IConfigurationSetProcessorFactory m_defaultRemoteFactory; + winrt::event> m_diagnostics; + IConfigurationSetProcessorFactory::Diagnostics_revoker m_factoryDiagnosticsEventRevoker; + std::mutex m_diagnosticsMutex; + DiagnosticLevel m_minimumLevel = DiagnosticLevel::Informational; + }; + struct DynamicProcessorInfo { IConfigurationSetProcessorFactory Factory; IConfigurationSetProcessor Processor; + IConfigurationSetProcessorFactory::Diagnostics_revoker DiagnosticsEventRevoker; }; struct DynamicSetProcessor : winrt::implements { using ProcessorMap = std::map; - DynamicSetProcessor(IConfigurationSetProcessorFactory defaultRemoteFactory, IConfigurationSetProcessor defaultRemoteSetProcessor, const ConfigurationSet& configurationSet) : m_configurationSet(configurationSet) + DynamicSetProcessor(winrt::com_ptr dynamicFactory, IConfigurationSetProcessor defaultRemoteSetProcessor, const ConfigurationSet& configurationSet) : + m_dynamicFactory(std::move(dynamicFactory)), m_configurationSet(configurationSet) { #ifndef AICLI_DISABLE_TEST_HOOKS m_enableTestMode = GetConfigurationSetMetadataOverride(m_configurationSet, EnableTestModeTestGuid); @@ -58,7 +90,7 @@ namespace AppInstaller::CLI::ConfigurationRemoting m_currentIntegrityLevel = Security::GetEffectiveIntegrityLevel(); #endif - m_setProcessors.emplace(m_currentIntegrityLevel, DynamicProcessorInfo{ defaultRemoteFactory, defaultRemoteSetProcessor }); + m_setProcessors.emplace(m_currentIntegrityLevel, DynamicProcessorInfo{ m_dynamicFactory->DefaultFactory(), defaultRemoteSetProcessor}); } IConfigurationUnitProcessorDetails GetUnitProcessorDetails(const ConfigurationUnit& unit, ConfigurationUnitDetailFlags detailFlags) @@ -141,7 +173,7 @@ namespace AppInstaller::CLI::ConfigurationRemoting Security::IntegrityLevel GetIntegrityLevelForUnit(const ConfigurationUnit& unit) { // Support for 0.2 schema via metadata value - // TODO: Support case insensitive lookup by iteration + // TODO: Support case-insensitive lookup by iteration auto unitMetadata = unit.Metadata(); auto securityContext = unitMetadata.TryLookup(L"securityContext"); if (securityContext) @@ -212,6 +244,7 @@ namespace AppInstaller::CLI::ConfigurationRemoting ProcessorMap::iterator CreateSetProcessorForIntegrityLevel(Security::IntegrityLevel integrityLevel) { IConfigurationSetProcessorFactory factory; + IConfigurationSetProcessorFactory::Diagnostics_revoker factoryDiagnosticsEventRevoker; // If we got here, the only option is that the current integrity level is not High. if (integrityLevel == Security::IntegrityLevel::High) @@ -228,9 +261,22 @@ namespace AppInstaller::CLI::ConfigurationRemoting THROW_WIN32(ERROR_NOT_SUPPORTED); } - return m_setProcessors.emplace(integrityLevel, DynamicProcessorInfo{ factory, factory.CreateSetProcessor(m_configurationSet) }).first; + if (factory) + { + factoryDiagnosticsEventRevoker = factory.Diagnostics(winrt::auto_revoke, + [weak_this{ get_weak() }](const IInspectable&, const IDiagnosticInformation& information) + { + if (auto strong_this{ weak_this.get() }) + { + strong_this->m_dynamicFactory->SendDiagnostics(information); + } + }); + } + + return m_setProcessors.emplace(integrityLevel, DynamicProcessorInfo{ factory, factory.CreateSetProcessor(m_configurationSet), std::move(factoryDiagnosticsEventRevoker) }).first; } + winrt::com_ptr m_dynamicFactory; Security::IntegrityLevel m_currentIntegrityLevel; ProcessorMap m_setProcessors; ConfigurationSet m_configurationSet; @@ -243,52 +289,68 @@ namespace AppInstaller::CLI::ConfigurationRemoting #endif }; - // This is implemented completely in the packaged context for now, if we want to make it more configurable, we will probably want to move it to configuration and - // have this implementation leverage that one with an event handler for the packaged specifics. - // TODO: Add SetProcessorFactory::IPwshConfigurationSetProcessorFactoryProperties and pass values along to sets on creation - // In turn, any properties must only be set via the command line (or eventual UI requests to the user). - struct DynamicFactory : winrt::implements>, WinRT::LifetimeWatcherBase + DynamicFactory::DynamicFactory() { - DynamicFactory() - { - m_defaultRemoteFactory = CreateOutOfProcessFactory(); - } + m_defaultRemoteFactory = CreateOutOfProcessFactory(); - IConfigurationSetProcessor CreateSetProcessor(const ConfigurationSet& configurationSet) + if (m_defaultRemoteFactory) { - return winrt::make(m_defaultRemoteFactory, m_defaultRemoteFactory.CreateSetProcessor(configurationSet), configurationSet); + m_factoryDiagnosticsEventRevoker = m_defaultRemoteFactory.Diagnostics(winrt::auto_revoke, + [weak_this{ get_weak() }](const IInspectable&, const IDiagnosticInformation& information) + { + if (auto strong_this{ weak_this.get() }) + { + strong_this->SendDiagnostics(information); + } + }); } + } - winrt::event_token Diagnostics(const EventHandler&) - { - // TODO: If we want diagnostics here, see ConfigurationProcessor for how to integrate nicely with the infrastructure. - // Best solution is probably to create a base class that both can leverage to handle it cleanly. - return {}; - } + IConfigurationSetProcessor DynamicFactory::CreateSetProcessor(const ConfigurationSet& configurationSet) + { + return winrt::make(get_strong(), m_defaultRemoteFactory.CreateSetProcessor(configurationSet), configurationSet); + } - void Diagnostics(const winrt::event_token&) noexcept - { - } + winrt::event_token DynamicFactory::Diagnostics(const EventHandler& handler) + { + return m_diagnostics.add(handler); + } - DiagnosticLevel MinimumLevel() - { - return m_minimumLevel; - } + void DynamicFactory::Diagnostics(const winrt::event_token& token) noexcept + { + m_diagnostics.remove(token); + } - void MinimumLevel(DiagnosticLevel value) - { - m_minimumLevel = value; - } + DiagnosticLevel DynamicFactory::MinimumLevel() + { + return m_minimumLevel; + } - HRESULT STDMETHODCALLTYPE SetLifetimeWatcher(IUnknown* watcher) + void DynamicFactory::MinimumLevel(DiagnosticLevel value) + { + m_minimumLevel = value; + } + + HRESULT STDMETHODCALLTYPE DynamicFactory::SetLifetimeWatcher(IUnknown* watcher) + { + return WinRT::LifetimeWatcherBase::SetLifetimeWatcher(watcher); + } + + IConfigurationSetProcessorFactory& DynamicFactory::DefaultFactory() + { + return m_defaultRemoteFactory; + } + + void DynamicFactory::SendDiagnostics(const IDiagnosticInformation& information) try + { + if (information.Level() >= m_minimumLevel) { - return WinRT::LifetimeWatcherBase::SetLifetimeWatcher(watcher); + std::lock_guard lock{ m_diagnosticsMutex }; + m_diagnostics(*this, information); } - - private: - IConfigurationSetProcessorFactory m_defaultRemoteFactory; - DiagnosticLevel m_minimumLevel = DiagnosticLevel::Informational; - }; + } + // While diagnostics can be important, a failure to send them should not cause additional issues. + catch (...) {} } winrt::Microsoft::Management::Configuration::IConfigurationSetProcessorFactory CreateDynamicRuntimeFactory() diff --git a/src/AppInstallerCLICore/ConfigurationWingetDscModuleUnitValidation.cpp b/src/AppInstallerCLICore/ConfigurationWingetDscModuleUnitValidation.cpp index 7bbcdebc61..a8f0cfb5a0 100644 --- a/src/AppInstallerCLICore/ConfigurationWingetDscModuleUnitValidation.cpp +++ b/src/AppInstallerCLICore/ConfigurationWingetDscModuleUnitValidation.cpp @@ -14,7 +14,7 @@ namespace AppInstaller::CLI::Configuration { namespace { - constexpr static std::string_view UnitType_WinGetSources = "WinGetSources"sv; + constexpr static std::string_view UnitType_WinGetSource = "WinGetSource"sv; constexpr static std::string_view UnitType_WinGetPackage = "WinGetPackage"sv; constexpr static std::string_view WellKnownSourceName_WinGet = "winget"sv; @@ -22,10 +22,11 @@ namespace AppInstaller::CLI::Configuration constexpr static std::string_view ValueSetKey_TreatAsArray = "treatAsArray"sv; - constexpr static std::string_view WinGetSourcesValueSetKey_Sources = "sources"sv; - constexpr static std::string_view WinGetSourcesValueSetKey_SourceName = "name"sv; - constexpr static std::string_view WinGetSourcesValueSetKey_SourceType = "type"sv; - constexpr static std::string_view WinGetSourcesValueSetKey_SourceArg = "arg"sv; + constexpr static std::string_view WinGetSourceValueSetKey_Name = "name"sv; + constexpr static std::string_view WinGetSourceValueSetKey_Type = "type"sv; + constexpr static std::string_view WinGetSourceValueSetKey_Arg = "argument"sv; + constexpr static std::string_view WinGetSourceValueSetKey_Ensure = "ensure"sv; + constexpr static std::string_view WinGetSourceValueSetKey_Ensure_Present = "present"sv; constexpr static std::string_view WinGetPackageValueSetKey_Id = "id"sv; constexpr static std::string_view WinGetPackageValueSetKey_Version = "version"sv; @@ -37,6 +38,7 @@ namespace AppInstaller::CLI::Configuration std::string Name; std::string Type; std::string Arg; + bool Present = true; bool Empty() { @@ -66,64 +68,30 @@ namespace AppInstaller::CLI::Configuration return defaultIfFailed; } - std::vector ParseWinGetSourcesFromSettings(const ValueSet& settings) + WinGetSource ParseWinGetSourceFromSettings(const ValueSet& settings) { - // Iterate through the value set as Powershell variables are case insensitive. - std::vector result; + WinGetSource result; + + // Iterate through the value set as Powershell variables are case-insensitive. for (auto const& settingsPair : settings) { auto settingsKey = Utility::ConvertToUTF8(settingsPair.Key()); - if (Utility::CaseInsensitiveEquals(WinGetSourcesValueSetKey_Sources, settingsKey)) - { - auto sources = settingsPair.Value().try_as(); - if (!sources) - { - return {}; - } - bool isArray = false; - for (auto const& sourcesPair : sources) - { - if (Utility::CaseInsensitiveEquals(ValueSetKey_TreatAsArray, Utility::ConvertToUTF8(sourcesPair.Key()))) - { - isArray = true; - } - else - { - auto source = sourcesPair.Value().try_as(); - if (source) - { - WinGetSource wingetSource; - for (auto const& sourcePair : source) - { - auto sourceKey = Utility::ConvertToUTF8(sourcePair.Key()); - if (Utility::CaseInsensitiveEquals(WinGetSourcesValueSetKey_SourceName, sourceKey)) - { - wingetSource.Name = GetPropertyValueAsString(sourcePair.Value()); - } - else if (Utility::CaseInsensitiveEquals(WinGetSourcesValueSetKey_SourceType, sourceKey)) - { - wingetSource.Type = GetPropertyValueAsString(sourcePair.Value()); - } - else if (Utility::CaseInsensitiveEquals(WinGetSourcesValueSetKey_SourceArg, sourceKey)) - { - wingetSource.Arg = GetPropertyValueAsString(sourcePair.Value()); - } - } - - if (!wingetSource.Empty()) - { - result.emplace_back(std::move(wingetSource)); - } - } - } - } - - if (!isArray) - { - return {}; - } - break; + if (Utility::CaseInsensitiveEquals(WinGetSourceValueSetKey_Name, settingsKey)) + { + result.Name = GetPropertyValueAsString(settingsPair.Value()); + } + else if (Utility::CaseInsensitiveEquals(WinGetSourceValueSetKey_Type, settingsKey)) + { + result.Type = GetPropertyValueAsString(settingsPair.Value()); + } + else if (Utility::CaseInsensitiveEquals(WinGetSourceValueSetKey_Arg, settingsKey)) + { + result.Arg = GetPropertyValueAsString(settingsPair.Value()); + } + else if (Utility::CaseInsensitiveEquals(WinGetSourceValueSetKey_Ensure, settingsKey)) + { + result.Present = Utility::CaseInsensitiveEquals(WinGetSourceValueSetKey_Ensure_Present, GetPropertyValueAsString(settingsPair.Value())); } } @@ -172,7 +140,7 @@ namespace AppInstaller::CLI::Configuration WinGetPackage ParseWinGetPackageFromSettings(const ValueSet& settings) { - // Iterate through the value set as Powershell variables are case insensitive. + // Iterate through the value set as Powershell variables are case-insensitive. WinGetPackage result; for (auto const& settingsPair : settings) { @@ -206,56 +174,48 @@ namespace AppInstaller::CLI::Configuration auto unitType = Utility::ConvertToUTF8(details.UnitType()); auto unitIntent = unit.Intent(); - if (Utility::CaseInsensitiveEquals(UnitType_WinGetSources, unitType)) + if (Utility::CaseInsensitiveEquals(UnitType_WinGetSource, unitType)) { - auto sources = ParseWinGetSourcesFromSettings(unit.Settings()); - if (sources.size() == 0) - { - AICLI_LOG(Config, Warning, << "Failed to parse WinGetSources or empty content."); - context.Reporter.Warn() << Resource::String::WinGetResourceUnitEmptyContent(Utility::LocIndView{ UnitType_WinGetSources }) << std::endl; - foundIssues = true; - } - for (auto const& source : sources) - { - // Validate basic semantics. - if (source.Name.empty()) - { - AICLI_LOG(Config, Error, << "WinGetSource unit missing required arg: Name"); - context.Reporter.Error() << Resource::String::WinGetResourceUnitMissingRequiredArg(Utility::LocIndView{ UnitType_WinGetSources }, "Name"_liv) << std::endl; - foundIssues = true; - } - if (source.Arg.empty()) - { - AICLI_LOG(Config, Error, << "WinGetSource unit missing required arg: Arg"); - context.Reporter.Error() << Resource::String::WinGetResourceUnitMissingRequiredArg(Utility::LocIndView{ UnitType_WinGetSources }, "Arg"_liv) << std::endl; - foundIssues = true; - } + auto source = ParseWinGetSourceFromSettings(unit.Settings()); - // Validate well known source or process 3rd party source. - if (IsWellKnownSourceName(source.Name)) - { - if (!ValidateWellKnownSource(source)) - { - AICLI_LOG(Config, Warning, << "WinGetSource conflicts with a well known source. Source: " << source.Name); - context.Reporter.Warn() << Resource::String::WinGetResourceUnitKnownSourceConfliction(Utility::LocIndView{ source.Name }) << std::endl; - foundIssues = true; - } - } - else - { - if (unitIntent == ConfigurationUnitIntent::Assert) - { - AICLI_LOG(Config, Warning, << "Asserting on 3rd party source: " << source.Name); - context.Reporter.Warn() << Resource::String::WinGetResourceUnitThirdPartySourceAssertion(Utility::LocIndView{ source.Name }) << std::endl; - foundIssues = true; - } - else if (unitIntent == ConfigurationUnitIntent::Apply) - { - // Add to dependency source map so it can be validated with later WinGetPackage source - m_dependenciesSourceAndUnitIdMap.emplace(Utility::FoldCase(std::string_view{ source.Name }), Utility::FoldCase(Utility::NormalizedString{ unit.Identifier() })); - } - } - } + // Validate basic semantics. + if (source.Name.empty()) + { + AICLI_LOG(Config, Error, << "WinGetSource unit missing required arg: Name"); + context.Reporter.Error() << Resource::String::WinGetResourceUnitMissingRequiredArg(Utility::LocIndView{ UnitType_WinGetSource }, "Name"_liv) << std::endl; + foundIssues = true; + } + if (source.Arg.empty() && source.Present) + { + AICLI_LOG(Config, Error, << "WinGetSource unit missing required arg: Argument"); + context.Reporter.Error() << Resource::String::WinGetResourceUnitMissingRequiredArg(Utility::LocIndView{ UnitType_WinGetSource }, "Argument"_liv) << std::endl; + foundIssues = true; + } + + // Validate well known source or process 3rd party source. + if (IsWellKnownSourceName(source.Name)) + { + if (!ValidateWellKnownSource(source)) + { + AICLI_LOG(Config, Warning, << "WinGetSource conflicts with a well known source. Source: " << source.Name); + context.Reporter.Warn() << Resource::String::WinGetResourceUnitKnownSourceConfliction(Utility::LocIndView{ source.Name }) << std::endl; + foundIssues = true; + } + } + else + { + if (unitIntent == ConfigurationUnitIntent::Assert) + { + AICLI_LOG(Config, Warning, << "Asserting on 3rd party source: " << source.Name); + context.Reporter.Warn() << Resource::String::WinGetResourceUnitThirdPartySourceAssertion(Utility::LocIndView{ source.Name }) << std::endl; + foundIssues = true; + } + else if (unitIntent == ConfigurationUnitIntent::Apply) + { + // Add to dependency source map so it can be validated with later WinGetPackage source + m_dependenciesSourceAndUnitIdMap.emplace(Utility::FoldCase(std::string_view{ source.Name }), Utility::FoldCase(Utility::NormalizedString{ unit.Identifier() })); + } + } } else if (Utility::CaseInsensitiveEquals(UnitType_WinGetPackage, unitType)) { @@ -281,8 +241,8 @@ namespace AppInstaller::CLI::Configuration } if (package.UseLatest && !package.Version.empty()) { - AICLI_LOG(Config, Error, << "WinGetPackage unit both UseLatest and Version declared. Package: " << package.Id); - context.Reporter.Error() << Resource::String::WinGetResourceUnitBothPackageVersionAndUseLatest(Utility::LocIndView{ package.Id }) << std::endl; + AICLI_LOG(Config, Warning, << "WinGetPackage unit both UseLatest and Version declared. Package: " << package.Id); + context.Reporter.Warn() << Resource::String::WinGetResourceUnitBothPackageVersionAndUseLatest(Utility::LocIndView{ package.Id }) << std::endl; foundIssues = true; } // Validate dependency source is configured. @@ -395,4 +355,4 @@ namespace AppInstaller::CLI::Configuration return !foundIssues; } -} \ No newline at end of file +} diff --git a/src/AppInstallerCLICore/ExecutionArgs.h b/src/AppInstallerCLICore/ExecutionArgs.h index 517ce35a35..41739b36f4 100644 --- a/src/AppInstallerCLICore/ExecutionArgs.h +++ b/src/AppInstallerCLICore/ExecutionArgs.h @@ -124,6 +124,7 @@ namespace AppInstaller::CLI::Execution // Configuration ConfigurationFile, ConfigurationAcceptWarning, + ConfigurationSuppressPrologue, ConfigurationEnable, ConfigurationDisable, ConfigurationModulePath, @@ -132,6 +133,7 @@ namespace AppInstaller::CLI::Execution ConfigurationExportResource, ConfigurationHistoryItem, ConfigurationHistoryRemove, + ConfigurationStatusWatch, // Common arguments NoVT, // Disable VirtualTerminal outputs diff --git a/src/AppInstallerCLICore/PortableInstaller.cpp b/src/AppInstallerCLICore/PortableInstaller.cpp index e80cfe5de7..4770836d87 100644 --- a/src/AppInstallerCLICore/PortableInstaller.cpp +++ b/src/AppInstallerCLICore/PortableInstaller.cpp @@ -72,9 +72,10 @@ namespace AppInstaller::CLI::Portable } else if (fileType == PortableFileType::Symlink) { - if (Filesystem::SymlinkExists(filePath) && !Filesystem::VerifySymlink(filePath, entry.SymlinkTarget)) + std::filesystem::path symlinkTargetPath{ AppInstaller::Utility::ConvertToUTF16(entry.SymlinkTarget) }; + if (Filesystem::SymlinkExists(filePath) && !Filesystem::VerifySymlink(filePath, symlinkTargetPath)) { - AICLI_LOG(CLI, Warning, << "Symlink target does not match ARP Entry. Expected: " << entry.SymlinkTarget << " Actual: " << std::filesystem::read_symlink(filePath)); + AICLI_LOG(CLI, Warning, << "Symlink target does not match ARP Entry. Expected: " << symlinkTargetPath << " Actual: " << std::filesystem::read_symlink(filePath)); return false; } } @@ -121,7 +122,18 @@ namespace AppInstaller::CLI::Portable } else if (entry.FileType == PortableFileType::Symlink) { - if (!InstallDirectoryAddedToPath) + std::filesystem::path symlinkTargetPath{ Utility::ConvertToUTF16(entry.SymlinkTarget) }; + + if (BinariesDependOnPath && !InstallDirectoryAddedToPath) + { + // Scenario indicated by 'ArchiveBinariesDependOnPath' manifest entry. + // Skip symlink creation for portables dependent on binaries that require the install directory to be added to PATH. + std::filesystem::path installDirectory = symlinkTargetPath.parent_path(); + AddToPathVariable(installDirectory); + AICLI_LOG(Core, Info, << "Install directory added to PATH: " << installDirectory); + CommitToARPEntry(PortableValueName::InstallDirectoryAddedToPath, InstallDirectoryAddedToPath = true); + } + else if (!InstallDirectoryAddedToPath) { std::filesystem::file_status status = std::filesystem::status(filePath); if (std::filesystem::is_directory(status)) @@ -141,15 +153,15 @@ namespace AppInstaller::CLI::Portable m_stream << Resource::String::OverwritingExistingFileAtMessage(Utility::LocIndView{ filePath.u8string() }) << std::endl; } - if (Filesystem::CreateSymlink(entry.SymlinkTarget, filePath)) + if (Filesystem::CreateSymlink(symlinkTargetPath, filePath)) { - AICLI_LOG(Core, Info, << "Symlink created at: " << filePath); + AICLI_LOG(Core, Info, << "Symlink created at: " << filePath << " with target path: " << symlinkTargetPath); } else { // If symlink creation fails, resort to adding the package directory to PATH. AICLI_LOG(Core, Info, << "Failed to create symlink at: " << filePath); - AddToPathVariable(std::filesystem::path(entry.SymlinkTarget).parent_path()); + AddToPathVariable(symlinkTargetPath.parent_path()); CommitToARPEntry(PortableValueName::InstallDirectoryAddedToPath, InstallDirectoryAddedToPath = true); } } @@ -177,7 +189,7 @@ namespace AppInstaller::CLI::Portable else if (InstallDirectoryAddedToPath) { // If symlink doesn't exist, check if install directory was added to PATH directly and remove. - RemoveFromPathVariable(std::filesystem::path(entry.SymlinkTarget).parent_path()); + RemoveFromPathVariable(std::filesystem::path(Utility::ConvertToUTF16(entry.SymlinkTarget)).parent_path()); } } else if (fileType == PortableFileType::Symlink && Filesystem::SymlinkExists(filePath)) diff --git a/src/AppInstallerCLICore/PortableInstaller.h b/src/AppInstallerCLICore/PortableInstaller.h index 7ac1a951dd..6a611df7a3 100644 --- a/src/AppInstallerCLICore/PortableInstaller.h +++ b/src/AppInstallerCLICore/PortableInstaller.h @@ -32,6 +32,7 @@ namespace AppInstaller::CLI::Portable std::string WinGetPackageIdentifier; std::string WinGetSourceIdentifier; bool InstallDirectoryCreated = false; + bool BinariesDependOnPath = false; // If we fail to create a symlink, add install directory to PATH variable bool InstallDirectoryAddedToPath = false; @@ -112,4 +113,4 @@ namespace AppInstaller::CLI::Portable void AddToPathVariable(const std::filesystem::path& value); void RemoveFromPathVariable(const std::filesystem::path& value); }; -} \ No newline at end of file +} diff --git a/src/AppInstallerCLICore/Resources.h b/src/AppInstallerCLICore/Resources.h index ea46f3c28d..284c012577 100644 --- a/src/AppInstallerCLICore/Resources.h +++ b/src/AppInstallerCLICore/Resources.h @@ -99,8 +99,14 @@ namespace AppInstaller::CLI::Resource WINGET_DEFINE_RESOURCE_STRINGID(ConfigurationNoTestRun); WINGET_DEFINE_RESOURCE_STRINGID(ConfigurationNotInDesiredState); WINGET_DEFINE_RESOURCE_STRINGID(ConfigurationReadingConfigFile); + WINGET_DEFINE_RESOURCE_STRINGID(ConfigurationSetStateCompleted); + WINGET_DEFINE_RESOURCE_STRINGID(ConfigurationSetStateInProgress); + WINGET_DEFINE_RESOURCE_STRINGID(ConfigurationSetStatePending); + WINGET_DEFINE_RESOURCE_STRINGID(ConfigurationSetStateUnknown); WINGET_DEFINE_RESOURCE_STRINGID(ConfigurationSettings); + WINGET_DEFINE_RESOURCE_STRINGID(ConfigurationStatusWatchArgumentDescription); WINGET_DEFINE_RESOURCE_STRINGID(ConfigurationSuccessfullyApplied); + WINGET_DEFINE_RESOURCE_STRINGID(ConfigurationSuppressPrologueArgumentDescription); WINGET_DEFINE_RESOURCE_STRINGID(ConfigurationUnexpectedTestResult); WINGET_DEFINE_RESOURCE_STRINGID(ConfigurationUnitAssertHadNegativeResult); WINGET_DEFINE_RESOURCE_STRINGID(ConfigurationUnitFailed); @@ -131,6 +137,11 @@ namespace AppInstaller::CLI::Resource WINGET_DEFINE_RESOURCE_STRINGID(ConfigurationUnitReturnedInvalidResult); WINGET_DEFINE_RESOURCE_STRINGID(ConfigurationUnitSettingConfigRoot); WINGET_DEFINE_RESOURCE_STRINGID(ConfigurationUnitSkipped); + WINGET_DEFINE_RESOURCE_STRINGID(ConfigurationUnitStateCompleted); + WINGET_DEFINE_RESOURCE_STRINGID(ConfigurationUnitStateInProgress); + WINGET_DEFINE_RESOURCE_STRINGID(ConfigurationUnitStatePending); + WINGET_DEFINE_RESOURCE_STRINGID(ConfigurationUnitStateSkipped); + WINGET_DEFINE_RESOURCE_STRINGID(ConfigurationUnitStateUnknown); WINGET_DEFINE_RESOURCE_STRINGID(ConfigurationValidationFoundNoIssues); WINGET_DEFINE_RESOURCE_STRINGID(ConfigurationWaitingOnAnother); WINGET_DEFINE_RESOURCE_STRINGID(ConfigurationWarning); @@ -148,6 +159,8 @@ namespace AppInstaller::CLI::Resource WINGET_DEFINE_RESOURCE_STRINGID(ConfigureExportResource); WINGET_DEFINE_RESOURCE_STRINGID(ConfigureExportUnitDescription); WINGET_DEFINE_RESOURCE_STRINGID(ConfigureExportUnitInstallDescription); + WINGET_DEFINE_RESOURCE_STRINGID(ConfigureListApplyBegun); + WINGET_DEFINE_RESOURCE_STRINGID(ConfigureListApplyEnded); WINGET_DEFINE_RESOURCE_STRINGID(ConfigureListCommandLongDescription); WINGET_DEFINE_RESOURCE_STRINGID(ConfigureListCommandShortDescription); WINGET_DEFINE_RESOURCE_STRINGID(ConfigureListFirstApplied); @@ -155,6 +168,10 @@ namespace AppInstaller::CLI::Resource WINGET_DEFINE_RESOURCE_STRINGID(ConfigureListName); WINGET_DEFINE_RESOURCE_STRINGID(ConfigureListOrigin); WINGET_DEFINE_RESOURCE_STRINGID(ConfigureListPath); + WINGET_DEFINE_RESOURCE_STRINGID(ConfigureListResult); + WINGET_DEFINE_RESOURCE_STRINGID(ConfigureListResultDescription); + WINGET_DEFINE_RESOURCE_STRINGID(ConfigureListState); + WINGET_DEFINE_RESOURCE_STRINGID(ConfigureListUnit); WINGET_DEFINE_RESOURCE_STRINGID(ConfigureShowCommandLongDescription); WINGET_DEFINE_RESOURCE_STRINGID(ConfigureShowCommandShortDescription); WINGET_DEFINE_RESOURCE_STRINGID(ConfigureTestCommandLongDescription); diff --git a/src/AppInstallerCLICore/Search/Search.h b/src/AppInstallerCLICore/Search/Search.h index 6ba4aec314..a16e36cc57 100644 --- a/src/AppInstallerCLICore/Search/Search.h +++ b/src/AppInstallerCLICore/Search/Search.h @@ -5,7 +5,7 @@ #include #include -// TODO: This code is expected to eventually be placed into it's own DLL to support the CLI +// TODO: This code is expected to eventually be placed into its own DLL to support the CLI // and OOP COM server for use by OS integration points. // For now we will just maintain the ABI with helper C++ wrappers for client use. diff --git a/src/AppInstallerCLICore/Workflows/ConfigurationFlow.cpp b/src/AppInstallerCLICore/Workflows/ConfigurationFlow.cpp index 923168ef85..5046aceb73 100644 --- a/src/AppInstallerCLICore/Workflows/ConfigurationFlow.cpp +++ b/src/AppInstallerCLICore/Workflows/ConfigurationFlow.cpp @@ -1209,7 +1209,7 @@ namespace AppInstaller::CLI::Workflow return getResult; } - std::optional CreateConfigurationUnit(Execution::Context& context, const std::optional dependantUnit) + std::optional CreateConfigurationUnit(Execution::Context& context, const std::optional dependentUnit) { if (context.Args.Contains(Execution::Args::Type::ConfigurationExportModule, Execution::Args::Type::ConfigurationExportResource)) { @@ -1226,9 +1226,9 @@ namespace AppInstaller::CLI::Workflow directives.Insert(s_Directive_Module, PropertyValue::CreateString(moduleNameWide)); Utility::LocIndString description; - if (dependantUnit.has_value()) + if (dependentUnit.has_value()) { - description = Resource::String::ConfigureExportUnitDescription(Utility::LocIndView{ Utility::ConvertToUTF8(dependantUnit.value().Identifier()) }); + description = Resource::String::ConfigureExportUnitDescription(Utility::LocIndView{ Utility::ConvertToUTF8(dependentUnit.value().Identifier()) }); } else { @@ -1276,10 +1276,10 @@ namespace AppInstaller::CLI::Workflow unit.Intent(ConfigurationUnitIntent::Apply); // Add dependency if needed. - if (dependantUnit.has_value()) + if (dependentUnit.has_value()) { auto dependencies = winrt::single_threaded_vector(); - dependencies.Append(dependantUnit.value().Identifier()); + dependencies.Append(dependentUnit.value().Identifier()); unit.Dependencies(std::move(dependencies)); } @@ -1317,6 +1317,76 @@ namespace AppInstaller::CLI::Workflow return Utility::CaseInsensitiveStartsWith(identifierView, foldedInput); } + + Resource::LocString ToLocString(ConfigurationSetState state) + { + switch (state) + { + case ConfigurationSetState::Pending: + return Resource::String::ConfigurationSetStatePending; + case ConfigurationSetState::InProgress: + return Resource::String::ConfigurationSetStateInProgress; + case ConfigurationSetState::Completed: + return Resource::String::ConfigurationSetStateCompleted; + case ConfigurationSetState::Unknown: + default: + return Resource::String::ConfigurationSetStateUnknown; + } + } + + Resource::LocString ToLocString(ConfigurationUnitState state) + { + switch (state) + { + case ConfigurationUnitState::Pending: + return Resource::String::ConfigurationUnitStatePending; + case ConfigurationUnitState::InProgress: + return Resource::String::ConfigurationUnitStateInProgress; + case ConfigurationUnitState::Completed: + return Resource::String::ConfigurationUnitStateCompleted; + case ConfigurationUnitState::Skipped: + return Resource::String::ConfigurationUnitStateSkipped; + case ConfigurationUnitState::Unknown: + default: + return Resource::String::ConfigurationUnitStateUnknown; + } + } + + std::string_view ToString(ConfigurationChangeEventType type) + { + switch (type) + { + case ConfigurationChangeEventType::SetAdded: + return "SetAdded"; + case ConfigurationChangeEventType::SetStateChanged: + return "SetStateChanged"; + case ConfigurationChangeEventType::SetRemoved: + return "SetRemoved"; + case ConfigurationChangeEventType::Unknown: + default: + return "Unknown"; + } + } + + std::string_view ToString(ConfigurationUnitResultSource source) + { + switch (source) + { + case ConfigurationUnitResultSource::Internal: + return "Internal"; + case ConfigurationUnitResultSource::ConfigurationSet: + return "ConfigurationSet"; + case ConfigurationUnitResultSource::UnitProcessing: + return "UnitProcessing"; + case ConfigurationUnitResultSource::SystemState: + return "SystemState"; + case ConfigurationUnitResultSource::Precondition: + return "Precondition"; + case ConfigurationUnitResultSource::None: + default: + return "None"; + } + } } void CreateConfigurationProcessor(Context& context) @@ -1389,27 +1459,31 @@ namespace AppInstaller::CLI::Workflow auto getDetailsOperation = configContext.Processor().GetSetDetailsAsync(configContext.Set(), ConfigurationUnitDetailFlags::ReadOnly); auto unification = anon::CreateProgressCancellationUnification(std::move(progressScope), getDetailsOperation); + bool suppressDetailsOutput = context.Args.Contains(Args::Type::ConfigurationAcceptWarning) && context.Args.Contains(Args::Type::ConfigurationSuppressPrologue); anon::OutputHelper outputHelper{ context }; uint32_t unitsShown = 0; - getDetailsOperation.Progress([&](const IAsyncOperationWithProgress& operation, const GetConfigurationUnitDetailsResult&) - { - auto threadContext = context.SetForCurrentThread(); + if (!suppressDetailsOutput) + { + getDetailsOperation.Progress([&](const IAsyncOperationWithProgress& operation, const GetConfigurationUnitDetailsResult&) + { + auto threadContext = context.SetForCurrentThread(); - unification.Reset(); + unification.Reset(); - auto unitResults = operation.GetResults().UnitResults(); - for (unitsShown; unitsShown < unitResults.Size(); ++unitsShown) - { - GetConfigurationUnitDetailsResult unitResult = unitResults.GetAt(unitsShown); - anon::LogFailedGetConfigurationUnitDetails(unitResult.Unit(), unitResult.ResultInformation()); - outputHelper.OutputConfigurationUnitInformation(unitResult.Unit()); - } + auto unitResults = operation.GetResults().UnitResults(); + for (unitsShown; unitsShown < unitResults.Size(); ++unitsShown) + { + GetConfigurationUnitDetailsResult unitResult = unitResults.GetAt(unitsShown); + anon::LogFailedGetConfigurationUnitDetails(unitResult.Unit(), unitResult.ResultInformation()); + outputHelper.OutputConfigurationUnitInformation(unitResult.Unit()); + } - progressScope = context.Reporter.BeginAsyncProgress(true); - progressScope->Callback().SetProgressMessage(gettingDetailString); - unification.Progress(std::move(progressScope)); - }); + progressScope = context.Reporter.BeginAsyncProgress(true); + progressScope->Callback().SetProgressMessage(gettingDetailString); + unification.Progress(std::move(progressScope)); + }); + } HRESULT hr = S_OK; GetConfigurationSetDetailsResult result = nullptr; @@ -1439,7 +1513,7 @@ namespace AppInstaller::CLI::Workflow } // Handle any missing progress callbacks that are in the results - if (result) + if (result && !suppressDetailsOutput) { auto unitResults = result.UnitResults(); if (unitResults) @@ -1454,11 +1528,14 @@ namespace AppInstaller::CLI::Workflow } // Handle any units that are NOT in the results (due to an exception part of the way through) - auto allUnits = configContext.Set().Units(); - for (unitsShown; unitsShown < allUnits.Size(); ++unitsShown) + if (!suppressDetailsOutput) { - ConfigurationUnit unit = allUnits.GetAt(unitsShown); - outputHelper.OutputConfigurationUnitInformation(unit); + auto allUnits = configContext.Set().Units(); + for (unitsShown; unitsShown < allUnits.Size(); ++unitsShown) + { + ConfigurationUnit unit = allUnits.GetAt(unitsShown); + outputHelper.OutputConfigurationUnitInformation(unit); + } } if (outputHelper.ValuesTruncated) @@ -1913,20 +1990,17 @@ namespace AppInstaller::CLI::Workflow } else { - TableOutput<4> historyTable{ context.Reporter, { Resource::String::ConfigureListIdentifier, Resource::String::ConfigureListName, Resource::String::ConfigureListFirstApplied, Resource::String::ConfigureListOrigin } }; + TableOutput<4> historyTable{ context.Reporter, { Resource::String::ConfigureListIdentifier, Resource::String::ConfigureListName, Resource::String::ConfigureListState, Resource::String::ConfigureListOrigin } }; for (const auto& set : history) { - std::ostringstream stream; - Utility::OutputTimePoint(stream, winrt::clock::to_sys(set.FirstApply())); - winrt::hstring origin = set.Path(); if (origin.empty()) { origin = set.Origin(); } - historyTable.OutputLine({ Utility::ConvertGuidToString(set.InstanceIdentifier()), Utility::ConvertToUTF8(set.Name()), std::move(stream).str(), Utility::ConvertToUTF8(origin)}); + historyTable.OutputLine({ Utility::ConvertGuidToString(set.InstanceIdentifier()), Utility::ConvertToUTF8(set.Name()), anon::ToLocString(set.State()), Utility::ConvertToUTF8(origin)}); } historyTable.Complete(); @@ -1987,18 +2061,132 @@ namespace AppInstaller::CLI::Workflow { const auto& set = context.Get().Set(); - std::ostringstream stream; - Utility::OutputTimePoint(stream, winrt::clock::to_sys(set.FirstApply())); - + // Output a table with name/value pairs for some of the set's properties. Example: + // + // Field Value + // ---------------------------------------------------- + // Identifier {7D5CF50E-F3C6-4333-BFE6-5A806F9EBA4E} + // Name Test Name + // Origin Test Origin + // Path Test Path + // State Completed + // First Applied 2024-07-16 21:15:13.000 + // Apply Begun 2024-07-16 21:15:13.000 + // Apply Ended 2024-07-16 21:15:13.000 Execution::TableOutput<2> table(context.Reporter, { Resource::String::SourceListField, Resource::String::SourceListValue }); table.OutputLine({ Resource::LocString{ Resource::String::ConfigureListIdentifier }, Utility::ConvertGuidToString(set.InstanceIdentifier()) }); table.OutputLine({ Resource::LocString{ Resource::String::ConfigureListName }, Utility::ConvertToUTF8(set.Name()) }); - table.OutputLine({ Resource::LocString{ Resource::String::ConfigureListFirstApplied }, std::move(stream).str() }); table.OutputLine({ Resource::LocString{ Resource::String::ConfigureListOrigin }, Utility::ConvertToUTF8(set.Origin()) }); table.OutputLine({ Resource::LocString{ Resource::String::ConfigureListPath }, Utility::ConvertToUTF8(set.Path()) }); + table.OutputLine({ Resource::LocString{ Resource::String::ConfigureListState }, anon::ToLocString(set.State()) }); + table.OutputLine({ Resource::LocString{ Resource::String::ConfigureListFirstApplied }, Utility::TimePointToString(winrt::clock::to_sys(set.FirstApply())) }); + + auto applyBegun = set.ApplyBegun(); + if (applyBegun != winrt::clock::time_point{}) + { + table.OutputLine({ Resource::LocString{ Resource::String::ConfigureListApplyBegun }, Utility::TimePointToString(winrt::clock::to_sys(applyBegun)) }); + } + + auto applyEnded = set.ApplyEnded(); + if (applyEnded != winrt::clock::time_point{}) + { + table.OutputLine({ Resource::LocString{ Resource::String::ConfigureListApplyEnded }, Utility::TimePointToString(winrt::clock::to_sys(applyEnded)) }); + } table.Complete(); + + context.Reporter.Info() << std::endl; + + // Output a table with unit state information. Groups are represented by indentation beneath their parent unit. Example: + // + // Unit State Result Details + // ------------------------------------------------------------ + // Module/Resource [Name] Completed 0x00000000 + // Module2/Resource [Group] Completed 0x00000000 + // |-Module3/Resource [Child1] Completed 0x00000000 + // |---Module4/Resource2 Completed 0x80004005 I failed :( + // |-Module3/Resource [Child2] Completed 0x00000000 + Execution::TableOutput<4> unitTable(context.Reporter, { Resource::String::ConfigureListUnit, Resource::String::ConfigureListState, Resource::String::ConfigureListResult, Resource::String::ConfigureListResultDescription }); + + struct UnitSiblings + { + size_t Depth = 0; + size_t Current = 0; + std::vector Siblings; + }; + + std::vector stack; + + { + UnitSiblings initial; + auto units = set.Units(); + initial.Siblings.resize(units.Size()); + units.GetMany(0, initial.Siblings); + stack.emplace_back(std::move(initial)); + } + + // Each item on the stack is a list of sibling units. + // Each iteration, we process the Current sibling from the group on top of the stack. + // If it is a group, we add its children as a new stack item to be processed next. + while (!stack.empty()) + { + UnitSiblings& currentSiblings = stack.back(); + + if (currentSiblings.Current >= currentSiblings.Siblings.size()) + { + stack.pop_back(); + continue; + } + + ConfigurationUnit& currentUnit = currentSiblings.Siblings[currentSiblings.Current++]; + + std::ostringstream unitStream; + + if (currentSiblings.Depth) + { + unitStream << '|' << std::string((currentSiblings.Depth * 2) - 1, '-'); + } + + unitStream << Utility::ConvertToUTF8(currentUnit.Type()); + + auto identifier = currentUnit.Identifier(); + if (!identifier.empty()) + { + unitStream << " [" << Utility::ConvertControlCodesToPictures(Utility::ConvertToUTF8(identifier)) << ']'; + } + + auto resultInformation = currentUnit.ResultInformation(); + std::ostringstream resultStream; + std::string resultDetails; + + if (resultInformation) + { + resultStream << "0x" << Logging::SetHRFormat << resultInformation.ResultCode(); + + auto description = resultInformation.Description(); + if (description.empty()) + { + description = resultInformation.Details(); + } + + resultDetails = Utility::ConvertControlCodesToPictures(Utility::ConvertToUTF8(description)); + } + + unitTable.OutputLine({ std::move(unitStream).str(), anon::ToLocString(currentUnit.State()), std::move(resultStream).str(), std::move(resultDetails) }); + + if (currentUnit.IsGroup()) + { + UnitSiblings unitChildren; + unitChildren.Depth = currentSiblings.Depth + 1; + auto units = currentUnit.Units(); + unitChildren.Siblings.resize(units.Size()); + units.GetMany(0, unitChildren.Siblings); + stack.emplace_back(std::move(unitChildren)); + } + } + + unitTable.Complete(); } void CompleteConfigurationHistoryItem(Execution::Context& context) @@ -2025,4 +2213,69 @@ namespace AppInstaller::CLI::Workflow } } } + + void MonitorConfigurationStatus(Execution::Context& context) + { + auto& configurationContext = context.Get(); + + std::mutex activeSetMutex; + ConfigurationSet activeSet{ nullptr }; + decltype(activeSet.ConfigurationSetChange(winrt::auto_revoke, nullptr)) activeSetRevoker; + + auto setChangeHandler = [&](const ConfigurationSet& set, const ConfigurationSetChangeData& changeData) + { + if (changeData.Change() == ConfigurationSetChangeEventType::SetStateChanged) + { + context.Reporter.Info() << "(SetStateChanged) " << set.InstanceIdentifier() << " :: " << anon::ToLocString(changeData.SetState()) << std::endl; + } + else if (changeData.Change() == ConfigurationSetChangeEventType::UnitStateChanged) + { + context.Reporter.Info() << "(UnitStateChanged) " << changeData.Unit().InstanceIdentifier() << " :: " << anon::ToLocString(changeData.UnitState()) << std::endl; + + auto resultInformation = changeData.ResultInformation(); + if (resultInformation) + { + context.Reporter.Info() << " [" << anon::ToString(resultInformation.ResultSource()) << "] :: 0x" << Logging::SetHRFormat << resultInformation.ResultCode() << std::endl; + } + } + }; + + auto setActiveSet = [&](const ConfigurationSet& set, bool force) + { + std::lock_guard lock{ activeSetMutex }; + + if (force || !activeSet) + { + activeSet = set; + activeSetRevoker = activeSet.ConfigurationSetChange(winrt::auto_revoke, setChangeHandler); + } + }; + + auto processorRevoker = configurationContext.Processor().ConfigurationChange(winrt::auto_revoke, [&](const ConfigurationSet& set, const ConfigurationChangeData& changeData) + { + context.Reporter.Info() << '[' << anon::ToString(changeData.Change()) << "] " << changeData.InstanceIdentifier() << " :: " << anon::ToLocString(changeData.State()) << std::endl; + + if (changeData.Change() == ConfigurationChangeEventType::SetStateChanged && changeData.State() == ConfigurationSetState::InProgress) + { + setActiveSet(set, true); + } + }); + + for (ConfigurationSet& historySet : configurationContext.History()) + { + if (historySet.State() == ConfigurationSetState::InProgress) + { + setActiveSet(historySet, false); + } + } + + for (;;) + { + std::this_thread::sleep_for(250ms); + if (context.IsTerminated()) + { + return; + } + } + } } diff --git a/src/AppInstallerCLICore/Workflows/ConfigurationFlow.h b/src/AppInstallerCLICore/Workflows/ConfigurationFlow.h index 1064276c10..36e349b5ec 100644 --- a/src/AppInstallerCLICore/Workflows/ConfigurationFlow.h +++ b/src/AppInstallerCLICore/Workflows/ConfigurationFlow.h @@ -150,4 +150,10 @@ namespace AppInstaller::CLI::Workflow // Inputs: None // Outputs: None void CompleteConfigurationHistoryItem(Execution::Context& context); + + // Monitors configuration status. + // Required Args: None + // Inputs: None + // Outputs: None + void MonitorConfigurationStatus(Execution::Context& context); } diff --git a/src/AppInstallerCLICore/Workflows/ManifestComparator.cpp b/src/AppInstallerCLICore/Workflows/ManifestComparator.cpp index 39b31e0ae5..894badc906 100644 --- a/src/AppInstallerCLICore/Workflows/ManifestComparator.cpp +++ b/src/AppInstallerCLICore/Workflows/ManifestComparator.cpp @@ -364,12 +364,12 @@ namespace AppInstaller::CLI::Workflow } }; - struct InstalledTypeComparator : public details::ComparisonField + struct InstalledTypeFilter : public details::FilterField { - InstalledTypeComparator(Manifest::InstallerTypeEnum installedType) : - details::ComparisonField("Installed Type"), m_installedType(installedType) {} + InstalledTypeFilter(Manifest::InstallerTypeEnum installedType) : + details::FilterField("Installed Type"), m_installedType(installedType) {} - static std::unique_ptr Create(const Repository::IPackageVersion::Metadata& installationMetadata) + static std::unique_ptr Create(const Repository::IPackageVersion::Metadata& installationMetadata) { auto installerTypeItr = installationMetadata.find(Repository::PackageVersionMetadata::InstalledType); if (installerTypeItr != installationMetadata.end()) @@ -377,7 +377,7 @@ namespace AppInstaller::CLI::Workflow Manifest::InstallerTypeEnum installedType = Manifest::ConvertToInstallerTypeEnum(installerTypeItr->second); if (installedType != Manifest::InstallerTypeEnum::Unknown) { - return std::make_unique(installedType); + return std::make_unique(installedType); } } @@ -386,22 +386,7 @@ namespace AppInstaller::CLI::Workflow InapplicabilityFlags IsApplicable(const Manifest::ManifestInstaller& installer) override { - // The installer is applicable if it's type or any of its ARP entries' type matches the installed type - if (Manifest::IsInstallerTypeCompatible(installer.EffectiveInstallerType(), m_installedType)) - { - return InapplicabilityFlags::None; - } - - auto itr = std::find_if( - installer.AppsAndFeaturesEntries.begin(), - installer.AppsAndFeaturesEntries.end(), - [=](AppsAndFeaturesEntry arpEntry) { return Manifest::IsInstallerTypeCompatible(arpEntry.InstallerType, m_installedType); }); - if (itr != installer.AppsAndFeaturesEntries.end()) - { - return InapplicabilityFlags::None; - } - - return InapplicabilityFlags::InstalledType; + return IsInstallerCompatibleWith(installer, m_installedType) ? InapplicabilityFlags::None : InapplicabilityFlags::InstalledType; } std::string ExplainInapplicable(const Manifest::ManifestInstaller& installer) override @@ -423,20 +408,27 @@ namespace AppInstaller::CLI::Workflow return result; } - details::ComparisonResult IsFirstBetter(const Manifest::ManifestInstaller& first, const Manifest::ManifestInstaller& second) override + private: + // The installer is compatible if it's type or any of its ARP entries' type matches the installed type + static bool IsInstallerCompatibleWith(const Manifest::ManifestInstaller& installer, Manifest::InstallerTypeEnum type) { - if (first.EffectiveInstallerType() == m_installedType && second.EffectiveInstallerType() != m_installedType) + if (Manifest::IsInstallerTypeCompatible(installer.EffectiveInstallerType(), type)) { - // Installed type matching is intended to be sticky, so make this a strong match. - return details::ComparisonResult::StrongPositive; + return true; } - else + + auto itr = std::find_if( + installer.AppsAndFeaturesEntries.begin(), + installer.AppsAndFeaturesEntries.end(), + [=](AppsAndFeaturesEntry arpEntry) { return Manifest::IsInstallerTypeCompatible(arpEntry.InstallerType, type); }); + if (itr != installer.AppsAndFeaturesEntries.end()) { - return details::ComparisonResult::Negative; + return true; } + + return false; } - private: Manifest::InstallerTypeEnum m_installedType; }; @@ -782,17 +774,47 @@ namespace AppInstaller::CLI::Workflow ManifestComparator::ManifestComparator(const Execution::Context& context, const Repository::IPackageVersion::Metadata& installationMetadata) { + // Filters based on installer's MinOSVersion AddFilter(std::make_unique()); + // Filters out portable installers if they are not supported by the system AddFilter(std::make_unique()); + // Filters based on the scope of a currently installed package AddFilter(InstalledScopeFilter::Create(installationMetadata)); + // Filters based on the market region of the system AddFilter(MarketFilter::Create()); + // Filters based on the installer type compatability, including with AppsAndFeaturesEntry declarations + AddFilter(InstalledTypeFilter::Create(installationMetadata)); // Filter order is not important, but comparison order determines priority. + // Note that all comparators are also filters and their comparison function will only be called on + // installers that both match the required criteria. + // + // The comparators are ordered by the `IsFirstBetter` method, which uses the following algorithm: + // - Each comparison between two installers can return one of { Strong, Weak, Negative } + // - Installers are compared in both directions, going through the list of comparators as defined here + // - The first Strong result in either direction is given priority + // - If no Strong results, the first Weak result is used + // - If all Negative results, then the two installers are equal in priority (meaning the first one in the list is kept as "better") + // // TODO: There are improvements to be made here around ordering, especially in the context of implicit vs explicit vs command line preferences. - AddComparator(InstalledTypeComparator::Create(installationMetadata)); + + // Filters based on exact matches for requirements or compatible matches for preferences + // Only applies when preference exists: + // Strong if first is compatible and better match than second + // Weak if first is unknown and second is not AddComparator(LocaleComparator::Create(context.Args, installationMetadata)); + // Filters only if a requirement is present and it cannot be satisfied by the installer (including installer types that we can control scope in code) + // Only applies when preference exists: + // Strong if first matches preference and second does not and is not Unknown + // Weak if first matches preference and second is Unknown AddComparator(ScopeComparator::Create(context)); + // Filters architectures out that are not supported or are not in the preferences/requirements/inputs. + // Strong if first equals the earliest architecture in the allowed list and second does not [default means the system architecture] + // Weak if first is better match for system architecture than second AddComparator(MachineArchitectureComparator::Create(context, installationMetadata)); + // Filters installer types out that are not in preferences or requirements. + // Only applies when preference exists: + // Weak if first is in preference list and second is not AddComparator(InstallerTypeComparator::Create(context.Args)); } diff --git a/src/AppInstallerCLICore/Workflows/PortableFlow.cpp b/src/AppInstallerCLICore/Workflows/PortableFlow.cpp index a0cbe166b5..d2df70bd90 100644 --- a/src/AppInstallerCLICore/Workflows/PortableFlow.cpp +++ b/src/AppInstallerCLICore/Workflows/PortableFlow.cpp @@ -135,12 +135,18 @@ namespace AppInstaller::CLI::Workflow } } - Utility::Architecture arch = context.Get()->Arch; + const auto& installer = context.Get().value(); + Utility::Architecture arch = installer.Arch; const std::string& productCode = GetPortableProductCode(context); PortableInstaller portableInstaller = PortableInstaller(scope, arch, productCode); portableInstaller.IsUpdate = isUpdate; + if (IsArchiveType(installer.BaseInstallerType) && installer.ArchiveBinariesDependOnPath) + { + portableInstaller.BinariesDependOnPath = true; + } + // Set target install directory std::string_view locationArg = context.Args.GetArg(Execution::Args::Type::InstallLocation); std::filesystem::path targetInstallDirectory; @@ -239,7 +245,6 @@ namespace AppInstaller::CLI::Workflow void PortableInstallImpl(Execution::Context& context) { PortableInstaller& portableInstaller = context.Get(); - try { context.Reporter.Info() << Resource::String::InstallFlowStartingPackageInstall << std::endl; @@ -324,4 +329,4 @@ namespace AppInstaller::CLI::Workflow EnsureVolumeSupportsReparsePoints; } } -} \ No newline at end of file +} diff --git a/src/AppInstallerCLICore/Workflows/ShellExecuteInstallerHandler.cpp b/src/AppInstallerCLICore/Workflows/ShellExecuteInstallerHandler.cpp index 781984a47c..0601e5a4ab 100644 --- a/src/AppInstallerCLICore/Workflows/ShellExecuteInstallerHandler.cpp +++ b/src/AppInstallerCLICore/Workflows/ShellExecuteInstallerHandler.cpp @@ -115,7 +115,7 @@ namespace AppInstaller::CLI::Workflow installerArgs += ' ' + installerSwitches.at(InstallerSwitchType::Log); } - // Construct repair arg. Custom switches and othe args are not applicable for repair scenario so we can return here. + // Construct repair arg. Custom switches and other args are not applicable for repair scenario so we can return here. if (isRepair) { if (installerSwitches.find(InstallerSwitchType::Repair) != installerSwitches.end()) diff --git a/src/AppInstallerCLICore/Workflows/UninstallFlow.cpp b/src/AppInstallerCLICore/Workflows/UninstallFlow.cpp index 169b3b77be..ce12427900 100644 --- a/src/AppInstallerCLICore/Workflows/UninstallFlow.cpp +++ b/src/AppInstallerCLICore/Workflows/UninstallFlow.cpp @@ -206,6 +206,13 @@ namespace AppInstaller::CLI::Workflow void GetUninstallInfo(Execution::Context& context) { auto installedPackageVersion = context.Get(); + + if (!installedPackageVersion) + { + AICLI_LOG(CLI, Verbose, << "No installed package version; cannot get uninstall information."); + return; + } + const std::string installedTypeString = installedPackageVersion->GetMetadata()[PackageVersionMetadata::InstalledType]; switch (ConvertToInstallerTypeEnum(installedTypeString)) { @@ -290,7 +297,15 @@ namespace AppInstaller::CLI::Workflow void ExecuteUninstaller(Execution::Context& context) { - const std::string installedTypeString = context.Get()->GetMetadata()[PackageVersionMetadata::InstalledType]; + auto installedPackageVersion = context.Get(); + + if (!installedPackageVersion) + { + AICLI_LOG(CLI, Verbose, << "No installed package version; cannot uninstall."); + return; + } + + const std::string installedTypeString = installedPackageVersion->GetMetadata()[PackageVersionMetadata::InstalledType]; InstallerTypeEnum installerType = ConvertToInstallerTypeEnum(installedTypeString); Synchronization::CrossProcessInstallLock lock; diff --git a/src/AppInstallerCLIE2ETests/AppInstallerCLIE2ETests.csproj b/src/AppInstallerCLIE2ETests/AppInstallerCLIE2ETests.csproj index 7a724c4a23..ddaa14aa3b 100644 --- a/src/AppInstallerCLIE2ETests/AppInstallerCLIE2ETests.csproj +++ b/src/AppInstallerCLIE2ETests/AppInstallerCLIE2ETests.csproj @@ -1,4 +1,4 @@ - + net6.0-windows @@ -21,8 +21,8 @@ - - + + @@ -33,9 +33,12 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + + + + @@ -52,6 +55,9 @@ + + + PreserveNewest diff --git a/src/AppInstallerCLIE2ETests/ConfigureCommand.cs b/src/AppInstallerCLIE2ETests/ConfigureCommand.cs index b530739fc1..9818498b4e 100644 --- a/src/AppInstallerCLIE2ETests/ConfigureCommand.cs +++ b/src/AppInstallerCLIE2ETests/ConfigureCommand.cs @@ -40,6 +40,7 @@ public void OneTimeTeardown() /// Intentionally has no settings to force a failure, but only after acquiring the module. /// [Test] + [Ignore("PS Gallery tests are unreliable.")] public void ConfigureFromGallery() { TestCommon.EnsureModuleState(Constants.GalleryTestModuleName, present: false); @@ -154,7 +155,7 @@ public void ConfigServerUnexpectedExit() } /// - /// Resource name case insensitive test. + /// Resource name case-insensitive test. /// [Test] public void ResourceCaseInsensitive() diff --git a/src/AppInstallerCLIE2ETests/ConfigureShowCommand.cs b/src/AppInstallerCLIE2ETests/ConfigureShowCommand.cs index bbe4b33242..6896300b6a 100644 --- a/src/AppInstallerCLIE2ETests/ConfigureShowCommand.cs +++ b/src/AppInstallerCLIE2ETests/ConfigureShowCommand.cs @@ -29,6 +29,7 @@ public void OneTimeTearDown() /// Simple test to confirm that a resource without a module specified can be discovered in the PSGallery. /// [Test] + [Ignore("PS Gallery tests are unreliable.")] public void ShowDetailsFromGallery() { TestCommon.EnsureModuleState(Constants.GalleryTestModuleName, present: false); @@ -93,7 +94,7 @@ public void ShowDetails_Schema0_3_Succeeds() TestCommon.EnsureModuleState(Constants.SimpleTestModuleName, present: false); WinGetSettingsHelper.ConfigureFeature("configuration03", true); - var result = TestCommon.RunAICLICommand("configure show", TestCommon.GetTestDataFile("Configuration\\ShowDetails_TestRepo_0_3.yml")); + var result = TestCommon.RunAICLICommand("configure show", $"{TestCommon.GetTestDataFile("Configuration\\ShowDetails_TestRepo_0_3.yml")} --verbose"); Assert.AreEqual(0, result.ExitCode); Assert.True(result.StdOut.Contains(Constants.TestRepoName)); } diff --git a/src/AppInstallerCLIE2ETests/ConfigureTestCommand.cs b/src/AppInstallerCLIE2ETests/ConfigureTestCommand.cs index b5e39404c4..2e9f2c2c48 100644 --- a/src/AppInstallerCLIE2ETests/ConfigureTestCommand.cs +++ b/src/AppInstallerCLIE2ETests/ConfigureTestCommand.cs @@ -8,7 +8,6 @@ namespace AppInstallerCLIE2ETests { using System.IO; using AppInstallerCLIE2ETests.Helpers; - using Microsoft.Management.Infrastructure; using NUnit.Framework; /// diff --git a/src/AppInstallerCLIE2ETests/Constants.cs b/src/AppInstallerCLIE2ETests/Constants.cs index 378ce3b3af..da1510292c 100644 --- a/src/AppInstallerCLIE2ETests/Constants.cs +++ b/src/AppInstallerCLIE2ETests/Constants.cs @@ -45,9 +45,6 @@ public class Constants public const string TestSourceType = "Microsoft.PreIndexed.Package"; public const string TestSourceIdentifier = @"WingetE2E.Tests_8wekyb3d8bbwe"; - public const string AppInstallerTestCert = "AppInstallerTest.cer"; - public const string AppInstallerTestCertThumbprint = "d03e7a688b388b1edde8476a627531c49db88017"; - public const string AICLIPackageFamilyName = "WinGetDevCLI_8wekyb3d8bbwe"; public const string AICLIPackageName = "WinGetDevCLI"; public const string AICLIPackagePublisherHash = "8wekyb3d8bbwe"; diff --git a/src/AppInstallerCLIE2ETests/HashCommand.cs b/src/AppInstallerCLIE2ETests/HashCommand.cs index 86b8ae5885..22e8f2f123 100644 --- a/src/AppInstallerCLIE2ETests/HashCommand.cs +++ b/src/AppInstallerCLIE2ETests/HashCommand.cs @@ -21,9 +21,9 @@ public class HashCommand : BaseCommand [Test] public void HashFile() { - var result = TestCommon.RunAICLICommand("hash", TestCommon.GetTestDataFile("AppInstallerTest.cer")); + var result = TestCommon.RunAICLICommand("hash", TestCommon.GetTestDataFile("AppInstallerTestMsiInstaller.msi")); Assert.AreEqual(Constants.ErrorCode.S_OK, result.ExitCode); - Assert.True(result.StdOut.Contains("9b4c49ad7e47afd97d2e666e93347745e1647c55f1a7ebba6d31b7dd5f69ee68")); + Assert.True(result.StdOut.Contains("21d90ee9b3569590c624836ef50bf39791c7184869c227eedc00585e1f39b4de")); } /// @@ -44,9 +44,9 @@ public void HashMSIX() [Test] public void HashInvalidMSIX() { - var result = TestCommon.RunAICLICommand("hash", TestCommon.GetTestDataFile("AppInstallerTest.cer") + " -m"); + var result = TestCommon.RunAICLICommand("hash", TestCommon.GetTestDataFile("AppInstallerTestMsiInstaller.msi") + " -m"); Assert.AreEqual(Constants.ErrorCode.OPC_E_ZIP_MISSING_END_OF_CENTRAL_DIRECTORY, result.ExitCode); - Assert.True(result.StdOut.Contains("9b4c49ad7e47afd97d2e666e93347745e1647c55f1a7ebba6d31b7dd5f69ee68")); + Assert.True(result.StdOut.Contains("21d90ee9b3569590c624836ef50bf39791c7184869c227eedc00585e1f39b4de")); Assert.True(result.StdOut.Contains("Please verify that the input file is a valid, signed MSIX.")); } diff --git a/src/AppInstallerCLIE2ETests/Helpers/TestCommon.cs b/src/AppInstallerCLIE2ETests/Helpers/TestCommon.cs index 567e2f6953..678102ee77 100644 --- a/src/AppInstallerCLIE2ETests/Helpers/TestCommon.cs +++ b/src/AppInstallerCLIE2ETests/Helpers/TestCommon.cs @@ -16,7 +16,6 @@ namespace AppInstallerCLIE2ETests.Helpers using System.Security.Principal; using System.Text; using System.Threading; - using System.Web; using AppInstallerCLIE2ETests; using AppInstallerCLIE2ETests.PowerShell; using Microsoft.Management.Deployment; @@ -354,13 +353,15 @@ public static string GetCheckpointsDirectory() /// Product code. /// Should exists. /// Scope. + /// Install directory added to path instead of the symlink directory. public static void VerifyPortablePackage( string installDir, string commandAlias, string filename, string productCode, bool shouldExist, - Scope scope = Scope.User) + Scope scope = Scope.User, + bool installDirectoryAddedToPath = false) { // When portables are installed, if the exe path is inside a directory it will not be aliased // if the exe path is at the root level, it will be aliased. Therefore, if either exist, the exe exists @@ -387,7 +388,7 @@ public static void VerifyPortablePackage( { string pathName = "Path"; var currentPathValue = (string)environmentRegistryKey.GetValue(pathName); - var portablePathValue = symlinkDirectory + ';'; + var portablePathValue = (installDirectoryAddedToPath ? installDir : symlinkDirectory) + ';'; isAddedToPath = currentPathValue.Contains(portablePathValue); } @@ -397,9 +398,9 @@ public static void VerifyPortablePackage( } Assert.AreEqual(shouldExist, exeExists, $"Expected portable exe path: {exePath}"); - Assert.AreEqual(shouldExist, symlinkExists, $"Expected portable symlink path: {symlinkPath}"); + Assert.AreEqual(shouldExist && !installDirectoryAddedToPath, symlinkExists, $"Expected portable symlink path: {symlinkPath}"); Assert.AreEqual(shouldExist, portableEntryExists, $"Expected {productCode} subkey in path: {uninstallSubKey}"); - Assert.AreEqual(shouldExist, isAddedToPath, $"Expected path variable: {symlinkDirectory}"); + Assert.AreEqual(shouldExist, isAddedToPath, $"Expected path variable: {(installDirectoryAddedToPath ? installDir : symlinkDirectory)}"); } /// diff --git a/src/AppInstallerCLIE2ETests/Helpers/WinGetSettingsHelper.cs b/src/AppInstallerCLIE2ETests/Helpers/WinGetSettingsHelper.cs index 335ecbbfa5..39c24504ae 100644 --- a/src/AppInstallerCLIE2ETests/Helpers/WinGetSettingsHelper.cs +++ b/src/AppInstallerCLIE2ETests/Helpers/WinGetSettingsHelper.cs @@ -237,9 +237,12 @@ private static JObject GetJsonSettingsObject(string objectName) private static void SetWingetSettings(JObject settingsJson) { var forcedExperimentalFeatures = ForcedExperimentalFeatures; - foreach (var feature in forcedExperimentalFeatures) + if (forcedExperimentalFeatures != null) { - ConfigureFeature(settingsJson, feature, true); + foreach (var feature in forcedExperimentalFeatures) + { + ConfigureFeature(settingsJson, feature, true); + } } SetWingetSettings(settingsJson.ToString()); diff --git a/src/AppInstallerCLIE2ETests/InstallCommand.cs b/src/AppInstallerCLIE2ETests/InstallCommand.cs index 54efdef1c8..8340407fe4 100644 --- a/src/AppInstallerCLIE2ETests/InstallCommand.cs +++ b/src/AppInstallerCLIE2ETests/InstallCommand.cs @@ -516,6 +516,25 @@ public void InstallZip_Portable() TestCommon.VerifyPortablePackage(Path.Combine(installDir, packageDirName), commandAlias, fileName, productCode, true, TestCommon.Scope.User); } + /// + /// Test install zip portable with binaries that depend on PATH variable. + /// + [Test] + public void InstallZip_ArchivePortableWithBinariesDependentOnPath() + { + string installDir = TestCommon.GetPortablePackagesDirectory(); + string packageId, commandAlias, fileName, packageDirName, productCode; + packageId = "AppInstallerTest.ArchivePortableWithBinariesDependentOnPath"; + packageDirName = productCode = packageId + "_" + Constants.TestSourceIdentifier; + commandAlias = "TestPortable.exe"; + fileName = "AppInstallerTestExeInstaller.exe"; + + var result = TestCommon.RunAICLICommand("install", $"{packageId}"); + Assert.AreEqual(Constants.ErrorCode.S_OK, result.ExitCode); + Assert.True(result.StdOut.Contains("Successfully installed")); + TestCommon.VerifyPortablePackage(Path.Combine(installDir, packageDirName), commandAlias, fileName, productCode, true, TestCommon.Scope.User, true); + } + /// /// Test install zip with invalid relative file path. /// diff --git a/src/AppInstallerCLIE2ETests/PowerShell/PowerShellHost.cs b/src/AppInstallerCLIE2ETests/PowerShell/PowerShellHost.cs index 91db986fb4..d0f1d22970 100644 --- a/src/AppInstallerCLIE2ETests/PowerShell/PowerShellHost.cs +++ b/src/AppInstallerCLIE2ETests/PowerShell/PowerShellHost.cs @@ -1,4 +1,4 @@ -// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- // // Copyright (c) Microsoft Corporation. Licensed under the MIT License. // @@ -10,7 +10,6 @@ namespace AppInstallerCLIE2ETests.PowerShell using System.Collections; using System.Management.Automation; using System.Management.Automation.Runspaces; - using AppInstallerCLIE2ETests.Helpers; using Microsoft.PowerShell; using NUnit.Framework; diff --git a/src/AppInstallerCLIE2ETests/SearchCommand.cs b/src/AppInstallerCLIE2ETests/SearchCommand.cs index a2464a19f2..7e68a266b3 100644 --- a/src/AppInstallerCLIE2ETests/SearchCommand.cs +++ b/src/AppInstallerCLIE2ETests/SearchCommand.cs @@ -121,7 +121,7 @@ public void SearchWithExactID() } /// - /// Test search with exact case sensitive. + /// Test search with exact case-sensitive. /// [Test] public void SearchWithExactArgCaseSensitivity() diff --git a/src/AppInstallerCLIE2ETests/SetUpFixture.cs b/src/AppInstallerCLIE2ETests/SetUpFixture.cs index 0abd729ea8..422eb1bc1f 100644 --- a/src/AppInstallerCLIE2ETests/SetUpFixture.cs +++ b/src/AppInstallerCLIE2ETests/SetUpFixture.cs @@ -41,8 +41,6 @@ public void Setup() shouldRevertDefaultFileTypeRiskOnExit = this.DecreaseFileTypeRisk(".exe;.msi", false); - Assert.True(TestCommon.RunCommand("certutil.exe", "-addstore -f \"TRUSTEDPEOPLE\" " + TestCommon.GetTestDataFile(Constants.AppInstallerTestCert)), "Add AppInstallerTestCert"); - if (testParams.PackagedContext) { if (testParams.LooseFileRegistration) @@ -83,8 +81,6 @@ public void TearDown() this.DecreaseFileTypeRisk(defaultFileTypes, true); } - TestCommon.RunCommand("certutil.exe", $"-delstore \"TRUSTEDPEOPLE\" {Constants.AppInstallerTestCertThumbprint}"); - TestCommon.PublishE2ETestLogs(); if (TestSetup.Parameters.PackagedContext) diff --git a/src/AppInstallerCLIE2ETests/TestData/AppInstallerTest.cer b/src/AppInstallerCLIE2ETests/TestData/AppInstallerTest.cer deleted file mode 100644 index 02f5ddf96c..0000000000 Binary files a/src/AppInstallerCLIE2ETests/TestData/AppInstallerTest.cer and /dev/null differ diff --git a/src/AppInstallerCLIE2ETests/TestData/Configuration/WinGetDscResourceValidate_Good.yml b/src/AppInstallerCLIE2ETests/TestData/Configuration/WinGetDscResourceValidate_Good.yml index 3cfea23b14..1a1cf08946 100644 --- a/src/AppInstallerCLIE2ETests/TestData/Configuration/WinGetDscResourceValidate_Good.yml +++ b/src/AppInstallerCLIE2ETests/TestData/Configuration/WinGetDscResourceValidate_Good.yml @@ -1,15 +1,14 @@ properties: configurationVersion: 0.2.0 resources: - - resource: Microsoft.WinGet.DSC/WinGetSources + - resource: Microsoft.WinGet.DSC/WinGetSource id: configureSource directives: description: Add test source allowPrerelease: true settings: - Sources: - - Name: TestSource - Arg: "https://localhost:5001/TestKit" + Name: TestSource + Argument: "https://localhost:5001/TestKit" - resource: Microsoft.WinGet.DSC/WinGetPackage id: testPackage dependsOn: @@ -21,4 +20,3 @@ properties: id: AppInstallerTest.TestExeInstaller source: TestSource version: "1.0.1.0" - \ No newline at end of file diff --git a/src/AppInstallerCLIE2ETests/TestData/Configuration/WinGetDscResourceValidate_PackageNotFound.yml b/src/AppInstallerCLIE2ETests/TestData/Configuration/WinGetDscResourceValidate_PackageNotFound.yml index 6b7633ba50..a9bbdd42ad 100644 --- a/src/AppInstallerCLIE2ETests/TestData/Configuration/WinGetDscResourceValidate_PackageNotFound.yml +++ b/src/AppInstallerCLIE2ETests/TestData/Configuration/WinGetDscResourceValidate_PackageNotFound.yml @@ -1,15 +1,14 @@ properties: configurationVersion: 0.2.0 resources: - - resource: Microsoft.WinGet.DSC/WinGetSources + - resource: Microsoft.WinGet.DSC/WinGetSource id: configureSource directives: description: Add test source allowPrerelease: true settings: - Sources: - - Name: TestSource - Arg: "https://localhost:5001/TestKit" + Name: TestSource + Argument: "https://localhost:5001/TestKit" - resource: Microsoft.WinGet.DSC/WinGetPackage id: testPackage dependsOn: @@ -21,4 +20,3 @@ properties: id: AppInstallerTest.DoesNotExist source: TestSource version: "1.0.1.0" - \ No newline at end of file diff --git a/src/AppInstallerCLIE2ETests/TestData/Configuration/WinGetDscResourceValidate_PackageVersionNotFound.yml b/src/AppInstallerCLIE2ETests/TestData/Configuration/WinGetDscResourceValidate_PackageVersionNotFound.yml index 1dacdfb090..c3d7920f63 100644 --- a/src/AppInstallerCLIE2ETests/TestData/Configuration/WinGetDscResourceValidate_PackageVersionNotFound.yml +++ b/src/AppInstallerCLIE2ETests/TestData/Configuration/WinGetDscResourceValidate_PackageVersionNotFound.yml @@ -1,15 +1,14 @@ properties: configurationVersion: 0.2.0 resources: - - resource: Microsoft.WinGet.DSC/WinGetSources + - resource: Microsoft.WinGet.DSC/WinGetSource id: configureSource directives: description: Add test source allowPrerelease: true settings: - Sources: - - Name: TestSource - Arg: "https://localhost:5001/TestKit" + Name: TestSource + Argument: "https://localhost:5001/TestKit" - resource: Microsoft.WinGet.DSC/WinGetPackage id: testPackage dependsOn: @@ -21,4 +20,3 @@ properties: id: AppInstallerTest.TestExeInstaller source: TestSource version: "101.0.101.0" - \ No newline at end of file diff --git a/src/AppInstallerCLIE2ETests/TestData/Configuration/WinGetDscResourceValidate_SourceOpenFailed.yml b/src/AppInstallerCLIE2ETests/TestData/Configuration/WinGetDscResourceValidate_SourceOpenFailed.yml index d94a17b548..e1d558a97d 100644 --- a/src/AppInstallerCLIE2ETests/TestData/Configuration/WinGetDscResourceValidate_SourceOpenFailed.yml +++ b/src/AppInstallerCLIE2ETests/TestData/Configuration/WinGetDscResourceValidate_SourceOpenFailed.yml @@ -1,15 +1,14 @@ properties: configurationVersion: 0.2.0 resources: - - resource: Microsoft.WinGet.DSC/WinGetSources + - resource: Microsoft.WinGet.DSC/WinGetSource id: configureSource directives: description: Add test source allowPrerelease: true settings: - Sources: - - Name: TestSourceV2 - Arg: "https://localhost:5001/TestKit" + Name: TestSourceV2 + Argument: "https://localhost:5001/TestKit" - resource: Microsoft.WinGet.DSC/WinGetPackage id: testPackage dependsOn: @@ -21,4 +20,3 @@ properties: id: AppInstallerTest.TestExeInstaller source: TestSourceV2 version: "1.0.1.0" - \ No newline at end of file diff --git a/src/AppInstallerCLIE2ETests/TestData/Configuration/WinGetDscResourceValidate_VersionSpecifiedWithOnlyOneVersionAvailable.yml b/src/AppInstallerCLIE2ETests/TestData/Configuration/WinGetDscResourceValidate_VersionSpecifiedWithOnlyOneVersionAvailable.yml index 3fc0f6dac2..5a40804ef7 100644 --- a/src/AppInstallerCLIE2ETests/TestData/Configuration/WinGetDscResourceValidate_VersionSpecifiedWithOnlyOneVersionAvailable.yml +++ b/src/AppInstallerCLIE2ETests/TestData/Configuration/WinGetDscResourceValidate_VersionSpecifiedWithOnlyOneVersionAvailable.yml @@ -1,15 +1,14 @@ properties: configurationVersion: 0.2.0 resources: - - resource: Microsoft.WinGet.DSC/WinGetSources + - resource: Microsoft.WinGet.DSC/WinGetSource id: configureSource directives: description: Add test source allowPrerelease: true settings: - Sources: - - Name: TestSource - Arg: "https://localhost:5001/TestKit" + Name: TestSource + Argument: "https://localhost:5001/TestKit" - resource: Microsoft.WinGet.DSC/WinGetPackage id: testPackage dependsOn: @@ -21,4 +20,3 @@ properties: id: AppInstallerTest.TestValidManifest source: TestSource version: "1.0.0.0" - \ No newline at end of file diff --git a/src/AppInstallerCLIE2ETests/TestData/Configuration/WinGetDscResourceValidate_VersionSpecifiedWithUseLatest.yml b/src/AppInstallerCLIE2ETests/TestData/Configuration/WinGetDscResourceValidate_VersionSpecifiedWithUseLatest.yml index 3b1bd82dcc..043df1e768 100644 --- a/src/AppInstallerCLIE2ETests/TestData/Configuration/WinGetDscResourceValidate_VersionSpecifiedWithUseLatest.yml +++ b/src/AppInstallerCLIE2ETests/TestData/Configuration/WinGetDscResourceValidate_VersionSpecifiedWithUseLatest.yml @@ -1,15 +1,14 @@ properties: configurationVersion: 0.2.0 resources: - - resource: Microsoft.WinGet.DSC/WinGetSources + - resource: Microsoft.WinGet.DSC/WinGetSource id: configureSource directives: description: Add test source allowPrerelease: true settings: - Sources: - - Name: TestSource - Arg: "https://localhost:5001/TestKit" + Name: TestSource + Argument: "https://localhost:5001/TestKit" - resource: Microsoft.WinGet.DSC/WinGetPackage id: testPackage dependsOn: @@ -22,4 +21,3 @@ properties: source: TestSource version: "1.0.1.0" useLatest: true - \ No newline at end of file diff --git a/src/AppInstallerCLIE2ETests/TestData/IndexPackageIntRoot.cer b/src/AppInstallerCLIE2ETests/TestData/IndexPackageIntRoot.cer deleted file mode 100644 index 4177d302bb..0000000000 Binary files a/src/AppInstallerCLIE2ETests/TestData/IndexPackageIntRoot.cer and /dev/null differ diff --git a/src/AppInstallerCLIE2ETests/TestData/Manifests/TestUpgradeAddsDependency.1.0.yaml b/src/AppInstallerCLIE2ETests/TestData/Manifests/TestUpgradeAddsDependency.1.0.yaml new file mode 100644 index 0000000000..974079850f --- /dev/null +++ b/src/AppInstallerCLIE2ETests/TestData/Manifests/TestUpgradeAddsDependency.1.0.yaml @@ -0,0 +1,18 @@ +PackageIdentifier: AppInstallerTest.TestUpgradeAddsDependency +PackageVersion: 1.0 +PackageName: TestUpgradeAddsDependency +PackageLocale: en-US +Publisher: Microsoft +License: Test +ShortDescription: E2E test for adding a new package dependency during an upgrade. +Installers: + - Architecture: x86 + InstallerUrl: https://localhost:5001/TestKit/AppInstallerTestExeInstaller/AppInstallerTestExeInstaller.exe + InstallerType: exe + InstallerSha256: + ProductCode: '{fda6c0e2-0977-482f-bda1-9bd025457b81}' + InstallerSwitches: + Custom: '/ProductID {fda6c0e2-0977-482f-bda1-9bd025457b81}' + InstallLocation: /InstallDir +ManifestType: singleton +ManifestVersion: 1.4.0 diff --git a/src/AppInstallerCLIE2ETests/TestData/Manifests/TestUpgradeAddsDependency.2.0.yaml b/src/AppInstallerCLIE2ETests/TestData/Manifests/TestUpgradeAddsDependency.2.0.yaml new file mode 100644 index 0000000000..d61380cdaa --- /dev/null +++ b/src/AppInstallerCLIE2ETests/TestData/Manifests/TestUpgradeAddsDependency.2.0.yaml @@ -0,0 +1,21 @@ +PackageIdentifier: AppInstallerTest.TestUpgradeAddsDependency +PackageVersion: 2.0 +PackageName: TestUpgradeAddsDependency +PackageLocale: en-US +Publisher: Microsoft +License: Test +ShortDescription: E2E test for adding a new package dependency during an upgrade. +Installers: + - Architecture: x86 + InstallerUrl: https://localhost:5001/TestKit/AppInstallerTestExeInstaller/AppInstallerTestExeInstaller.exe + InstallerType: exe + InstallerSha256: + ProductCode: '{fda6c0e2-0977-482f-bda1-9bd025457b81}' + InstallerSwitches: + Custom: '/ProductID {fda6c0e2-0977-482f-bda1-9bd025457b81}' + InstallLocation: /InstallDir + Dependencies: + PackageDependencies: + - PackageIdentifier: AppInstallerTest.TestUpgradeAddsDependencyDependent +ManifestType: singleton +ManifestVersion: 1.4.0 diff --git a/src/AppInstallerCLIE2ETests/TestData/Manifests/TestUpgradeAddsDependencyDependent.1.0.yaml b/src/AppInstallerCLIE2ETests/TestData/Manifests/TestUpgradeAddsDependencyDependent.1.0.yaml new file mode 100644 index 0000000000..7d48f3410b --- /dev/null +++ b/src/AppInstallerCLIE2ETests/TestData/Manifests/TestUpgradeAddsDependencyDependent.1.0.yaml @@ -0,0 +1,19 @@ +PackageIdentifier: AppInstallerTest.TestUpgradeAddsDependencyDependent +PackageVersion: 1.0 +PackageName: TestUpgradeAddsDependencyDependent +PackageLocale: en-US +Publisher: Microsoft +License: Test +ShortDescription: E2E test for adding a new package dependency during an upgrade. +Installers: + - Architecture: x86 + InstallerUrl: https://localhost:5001/TestKit/AppInstallerTestExeInstaller/AppInstallerTestExeInstaller.exe + InstallerType: exe + InstallerSha256: + UpgradeBehavior: uninstallPrevious + ProductCode: '{648274a3-17aa-4731-8bf1-5854ca61e475}' + InstallerSwitches: + Custom: '/ProductID {648274a3-17aa-4731-8bf1-5854ca61e475}' + InstallLocation: /InstallDir +ManifestType: singleton +ManifestVersion: 1.4.0 diff --git a/src/AppInstallerCLIE2ETests/TestData/Manifests/TestZipInstaller_Portable_BinariesDependOnPath.yaml b/src/AppInstallerCLIE2ETests/TestData/Manifests/TestZipInstaller_Portable_BinariesDependOnPath.yaml new file mode 100644 index 0000000000..7707a08a8d --- /dev/null +++ b/src/AppInstallerCLIE2ETests/TestData/Manifests/TestZipInstaller_Portable_BinariesDependOnPath.yaml @@ -0,0 +1,19 @@ +PackageIdentifier: AppInstallerTest.ArchivePortableWithBinariesDependentOnPath +PackageVersion: 1.0.0.0 +PackageName: TestArchivePortableWithBinariesDependentOnPath +PackageLocale: en-US +Publisher: AppInstallerTest +License: Test +ShortDescription: E2E test for installing a zip containing a portable with binaries that depend on the PATH variable. +Installers: + - Architecture: x64 + InstallerUrl: https://localhost:5001/TestKit/AppInstallerTestZipInstaller/AppInstallerTestZipInstaller.zip + InstallerType: zip + InstallerSha256: + NestedInstallerType: portable + NestedInstallerFiles: + - RelativeFilePath: AppInstallerTestExeInstaller.exe + PortableCommandAlias: TestPortable + ArchiveBinariesDependOnPath: true +ManifestType: singleton +ManifestVersion: 1.9.0 diff --git a/src/AppInstallerCLIE2ETests/TestData/localsource.json b/src/AppInstallerCLIE2ETests/TestData/localsource.json index 45bae359be..77eb3bd41d 100644 --- a/src/AppInstallerCLIE2ETests/TestData/localsource.json +++ b/src/AppInstallerCLIE2ETests/TestData/localsource.json @@ -44,6 +44,7 @@ } ], "Signature": { - "CertFile": "%APPINSTALLERTEST_SECUREFILEPATH%" + "CertFile": "%TestSigningCert_PfxPath%", + "Password": "%TestSigningCert_Password%" } } diff --git a/src/AppInstallerCLIE2ETests/UpgradeCommand.cs b/src/AppInstallerCLIE2ETests/UpgradeCommand.cs index e1c833ce40..85e9129619 100644 --- a/src/AppInstallerCLIE2ETests/UpgradeCommand.cs +++ b/src/AppInstallerCLIE2ETests/UpgradeCommand.cs @@ -187,5 +187,18 @@ public void UpgradeZip_Portable() Assert.True(result2.StdOut.Contains("Successfully installed")); TestCommon.VerifyPortablePackage(Path.Combine(installDir, packageDirName), commandAlias, fileName, productCode, true, TestCommon.Scope.User); } + + /// + /// Test upgrade when a new dependency is added that is not installed. + /// + [Test] + public void UpgradeAddsDependency() + { + var result = TestCommon.RunAICLICommand("install", $"AppInstallerTest.TestUpgradeAddsDependency -v 1.0 --verbose"); + Assert.AreEqual(Constants.ErrorCode.S_OK, result.ExitCode); + + result = TestCommon.RunAICLICommand("upgrade", $"AppInstallerTest.TestUpgradeAddsDependency"); + Assert.AreEqual(Constants.ErrorCode.S_OK, result.ExitCode); + } } } diff --git a/src/AppInstallerCLIPackage/AppInstallerCLIPackage.wapproj b/src/AppInstallerCLIPackage/AppInstallerCLIPackage.wapproj index 8fb768c644..1c13e88686 100644 --- a/src/AppInstallerCLIPackage/AppInstallerCLIPackage.wapproj +++ b/src/AppInstallerCLIPackage/AppInstallerCLIPackage.wapproj @@ -228,33 +228,32 @@ - $(SolutionDir) - $(OutputPath)\..\..\..\.. + $(SolutionDir) - + - + WindowsPackageManager.dll - + libsmartscreen.dll - + Microsoft.Management.Deployment.winmd - + Microsoft.Management.Configuration.dll - + Microsoft.Management.Configuration.winmd - + Microsoft.Management.Configuration.Processor.winmd - + ConfigurationRemotingServer\Microsoft.Management.Configuration.Projection.dll - + ConfigurationRemotingServer true diff --git a/src/AppInstallerCLIPackage/Shared/Strings/en-us/winget.resw b/src/AppInstallerCLIPackage/Shared/Strings/en-us/winget.resw index 84ed70abe1..c1d8771680 100644 --- a/src/AppInstallerCLIPackage/Shared/Strings/en-us/winget.resw +++ b/src/AppInstallerCLIPackage/Shared/Strings/en-us/winget.resw @@ -2874,7 +2874,7 @@ Please specify one of them using the --source option to proceed. Sets the value of an admin setting. - + Excludes a source from discovery unless specified @@ -3045,4 +3045,71 @@ Please specify one of them using the --source option to proceed. The specified configuration could not be found. + + Completed + The state of processing an item. + + + In progress + The state of processing an item. + + + Pending + The state of processing an item. + + + Unknown + The state of processing an item. + + + Monitor configuration status. + As in "to monitor the status of a configuration being applied". + + + Completed + The state of processing an item. + + + In progress + The state of processing an item. + + + Pending + The state of processing an item. + + + Skipped + The state of processing an item. + + + Unknown + The state of processing an item. + + + Apply Started + When the configuration application started. + + + Apply Ended + When the configuration application ended. + + + Result + + + Details + + + State + The state of processing an item. + + + Unit + + + The package is not compatible with the current Windows version or platform. + + + Suppress showing initial configuration details when possible + \ No newline at end of file diff --git a/src/AppInstallerCLITests/AppInstallerCLITests.vcxproj b/src/AppInstallerCLITests/AppInstallerCLITests.vcxproj index a250ab1c63..63a71a30d7 100644 --- a/src/AppInstallerCLITests/AppInstallerCLITests.vcxproj +++ b/src/AppInstallerCLITests/AppInstallerCLITests.vcxproj @@ -809,6 +809,9 @@ true + + true + true @@ -893,6 +896,18 @@ true + + true + + + true + + + true + + + true + true diff --git a/src/AppInstallerCLITests/AppInstallerCLITests.vcxproj.filters b/src/AppInstallerCLITests/AppInstallerCLITests.vcxproj.filters index e450823d45..cd7c5e5e2b 100644 --- a/src/AppInstallerCLITests/AppInstallerCLITests.vcxproj.filters +++ b/src/AppInstallerCLITests/AppInstallerCLITests.vcxproj.filters @@ -37,6 +37,9 @@ {3e7d4dff-5513-46dd-95d2-f616c867ebe4} + + {3499d391-99c1-4fa3-ba8d-0ce846c2497b} + {b35e1a8b-1961-46d5-98e5-adc8e52c54a9} @@ -804,6 +807,9 @@ TestData + + TestData + TestData\MultiFileManifestV1 @@ -888,6 +894,18 @@ TestData\MultiFileManifestV1_7 + + TestData\MultiFileManifestV1_9 + + + TestData\MultiFileManifestV1_9 + + + TestData\MultiFileManifestV1_9 + + + TestData\MultiFileManifestV1_9 + TestData diff --git a/src/AppInstallerCLITests/ManifestComparator.cpp b/src/AppInstallerCLITests/ManifestComparator.cpp index 62f904d5b3..2bd0110236 100644 --- a/src/AppInstallerCLITests/ManifestComparator.cpp +++ b/src/AppInstallerCLITests/ManifestComparator.cpp @@ -110,7 +110,7 @@ TEST_CASE("ManifestComparator_OSFilter_High", "[manifest_comparator]") REQUIRE(inapplicabilities.size() == 0); } -TEST_CASE("ManifestComparator_InstalledScopeFilter_Uknown", "[manifest_comparator]") +TEST_CASE("ManifestComparator_InstalledScopeFilter_Unknown", "[manifest_comparator]") { Manifest manifest; ManifestInstaller unknown = AddInstaller(manifest, Architecture::Neutral, InstallerTypeEnum::Msi, ScopeEnum::Unknown); @@ -249,7 +249,7 @@ TEST_CASE("ManifestComparator_InstalledTypeCompare", "[manifest_comparator]") ManifestComparator mc(ManifestComparatorTestContext{}, metadata); auto [result, inapplicabilities] = mc.GetPreferredInstaller(manifest); - RequireInstaller(result, exe); + RequireInstaller(result, burn); REQUIRE(inapplicabilities.size() == 0); } SECTION("Inno Installed") @@ -343,7 +343,7 @@ TEST_CASE("ManifestComparator_ScopeCompare", "[manifest_comparator]") } } -TEST_CASE("ManifestComparator_LocaleComparator_Installed_WithUknown", "[manifest_comparator]") +TEST_CASE("ManifestComparator_LocaleComparator_Installed_WithUnknown", "[manifest_comparator]") { Manifest manifest; ManifestInstaller unknown = AddInstaller(manifest, Architecture::Neutral, InstallerTypeEnum::Msi, ScopeEnum::User, "", ""); @@ -869,3 +869,20 @@ TEST_CASE("ManifestComparator_MachineArchitecture_Strong_Scope_Weak", "[manifest RequireInstaller(result, system); } + +TEST_CASE("ManifestComparator_InstallerCompatibilitySet_Weaker_Than_Architecture", "[manifest_comparator]") +{ + Manifest manifest; + ManifestInstaller target = AddInstaller(manifest, GetSystemArchitecture(), InstallerTypeEnum::Wix, ScopeEnum::Unknown, "", ""); + ManifestInstaller foil = AddInstaller(manifest, Architecture::Neutral, InstallerTypeEnum::Msi, ScopeEnum::Unknown, "", ""); + + ManifestComparatorTestContext context; + + IPackageVersion::Metadata installationMetadata; + installationMetadata[PackageVersionMetadata::InstalledType] = InstallerTypeToString(foil.EffectiveInstallerType()); + + ManifestComparator mc(context, installationMetadata); + auto [result, inapplicabilities] = mc.GetPreferredInstaller(manifest); + + RequireInstaller(result, target); +} diff --git a/src/AppInstallerCLITests/PortableInstaller.cpp b/src/AppInstallerCLITests/PortableInstaller.cpp index a53711b9f9..4959928f10 100644 --- a/src/AppInstallerCLITests/PortableInstaller.cpp +++ b/src/AppInstallerCLITests/PortableInstaller.cpp @@ -171,4 +171,41 @@ TEST_CASE("PortableInstaller_InstallToIndex_ExistingInstallRoot", "[PortableInst REQUIRE_FALSE(AppInstaller::Filesystem::SymlinkExists(symlinkPath)); REQUIRE_FALSE(AppInstaller::Filesystem::SymlinkExists(symlinkPath2)); REQUIRE_FALSE(std::filesystem::exists(directoryPath)); -} \ No newline at end of file +} + +TEST_CASE("PortableInstaller_UnicodeSymlinkPath", "[PortableInstaller]") +{ + TempDirectory tempDirectory = TestCommon::TempDirectory("TempDirectory", false); + + // Modify install location path to include unicode characters. + std::filesystem::path testInstallLocation = tempDirectory.GetPath() / std::filesystem::path{ ConvertToUTF16("романтический") }; + + std::vector desiredTestState; + + TestCommon::TempFile testPortable("testPortable.txt"); + std::ofstream file(testPortable, std::ofstream::out); + file.close(); + + std::filesystem::path targetPath = testInstallLocation / "testPortable.txt"; + std::filesystem::path symlinkPath = tempDirectory.GetPath() / "testSymlink.exe"; + + desiredTestState.emplace_back(std::move(PortableFileEntry::CreateFileEntry(testPortable.GetPath(), targetPath, {}))); + desiredTestState.emplace_back(std::move(PortableFileEntry::CreateSymlinkEntry(symlinkPath, targetPath))); + + PortableInstaller portableInstaller = PortableInstaller(ScopeEnum::User, Architecture::X64, "testProductCode"); + portableInstaller.TargetInstallLocation = testInstallLocation; + portableInstaller.SetDesiredState(desiredTestState); + REQUIRE(portableInstaller.VerifyExpectedState()); + + portableInstaller.Install(); + + PortableInstaller portableInstaller2 = PortableInstaller(ScopeEnum::User, Architecture::X64, "testProductCode"); + REQUIRE(portableInstaller2.ARPEntryExists()); + REQUIRE(std::filesystem::exists(portableInstaller2.PortableTargetFullPath)); + REQUIRE(AppInstaller::Filesystem::SymlinkExists(portableInstaller2.PortableSymlinkFullPath)); + + portableInstaller2.Uninstall(); + REQUIRE_FALSE(std::filesystem::exists(portableInstaller2.PortableTargetFullPath)); + REQUIRE_FALSE(AppInstaller::Filesystem::SymlinkExists(portableInstaller2.PortableSymlinkFullPath)); + REQUIRE_FALSE(std::filesystem::exists(portableInstaller2.InstallLocation)); +} diff --git a/src/AppInstallerCLITests/SQLiteDynamicStorage.cpp b/src/AppInstallerCLITests/SQLiteDynamicStorage.cpp index 9f27008a7b..03ed583994 100644 --- a/src/AppInstallerCLITests/SQLiteDynamicStorage.cpp +++ b/src/AppInstallerCLITests/SQLiteDynamicStorage.cpp @@ -20,7 +20,7 @@ TEST_CASE("SQLiteDynamicStorage_UpgradeDetection", "[sqlite_dynamic]") SQLiteDynamicStorage storage{ tempFile.GetPath(), Version{ 1, 0 } }; { - auto transactionLock = storage.TryBeginTransaction("test"); + auto transactionLock = storage.TryBeginTransaction("test", false); REQUIRE(transactionLock); } @@ -33,11 +33,11 @@ TEST_CASE("SQLiteDynamicStorage_UpgradeDetection", "[sqlite_dynamic]") REQUIRE(storage.GetVersion() == Version{ 1, 0 }); - auto transactionLock = storage.TryBeginTransaction("test"); + auto transactionLock = storage.TryBeginTransaction("test", false); REQUIRE(!transactionLock); REQUIRE(storage.GetVersion() == Version{ 2, 0 }); - transactionLock = storage.TryBeginTransaction("test"); + transactionLock = storage.TryBeginTransaction("test", false); REQUIRE(transactionLock); } diff --git a/src/AppInstallerCLITests/SQLiteIndex.cpp b/src/AppInstallerCLITests/SQLiteIndex.cpp index 40dd364979..12af2a5c9c 100644 --- a/src/AppInstallerCLITests/SQLiteIndex.cpp +++ b/src/AppInstallerCLITests/SQLiteIndex.cpp @@ -3747,7 +3747,7 @@ TEST_CASE("SQLiteIndex_V2_0_UsageFlow_Complex", "[sqliteindex][V2_0]") PrepareAndCheckIntermediates(baseFile, preparedFile, { { manifest1, manifest3 } }); - // Open existing file to add a new verion of existing package and update an existing version + // Open existing file to add a new version of existing package and update an existing version manifest2.Manifest.StreamSha256 = SHA256::ComputeHash(manifest2.Manifest.Id); ManifestAndPath manifest4; @@ -3821,7 +3821,7 @@ TEST_CASE("SQLiteIndex_V2_0_UsageFlow_ComplexMigration", "[sqliteindex][V2_0]") MigratePrepareAndCheckIntermediates(baseFile, preparedFile, { { manifest2 }, { manifest1, manifest3 } }); - // Open existing file to add a new verion of existing package and update an existing version + // Open existing file to add a new version of existing package and update an existing version manifest2.Manifest.StreamSha256 = SHA256::ComputeHash(manifest2.Manifest.Id); ManifestAndPath manifest4; diff --git a/src/AppInstallerCLITests/SQLiteWrapper.cpp b/src/AppInstallerCLITests/SQLiteWrapper.cpp index bc597e19b7..d109b13ca4 100644 --- a/src/AppInstallerCLITests/SQLiteWrapper.cpp +++ b/src/AppInstallerCLITests/SQLiteWrapper.cpp @@ -729,3 +729,128 @@ TEST_CASE("SQLBuilder_InsertValueBinding", "[sqlbuilder]") REQUIRE(!select.Step()); } } + +TEST_CASE("SQLiteWrapperTransactionRollback", "[sqlitewrapper]") +{ + Connection connection = Connection::Create(SQLITE_MEMORY_DB_CONNECTION_TARGET, Connection::OpenDisposition::Create); + + int firstVal = 1; + std::string secondVal = "test"; + + CreateSimpleTestTable(connection); + + Transaction transaction = Transaction::Create(connection, "test_transaction", false); + + InsertIntoSimpleTestTable(connection, firstVal, secondVal); + + transaction.Rollback(); + + Statement select = Statement::Create(connection, s_selectFromSimpleTestTableSQL); + REQUIRE(!select.Step()); + REQUIRE(select.GetState() == Statement::State::Completed); +} + +TEST_CASE("SQLiteWrapperTransactionRollbackOnDestruct", "[sqlitewrapper]") +{ + Connection connection = Connection::Create(SQLITE_MEMORY_DB_CONNECTION_TARGET, Connection::OpenDisposition::Create); + + int firstVal = 1; + std::string secondVal = "test"; + + CreateSimpleTestTable(connection); + + { + Transaction transaction = Transaction::Create(connection, "test_transaction", false); + + InsertIntoSimpleTestTable(connection, firstVal, secondVal); + } + + Statement select = Statement::Create(connection, s_selectFromSimpleTestTableSQL); + REQUIRE(!select.Step()); + REQUIRE(select.GetState() == Statement::State::Completed); +} + +TEST_CASE("SQLiteWrapperTransactionCommit", "[sqlitewrapper]") +{ + Connection connection = Connection::Create(SQLITE_MEMORY_DB_CONNECTION_TARGET, Connection::OpenDisposition::Create); + + int firstVal = 1; + std::string secondVal = "test"; + + CreateSimpleTestTable(connection); + + { + Transaction transaction = Transaction::Create(connection, "test_transaction", false); + + InsertIntoSimpleTestTable(connection, firstVal, secondVal); + + transaction.Commit(); + } + + SelectFromSimpleTestTableOnlyOneRow(connection, firstVal, secondVal); +} + +TEST_CASE("SQLiteWrapperTransactionImmediate", "[sqlitewrapper]") +{ + Connection connection = Connection::Create(SQLITE_MEMORY_DB_CONNECTION_TARGET, Connection::OpenDisposition::Create); + + int firstVal = 1; + std::string secondVal = "test"; + + CreateSimpleTestTable(connection); + + { + Transaction transaction = Transaction::Create(connection, "test_transaction", true); + + InsertIntoSimpleTestTable(connection, firstVal, secondVal); + + transaction.Commit(); + } + + SelectFromSimpleTestTableOnlyOneRow(connection, firstVal, secondVal); +} + +TEST_CASE("SQLiteWrapperTransactionWriteConflict", "[sqlitewrapper]") +{ + TestCommon::TempFile tempFile{ "repolibtest_tempdb"s, ".db"s }; + INFO("Using temporary file named: " << tempFile.GetPath()); + + Connection connection = Connection::Create(tempFile, Connection::OpenDisposition::Create); + connection.SetJournalMode("WAL"); + + int firstVal = 1; + std::string secondVal = "test"; + + CreateSimpleTestTable(connection); + + Connection connection2 = Connection::Create(tempFile, Connection::OpenDisposition::ReadWrite); + std::chrono::milliseconds busyWait = 250ms; + connection2.SetBusyTimeout(busyWait); + + { + Transaction transaction = Transaction::Create(connection, "test_transaction", true); + InsertIntoSimpleTestTable(connection, firstVal, secondVal); + + // Start second transaction + std::chrono::system_clock::time_point start = std::chrono::system_clock::now(); + std::chrono::system_clock::time_point end = start; + try + { + Transaction transaction2 = Transaction::Create(connection2, "test_transaction2", true); + } + catch (...) + { + end = std::chrono::system_clock::now(); + } + + std::chrono::milliseconds duration = std::chrono::duration_cast(end - start); + REQUIRE(duration >= busyWait); + + transaction.Commit(); + + Transaction transaction2 = Transaction::Create(connection2, "test_transaction2", true); + InsertIntoSimpleTestTable(connection2, firstVal, secondVal); + } + + SelectFromSimpleTestTableOnlyOneRow(connection, firstVal, secondVal); +} diff --git a/src/AppInstallerCLITests/TestData/ManifestV1_9-Singleton.yaml b/src/AppInstallerCLITests/TestData/ManifestV1_9-Singleton.yaml new file mode 100644 index 0000000000..5c3132ec01 --- /dev/null +++ b/src/AppInstallerCLITests/TestData/ManifestV1_9-Singleton.yaml @@ -0,0 +1,200 @@ +PackageIdentifier: microsoft.msixsdk +PackageVersion: 1.7.32 +PackageLocale: en-US +Publisher: Microsoft +PublisherUrl: https://www.microsoft.com +PublisherSupportUrl: https://www.microsoft.com/support +PrivacyUrl: https://www.microsoft.com/privacy +Author: Microsoft +PackageName: MSIX SDK +PackageUrl: https://www.microsoft.com/msixsdk/home +License: MIT License +LicenseUrl: https://www.microsoft.com/msixsdk/license +Copyright: Copyright Microsoft Corporation +CopyrightUrl: https://www.microsoft.com/msixsdk/copyright +ShortDescription: This is MSIX SDK +Description: The MSIX SDK project is an effort to enable developers +Moniker: msixsdk +Tags: + - "appxsdk" + - "msixsdk" +ReleaseNotes: Default release notes +ReleaseNotesUrl: https://DefaultReleaseNotes.net +PurchaseUrl: https://DefaultPurchaseUrl.com +InstallationNotes: Default installation notes +Documentations: + - DocumentLabel: Default document label + DocumentUrl: https://DefaultDocumentUrl.com +Icons: + - IconUrl: https://testIcon-en-US + IconFileType: ico + IconResolution: custom + IconTheme: default + IconSha256: 69D84CA8899800A5575CE31798293CD4FEBAB1D734A07C2E51E56A28E0DF8123 +Agreements: + - AgreementLabel: DefaultLabel + Agreement: DefaultText + AgreementUrl: https://DefaultAgreementUrl.net +InstallerLocale: en-US +Platform: + - Windows.Desktop + - Windows.Universal +MinimumOSVersion: 10.0.0.0 +InstallerType: exe +Scope: machine +InstallModes: + - interactive + - silent + - silentWithProgress +InstallerSwitches: + Custom: /custom + SilentWithProgress: /silentwithprogress + Silent: /silence + Interactive: /interactive + Log: /log= + InstallLocation: /dir= + Upgrade: /upgrade + Repair: /repair +InstallerSuccessCodes: + - 1 + - 0x80070005 +UpgradeBehavior: uninstallPrevious +RepairBehavior: modify +Commands: + - makemsix + - makeappx +Protocols: + - protocol1 + - protocol2 +FileExtensions: + - appx + - msix + - appxbundle + - msixbundle +Dependencies: + WindowsFeatures: + - IIS + WindowsLibraries: + - VC Runtime + PackageDependencies: + - PackageIdentifier: Microsoft.MsixSdkDep + MinimumVersion: 1.0.0 + ExternalDependencies: + - Outside dependencies +Capabilities: + - internetClient +RestrictedCapabilities: + - runFullTrust +PackageFamilyName: Microsoft.DesktopAppInstaller_8wekyb3d8bbwe +ProductCode: "{Foo}" +ReleaseDate: 2021-01-01 +InstallerAbortsTerminal: true +InstallLocationRequired: true +RequireExplicitUpgrade: true +DisplayInstallWarnings: true +ElevationRequirement: elevatesSelf +UnsupportedOSArchitectures: + - arm +AppsAndFeaturesEntries: + - DisplayName: DisplayName + DisplayVersion: DisplayVersion + Publisher: Publisher + ProductCode: ProductCode + UpgradeCode: UpgradeCode + InstallerType: exe +Markets: + AllowedMarkets: + - US +ExpectedReturnCodes: + - InstallerReturnCode: 10 + ReturnResponse: packageInUse + ReturnResponseUrl: https://DefaultReturnResponseUrl.com +UnsupportedArguments: + - log +NestedInstallerType: msi +NestedInstallerFiles: + - RelativeFilePath: RelativeFilePath + PortableCommandAlias: PortableCommandAlias +InstallationMetadata: + DefaultInstallLocation: "%ProgramFiles%\\TestApp" + Files: + - RelativeFilePath: "main.exe" + FileSha256: 69D84CA8899800A5575CE31798293CD4FEBAB1D734A07C2E51E56A28E0DF8C82 + FileType: launch + InvocationParameter: "/arg" + DisplayName: "DisplayName" +DownloadCommandProhibited: true +ArchiveBinariesDependOnPath: true + +Installers: + - Architecture: x86 + InstallerLocale: en-GB + Platform: + - Windows.Desktop + MinimumOSVersion: 10.0.1.0 + InstallerType: msix + InstallerUrl: https://www.microsoft.com/msixsdk/msixsdkx86.msix + InstallerSha256: 69D84CA8899800A5575CE31798293CD4FEBAB1D734A07C2E51E56A28E0DF8C82 + SignatureSha256: 69D84CA8899800A5575CE31798293CD4FEBAB1D734A07C2E51E56A28E0DF8C82 + Scope: user + InstallModes: + - interactive + InstallerSwitches: + Custom: /c + SilentWithProgress: /sp + Silent: /s + Interactive: /i + Log: /l= + InstallLocation: /d= + Upgrade: /u + Repair: /r + UpgradeBehavior: install + Commands: + - makemsixPreview + - makeappxPreview + Protocols: + - protocol1preview + - protocol2preview + FileExtensions: + - appxbundle + - msixbundle + - appx + - msix + Dependencies: + WindowsFeatures: + - PreviewIIS + WindowsLibraries: + - Preview VC Runtime + PackageDependencies: + - PackageIdentifier: Microsoft.MsixSdkDepPreview + MinimumVersion: 1.0.0 + ExternalDependencies: + - Preview Outside dependencies + PackageFamilyName: Microsoft.DesktopAppInstallerPreview_8wekyb3d8bbwe + Capabilities: + - internetClientPreview + RestrictedCapabilities: + - runFullTrustPreview + ReleaseDate: 2021-02-02 + InstallerAbortsTerminal: false + InstallLocationRequired: false + RequireExplicitUpgrade: false + DisplayInstallWarnings: false + ElevationRequirement: elevationRequired + UnsupportedArguments: + - location + UnsupportedOSArchitectures: + - arm64 + Markets: + ExcludedMarkets: + - "US" + ExpectedReturnCodes: + - InstallerReturnCode: 2 + ReturnResponse: contactSupport + - InstallerReturnCode: 3 + ReturnResponse: custom + ReturnResponseUrl: https://defaultReturnResponseUrl.com + DownloadCommandProhibited: false + ArchiveBinariesDependOnPath: false +ManifestType: singleton +ManifestVersion: 1.9.0 diff --git a/src/AppInstallerCLITests/TestData/MultiFileManifestV1_9/ManifestV1_9-MultiFile-DefaultLocale.yaml b/src/AppInstallerCLITests/TestData/MultiFileManifestV1_9/ManifestV1_9-MultiFile-DefaultLocale.yaml new file mode 100644 index 0000000000..a6dad8f1da --- /dev/null +++ b/src/AppInstallerCLITests/TestData/MultiFileManifestV1_9/ManifestV1_9-MultiFile-DefaultLocale.yaml @@ -0,0 +1,39 @@ +PackageIdentifier: microsoft.msixsdk +PackageVersion: 1.7.32 +PackageLocale: en-US +Publisher: Microsoft +PublisherUrl: https://www.microsoft.com +PublisherSupportUrl: https://www.microsoft.com/support +PrivacyUrl: https://www.microsoft.com/privacy +Author: Microsoft +PackageName: MSIX SDK +PackageUrl: https://www.microsoft.com/msixsdk/home +License: MIT License +LicenseUrl: https://www.microsoft.com/msixsdk/license +Copyright: Copyright Microsoft Corporation +CopyrightUrl: https://www.microsoft.com/msixsdk/copyright +PurchaseUrl: https://DefaultPurchaseUrl.com +InstallationNotes: "Default installation notes" +ShortDescription: This is MSIX SDK +Description: The MSIX SDK project is an effort to enable developers +Moniker: msixsdk +Tags: + - "appxsdk" + - "msixsdk" +ReleaseNotes: Default release notes +ReleaseNotesUrl: https://DefaultReleaseNotes.net +Documentations: + - DocumentLabel: Default document label + DocumentUrl: https://DefaultDocumentUrl.com +Icons: + - IconUrl: https://testIcon-en-US + IconFileType: ico + IconResolution: custom + IconTheme: default + IconSha256: 69D84CA8899800A5575CE31798293CD4FEBAB1D734A07C2E51E56A28E0DF8123 +Agreements: + - AgreementLabel: DefaultLabel + Agreement: DefaultText + AgreementUrl: https://DefaultAgreementUrl.net +ManifestType: defaultLocale +ManifestVersion: 1.9.0 diff --git a/src/AppInstallerCLITests/TestData/MultiFileManifestV1_9/ManifestV1_9-MultiFile-Installer.yaml b/src/AppInstallerCLITests/TestData/MultiFileManifestV1_9/ManifestV1_9-MultiFile-Installer.yaml new file mode 100644 index 0000000000..3d88f9ec76 --- /dev/null +++ b/src/AppInstallerCLITests/TestData/MultiFileManifestV1_9/ManifestV1_9-MultiFile-Installer.yaml @@ -0,0 +1,211 @@ +PackageIdentifier: microsoft.msixsdk +PackageVersion: 1.7.32 +InstallerLocale: en-US +Platform: + - Windows.Desktop + - Windows.Universal +MinimumOSVersion: 10.0.0.0 +InstallerType: exe +Scope: machine +InstallModes: + - interactive + - silent + - silentWithProgress +InstallerSwitches: + Custom: /custom + SilentWithProgress: /silentwithprogress + Silent: /silence + Interactive: /interactive + Log: /log= + InstallLocation: /dir= + Upgrade: /upgrade + Repair: /repair +InstallerSuccessCodes: + - 1 + - 0x80070005 +UpgradeBehavior: uninstallPrevious +RepairBehavior: modify +Commands: + - makemsix + - makeappx +Protocols: + - protocol1 + - protocol2 +FileExtensions: + - appx + - msix + - appxbundle + - msixbundle +Dependencies: + WindowsFeatures: + - IIS + WindowsLibraries: + - VC Runtime + PackageDependencies: + - PackageIdentifier: Microsoft.MsixSdkDep + MinimumVersion: 1.0.0 + ExternalDependencies: + - Outside dependencies +Capabilities: + - internetClient +RestrictedCapabilities: + - runFullTrust +PackageFamilyName: Microsoft.DesktopAppInstaller_8wekyb3d8bbwe +ProductCode: "{Foo}" +ReleaseDate: 2021-01-01 +InstallerAbortsTerminal: true +InstallLocationRequired: true +RequireExplicitUpgrade: true +DisplayInstallWarnings: true +ElevationRequirement: elevatesSelf +UnsupportedOSArchitectures: + - arm +AppsAndFeaturesEntries: + - DisplayName: DisplayName + DisplayVersion: DisplayVersion + Publisher: Publisher + ProductCode: ProductCode + UpgradeCode: UpgradeCode + InstallerType: exe +Markets: + AllowedMarkets: + - "US" +ExpectedReturnCodes: + - InstallerReturnCode: 10 + ReturnResponse: packageInUse + ReturnResponseUrl: https://DefaultReturnResponseUrl.com +UnsupportedArguments: + - log +NestedInstallerType: msi +NestedInstallerFiles: + - RelativeFilePath: RelativeFilePath + PortableCommandAlias: PortableCommandAlias +InstallationMetadata: + DefaultInstallLocation: "%ProgramFiles%\\TestApp" + Files: + - RelativeFilePath: "main.exe" + FileSha256: 69D84CA8899800A5575CE31798293CD4FEBAB1D734A07C2E51E56A28E0DF8C82 + FileType: launch + InvocationParameter: "/arg" + DisplayName: "DisplayName" +DownloadCommandProhibited: true +ArchiveBinariesDependOnPath: true + +Installers: + - Architecture: x86 + InstallerLocale: en-GB + Platform: + - Windows.Desktop + MinimumOSVersion: 10.0.1.0 + InstallerType: msix + InstallerUrl: https://www.microsoft.com/msixsdk/msixsdkx86.msix + InstallerSha256: 69D84CA8899800A5575CE31798293CD4FEBAB1D734A07C2E51E56A28E0DF8C82 + SignatureSha256: 69D84CA8899800A5575CE31798293CD4FEBAB1D734A07C2E51E56A28E0DF8C82 + Scope: user + InstallModes: + - interactive + InstallerSwitches: + Custom: /c + SilentWithProgress: /sp + Silent: /s + Interactive: /i + Log: /l= + InstallLocation: /d= + Upgrade: /u + Repair: /r + UpgradeBehavior: install + Commands: + - makemsixPreview + - makeappxPreview + Protocols: + - protocol1preview + - protocol2preview + FileExtensions: + - appxbundle + - msixbundle + - appx + - msix + Dependencies: + WindowsFeatures: + - PreviewIIS + WindowsLibraries: + - Preview VC Runtime + PackageDependencies: + - PackageIdentifier: Microsoft.MsixSdkDepPreview + MinimumVersion: 1.0.0 + ExternalDependencies: + - Preview Outside dependencies + PackageFamilyName: Microsoft.DesktopAppInstallerPreview_8wekyb3d8bbwe + Capabilities: + - internetClientPreview + RestrictedCapabilities: + - runFullTrustPreview + ReleaseDate: 2021-02-02 + InstallerAbortsTerminal: false + InstallLocationRequired: false + RequireExplicitUpgrade: false + DisplayInstallWarnings: false + ElevationRequirement: elevationRequired + UnsupportedOSArchitectures: + - arm64 + Markets: + ExcludedMarkets: + - "US" + ExpectedReturnCodes: + - InstallerReturnCode: 2 + ReturnResponse: contactSupport + - InstallerReturnCode: 3 + ReturnResponse: custom + ReturnResponseUrl: https://defaultReturnResponseUrl.com + UnsupportedArguments: + - location + DownloadCommandProhibited: false + ArchiveBinariesDependOnPath: false + - Architecture: x64 + InstallerType: exe + InstallerUrl: https://www.microsoft.com/msixsdk/msixsdkx64.exe + InstallerSha256: 69D84CA8899800A5575CE31798293CD4FEBAB1D734A07C2E51E56A28E0DF8C82 + ProductCode: "{Bar}" + InstallerSwitches: + Repair: /r + UpgradeBehavior: deny + RepairBehavior: uninstaller + - Architecture: x86 + InstallerType: portable + InstallerUrl: https://www.microsoft.com/msixsdk/msixsdkx86.exe + InstallerSha256: 69D84CA8899800A5575CE31798293CD4FEBAB1D734A07C2E51E56A28E0DF8C82 + DisplayInstallWarnings: false + Commands: + - standalone + ExpectedReturnCodes: + - InstallerReturnCode: 11 + ReturnResponse: custom + ReturnResponseUrl: https://defaultReturnResponseUrl.com + - Architecture: x64 + InstallerType: zip + InstallerUrl: https://www.microsoft.com/msixsdk/msixsdkx64.exe + InstallerSha256: 69D84CA8899800A5575CE31798293CD4FEBAB1D734A07C2E51E56A28E0DF8C82 + NestedInstallerType: portable + NestedInstallerFiles: + - RelativeFilePath: relativeFilePath1 + PortableCommandAlias: portableAlias1 + - RelativeFilePath: relativeFilePath2 + PortableCommandAlias: portableAlias2 + InstallationMetadata: + DefaultInstallLocation: "%ProgramFiles%\\TestApp2" + Files: + - RelativeFilePath: "main2.exe" + FileSha256: 69D84CA8899800A5575CE31798293CD4FEBAB1D734A07C2E51E56A28E0DF8C82 + FileType: other + InvocationParameter: "/arg2" + DisplayName: "DisplayName2" + ArchiveBinariesDependOnPath: true + - Architecture: x64 + InstallerType: burn + InstallerUrl: https://www.microsoft.com/msixsdk/msixsdkx64.exe + InstallerSha256: 69D84CA8899800A5575CE31798293CD4FEBAB1D734A07C2E51E56A28E0DF8C82 + ProductCode: "{Bar}" + UpgradeBehavior: deny + RepairBehavior: modify +ManifestType: installer +ManifestVersion: 1.9.0 diff --git a/src/AppInstallerCLITests/TestData/MultiFileManifestV1_9/ManifestV1_9-MultiFile-Locale.yaml b/src/AppInstallerCLITests/TestData/MultiFileManifestV1_9/ManifestV1_9-MultiFile-Locale.yaml new file mode 100644 index 0000000000..3dc327483c --- /dev/null +++ b/src/AppInstallerCLITests/TestData/MultiFileManifestV1_9/ManifestV1_9-MultiFile-Locale.yaml @@ -0,0 +1,38 @@ +PackageIdentifier: microsoft.msixsdk +PackageVersion: 1.7.32 +PackageLocale: en-GB +Publisher: Microsoft UK +PublisherUrl: https://www.microsoft.com/UK +PublisherSupportUrl: https://www.microsoft.com/support/UK +PrivacyUrl: https://www.microsoft.com/privacy/UK +Author: Microsoft UK +PackageName: MSIX SDK UK +PackageUrl: https://www.microsoft.com/msixsdk/home/UK +License: MIT License UK +LicenseUrl: https://www.microsoft.com/msixsdk/license/UK +Copyright: Copyright Microsoft Corporation UK +CopyrightUrl: https://www.microsoft.com/msixsdk/copyright/UK +ShortDescription: This is MSIX SDK UK +Description: The MSIX SDK project is an effort to enable developers UK +Tags: + - "appxsdkUK" + - "msixsdkUK" +ReleaseNotes: Release notes +ReleaseNotesUrl: https://ReleaseNotes.net +PurchaseUrl: https://DefaultPurchaseUrl.com +InstallationNotes: Default installation notes +Agreements: + - AgreementLabel: Label + Agreement: Text + AgreementUrl: https://AgreementUrl.net +Documentations: + - DocumentLabel: Default document label + DocumentUrl: https://DefaultDocumentUrl.com +Icons: + - IconUrl: https://localeTestIcon-en-GB + IconFileType: png + IconResolution: 32x32 + IconTheme: light + IconSha256: 69D84CA8899800A5575CE31798293CD4FEBAB1D734A07C2E51E56A28E0DF8321 +ManifestType: locale +ManifestVersion: 1.9.0 diff --git a/src/AppInstallerCLITests/TestData/MultiFileManifestV1_9/ManifestV1_9-MultiFile-Version.yaml b/src/AppInstallerCLITests/TestData/MultiFileManifestV1_9/ManifestV1_9-MultiFile-Version.yaml new file mode 100644 index 0000000000..81f702970a --- /dev/null +++ b/src/AppInstallerCLITests/TestData/MultiFileManifestV1_9/ManifestV1_9-MultiFile-Version.yaml @@ -0,0 +1,5 @@ +PackageIdentifier: microsoft.msixsdk +PackageVersion: 1.7.32 +DefaultLocale: en-US +ManifestType: version +ManifestVersion: 1.9.0 diff --git a/src/AppInstallerCLITests/YamlManifest.cpp b/src/AppInstallerCLITests/YamlManifest.cpp index b7c1517b72..4764a6980a 100644 --- a/src/AppInstallerCLITests/YamlManifest.cpp +++ b/src/AppInstallerCLITests/YamlManifest.cpp @@ -261,6 +261,11 @@ namespace REQUIRE(defaultSwitches.at(InstallerSwitchType::Repair) == "/repair"); REQUIRE(manifest.DefaultInstallerInfo.RepairBehavior == RepairBehaviorEnum::Modify); } + + if (manifestVer >= ManifestVer{ s_ManifestVersionV1_9 }) + { + REQUIRE(manifest.DefaultInstallerInfo.ArchiveBinariesDependOnPath); + } } if (isSingleton || isExported) @@ -375,6 +380,11 @@ namespace REQUIRE(installer1.RepairBehavior == RepairBehaviorEnum::Modify); } + if (manifestVer >= ManifestVer{ s_ManifestVersionV1_9 }) + { + REQUIRE_FALSE(installer1.ArchiveBinariesDependOnPath); + } + if (!isSingleton) { if (!isExported) @@ -467,6 +477,12 @@ namespace REQUIRE(installer5.Switches.at(InstallerSwitchType::Repair) == "/repair"); REQUIRE(installer5.RepairBehavior == RepairBehaviorEnum::Modify); } + + if (manifestVer >= ManifestVer{ s_ManifestVersionV1_9 }) + { + ManifestInstaller installer4 = manifest.Installers.at(3); + REQUIRE(installer4.ArchiveBinariesDependOnPath); + } } // Localization @@ -1072,6 +1088,31 @@ TEST_CASE("ValidateV1_7GoodManifestAndVerifyContents", "[ManifestValidation]") VerifyV1ManifestContent(mergedManifest, false, ManifestVer{ s_ManifestVersionV1_7 }); } +TEST_CASE("ValidateV1_9GoodManifestAndVerifyContents", "[ManifestValidation]") +{ + ManifestValidateOption validateOption; + validateOption.FullValidation = true; + TempDirectory singletonDirectory{ "SingletonManifest" }; + CopyTestDataFilesToFolder({ "ManifestV1_9-Singleton.yaml" }, singletonDirectory); + Manifest singletonManifest = YamlParser::CreateFromPath(singletonDirectory, validateOption); + VerifyV1ManifestContent(singletonManifest, true, ManifestVer{ s_ManifestVersionV1_9 }); + + TempDirectory multiFileDirectory{ "MultiFileManifest" }; + CopyTestDataFilesToFolder({ + "ManifestV1_9-MultiFile-Version.yaml", + "ManifestV1_9-MultiFile-Installer.yaml", + "ManifestV1_9-MultiFile-DefaultLocale.yaml", + "ManifestV1_9-MultiFile-Locale.yaml" }, multiFileDirectory); + + TempFile mergedManifestFile{ "merged.yaml" }; + Manifest multiFileManifest = YamlParser::CreateFromPath(multiFileDirectory, validateOption, mergedManifestFile); + VerifyV1ManifestContent(multiFileManifest, false, ManifestVer{ s_ManifestVersionV1_9 }); + + // Read from merged manifest should have the same content as multi file manifest + Manifest mergedManifest = YamlParser::CreateFromPath(mergedManifestFile); + VerifyV1ManifestContent(mergedManifest, false, ManifestVer{ s_ManifestVersionV1_9 }); +} + TEST_CASE("WriteV1SingletonManifestAndVerifyContents", "[ManifestCreation]") { TempDirectory singletonDirectory{ "SingletonManifest" }; diff --git a/src/AppInstallerCommonCore/MSStoreDownload.cpp b/src/AppInstallerCommonCore/MSStoreDownload.cpp index 4db8b72d60..254987f3e1 100644 --- a/src/AppInstallerCommonCore/MSStoreDownload.cpp +++ b/src/AppInstallerCommonCore/MSStoreDownload.cpp @@ -786,7 +786,7 @@ namespace AppInstaller::MSStore { using PlatformAndArchitectureKey = std::pair; - // Since the server may return multiple versions of the same package, we'll use ths map to record the one with latest version + // Since the server may return multiple versions of the same package, we'll use this map to record the one with latest version // for each Platform|Architecture pair. std::map downloadFilesMap; diff --git a/src/AppInstallerCommonCore/Manifest/ManifestSchemaValidation.cpp b/src/AppInstallerCommonCore/Manifest/ManifestSchemaValidation.cpp index 31c0ed1b6d..2f2d064402 100644 --- a/src/AppInstallerCommonCore/Manifest/ManifestSchemaValidation.cpp +++ b/src/AppInstallerCommonCore/Manifest/ManifestSchemaValidation.cpp @@ -32,7 +32,8 @@ namespace AppInstaller::Manifest::YamlParser { "RequireExplicitUpgrade"sv, YamlScalarType::Bool }, { "DisplayInstallWarnings"sv, YamlScalarType::Bool }, { "InstallerReturnCode"sv, YamlScalarType::Int }, - { "DownloadCommandProhibited", YamlScalarType::Bool } + { "DownloadCommandProhibited", YamlScalarType::Bool }, + { "ArchiveBinariesDependOnPath", YamlScalarType::Bool } }; YamlScalarType GetManifestScalarValueType(const std::string& key) @@ -104,7 +105,17 @@ namespace AppInstaller::Manifest::YamlParser int idx = MANIFESTSCHEMA_NO_RESOURCE; std::map resourceMap; - if (manifestVersion >= ManifestVer{ s_ManifestVersionV1_7 }) + if (manifestVersion >= ManifestVer{ s_ManifestVersionV1_9 }) + { + resourceMap = { + { ManifestTypeEnum::Singleton, IDX_MANIFEST_SCHEMA_V1_9_SINGLETON }, + { ManifestTypeEnum::Version, IDX_MANIFEST_SCHEMA_V1_9_VERSION }, + { ManifestTypeEnum::Installer, IDX_MANIFEST_SCHEMA_V1_9_INSTALLER }, + { ManifestTypeEnum::DefaultLocale, IDX_MANIFEST_SCHEMA_V1_9_DEFAULTLOCALE }, + { ManifestTypeEnum::Locale, IDX_MANIFEST_SCHEMA_V1_9_LOCALE }, + }; + } + else if (manifestVersion >= ManifestVer{ s_ManifestVersionV1_7 }) { resourceMap = { { ManifestTypeEnum::Singleton, IDX_MANIFEST_SCHEMA_V1_7_SINGLETON }, @@ -230,4 +241,4 @@ namespace AppInstaller::Manifest::YamlParser return errors; } -} \ No newline at end of file +} diff --git a/src/AppInstallerCommonCore/Manifest/ManifestValidation.cpp b/src/AppInstallerCommonCore/Manifest/ManifestValidation.cpp index 1ff1bceaca..4b1da4fb92 100644 --- a/src/AppInstallerCommonCore/Manifest/ManifestValidation.cpp +++ b/src/AppInstallerCommonCore/Manifest/ManifestValidation.cpp @@ -63,7 +63,7 @@ namespace AppInstaller::Manifest { AppInstaller::Manifest::ManifestError::ArpValidationError, "Arp Validation Error."sv }, { AppInstaller::Manifest::ManifestError::SchemaError, "Schema Error."sv }, { AppInstaller::Manifest::ManifestError::MsixSignatureHashFailed, "Failed to calculate MSIX signature hash.Please verify that the input file is a valid, signed MSIX."sv }, - { AppInstaller::Manifest::ManifestError::ShadowManifestNotAllowed, "Shadow manifest is not allowed."} + { AppInstaller::Manifest::ManifestError::ShadowManifestNotAllowed, "Shadow manifest is not allowed." } }; return ErrorIdToMessageMap; @@ -414,4 +414,4 @@ namespace AppInstaller::Manifest return Utility::ConvertToUTF8(Message); } -} \ No newline at end of file +} diff --git a/src/AppInstallerCommonCore/Manifest/ManifestYamlPopulator.cpp b/src/AppInstallerCommonCore/Manifest/ManifestYamlPopulator.cpp index cf55ced326..51379004da 100644 --- a/src/AppInstallerCommonCore/Manifest/ManifestYamlPopulator.cpp +++ b/src/AppInstallerCommonCore/Manifest/ManifestYamlPopulator.cpp @@ -376,6 +376,16 @@ namespace AppInstaller::Manifest std::move(fields_v1_7.begin(), fields_v1_7.end(), std::inserter(result, result.end())); } + + if (m_manifestVersion.get() >= ManifestVer{ s_ManifestVersionV1_9 }) + { + std::vector fields_v1_9 = + { + { "ArchiveBinariesDependOnPath", [](const YAML::Node& value, const VariantManifestPtr& v)->ValidationErrors { GetManifestInstallerPtr(v)->ArchiveBinariesDependOnPath = value.as(); return {}; } }, + }; + + std::move(fields_v1_9.begin(), fields_v1_9.end(), std::inserter(result, result.end())); + } } return result; @@ -776,7 +786,7 @@ namespace AppInstaller::Manifest std::string key = keyValuePair.first.as(); const YAML::Node& valueNode = keyValuePair.second; - // We'll do case insensitive search first and validate correct case later. + // We'll do case-insensitive search first and validate correct case later. auto fieldIter = std::find_if(fieldInfos.begin(), fieldInfos.end(), [&](auto const& s) { @@ -1243,4 +1253,4 @@ namespace AppInstaller::Manifest return errors; } -} \ No newline at end of file +} diff --git a/src/AppInstallerCommonCore/Manifest/YamlWriter.cpp b/src/AppInstallerCommonCore/Manifest/YamlWriter.cpp index 61910e13e9..92f23dcbc1 100644 --- a/src/AppInstallerCommonCore/Manifest/YamlWriter.cpp +++ b/src/AppInstallerCommonCore/Manifest/YamlWriter.cpp @@ -66,7 +66,8 @@ namespace AppInstaller::Manifest::YamlWriter constexpr std::string_view DisplayName = "DisplayName"sv; constexpr std::string_view MinimumOSVersion = "MinimumOSVersion"sv; constexpr std::string_view DownloadCommandProhibited = "DownloadCommandProhibited"sv; - constexpr std::string_view RepairBehavior = "RepairBehavior"sv; + constexpr std::string_view RepairBehavior = "RepairBehavior"sv; + constexpr std::string_view ArchiveBinariesDependOnPath = "ArchiveBinariesDependOnPath"sv; // Installer switches constexpr std::string_view InstallerSwitches = "InstallerSwitches"sv; @@ -568,7 +569,8 @@ namespace AppInstaller::Manifest::YamlWriter WRITE_BOOL_PROPERTY(out, InstallLocationRequired, installer.InstallLocationRequired); WRITE_BOOL_PROPERTY(out, RequireExplicitUpgrade, installer.RequireExplicitUpgrade); WRITE_BOOL_PROPERTY(out, DisplayInstallWarnings, installer.DisplayInstallWarnings); - WRITE_BOOL_PROPERTY(out, DownloadCommandProhibited, installer.DownloadCommandProhibited); + WRITE_BOOL_PROPERTY(out, DownloadCommandProhibited, installer.DownloadCommandProhibited); + WRITE_BOOL_PROPERTY(out, ArchiveBinariesDependOnPath, installer.ArchiveBinariesDependOnPath); WRITE_PROPERTY_IF_EXISTS(out, MinimumOSVersion, installer.MinOSVersion); WRITE_PROPERTY_IF_EXISTS(out, ProductCode, installer.ProductCode); WRITE_PROPERTY_IF_EXISTS(out, UpgradeBehavior, UpdateBehaviorToString(installer.UpdateBehavior)); diff --git a/src/AppInstallerCommonCore/NetworkSettings.cpp b/src/AppInstallerCommonCore/NetworkSettings.cpp index 625df53f12..2cf8e24b7d 100644 --- a/src/AppInstallerCommonCore/NetworkSettings.cpp +++ b/src/AppInstallerCommonCore/NetworkSettings.cpp @@ -26,17 +26,21 @@ namespace AppInstaller::Settings InstallerDownloader NetworkSettings::GetInstallerDownloader() const { // The default is DeliveryOptimization. - // We only use WinINet if specified by settings, or if we want to use proxy (as DO does not support that) + // We use WinINet if specified by settings, or if we want to use proxy (as DO does not support that) InstallerDownloader setting = User().Get(); - if (setting != InstallerDownloader::WinInet && m_proxyUri) + if (m_proxyUri && setting != InstallerDownloader::WinInet) { AICLI_LOG(Core, Info, << "Forcing use of wininet for download as DO does not support proxy"); return InstallerDownloader::WinInet; } - else // Default or DO + else if (setting == InstallerDownloader::Default) { return InstallerDownloader::DeliveryOptimization; + } + else + { + return setting; } } diff --git a/src/AppInstallerCommonCore/Public/winget/Locale.h b/src/AppInstallerCommonCore/Public/winget/Locale.h index 5934a75239..f4cd7a2d54 100644 --- a/src/AppInstallerCommonCore/Public/winget/Locale.h +++ b/src/AppInstallerCommonCore/Public/winget/Locale.h @@ -20,6 +20,6 @@ namespace AppInstaller::Locale // Get the list of user Preferred Languages from settings. Returns an empty vector in rare cases of failure. std::vector GetUserPreferredLanguages(); - // Get the bcp47 tag from a locale id. Returns empty string if conversion can not be performed. + // Get the bcp47 tag from a locale id. Returns empty string if conversion cannot be performed. std::string LocaleIdToBcp47Tag(LCID localeId); } \ No newline at end of file diff --git a/src/AppInstallerCommonCore/Public/winget/ManifestCommon.h b/src/AppInstallerCommonCore/Public/winget/ManifestCommon.h index db2155bb9b..a5e8f42b5d 100644 --- a/src/AppInstallerCommonCore/Public/winget/ManifestCommon.h +++ b/src/AppInstallerCommonCore/Public/winget/ManifestCommon.h @@ -44,6 +44,9 @@ namespace AppInstaller::Manifest // V1.7 manifest version constexpr std::string_view s_ManifestVersionV1_7 = "1.7.0"sv; + // V1.9 manifest version + constexpr std::string_view s_ManifestVersionV1_9 = "1.9.0"sv; + // The manifest extension for the MS Store constexpr std::string_view s_MSStoreExtension = "msstore"sv; diff --git a/src/AppInstallerCommonCore/Public/winget/ManifestInstaller.h b/src/AppInstallerCommonCore/Public/winget/ManifestInstaller.h index c663271a76..e80d076f9c 100644 --- a/src/AppInstallerCommonCore/Public/winget/ManifestInstaller.h +++ b/src/AppInstallerCommonCore/Public/winget/ManifestInstaller.h @@ -115,5 +115,7 @@ namespace AppInstaller::Manifest InstallationMetadataInfo InstallationMetadata; bool DownloadCommandProhibited = false; + + bool ArchiveBinariesDependOnPath = false; }; -} \ No newline at end of file +} diff --git a/src/AppInstallerCommonCore/Public/winget/ManifestYamlPopulator.h b/src/AppInstallerCommonCore/Public/winget/ManifestYamlPopulator.h index 84874ea056..4c79f7e3f5 100644 --- a/src/AppInstallerCommonCore/Public/winget/ManifestYamlPopulator.h +++ b/src/AppInstallerCommonCore/Public/winget/ManifestYamlPopulator.h @@ -81,7 +81,7 @@ namespace AppInstaller::Manifest std::vector GetShadowLocalizationFieldProcessInfo(); // This method takes YAML root node and list of manifest field info. - // Yaml lib does not support case insensitive search and it allows duplicate keys. If duplicate keys exist, + // Yaml lib does not support case-insensitive search and it allows duplicate keys. If duplicate keys exist, // the value is undefined. So in this method, we will iterate through the node map and process each individual // pair ourselves. This also helps with generating aggregated error rather than throwing on first failure. std::vector ValidateAndProcessFields( diff --git a/src/AppInstallerCommonCore/Public/winget/ThreadGlobals.h b/src/AppInstallerCommonCore/Public/winget/ThreadGlobals.h index 2242c5be73..65e1a8270a 100644 --- a/src/AppInstallerCommonCore/Public/winget/ThreadGlobals.h +++ b/src/AppInstallerCommonCore/Public/winget/ThreadGlobals.h @@ -24,7 +24,7 @@ namespace AppInstaller::ThreadLocalStorage AppInstaller::Logging::TelemetryTraceLogger& GetTelemetryLogger(); // Set Globals for Current Thread - // Return RAII object with it's ownership to set the AppInstaller ThreadLocalStorage back to previous state + // Return RAII object with its ownership to set the AppInstaller ThreadLocalStorage back to previous state std::unique_ptr SetForCurrentThread() override; private: diff --git a/src/AppInstallerRepositoryCore/Microsoft/Schema/1_0/ManifestTable.cpp b/src/AppInstallerRepositoryCore/Microsoft/Schema/1_0/ManifestTable.cpp index 5b68ce2ed8..6c1b2cad0e 100644 --- a/src/AppInstallerRepositoryCore/Microsoft/Schema/1_0/ManifestTable.cpp +++ b/src/AppInstallerRepositoryCore/Microsoft/Schema/1_0/ManifestTable.cpp @@ -213,7 +213,7 @@ namespace AppInstaller::Repository::Microsoft::Schema::V1_0 } else { - builder.LiteralColumn(""); + builder.Value(std::string_view{}); } builder.As(valueAlias).From(s_ManifestTable_Table_Name); diff --git a/src/AppInstallerRepositoryCore/Microsoft/Schema/2_0/SystemReferenceStringTable.cpp b/src/AppInstallerRepositoryCore/Microsoft/Schema/2_0/SystemReferenceStringTable.cpp index 4abc75e07d..59b9d9156b 100644 --- a/src/AppInstallerRepositoryCore/Microsoft/Schema/2_0/SystemReferenceStringTable.cpp +++ b/src/AppInstallerRepositoryCore/Microsoft/Schema/2_0/SystemReferenceStringTable.cpp @@ -227,7 +227,7 @@ namespace AppInstaller::Repository::Microsoft::Schema::V2_0 // where table.value = and paired.pairedValue = builder.Select(). Column(QCol(tableName, s_SystemReferenceStringTable_PrimaryName)).As(primaryAlias). - LiteralColumn("").As(valueAlias). + Value(std::string_view{}).As(valueAlias). From(tableName). Join(pairedTableName).On(QCol(tableName, s_SystemReferenceStringTable_PrimaryName), QCol(pairedTableName, s_SystemReferenceStringTable_PrimaryName)). Where(QCol(tableName, valueName)); diff --git a/src/AppInstallerRepositoryCore/SourcePolicy.cpp b/src/AppInstallerRepositoryCore/SourcePolicy.cpp index 84a1859b0a..8df191947d 100644 --- a/src/AppInstallerRepositoryCore/SourcePolicy.cpp +++ b/src/AppInstallerRepositoryCore/SourcePolicy.cpp @@ -108,7 +108,7 @@ namespace AppInstaller::Repository // Case 2: // - The source is not a tombstone and we don't need the policy to be explicitly enabled. // - Check only against the source argument and type as the user source may have a different name. - // - Do a case insensitive check as the domain portion of the URL is case insensitive, + // - Do a case-insensitive check as the domain portion of the URL is case-insensitive, // and we don't need case sensitivity for the rest as we control the domain. if (Utility::CaseInsensitiveEquals(arg, GetWellKnownSourceArg(WellKnownSource::WinGet)) && Utility::CaseInsensitiveEquals(type, Microsoft::PreIndexedPackageSourceFactory::Type())) diff --git a/src/AppInstallerSharedLib/DateTime.cpp b/src/AppInstallerSharedLib/DateTime.cpp index c7a03db6c3..82b1fc8cb0 100644 --- a/src/AppInstallerSharedLib/DateTime.cpp +++ b/src/AppInstallerSharedLib/DateTime.cpp @@ -37,6 +37,13 @@ namespace AppInstaller::Utility } } + std::string TimePointToString(const std::chrono::system_clock::time_point& time, bool useRFC3339) + { + std::ostringstream stream; + OutputTimePoint(stream, time, useRFC3339); + return std::move(stream).str(); + } + std::string GetCurrentTimeForFilename() { std::stringstream stream; diff --git a/src/AppInstallerSharedLib/Errors.cpp b/src/AppInstallerSharedLib/Errors.cpp index 0503aacade..fea0fcad7c 100644 --- a/src/AppInstallerSharedLib/Errors.cpp +++ b/src/AppInstallerSharedLib/Errors.cpp @@ -12,13 +12,13 @@ namespace AppInstaller namespace { // A simple struct to hold the data - struct WinGetHResultData + struct HResultData { HRESULT Value; std::string_view Symbol; std::string_view Description; - bool operator<(const WinGetHResultData& other) const + bool operator<(const HResultData& other) const { return Value < other.Value; } @@ -31,7 +31,7 @@ namespace AppInstaller Errors::HResultInformation(value, symbol), m_unlocalizedDescription(unlocalizedDescription) {} - constexpr WinGetHResultInformation(const WinGetHResultData& data) : + constexpr WinGetHResultInformation(const HResultData& data) : Errors::HResultInformation(data.Value, data.Symbol), m_unlocalizedDescription(data.Description) {} @@ -54,7 +54,7 @@ namespace AppInstaller Errors::HResultInformation(value, symbol), m_unlocalizedDescription(unlocalizedDescription) {} - constexpr WinGetHResultInformationUnlocalized(const WinGetHResultData& data) : + constexpr WinGetHResultInformationUnlocalized(const HResultData& data) : Errors::HResultInformation(data.Value, data.Symbol), m_unlocalizedDescription(data.Description) {} @@ -83,9 +83,9 @@ namespace AppInstaller } }; -#define WINGET_HRESULT_INFO(_name_,_description_) WinGetHResultData{ _name_, #_name_, _description_ } +#define WINGET_HRESULT_INFO(_name_,_description_) HResultData{ _name_, #_name_, _description_ } - constexpr const WinGetHResultData s_wingetHResultData[] = + constexpr const HResultData s_wingetHResultData[] = { // Changes to any of these errors require the corresponding resource string in winget.resw to be updated. WINGET_HRESULT_INFO(APPINSTALLER_CLI_ERROR_INTERNAL_ERROR, "Internal Error"), @@ -216,8 +216,8 @@ namespace AppInstaller WINGET_HRESULT_INFO(APPINSTALLER_CLI_ERROR_SQLITE_CONNECTION_TERMINATED, "The SQLite connection was terminated to prevent corruption."), WINGET_HRESULT_INFO(APPINSTALLER_CLI_ERROR_DISPLAYCATALOG_API_FAILED, "Failed to get Microsoft Store package catalog."), WINGET_HRESULT_INFO(APPINSTALLER_CLI_ERROR_NO_APPLICABLE_DISPLAYCATALOG_PACKAGE, "No applicable Microsoft Store package found from Microsoft Store package catalog."), - WINGET_HRESULT_INFO(APPINSTALLER_CLI_ERROR_SFSCLIENT_API_FAILED, "Failed to get Microsoft Store package download infomation."), - WINGET_HRESULT_INFO(APPINSTALLER_CLI_ERROR_NO_APPLICABLE_SFSCLIENT_PACKAGE, "No applicable Microsoft Store package download infomation found."), + WINGET_HRESULT_INFO(APPINSTALLER_CLI_ERROR_SFSCLIENT_API_FAILED, "Failed to get Microsoft Store package download information."), + WINGET_HRESULT_INFO(APPINSTALLER_CLI_ERROR_NO_APPLICABLE_SFSCLIENT_PACKAGE, "No applicable Microsoft Store package download information found."), WINGET_HRESULT_INFO(APPINSTALLER_CLI_ERROR_LICENSING_API_FAILED, "Failed to retrieve Microsoft Store package license."), // Install errors. @@ -289,11 +289,21 @@ namespace AppInstaller WINGET_HRESULT_INFO(WINGET_INSTALLED_STATUS_FILE_FOUND_WITHOUT_HASH_CHECK, "The file was found but the hash was not checked."), }; - const WinGetHResultData* FindWinGetHResultData(HRESULT value) + // Map externally defined HRESULTs to error messages we want to use here + constexpr const HResultData s_externalHResultData[] = { - auto itr = std::lower_bound(std::cbegin(s_wingetHResultData), std::cend(s_wingetHResultData), WinGetHResultData{ value }); + // Changes to any of these errors require the corresponding resource string in winget.resw to be updated. + HResultData{ static_cast(0x803FB103), "StoreInstall_PackageNotAvailableForCurrentSystem", "The package is not compatible with the current Windows version or platform." }, + HResultData{ static_cast(0x803FB104), "StoreInstall_PackageNotAvailableForCurrentSystem", "The package is not compatible with the current Windows version or platform." }, + HResultData{ static_cast(0x803FB106), "StoreInstall_PackageNotAvailableForCurrentSystem", "The package is not compatible with the current Windows version or platform." }, + }; - if (itr != std::cend(s_wingetHResultData) && itr->Value == value) + template + const HResultData* FindHResultData(HRESULT value, const HResultData (&dataArray)[ArraySize]) + { + auto itr = std::lower_bound(std::cbegin(dataArray), std::cend(dataArray), HResultData{ value }); + + if (itr != std::cend(dataArray) && itr->Value == value) { return itr; } @@ -301,9 +311,19 @@ namespace AppInstaller return nullptr; } + const HResultData* FindWinGetHResultData(HRESULT value) + { + return FindHResultData(value, s_wingetHResultData); + } + + const HResultData* FindExternalHResultData(HRESULT value) + { + return FindHResultData(value, s_externalHResultData); + } + Utility::LocIndString GetMessageForAppInstallerHR(HRESULT hr) { - const WinGetHResultData* data = FindWinGetHResultData(hr); + const HResultData* data = FindWinGetHResultData(hr); return data ? WinGetHResultInformation(*data).GetDescription() : UnknownHResultInformation(hr).GetDescription(); @@ -319,7 +339,16 @@ namespace AppInstaller } else { - strstr << std::system_category().message(hr); + const HResultData* data = FindExternalHResultData(hr); + + if (data) + { + strstr << WinGetHResultInformation(*data).GetDescription(); + } + else + { + strstr << std::system_category().message(hr); + } } } } @@ -402,7 +431,7 @@ namespace AppInstaller { if (HRESULT_FACILITY(value) == APPINSTALLER_CLI_ERROR_FACILITY) { - const WinGetHResultData* data = FindWinGetHResultData(value); + const HResultData* data = FindWinGetHResultData(value); if (data) { @@ -425,7 +454,7 @@ namespace AppInstaller auto addToResultIf = [&](auto predicate) { - for (const WinGetHResultData& data : s_wingetHResultData) + for (const HResultData& data : s_wingetHResultData) { if (predicate(data) && std::none_of(result.begin(), result.end(), [&](const std::unique_ptr& info) { return info->Value() == data.Value; })) @@ -435,9 +464,9 @@ namespace AppInstaller } }; - addToResultIf([&](const WinGetHResultData& data) { return Utility::CaseInsensitiveEquals(data.Symbol, value); }); - addToResultIf([&](const WinGetHResultData& data) { return Utility::CaseInsensitiveContainsSubstring(data.Symbol, value); }); - addToResultIf([&](const WinGetHResultData& data) { return Utility::CaseInsensitiveContainsSubstring(data.Description, value); }); + addToResultIf([&](const HResultData& data) { return Utility::CaseInsensitiveEquals(data.Symbol, value); }); + addToResultIf([&](const HResultData& data) { return Utility::CaseInsensitiveContainsSubstring(data.Symbol, value); }); + addToResultIf([&](const HResultData& data) { return Utility::CaseInsensitiveContainsSubstring(data.Description, value); }); return result; } @@ -447,7 +476,7 @@ namespace AppInstaller std::vector> result; result.reserve(ARRAYSIZE(s_wingetHResultData)); - for (const WinGetHResultData& data : s_wingetHResultData) + for (const HResultData& data : s_wingetHResultData) { result.emplace_back(std::make_unique(data)); } diff --git a/src/AppInstallerSharedLib/Public/AppInstallerDateTime.h b/src/AppInstallerSharedLib/Public/AppInstallerDateTime.h index dc6d12915b..dfd7d756da 100644 --- a/src/AppInstallerSharedLib/Public/AppInstallerDateTime.h +++ b/src/AppInstallerSharedLib/Public/AppInstallerDateTime.h @@ -12,6 +12,9 @@ namespace AppInstaller::Utility // Time is also assumed to be after the epoch. void OutputTimePoint(std::ostream& stream, const std::chrono::system_clock::time_point& time, bool useRFC3339 = false); + // Converts the time point to a string using OutputTimePoint. + std::string TimePointToString(const std::chrono::system_clock::time_point& time, bool useRFC3339 = false); + // Gets the current time as a string. Can be used as a file name. std::string GetCurrentTimeForFilename(); diff --git a/src/AppInstallerSharedLib/Public/AppInstallerStrings.h b/src/AppInstallerSharedLib/Public/AppInstallerStrings.h index b2386801fb..a8b4939244 100644 --- a/src/AppInstallerSharedLib/Public/AppInstallerStrings.h +++ b/src/AppInstallerSharedLib/Public/AppInstallerStrings.h @@ -104,15 +104,15 @@ namespace AppInstaller::Utility using NormalizedString = NormalizedUTF8; - // Compares the two UTF8 strings in a case insensitive manner. + // Compares the two UTF8 strings in a case-insensitive manner. // Use this if one of the values is a known value, and thus ToLower is sufficient. bool CaseInsensitiveEquals(std::string_view a, std::string_view b); - // Compares the two UTF16 strings in a case insensitive manner. + // Compares the two UTF16 strings in a case-insensitive manner. // Use this if one of the values is a known value, and thus ToLower is sufficient. bool CaseInsensitiveEquals(std::wstring_view a, std::wstring_view b); - // Returns if a UTF8 string is contained within a vector in a case insensitive manner. + // Returns if a UTF8 string is contained within a vector in a case-insensitive manner. bool CaseInsensitiveContains(const std::vector& a, std::string_view b); // Determines if string a starts with string b. @@ -123,7 +123,7 @@ namespace AppInstaller::Utility // Use this if one of the values is a known value, and thus ToLower is sufficient. bool CaseInsensitiveContainsSubstring(std::string_view a, std::string_view b); - // Compares the two UTF8 strings in a case insensitive manner, using ICU for case folding. + // Compares the two UTF8 strings in a case-insensitive manner, using ICU for case folding. bool ICUCaseInsensitiveEquals(std::string_view a, std::string_view b); // Determines if string a starts with string b, using ICU for case folding. diff --git a/src/AppInstallerSharedLib/Public/winget/SQLiteDynamicStorage.h b/src/AppInstallerSharedLib/Public/winget/SQLiteDynamicStorage.h index 2e5ac7a021..14f11b74ac 100644 --- a/src/AppInstallerSharedLib/Public/winget/SQLiteDynamicStorage.h +++ b/src/AppInstallerSharedLib/Public/winget/SQLiteDynamicStorage.h @@ -34,7 +34,7 @@ namespace AppInstaller::SQLite TransactionLock(std::mutex& mutex); _Acquires_lock_(mutex) - TransactionLock(std::mutex& mutex, Connection& connection, std::string_view name); + TransactionLock(std::mutex& mutex, Connection& connection, std::string_view name, bool immediateWrite); // Abandons the transaction and any changes; releases the connection lock. void Rollback(bool throwOnError = true); @@ -44,12 +44,12 @@ namespace AppInstaller::SQLite private: std::lock_guard m_lock; - Savepoint m_transaction; + Transaction m_transaction; }; // Acquires the connection lock and begins a transaction on the database. // If the returned result is empty, the schema version has changed and the caller must handle this. - std::unique_ptr TryBeginTransaction(std::string_view name); + std::unique_ptr TryBeginTransaction(std::string_view name, bool immediateWrite); // Locks the connection for use during the schema upgrade. std::unique_ptr LockConnection(); diff --git a/src/AppInstallerSharedLib/Public/winget/SQLiteStatementBuilder.h b/src/AppInstallerSharedLib/Public/winget/SQLiteStatementBuilder.h index 498a6d5015..7de19998d7 100644 --- a/src/AppInstallerSharedLib/Public/winget/SQLiteStatementBuilder.h +++ b/src/AppInstallerSharedLib/Public/winget/SQLiteStatementBuilder.h @@ -282,6 +282,7 @@ namespace AppInstaller::SQLite::Builder StatementBuilder& Equals(details::unbound_t, std::optional index = {}); StatementBuilder& Equals(std::nullptr_t); StatementBuilder& Equals(); + StatementBuilder& Equals(const QualifiedColumn& column); template StatementBuilder& IsGreaterThan(const ValueType& value) @@ -302,8 +303,6 @@ namespace AppInstaller::SQLite::Builder StatementBuilder& LikeWithEscape(std::string_view value); StatementBuilder& Like(details::unbound_t); - StatementBuilder& LiteralColumn(std::string_view value); - StatementBuilder& Escape(std::string_view escapeChar); StatementBuilder& Not(); @@ -380,6 +379,17 @@ namespace AppInstaller::SQLite::Builder StatementBuilder& Column(const details::SubBuilder& column); StatementBuilder& EndColumns(); + // Set the columns null constraint. + StatementBuilder& NotNull(bool isTrue = true); + + // Set the column's default value. + template + StatementBuilder& Default(const ValueType& value) + { + m_stream << " DEFAULT (" << value << ")"; + return *this; + } + // Add the values clause for an insert statement. template StatementBuilder& Values(const ValueTypes&... values) diff --git a/src/AppInstallerSharedLib/Public/winget/SQLiteWrapper.h b/src/AppInstallerSharedLib/Public/winget/SQLiteWrapper.h index 6eb67d3df1..abf2a9ffa8 100644 --- a/src/AppInstallerSharedLib/Public/winget/SQLiteWrapper.h +++ b/src/AppInstallerSharedLib/Public/winget/SQLiteWrapper.h @@ -377,6 +377,39 @@ namespace AppInstaller::SQLite State m_state = State::Prepared; }; + // A SQLite transaction. + // Use as the beginning of a transaction stack, specifically when the transaction will write + // and the database is in WAL mode. + struct Transaction + { + // Creates a transaction, beginning it. + static Transaction Create(Connection& connection, std::string name, bool immediateWrite); + + Transaction(); + + Transaction(const Transaction&) = delete; + Transaction& operator=(const Transaction&) = delete; + + Transaction(Transaction&&) = default; + Transaction& operator=(Transaction&&) = default; + + ~Transaction(); + + // Rolls back the Transaction. + void Rollback(bool throwOnError = true); + + // Commits the Transaction. + void Commit(); + + private: + Transaction(Connection& connection, std::string&& name, bool immediateWrite); + + std::string m_name; + DestructionToken m_inProgress = true; + Statement m_rollback; + Statement m_commit; + }; + // A SQLite savepoint. struct Savepoint { diff --git a/src/AppInstallerSharedLib/Public/winget/SharedThreadGlobals.h b/src/AppInstallerSharedLib/Public/winget/SharedThreadGlobals.h index 9abfeb60b9..915f583b17 100644 --- a/src/AppInstallerSharedLib/Public/winget/SharedThreadGlobals.h +++ b/src/AppInstallerSharedLib/Public/winget/SharedThreadGlobals.h @@ -18,7 +18,7 @@ namespace AppInstaller::ThreadLocalStorage virtual void* GetTelemetryObject() = 0; // Set Globals for Current Thread - // Return RAII object with it's ownership to set the AppInstaller ThreadLocalStorage back to previous state + // Return RAII object with its ownership to set the AppInstaller ThreadLocalStorage back to previous state virtual std::unique_ptr SetForCurrentThread(); // Return Globals for Current Thread diff --git a/src/AppInstallerSharedLib/Public/winget/Yaml.h b/src/AppInstallerSharedLib/Public/winget/Yaml.h index dcf6bf006e..59e582f123 100644 --- a/src/AppInstallerSharedLib/Public/winget/Yaml.h +++ b/src/AppInstallerSharedLib/Public/winget/Yaml.h @@ -157,7 +157,7 @@ namespace AppInstaller::YAML Node& operator[](std::string_view key); const Node& operator[](std::string_view key) const; - // Gets a child node from the mapping by its name case insensitive. + // Gets a child node from the mapping by its name case-insensitive. Node& GetChildNode(std::string_view key); const Node& GetChildNode(std::string_view key) const; diff --git a/src/AppInstallerSharedLib/SQLiteDynamicStorage.cpp b/src/AppInstallerSharedLib/SQLiteDynamicStorage.cpp index 0925aae37e..42c0d97510 100644 --- a/src/AppInstallerSharedLib/SQLiteDynamicStorage.cpp +++ b/src/AppInstallerSharedLib/SQLiteDynamicStorage.cpp @@ -54,10 +54,10 @@ namespace AppInstaller::SQLite } _Acquires_lock_(mutex) - SQLiteDynamicStorage::TransactionLock::TransactionLock(std::mutex& mutex, Connection& connection, std::string_view name) : + SQLiteDynamicStorage::TransactionLock::TransactionLock(std::mutex& mutex, Connection& connection, std::string_view name, bool immediateWrite) : m_lock(mutex) { - m_transaction = Savepoint::Create(connection, std::string{ name }); + m_transaction = Transaction::Create(connection, std::string{ name }, immediateWrite); } void SQLiteDynamicStorage::TransactionLock::Rollback(bool throwOnError) @@ -70,9 +70,9 @@ namespace AppInstaller::SQLite m_transaction.Commit(); } - std::unique_ptr SQLiteDynamicStorage::TryBeginTransaction(std::string_view name) + std::unique_ptr SQLiteDynamicStorage::TryBeginTransaction(std::string_view name, bool immediateWrite) { - auto result = std::make_unique(*m_interfaceLock, m_dbconn, name); + auto result = std::make_unique(*m_interfaceLock, m_dbconn, name, immediateWrite); Version currentVersion = Version::GetSchemaVersion(m_dbconn); if (currentVersion != m_version) diff --git a/src/AppInstallerSharedLib/SQLiteStatementBuilder.cpp b/src/AppInstallerSharedLib/SQLiteStatementBuilder.cpp index 1cecb37772..a28644025b 100644 --- a/src/AppInstallerSharedLib/SQLiteStatementBuilder.cpp +++ b/src/AppInstallerSharedLib/SQLiteStatementBuilder.cpp @@ -358,6 +358,12 @@ namespace AppInstaller::SQLite::Builder return *this; } + StatementBuilder& StatementBuilder::Equals(const QualifiedColumn& column) + { + OutputColumns(m_stream, " = ", column); + return *this; + } + StatementBuilder& StatementBuilder::IsGreaterThan(details::unbound_t, std::optional index) { AppendOpAndBinder(Op::GreaterThan, index); @@ -382,17 +388,6 @@ namespace AppInstaller::SQLite::Builder return *this; } - StatementBuilder& StatementBuilder::LiteralColumn(std::string_view value) - { - if (m_needsComma) - { - m_stream << ", "; - } - AddBindFunctor(AppendOpAndBinder(Op::Literal), value); - m_needsComma = true; - return *this; - } - StatementBuilder& StatementBuilder::Escape(std::string_view escapeChar) { THROW_HR_IF(E_INVALIDARG, escapeChar.length() != 1); @@ -679,6 +674,15 @@ namespace AppInstaller::SQLite::Builder return *this; } + StatementBuilder& StatementBuilder::NotNull(bool isTrue) + { + if (isTrue) + { + m_stream << " NOT NULL"; + } + return *this; + } + StatementBuilder& StatementBuilder::BeginValues() { m_stream << " VALUES ("; diff --git a/src/AppInstallerSharedLib/SQLiteWrapper.cpp b/src/AppInstallerSharedLib/SQLiteWrapper.cpp index 925aabdd59..22c8c06f10 100644 --- a/src/AppInstallerSharedLib/SQLiteWrapper.cpp +++ b/src/AppInstallerSharedLib/SQLiteWrapper.cpp @@ -374,6 +374,67 @@ namespace AppInstaller::SQLite m_state = State::Prepared; } + Transaction::Transaction() : m_inProgress(false) + {} + + Transaction::Transaction(Connection& connection, std::string&& name, bool immediateWrite) : + m_name(std::move(name)) + { + using namespace std::string_literals; + + Statement begin = Statement::Create(connection, "BEGIN "s + (immediateWrite ? "IMMEDIATE" : "DEFERRED")); + m_rollback = Statement::Create(connection, "ROLLBACK"); + m_commit = Statement::Create(connection, "COMMIT"); + + AICLI_LOG(SQL, Verbose, << "Begin transaction: " << m_name); + begin.Step(); + } + + Transaction Transaction::Create(Connection& connection, std::string name, bool immediateWrite) + { + return { connection, std::move(name), immediateWrite }; + } + + Transaction::~Transaction() + { + // Prevent a termination by not throwing on errors here + Rollback(false); + } + + void Transaction::Rollback(bool throwOnError) + { + if (m_inProgress) + { + // Only try rollback once + m_inProgress = false; + + try + { + AICLI_LOG(SQL, Verbose, << "Roll back transaction: " << m_name); + m_rollback.Step(true); + } + catch (...) + { + if (throwOnError) + { + throw; + } + + LOG_CAUGHT_EXCEPTION(); + } + } + } + + void Transaction::Commit() + { + if (m_inProgress) + { + AICLI_LOG(SQL, Verbose, << "Commit transaction: " << m_name); + m_commit.Step(); + m_inProgress = false; + } + } + Savepoint::Savepoint() : m_inProgress(false) {} diff --git a/src/ConfigurationRemotingServer/ConfigurationRemotingServer.csproj b/src/ConfigurationRemotingServer/ConfigurationRemotingServer.csproj index 979171e0f8..a105353ce4 100644 --- a/src/ConfigurationRemotingServer/ConfigurationRemotingServer.csproj +++ b/src/ConfigurationRemotingServer/ConfigurationRemotingServer.csproj @@ -39,11 +39,11 @@ - - + + - - + + diff --git a/src/ConfigurationRemotingServer/Program.cs b/src/ConfigurationRemotingServer/Program.cs index 6a79a64bd6..1185e4037a 100644 --- a/src/ConfigurationRemotingServer/Program.cs +++ b/src/ConfigurationRemotingServer/Program.cs @@ -70,6 +70,9 @@ internal class Program static int Main(string[] args) { + // Remove any attached console to prevent modules (or their actions) from writing to our console. + FreeConsole(); + // Help find WindowsPackageManager.dll AssemblyLoadContext.Default.ResolvingUnmanagedDll += NativeAssemblyLoadContext.ResolvingUnmanagedHandler; @@ -196,5 +199,9 @@ private static extern int WindowsPackageManagerConfigurationCompleteOutOfProcess [DllImport("kernel32.dll", CharSet = CharSet.Unicode)] private static extern IntPtr GetCommandLineW(); + + [DllImport("kernel32.dll")] + [return: MarshalAs(UnmanagedType.Bool)] + private static extern bool FreeConsole(); } } diff --git a/src/LocalhostWebServer/InstallDevCert.ps1 b/src/LocalhostWebServer/InstallDevCert.ps1 deleted file mode 100644 index 3299d819ea..0000000000 --- a/src/LocalhostWebServer/InstallDevCert.ps1 +++ /dev/null @@ -1,15 +0,0 @@ -param( - [Parameter(Mandatory=$true)] - [string]$pfxpath, - - [Parameter(Mandatory=$true)] - [string]$password -) - -Add-Type -AssemblyName System.Security -$cert = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2 -$cert.Import($pfxpath, $password, [System.Security.Cryptography.X509Certificates.X509KeyStorageFlags]"PersistKeySet") -$store = new-object system.security.cryptography.X509Certificates.X509Store -argumentlist "Root", LocalMachine -$store.Open([System.Security.Cryptography.X509Certificates.OpenFlags]"ReadWrite") -$store.Add($cert) -$store.Close() \ No newline at end of file diff --git a/src/LocalhostWebServer/Program.cs b/src/LocalhostWebServer/Program.cs index df84c6416c..11e06a0b58 100644 --- a/src/LocalhostWebServer/Program.cs +++ b/src/LocalhostWebServer/Program.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. namespace LocalhostWebServer @@ -35,6 +35,7 @@ static void Main(string[] args) Startup.OutCertFile = config.GetValue("OutCertFile"); Startup.LocalSourceJson = config.GetValue("LocalSourceJson"); Startup.TestDataPath = config.GetValue("TestDataPath"); + Startup.ExitBeforeRun = config.GetValue("ExitBeforeRun"); if (string.IsNullOrEmpty(Startup.StaticFileRoot) || string.IsNullOrEmpty(Startup.CertPath)) @@ -127,6 +128,11 @@ static void Main(string[] args) CopyDirectoryRecursive(Startup.TestDataPath, testDataDirectory); } + if (Startup.ExitBeforeRun) + { + return; + } + CreateHostBuilder(args).Build().Run(); } @@ -158,7 +164,7 @@ private static void CopyDirectoryRecursive(string sourceDir, string destDir) foreach (string file in files) { string dest = Path.Combine(destDir, Path.GetFileName(file)); - File.Copy(file, dest); + File.Copy(file, dest, overwrite: true); } string[] directories = Directory.GetDirectories(sourceDir); @@ -169,4 +175,4 @@ private static void CopyDirectoryRecursive(string sourceDir, string destDir) } } } -} \ No newline at end of file +} diff --git a/src/LocalhostWebServer/Run-LocalhostWebServer.ps1 b/src/LocalhostWebServer/Run-LocalhostWebServer.ps1 index a8142e6f21..d3d0352038 100644 --- a/src/LocalhostWebServer/Run-LocalhostWebServer.ps1 +++ b/src/LocalhostWebServer/Run-LocalhostWebServer.ps1 @@ -40,7 +40,10 @@ param( [string]$SourceCert, [Parameter()] - [string]$TestDataPath + [string]$TestDataPath, + + [Parameter()] + [switch]$ExitBeforeRun ) if (-not [System.String]::IsNullOrEmpty($sourceCert)) @@ -51,6 +54,23 @@ if (-not [System.String]::IsNullOrEmpty($sourceCert)) Push-Location $BuildRoot -Start-Process -FilePath "LocalhostWebServer.exe" -ArgumentList "StaticFileRoot=$StaticFileRoot CertPath=$CertPath CertPassword=$CertPassword OutCertFile=$OutCertFile LocalSourceJson=$LocalSourceJson TestDataPath=$TestDataPath" +$startProcessArguments = @{ + FilePath = Join-Path $BuildRoot "LocalhostWebServer.exe" + ArgumentList = "StaticFileRoot=$StaticFileRoot CertPath=$CertPath CertPassword=$CertPassword OutCertFile=$OutCertFile LocalSourceJson=$LocalSourceJson TestDataPath=$TestDataPath ExitBeforeRun=$ExitBeforeRun" + PassThru = $true +} + +if (-not [System.string]::IsNullOrEmpty($env:artifactsDir)) +{ + $startProcessArguments.RedirectStandardOutput = Join-Path $env:artifactsDir "LocalhostWebServer.out" + $startProcessArguments.RedirectStandardError = Join-Path $env:artifactsDir "LocalhostWebServer.err" +} + +$Local:process = Start-Process @startProcessArguments + +if ($ExitBeforeRun) +{ + Wait-Process -InputObject $Local:process +} -Pop-Location \ No newline at end of file +Pop-Location diff --git a/src/LocalhostWebServer/Startup.cs b/src/LocalhostWebServer/Startup.cs index 3c5957adf4..a0348c485c 100644 --- a/src/LocalhostWebServer/Startup.cs +++ b/src/LocalhostWebServer/Startup.cs @@ -29,6 +29,8 @@ public class Startup public static string TestDataPath { get; set; } + public static bool ExitBeforeRun { get; set; } + public Startup(IConfiguration configuration) { Configuration = configuration; diff --git a/src/ManifestSchema/ManifestSchema.h b/src/ManifestSchema/ManifestSchema.h index 4a9ebf41fa..4c9762e4bb 100644 --- a/src/ManifestSchema/ManifestSchema.h +++ b/src/ManifestSchema/ManifestSchema.h @@ -50,3 +50,9 @@ #define IDX_MANIFEST_SCHEMA_V1_7_INSTALLER 234 #define IDX_MANIFEST_SCHEMA_V1_7_DEFAULTLOCALE 235 #define IDX_MANIFEST_SCHEMA_V1_7_LOCALE 236 + +#define IDX_MANIFEST_SCHEMA_V1_9_SINGLETON 237 +#define IDX_MANIFEST_SCHEMA_V1_9_VERSION 238 +#define IDX_MANIFEST_SCHEMA_V1_9_INSTALLER 239 +#define IDX_MANIFEST_SCHEMA_V1_9_DEFAULTLOCALE 240 +#define IDX_MANIFEST_SCHEMA_V1_9_LOCALE 241 diff --git a/src/ManifestSchema/ManifestSchema.rc b/src/ManifestSchema/ManifestSchema.rc index ba3db3ec06..6f86e0a977 100644 --- a/src/ManifestSchema/ManifestSchema.rc +++ b/src/ManifestSchema/ManifestSchema.rc @@ -105,4 +105,10 @@ IDX_MANIFEST_SCHEMA_V1_7_SINGLETON MANIFESTSCHEMA_RESOURCE_TYPE "..\ IDX_MANIFEST_SCHEMA_V1_7_VERSION MANIFESTSCHEMA_RESOURCE_TYPE "..\\..\\schemas\\JSON\\manifests\\v1.7.0\\manifest.version.1.7.0.json" IDX_MANIFEST_SCHEMA_V1_7_INSTALLER MANIFESTSCHEMA_RESOURCE_TYPE "..\\..\\schemas\\JSON\\manifests\\v1.7.0\\manifest.installer.1.7.0.json" IDX_MANIFEST_SCHEMA_V1_7_DEFAULTLOCALE MANIFESTSCHEMA_RESOURCE_TYPE "..\\..\\schemas\\JSON\\manifests\\v1.7.0\\manifest.defaultLocale.1.7.0.json" -IDX_MANIFEST_SCHEMA_V1_7_LOCALE MANIFESTSCHEMA_RESOURCE_TYPE "..\\..\\schemas\\JSON\\manifests\\v1.7.0\\manifest.locale.1.7.0.json" \ No newline at end of file +IDX_MANIFEST_SCHEMA_V1_7_LOCALE MANIFESTSCHEMA_RESOURCE_TYPE "..\\..\\schemas\\JSON\\manifests\\v1.7.0\\manifest.locale.1.7.0.json" + +IDX_MANIFEST_SCHEMA_V1_9_SINGLETON MANIFESTSCHEMA_RESOURCE_TYPE "..\\..\\schemas\\JSON\\manifests\\v1.9.0\\manifest.singleton.1.9.0.json" +IDX_MANIFEST_SCHEMA_V1_9_VERSION MANIFESTSCHEMA_RESOURCE_TYPE "..\\..\\schemas\\JSON\\manifests\\v1.9.0\\manifest.version.1.9.0.json" +IDX_MANIFEST_SCHEMA_V1_9_INSTALLER MANIFESTSCHEMA_RESOURCE_TYPE "..\\..\\schemas\\JSON\\manifests\\v1.9.0\\manifest.installer.1.9.0.json" +IDX_MANIFEST_SCHEMA_V1_9_DEFAULTLOCALE MANIFESTSCHEMA_RESOURCE_TYPE "..\\..\\schemas\\JSON\\manifests\\v1.9.0\\manifest.defaultLocale.1.9.0.json" +IDX_MANIFEST_SCHEMA_V1_9_LOCALE MANIFESTSCHEMA_RESOURCE_TYPE "..\\..\\schemas\\JSON\\manifests\\v1.9.0\\manifest.locale.1.9.0.json" diff --git a/src/ManifestSchema/ManifestSchema.vcxitems b/src/ManifestSchema/ManifestSchema.vcxitems index fff19a9f0f..80fdfbec4a 100644 --- a/src/ManifestSchema/ManifestSchema.vcxitems +++ b/src/ManifestSchema/ManifestSchema.vcxitems @@ -57,5 +57,10 @@ + + + + + \ No newline at end of file diff --git a/src/ManifestSchema/ManifestSchema.vcxitems.filters b/src/ManifestSchema/ManifestSchema.vcxitems.filters index afab05e70f..ba39358ca6 100644 --- a/src/ManifestSchema/ManifestSchema.vcxitems.filters +++ b/src/ManifestSchema/ManifestSchema.vcxitems.filters @@ -28,6 +28,9 @@ {040a7f05-fd31-466c-bb71-0d59e4cdf1c4} + + {f7069050-9235-44e0-ab07-72e4addfd765} + @@ -145,5 +148,20 @@ schema\v1.7.0 + + schema\v1.9.0 + + + schema\v1.9.0 + + + schema\v1.9.0 + + + schema\v1.9.0 + + + schema\v1.9.0 + \ No newline at end of file diff --git a/src/Microsoft.Management.Configuration.UnitTests/Fixtures/UnitTestFixture.cs b/src/Microsoft.Management.Configuration.UnitTests/Fixtures/UnitTestFixture.cs index 865ca52c14..bec822c5fb 100644 --- a/src/Microsoft.Management.Configuration.UnitTests/Fixtures/UnitTestFixture.cs +++ b/src/Microsoft.Management.Configuration.UnitTests/Fixtures/UnitTestFixture.cs @@ -40,16 +40,22 @@ public UnitTestFixture(IMessageSink messageSink) throw new DirectoryNotFoundException(this.TestModulesPath); } - string? gitSearchPath = Path.GetDirectoryName(assemblyPath); + // Use the environment variable if present, which is how ADO pipelines will find it. + string? gitSearchPath = Environment.GetEnvironmentVariable("BUILD_SOURCESDIRECTORY"); - while (!string.IsNullOrEmpty(gitSearchPath)) + if (string.IsNullOrWhiteSpace(gitSearchPath)) { - if (Directory.Exists(Path.Combine(gitSearchPath, ".git"))) + gitSearchPath = Path.GetDirectoryName(assemblyPath); + + while (!string.IsNullOrEmpty(gitSearchPath)) { - break; - } + if (Directory.Exists(Path.Combine(gitSearchPath, ".git"))) + { + break; + } - gitSearchPath = Path.GetDirectoryName(gitSearchPath); + gitSearchPath = Path.GetDirectoryName(gitSearchPath); + } } this.GitRootPath = gitSearchPath ?? throw new DirectoryNotFoundException("git root path"); diff --git a/src/Microsoft.Management.Configuration.UnitTests/Helpers/OutOfProcAttribute.cs b/src/Microsoft.Management.Configuration.UnitTests/Helpers/OutOfProcAttribute.cs index c6613eeae9..58c4b1491c 100644 --- a/src/Microsoft.Management.Configuration.UnitTests/Helpers/OutOfProcAttribute.cs +++ b/src/Microsoft.Management.Configuration.UnitTests/Helpers/OutOfProcAttribute.cs @@ -23,6 +23,10 @@ public OutOfProcAttribute() { // To run the tests OOP, you need to replace Microsoft.Management.Configuration.dll with Microsoft.Management.Configuration.OutOfProc.dll (renamed to remove the OutOfProc). // You will also need to copy over Microsoft.Management.Configuration.winmd as it is needed by COM. + // + // You can use the script to do this: + // \src\Microsoft.Management.Configuration.OutOfProc\Prepare-ConfigurationOOPTests.ps1 -BuildOutputPath \src\x64\Debug + // // It can be easier to run the tests on the command line because any changes needing a recompile will overwrite the DLL update above. // The test runner is located somewhere like this: // C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\Extensions\TestPlatform diff --git a/src/Microsoft.Management.Configuration.UnitTests/Helpers/OutOfProcDiscoverer.cs b/src/Microsoft.Management.Configuration.UnitTests/Helpers/OutOfProcDiscoverer.cs index d5e3a24397..fed7070c6f 100644 --- a/src/Microsoft.Management.Configuration.UnitTests/Helpers/OutOfProcDiscoverer.cs +++ b/src/Microsoft.Management.Configuration.UnitTests/Helpers/OutOfProcDiscoverer.cs @@ -1,4 +1,4 @@ -// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- // // Copyright (c) Microsoft Corporation. Licensed under the MIT License. // diff --git a/src/Microsoft.Management.Configuration.UnitTests/Helpers/TestConfigurationSetProcessor.cs b/src/Microsoft.Management.Configuration.UnitTests/Helpers/TestConfigurationSetProcessor.cs index 2dfedac1ec..dfc760a931 100644 --- a/src/Microsoft.Management.Configuration.UnitTests/Helpers/TestConfigurationSetProcessor.cs +++ b/src/Microsoft.Management.Configuration.UnitTests/Helpers/TestConfigurationSetProcessor.cs @@ -1,4 +1,4 @@ -// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- // // Copyright (c) Microsoft Corporation. Licensed under the MIT License. // @@ -41,6 +41,11 @@ internal TestConfigurationSetProcessor(ConfigurationSet? set) internal Dictionary Exceptions { get; set; } = new Dictionary(); + /// + /// Gets or sets a value indicating whether the default unit processors for groups will enable group processing. + /// + internal bool EnableDefaultGroupProcessorCreation { get; set; } = false; + /// /// Gets the ConfigurationSet that this processor targets. /// @@ -60,7 +65,14 @@ public IConfigurationUnitProcessor CreateUnitProcessor(ConfigurationUnit unit) if (!this.Processors.ContainsKey(unit)) { - this.Processors.Add(unit, new TestConfigurationUnitProcessor(unit)); + if (this.EnableDefaultGroupProcessorCreation && unit.IsGroup) + { + this.Processors.Add(unit, new TestConfigurationUnitGroupProcessor(unit)); + } + else + { + this.Processors.Add(unit, new TestConfigurationUnitProcessor(unit)); + } } return this.Processors[unit]; diff --git a/src/Microsoft.Management.Configuration.UnitTests/Microsoft.Management.Configuration.UnitTests.csproj b/src/Microsoft.Management.Configuration.UnitTests/Microsoft.Management.Configuration.UnitTests.csproj index 52645fa70b..2e501f4fa5 100644 --- a/src/Microsoft.Management.Configuration.UnitTests/Microsoft.Management.Configuration.UnitTests.csproj +++ b/src/Microsoft.Management.Configuration.UnitTests/Microsoft.Management.Configuration.UnitTests.csproj @@ -35,7 +35,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/src/Microsoft.Management.Configuration.UnitTests/Tests/ConfigurationHistoryTests.cs b/src/Microsoft.Management.Configuration.UnitTests/Tests/ConfigurationHistoryTests.cs index db71cd428e..210a5d4d93 100644 --- a/src/Microsoft.Management.Configuration.UnitTests/Tests/ConfigurationHistoryTests.cs +++ b/src/Microsoft.Management.Configuration.UnitTests/Tests/ConfigurationHistoryTests.cs @@ -21,7 +21,7 @@ namespace Microsoft.Management.Configuration.UnitTests.Tests /// Unit tests for configuration history. /// [Collection("UnitTestCollection")] - [OutOfProc] + [InProc] public class ConfigurationHistoryTests : ConfigurationProcessorTestBase { /// @@ -38,6 +38,7 @@ public ConfigurationHistoryTests(UnitTestFixture fixture, ITestOutputHelper log) /// Checks that the history matches the applied set. /// [Fact] + [OutOfProc] public void ApplySet_HistoryMatches_0_1() { this.RunApplyHistoryMatchTest( @@ -79,6 +80,7 @@ public void ApplySet_HistoryMatches_0_1() /// Checks that the history matches the applied set. /// [Fact] + [OutOfProc] public void ApplySet_HistoryMatches_0_2() { this.RunApplyHistoryMatchTest( @@ -168,13 +170,14 @@ public void ApplySet_HistoryMatches_0_3() i: '7' j: 8 q: 42 -", new string[] { "AssertIdentifier2" }); +"); } /// /// Applies a set, reads the history, changes the read set and reapplies it. /// [Fact] + [OutOfProc] public void ApplySet_ChangeHistory() { string disabledIdentifier = "AssertIdentifier2"; @@ -241,6 +244,7 @@ public void ApplySet_ChangeHistory() /// Applies a set, reads the history and removes it. /// [Fact] + [OutOfProc] public void ApplySet_RemoveHistory() { ConfigurationSet returnedSet = this.RunApplyHistoryMatchTest( @@ -301,6 +305,9 @@ private ConfigurationSet RunApplyHistoryMatchTest(string contents, string[]? ina ConfigurationSet configurationSet = configurationSetResult.Set; Assert.NotNull(configurationSet); + TestConfigurationSetProcessor setProcessor = factory.CreateTestProcessor(configurationSet); + setProcessor.EnableDefaultGroupProcessorCreation = true; + configurationSet.Name = "Test Name"; configurationSet.Origin = "Test Origin"; configurationSet.Path = "Test Path"; @@ -334,6 +341,7 @@ private ConfigurationSet RunApplyHistoryMatchTest(string contents, string[]? ina } this.AssertSetsEqual(configurationSet, historySet); + this.AssertResultsEqual(result, historySet); return historySet; } @@ -343,7 +351,15 @@ private void AssertSetsEqual(ConfigurationSet expectedSet, [NotNull] Configurati Assert.Equal(expectedSet.Name, actualSet.Name); Assert.Equal(expectedSet.Origin, actualSet.Origin); Assert.Equal(expectedSet.Path, actualSet.Path); - Assert.NotEqual(DateTimeOffset.UnixEpoch, actualSet.FirstApply); + + Assert.Equal(ConfigurationSetState.Completed, actualSet.State); + + this.AssertTimeNotZero(actualSet.FirstApply); + this.AssertTimeNotZero(actualSet.ApplyBegun); + this.AssertTimeNotZero(actualSet.ApplyEnded); + Assert.True(actualSet.FirstApply <= actualSet.ApplyBegun); + Assert.True(actualSet.ApplyBegun <= actualSet.ApplyEnded); + Assert.Equal(expectedSet.SchemaVersion, actualSet.SchemaVersion); Assert.Equal(expectedSet.SchemaUri, actualSet.SchemaUri); Assert.True(expectedSet.Metadata.ContentEquals(actualSet.Metadata)); @@ -351,6 +367,12 @@ private void AssertSetsEqual(ConfigurationSet expectedSet, [NotNull] Configurati this.AssertUnitsListEqual(expectedSet.Units, actualSet.Units); } + private void AssertTimeNotZero(DateTimeOffset actualTime) + { + Assert.NotEqual(DateTimeOffset.UnixEpoch, actualTime); + Assert.NotEqual(DateTimeOffset.MinValue, actualTime); + } + private void AssertUnitsListEqual(IList expectedUnits, IList actualUnits) { Assert.Equal(expectedUnits.Count, actualUnits.Count); @@ -387,5 +409,64 @@ private void AssertUnitsEqual(ConfigurationUnit expectedUnit, ConfigurationUnit? this.AssertUnitsListEqual(expectedUnit.Units, actualUnit.Units); } } + + private void AssertResultsEqual(ApplyConfigurationSetResult expected, ConfigurationSet actualSet) + { + List actualUnitList = new List(); + + foreach (ConfigurationUnit unit in actualSet.Units) + { + this.AccumulateUnits(actualUnitList, unit); + } + + foreach (ApplyConfigurationUnitResult expectedUnitResult in expected.UnitResults) + { + ConfigurationUnit? actualUnit = null; + foreach (ConfigurationUnit historyUnit in actualUnitList) + { + if (historyUnit.InstanceIdentifier == expectedUnitResult.Unit.InstanceIdentifier) + { + actualUnit = historyUnit; + } + } + + this.AssertUnitResultsEqual(expectedUnitResult, actualUnit); + } + } + + private void AccumulateUnits(List unitList, ConfigurationUnit unit) + { + unitList.Add(unit); + if (unit.IsGroup) + { + foreach (ConfigurationUnit child in unit.Units) + { + this.AccumulateUnits(unitList, child); + } + } + } + + private void AssertUnitResultsEqual(ApplyConfigurationUnitResult expectedResult, ConfigurationUnit? actualUnit) + { + Assert.NotNull(actualUnit); + Assert.Equal(expectedResult.State, actualUnit.State); + + var expectedResultInformation = expectedResult.ResultInformation; + if (expectedResultInformation != null) + { + var actualResultInformation = actualUnit.ResultInformation; + Assert.NotNull(actualResultInformation); + + Assert.Equal(expectedResultInformation.ResultCode == null, actualResultInformation.ResultCode == null); + if (expectedResultInformation.ResultCode != null) + { + Assert.Equal(expectedResultInformation.ResultCode.HResult, actualResultInformation.ResultCode!.HResult); + } + + Assert.Equal(expectedResultInformation.Description, actualResultInformation.Description); + Assert.Equal(expectedResultInformation.Details, actualResultInformation.Details); + Assert.Equal(expectedResultInformation.ResultSource, actualResultInformation.ResultSource); + } + } } } diff --git a/src/Microsoft.Management.Configuration.UnitTests/Tests/ConfigurationProcessorApplyTests.cs b/src/Microsoft.Management.Configuration.UnitTests/Tests/ConfigurationProcessorApplyTests.cs index 5ec50d87aa..0a93758625 100644 --- a/src/Microsoft.Management.Configuration.UnitTests/Tests/ConfigurationProcessorApplyTests.cs +++ b/src/Microsoft.Management.Configuration.UnitTests/Tests/ConfigurationProcessorApplyTests.cs @@ -418,6 +418,12 @@ public void ApplySet_Progress() new ExpectedConfigurationChangeData() { Change = ConfigurationSetChangeEventType.SetStateChanged, SetState = ConfigurationSetState.Completed }, }; + // Drop the pending event if it happens to be present + if (progressEvents.Count > 0 && progressEvents[0].Change == ConfigurationSetChangeEventType.SetStateChanged && progressEvents[0].SetState == ConfigurationSetState.Pending) + { + progressEvents.RemoveAt(0); + } + Assert.Equal(expectedProgress.Count(), progressEvents.Count); for (int i = 0; i < progressEvents.Count; ++i) @@ -531,6 +537,8 @@ public void ApplySet_Sequenced() waitingUnitApply.Set(); WaitOn(waitingProgress); Assert.Equal(ConfigurationSetState.Completed, progressState); + + waitingSetOperation.AsTask().Wait(); } /// diff --git a/src/Microsoft.Management.Configuration.UnitTests/Tests/ConfigurationProcessorTelemetryTests.cs b/src/Microsoft.Management.Configuration.UnitTests/Tests/ConfigurationProcessorTelemetryTests.cs index aff7f271c8..3910de7ee0 100644 --- a/src/Microsoft.Management.Configuration.UnitTests/Tests/ConfigurationProcessorTelemetryTests.cs +++ b/src/Microsoft.Management.Configuration.UnitTests/Tests/ConfigurationProcessorTelemetryTests.cs @@ -50,7 +50,8 @@ public void Telemetry_NoUnitEventOnSuccess() GetConfigurationUnitSettingsResult result = testObjects.Processor.GetUnitSettings(testObjects.Unit); - Assert.Empty(this.EventSink.Events); + Assert.Single(this.EventSink.Events); + Assert.Equal(TelemetryEvent.ConfigUnitRunName, this.EventSink.Events[0].Name); } /// diff --git a/src/Microsoft.Management.Configuration.UnitTests/Tests/ConfigurationSetProcessorTests.cs b/src/Microsoft.Management.Configuration.UnitTests/Tests/ConfigurationSetProcessorTests.cs index e59840b278..815967b223 100644 --- a/src/Microsoft.Management.Configuration.UnitTests/Tests/ConfigurationSetProcessorTests.cs +++ b/src/Microsoft.Management.Configuration.UnitTests/Tests/ConfigurationSetProcessorTests.cs @@ -80,7 +80,7 @@ public void CreateUnitProcessor_ResourceExists() } /// - /// Test CreateUnitProcessor case insensitive. + /// Test CreateUnitProcessor case-insensitive. /// [Fact] public void CreateUnitProcessor_CaseInsensitive() @@ -114,7 +114,7 @@ public void CreateUnitProcessor_CaseInsensitive() } /// - /// Test CreateUnitProcessor case insensitive. + /// Test CreateUnitProcessor case-insensitive. /// [Fact] public void CreateUnitProcessor_ResourceNameMismatch() diff --git a/src/Microsoft.Management.Configuration/ConfigurationChangeData.h b/src/Microsoft.Management.Configuration/ConfigurationChangeData.h index 8e6fab6d96..5bae6952ff 100644 --- a/src/Microsoft.Management.Configuration/ConfigurationChangeData.h +++ b/src/Microsoft.Management.Configuration/ConfigurationChangeData.h @@ -20,7 +20,7 @@ namespace winrt::Microsoft::Management::Configuration::implementation #if !defined(INCLUDE_ONLY_INTERFACE_METHODS) private: ConfigurationChangeEventType m_change{}; - guid m_instanceIdentifier; + guid m_instanceIdentifier{}; ConfigurationSetState m_state{}; #endif }; diff --git a/src/Microsoft.Management.Configuration/ConfigurationProcessor.cpp b/src/Microsoft.Management.Configuration/ConfigurationProcessor.cpp index f7c106f51f..f10b51e4f4 100644 --- a/src/Microsoft.Management.Configuration/ConfigurationProcessor.cpp +++ b/src/Microsoft.Management.Configuration/ConfigurationProcessor.cpp @@ -20,6 +20,7 @@ #include "GetConfigurationSetDetailsResult.h" #include "DefaultSetGroupProcessor.h" #include "ConfigurationSequencer.h" +#include "ConfigurationStatus.h" #include #include @@ -184,15 +185,32 @@ namespace winrt::Microsoft::Management::Configuration::implementation std::ignore = m_threadGlobals.GetTelemetryLogger().EnableRuntime(value); } - event_token ConfigurationProcessor::ConfigurationChange(const Windows::Foundation::TypedEventHandler& handler) + event_token ConfigurationProcessor::ConfigurationChange(const Windows::Foundation::TypedEventHandler& handler) { + if (!m_configurationChange) + { + auto status = ConfigurationStatus::Instance(); + std::atomic_store(&m_changeRegistration, status->RegisterForChange(*this)); + } + return m_configurationChange.add(handler); } void ConfigurationProcessor::ConfigurationChange(const event_token& token) noexcept { m_configurationChange.remove(token); + + if (!m_configurationChange) + { + std::atomic_store(&m_changeRegistration, {}); + } + } + + void ConfigurationProcessor::ConfigurationChange(const Configuration::ConfigurationSet& set, const Configuration::ConfigurationChangeData& data) try + { + m_configurationChange(set, data); } + CATCH_LOG(); Windows::Foundation::Collections::IVector ConfigurationProcessor::GetConfigurationHistory() { @@ -311,7 +329,7 @@ namespace winrt::Microsoft::Management::Configuration::implementation } Windows::Foundation::Collections::IVector ConfigurationProcessor::CheckForConflicts( - const Windows::Foundation::Collections::IVectorView& configurationSets, + const Windows::Foundation::Collections::IVectorView& configurationSets, bool includeConfigurationHistory) { UNREFERENCED_PARAMETER(configurationSets); @@ -320,24 +338,26 @@ namespace winrt::Microsoft::Management::Configuration::implementation } Windows::Foundation::IAsyncOperation> ConfigurationProcessor::CheckForConflictsAsync( - const Windows::Foundation::Collections::IVectorView& configurationSets, + const Windows::Foundation::Collections::IVectorView& configurationSets, bool includeConfigurationHistory) { co_return CheckForConflicts(configurationSets, includeConfigurationHistory); } - Configuration::GetConfigurationSetDetailsResult ConfigurationProcessor::GetSetDetails(const ConfigurationSet& configurationSet, ConfigurationUnitDetailFlags detailFlags) + Configuration::GetConfigurationSetDetailsResult ConfigurationProcessor::GetSetDetails(const Configuration::ConfigurationSet& configurationSet, ConfigurationUnitDetailFlags detailFlags) { THROW_HR_IF(E_NOT_VALID_STATE, !m_factory); return GetSetDetailsImpl(configurationSet, detailFlags); } - Windows::Foundation::IAsyncOperationWithProgress ConfigurationProcessor::GetSetDetailsAsync(const ConfigurationSet& configurationSet, ConfigurationUnitDetailFlags detailFlags) + Windows::Foundation::IAsyncOperationWithProgress ConfigurationProcessor::GetSetDetailsAsync( + const Configuration::ConfigurationSet& configurationSet, + ConfigurationUnitDetailFlags detailFlags) { THROW_HR_IF(E_NOT_VALID_STATE, !m_factory); auto strong_this{ get_strong() }; - ConfigurationSet localSet = configurationSet; + Configuration::ConfigurationSet localSet = configurationSet; co_await winrt::resume_background(); @@ -351,7 +371,7 @@ namespace winrt::Microsoft::Management::Configuration::implementation m_database.EnsureOpened(false); cancellation.ThrowIfCancelled(); - std::vector result; + std::vector result; for (const auto& set : m_database.GetSetHistory()) { PropagateLifetimeWatcher(*set); @@ -362,7 +382,7 @@ namespace winrt::Microsoft::Management::Configuration::implementation } Configuration::GetConfigurationSetDetailsResult ConfigurationProcessor::GetSetDetailsImpl( - const ConfigurationSet& configurationSet, + const Configuration::ConfigurationSet& configurationSet, ConfigurationUnitDetailFlags detailFlags, AppInstaller::WinRT::AsyncProgress progress) { @@ -443,18 +463,20 @@ namespace winrt::Microsoft::Management::Configuration::implementation return *unitResult; } - Configuration::ApplyConfigurationSetResult ConfigurationProcessor::ApplySet(const ConfigurationSet& configurationSet, ApplyConfigurationSetFlags flags) + Configuration::ApplyConfigurationSetResult ConfigurationProcessor::ApplySet(const Configuration::ConfigurationSet& configurationSet, ApplyConfigurationSetFlags flags) { THROW_HR_IF(E_NOT_VALID_STATE, !m_factory); return ApplySetImpl(configurationSet, flags); } - Windows::Foundation::IAsyncOperationWithProgress ConfigurationProcessor::ApplySetAsync(const ConfigurationSet& configurationSet, ApplyConfigurationSetFlags flags) + Windows::Foundation::IAsyncOperationWithProgress ConfigurationProcessor::ApplySetAsync( + const Configuration::ConfigurationSet& configurationSet, + ApplyConfigurationSetFlags flags) { THROW_HR_IF(E_NOT_VALID_STATE, !m_factory); auto strong_this{ get_strong() }; - ConfigurationSet localSet = configurationSet; + Configuration::ConfigurationSet localSet = configurationSet; co_await winrt::resume_background(); @@ -462,13 +484,14 @@ namespace winrt::Microsoft::Management::Configuration::implementation } Configuration::ApplyConfigurationSetResult ConfigurationProcessor::ApplySetImpl( - const ConfigurationSet& configurationSet, + const Configuration::ConfigurationSet& configurationSet, ApplyConfigurationSetFlags flags, AppInstaller::WinRT::AsyncProgress progress) { auto threadGlobals = m_threadGlobals.SetForCurrentThread(); IConfigurationGroupProcessor groupProcessor; + bool recordHistoryAndStatus = false; if (WI_IsFlagSet(flags, ApplyConfigurationSetFlags::PerformConsistencyCheckOnly)) { @@ -483,6 +506,7 @@ namespace winrt::Microsoft::Management::Configuration::implementation // Write this set to the database history // This is a somewhat arbitrary time to write it, but it should not be done if PerformConsistencyCheckOnly is passed, so this is convenient. + recordHistoryAndStatus = true; m_database.EnsureOpened(); progress.ThrowIfCancelled(); m_database.WriteSetHistory(configurationSet, WI_IsFlagSet(flags, ApplyConfigurationSetFlags::DoNotOverwriteMatchingOriginSet)); @@ -522,28 +546,34 @@ namespace winrt::Microsoft::Management::Configuration::implementation try { ConfigurationSequencer sequencer{ m_database }; - - if (!WI_IsFlagSet(flags, ApplyConfigurationSetFlags::PerformConsistencyCheckOnly)) - { - if (sequencer.Enqueue(configurationSet)) + auto status = ConfigurationStatus::Instance(); + guid setInstanceIdentifier = configurationSet.InstanceIdentifier(); + auto updateState = [&](ConfigurationSetState state) { try { - progress.Progress(implementation::ConfigurationSetChangeData::Create(ConfigurationSetState::Pending)); + progress.Progress(implementation::ConfigurationSetChangeData::Create(state)); } CATCH_LOG(); + if (recordHistoryAndStatus) + { + status->UpdateSetState(setInstanceIdentifier, state); + } + }; + + if (!WI_IsFlagSet(flags, ApplyConfigurationSetFlags::PerformConsistencyCheckOnly)) + { + if (sequencer.Enqueue(configurationSet)) + { + updateState(ConfigurationSetState::Pending); sequencer.Wait(progress); } } progress.ThrowIfCancelled(); - try - { - progress.Progress(implementation::ConfigurationSetChangeData::Create(ConfigurationSetState::InProgress)); - } - CATCH_LOG(); + updateState(ConfigurationSetState::InProgress); // Forward unit result progress to caller auto applyOperation = groupProcessor.ApplyGroupSettingsAsync([&](const auto&, const IApplyGroupMemberSettingsResult& unitResult) @@ -555,9 +585,14 @@ namespace winrt::Microsoft::Management::Configuration::implementation } // Create progress object - auto applyResult = make_self>(); + auto applyResult = make_self(); applyResult->Initialize(unitResult); progress.Progress(*applyResult); + + if (recordHistoryAndStatus) + { + status->UpdateUnitState(setInstanceIdentifier, applyResult); + } }); // Cancel the inner operation if we are cancelled @@ -590,11 +625,7 @@ namespace winrt::Microsoft::Management::Configuration::implementation itr->second->ResultInformation()); } - try - { - progress.Progress(implementation::ConfigurationSetChangeData::Create(ConfigurationSetState::Completed)); - } - CATCH_LOG(); + updateState(ConfigurationSetState::Completed); m_threadGlobals.GetTelemetryLogger().LogConfigProcessingSummaryForApply(*winrt::get_self(configurationSet), *result); return *result; @@ -609,18 +640,18 @@ namespace winrt::Microsoft::Management::Configuration::implementation } } - Configuration::TestConfigurationSetResult ConfigurationProcessor::TestSet(const ConfigurationSet& configurationSet) + Configuration::TestConfigurationSetResult ConfigurationProcessor::TestSet(const Configuration::ConfigurationSet& configurationSet) { THROW_HR_IF(E_NOT_VALID_STATE, !m_factory); return TestSetImpl(configurationSet); } - Windows::Foundation::IAsyncOperationWithProgress ConfigurationProcessor::TestSetAsync(const ConfigurationSet& configurationSet) + Windows::Foundation::IAsyncOperationWithProgress ConfigurationProcessor::TestSetAsync(const Configuration::ConfigurationSet& configurationSet) { THROW_HR_IF(E_NOT_VALID_STATE, !m_factory); auto strong_this{ get_strong() }; - ConfigurationSet localSet = configurationSet; + Configuration::ConfigurationSet localSet = configurationSet; co_await winrt::resume_background(); @@ -628,7 +659,7 @@ namespace winrt::Microsoft::Management::Configuration::implementation } Configuration::TestConfigurationSetResult ConfigurationProcessor::TestSetImpl( - const ConfigurationSet& configurationSet, + const Configuration::ConfigurationSet& configurationSet, AppInstaller::WinRT::AsyncProgress progress) { auto threadGlobals = m_threadGlobals.SetForCurrentThread(); @@ -817,7 +848,7 @@ namespace winrt::Microsoft::Management::Configuration::implementation return *result; } - IConfigurationGroupProcessor ConfigurationProcessor::GetSetGroupProcessor(const ConfigurationSet& configurationSet) + IConfigurationGroupProcessor ConfigurationProcessor::GetSetGroupProcessor(const Configuration::ConfigurationSet& configurationSet) { IConfigurationSetProcessor setProcessor = m_factory.CreateSetProcessor(configurationSet); @@ -881,12 +912,6 @@ namespace winrt::Microsoft::Management::Configuration::implementation m_supportSchema03 = value; } - void ConfigurationProcessor::RemoveHistory(const ConfigurationSet& configurationSet) - { - m_database.EnsureOpened(false); - m_database.RemoveSetHistory(configurationSet); - } - void ConfigurationProcessor::SendDiagnosticsImpl(const IDiagnosticInformation& information) { std::lock_guard lock{ m_diagnosticsMutex }; diff --git a/src/Microsoft.Management.Configuration/ConfigurationProcessor.h b/src/Microsoft.Management.Configuration/ConfigurationProcessor.h index 5d0119c9dd..b4aff84c95 100644 --- a/src/Microsoft.Management.Configuration/ConfigurationProcessor.h +++ b/src/Microsoft.Management.Configuration/ConfigurationProcessor.h @@ -6,6 +6,7 @@ #include #include #include "ConfigThreadGlobals.h" +#include "ConfigurationStatus.h" #include "Database/ConfigurationDatabase.h" #include #include @@ -18,7 +19,6 @@ namespace winrt::Microsoft::Management::Configuration::implementation { struct ConfigurationProcessor : ConfigurationProcessorT>, AppInstaller::WinRT::LifetimeWatcherBase { - using ConfigurationSet = Configuration::ConfigurationSet; using ConfigurationSetChangeData = Configuration::ConfigurationSetChangeData; using ConfigurationUnit = Configuration::ConfigurationUnit; using ApplyConfigurationSetResult = Configuration::ApplyConfigurationSetResult; @@ -50,33 +50,33 @@ namespace winrt::Microsoft::Management::Configuration::implementation bool GenerateTelemetryEvents(); void GenerateTelemetryEvents(bool value); - event_token ConfigurationChange(const Windows::Foundation::TypedEventHandler& handler); + event_token ConfigurationChange(const Windows::Foundation::TypedEventHandler& handler); void ConfigurationChange(const event_token& token) noexcept; - Windows::Foundation::Collections::IVector GetConfigurationHistory(); - Windows::Foundation::IAsyncOperation> GetConfigurationHistoryAsync(); + Windows::Foundation::Collections::IVector GetConfigurationHistory(); + Windows::Foundation::IAsyncOperation> GetConfigurationHistoryAsync(); Configuration::OpenConfigurationSetResult OpenConfigurationSet(const Windows::Storage::Streams::IInputStream& stream); Windows::Foundation::IAsyncOperation OpenConfigurationSetAsync(const Windows::Storage::Streams::IInputStream& stream); Windows::Foundation::Collections::IVector CheckForConflicts( - const Windows::Foundation::Collections::IVectorView& configurationSets, + const Windows::Foundation::Collections::IVectorView& configurationSets, bool includeConfigurationHistory); Windows::Foundation::IAsyncOperation> CheckForConflictsAsync( - const Windows::Foundation::Collections::IVectorView& configurationSets, + const Windows::Foundation::Collections::IVectorView& configurationSets, bool includeConfigurationHistory); - GetConfigurationSetDetailsResult GetSetDetails(const ConfigurationSet& configurationSet, ConfigurationUnitDetailFlags detailFlags); - Windows::Foundation::IAsyncOperationWithProgress GetSetDetailsAsync(const ConfigurationSet& configurationSet, ConfigurationUnitDetailFlags detailFlags); + GetConfigurationSetDetailsResult GetSetDetails(const Configuration::ConfigurationSet& configurationSet, ConfigurationUnitDetailFlags detailFlags); + Windows::Foundation::IAsyncOperationWithProgress GetSetDetailsAsync(const Configuration::ConfigurationSet& configurationSet, ConfigurationUnitDetailFlags detailFlags); GetConfigurationUnitDetailsResult GetUnitDetails(const ConfigurationUnit& unit, ConfigurationUnitDetailFlags detailFlags); Windows::Foundation::IAsyncOperation GetUnitDetailsAsync(const ConfigurationUnit& unit, ConfigurationUnitDetailFlags detailFlags); - ApplyConfigurationSetResult ApplySet(const ConfigurationSet& configurationSet, ApplyConfigurationSetFlags flags); - Windows::Foundation::IAsyncOperationWithProgress ApplySetAsync(const ConfigurationSet& configurationSet, ApplyConfigurationSetFlags flags); + ApplyConfigurationSetResult ApplySet(const Configuration::ConfigurationSet& configurationSet, ApplyConfigurationSetFlags flags); + Windows::Foundation::IAsyncOperationWithProgress ApplySetAsync(const Configuration::ConfigurationSet& configurationSet, ApplyConfigurationSetFlags flags); - TestConfigurationSetResult TestSet(const ConfigurationSet& configurationSet); - Windows::Foundation::IAsyncOperationWithProgress TestSetAsync(const ConfigurationSet& configurationSet); + TestConfigurationSetResult TestSet(const Configuration::ConfigurationSet& configurationSet); + Windows::Foundation::IAsyncOperationWithProgress TestSetAsync(const Configuration::ConfigurationSet& configurationSet); GetConfigurationUnitSettingsResult GetUnitSettings(const ConfigurationUnit& unit); Windows::Foundation::IAsyncOperation GetUnitSettingsAsync(const ConfigurationUnit& unit); @@ -98,39 +98,39 @@ namespace winrt::Microsoft::Management::Configuration::implementation // Temporary entry point to enable experimental schema support. void SetSupportsSchema03(bool value); - // Removes the history for the given set. - void RemoveHistory(const ConfigurationSet& configurationSet); + // Indicate a configuration change occurred. + void ConfigurationChange(const Configuration::ConfigurationSet& set, const Configuration::ConfigurationChangeData& data); private: - Windows::Foundation::Collections::IVector GetConfigurationHistoryImpl(AppInstaller::WinRT::AsyncCancellation cancellation = {}); + Windows::Foundation::Collections::IVector GetConfigurationHistoryImpl(AppInstaller::WinRT::AsyncCancellation cancellation = {}); GetConfigurationSetDetailsResult GetSetDetailsImpl( - const ConfigurationSet& configurationSet, + const Configuration::ConfigurationSet& configurationSet, ConfigurationUnitDetailFlags detailFlags, AppInstaller::WinRT::AsyncProgress progress = {}); GetConfigurationUnitDetailsResult GetUnitDetailsImpl(const ConfigurationUnit& unit, ConfigurationUnitDetailFlags detailFlags); ApplyConfigurationSetResult ApplySetImpl( - const ConfigurationSet& configurationSet, + const Configuration::ConfigurationSet& configurationSet, ApplyConfigurationSetFlags flags, AppInstaller::WinRT::AsyncProgress progress = {}); TestConfigurationSetResult TestSetImpl( - const ConfigurationSet& configurationSet, + const Configuration::ConfigurationSet& configurationSet, AppInstaller::WinRT::AsyncProgress progress = {}); GetConfigurationUnitSettingsResult GetUnitSettingsImpl(const ConfigurationUnit& unit, AppInstaller::WinRT::AsyncCancellation cancellation = {}); GetAllConfigurationUnitSettingsResult GetAllUnitSettingsImpl(const ConfigurationUnit& unit, AppInstaller::WinRT::AsyncCancellation cancellation = {}); - IConfigurationGroupProcessor GetSetGroupProcessor(const ConfigurationSet& configurationSet); + IConfigurationGroupProcessor GetSetGroupProcessor(const Configuration::ConfigurationSet& configurationSet); void SendDiagnosticsImpl(const IDiagnosticInformation& information); IConfigurationSetProcessorFactory m_factory = nullptr; event> m_diagnostics; - event> m_configurationChange; + event> m_configurationChange; ConfigThreadGlobals m_threadGlobals; IConfigurationSetProcessorFactory::Diagnostics_revoker m_factoryDiagnosticsEventRevoker; DiagnosticLevel m_minimumLevel = DiagnosticLevel::Informational; @@ -139,6 +139,7 @@ namespace winrt::Microsoft::Management::Configuration::implementation bool m_isHandlingDiagnostics = false; // Temporary value to enable experimental schema support. bool m_supportSchema03 = true; + std::shared_ptr m_changeRegistration; #endif }; } diff --git a/src/Microsoft.Management.Configuration/ConfigurationSequencer.cpp b/src/Microsoft.Management.Configuration/ConfigurationSequencer.cpp index b0d4616309..cdbc061c48 100644 --- a/src/Microsoft.Management.Configuration/ConfigurationSequencer.cpp +++ b/src/Microsoft.Management.Configuration/ConfigurationSequencer.cpp @@ -2,6 +2,7 @@ // Licensed under the MIT License. #include "pch.h" #include "ConfigurationSequencer.h" +#include "ConfigurationStatus.h" #include using namespace std::chrono_literals; @@ -16,6 +17,9 @@ namespace winrt::Microsoft::Management::Configuration::implementation try { m_database.RemoveQueueItem(m_queueItemObjectName); + + auto status = ConfigurationStatus::Instance(); + status->UpdateSetState(m_setInstanceIdentifier, false); } CATCH_LOG(); } @@ -24,6 +28,8 @@ namespace winrt::Microsoft::Management::Configuration::implementation // It then performs the equivalent of `Wait` with a timeout of 0. bool ConfigurationSequencer::Enqueue(const Configuration::ConfigurationSet& configurationSet) { + m_setInstanceIdentifier = configurationSet.InstanceIdentifier(); + // Create an arbitrarily named object std::wstring objectName = L"WinGetConfigQueue_" + AppInstaller::Utility::CreateNewGuidNameWString(); m_queueItemObjectName = AppInstaller::Utility::ConvertToUTF8(objectName); @@ -31,6 +37,9 @@ namespace winrt::Microsoft::Management::Configuration::implementation m_database.AddQueueItem(configurationSet, m_queueItemObjectName); + auto statusInstance = ConfigurationStatus::Instance(); + statusInstance->UpdateSetState(m_setInstanceIdentifier, true); + // Create shared mutex constexpr PCWSTR applyMutexName = L"WinGetConfigQueueApplyMutex"; diff --git a/src/Microsoft.Management.Configuration/ConfigurationSequencer.h b/src/Microsoft.Management.Configuration/ConfigurationSequencer.h index 2fb336227d..189b07a2f0 100644 --- a/src/Microsoft.Management.Configuration/ConfigurationSequencer.h +++ b/src/Microsoft.Management.Configuration/ConfigurationSequencer.h @@ -39,6 +39,7 @@ namespace winrt::Microsoft::Management::Configuration::implementation using QueueObjectType = wil::unique_event; ConfigurationDatabase& m_database; + guid m_setInstanceIdentifier{}; std::string m_queueItemObjectName; QueueObjectType m_queueItemObject; wil::unique_mutex m_applyMutex; diff --git a/src/Microsoft.Management.Configuration/ConfigurationSet.cpp b/src/Microsoft.Management.Configuration/ConfigurationSet.cpp index fbf33cebae..0e0077cd49 100644 --- a/src/Microsoft.Management.Configuration/ConfigurationSet.cpp +++ b/src/Microsoft.Management.Configuration/ConfigurationSet.cpp @@ -18,7 +18,7 @@ namespace winrt::Microsoft::Management::Configuration::implementation } ConfigurationSet::ConfigurationSet(const guid& instanceIdentifier) : - m_instanceIdentifier(instanceIdentifier), m_fromHistory(true) + m_instanceIdentifier(instanceIdentifier) { } @@ -32,11 +32,6 @@ namespace winrt::Microsoft::Management::Configuration::implementation m_parameters = winrt::multi_threaded_vector(std::move(value)); } - bool ConfigurationSet::IsFromHistory() const - { - return m_fromHistory; - } - hstring ConfigurationSet::Name() { return m_name; @@ -74,27 +69,26 @@ namespace winrt::Microsoft::Management::Configuration::implementation ConfigurationSetState ConfigurationSet::State() { - return ConfigurationSetState::Unknown; + auto status = ConfigurationStatus::Instance(); + return status->GetSetState(m_instanceIdentifier); } clock::time_point ConfigurationSet::FirstApply() { - return m_firstApply; - } - - void ConfigurationSet::FirstApply(clock::time_point value) - { - m_firstApply = value; + auto status = ConfigurationStatus::Instance(); + return status->GetSetFirstApply(m_instanceIdentifier); } clock::time_point ConfigurationSet::ApplyBegun() { - return clock::time_point{}; + auto status = ConfigurationStatus::Instance(); + return status->GetSetApplyBegun(m_instanceIdentifier); } clock::time_point ConfigurationSet::ApplyEnded() { - return clock::time_point{}; + auto status = ConfigurationStatus::Instance(); + return status->GetSetApplyEnded(m_instanceIdentifier); } Windows::Foundation::Collections::IVector ConfigurationSet::Units() @@ -120,14 +114,48 @@ namespace winrt::Microsoft::Management::Configuration::implementation m_schemaVersion = value; } - event_token ConfigurationSet::ConfigurationSetChange(const Windows::Foundation::TypedEventHandler& handler) + void ConfigurationSet::ConfigurationSetChange(com_ptr& data, const std::optional& unitInstanceIdentifier) try + { + if (unitInstanceIdentifier) + { + Windows::Foundation::Collections::IVector comUnits = m_units; + + std::vector units{ comUnits.Size() }; + units.resize(comUnits.GetMany(0, units)); + + for (const ConfigurationUnit& unit : units) + { + if (unit.InstanceIdentifier() == unitInstanceIdentifier.value()) + { + data->Unit(unit); + break; + } + } + } + + m_configurationSetChange(*get_strong(), *data); + } + CATCH_LOG(); + + event_token ConfigurationSet::ConfigurationSetChange(const Windows::Foundation::TypedEventHandler& handler) { + if (!m_configurationSetChange) + { + auto status = ConfigurationStatus::Instance(); + std::atomic_store(&m_setChangeRegistration, status->RegisterForSetChange(*this)); + } + return m_configurationSetChange.add(handler); } void ConfigurationSet::ConfigurationSetChange(const event_token& token) noexcept { m_configurationSetChange.remove(token); + + if (!m_configurationSetChange) + { + std::atomic_store(&m_setChangeRegistration, {}); + } } void ConfigurationSet::Serialize(const Windows::Storage::Streams::IOutputStream& stream) diff --git a/src/Microsoft.Management.Configuration/ConfigurationSet.h b/src/Microsoft.Management.Configuration/ConfigurationSet.h index fd16cc1f58..a39c256bb6 100644 --- a/src/Microsoft.Management.Configuration/ConfigurationSet.h +++ b/src/Microsoft.Management.Configuration/ConfigurationSet.h @@ -2,6 +2,8 @@ // Licensed under the MIT License. #pragma once #include "ConfigurationSet.g.h" +#include "ConfigurationSetChangeData.h" +#include "ConfigurationStatus.h" #include #include #include @@ -20,11 +22,9 @@ namespace winrt::Microsoft::Management::Configuration::implementation #if !defined(INCLUDE_ONLY_INTERFACE_METHODS) ConfigurationSet(const guid& instanceIdentifier); - void FirstApply(clock::time_point value); void Units(std::vector&& units); void Parameters(std::vector&& value); - - bool IsFromHistory() const; + void ConfigurationSetChange(com_ptr& data, const std::optional& unitInstanceIdentifier); #endif hstring Name(); @@ -48,7 +48,7 @@ namespace winrt::Microsoft::Management::Configuration::implementation hstring SchemaVersion(); void SchemaVersion(const hstring& value); - event_token ConfigurationSetChange(const Windows::Foundation::TypedEventHandler& handler); + event_token ConfigurationSetChange(const Windows::Foundation::TypedEventHandler& handler); void ConfigurationSetChange(const event_token& token) noexcept; void Serialize(const Windows::Storage::Streams::IOutputStream& stream); @@ -81,13 +81,13 @@ namespace winrt::Microsoft::Management::Configuration::implementation clock::time_point m_firstApply{}; Windows::Foundation::Collections::IVector m_units{ winrt::multi_threaded_vector() }; hstring m_schemaVersion; - winrt::event> m_configurationSetChange; + winrt::event> m_configurationSetChange; Windows::Foundation::Collections::ValueSet m_metadata; Windows::Foundation::Collections::IVector m_parameters{ winrt::multi_threaded_vector() }; Windows::Foundation::Collections::ValueSet m_variables; Windows::Foundation::Uri m_schemaUri = nullptr; std::string m_inputHash; - bool m_fromHistory = false; + std::shared_ptr m_setChangeRegistration; #endif }; } diff --git a/src/Microsoft.Management.Configuration/ConfigurationSetChangeData.cpp b/src/Microsoft.Management.Configuration/ConfigurationSetChangeData.cpp index a591cec139..de1ae0ee1a 100644 --- a/src/Microsoft.Management.Configuration/ConfigurationSetChangeData.cpp +++ b/src/Microsoft.Management.Configuration/ConfigurationSetChangeData.cpp @@ -8,14 +8,14 @@ namespace winrt::Microsoft::Management::Configuration::implementation { Configuration::ConfigurationSetChangeData ConfigurationSetChangeData::Create(ConfigurationSetState state) { - auto result = make_self>(); + auto result = make_self(); result->Initialize(state); return *result; } Configuration::ConfigurationSetChangeData ConfigurationSetChangeData::Create(ConfigurationUnitState state, IConfigurationUnitResultInformation resultInformation, ConfigurationUnit unit) { - auto result = make_self>(); + auto result = make_self(); result->Initialize(state, resultInformation, unit); return *result; } @@ -68,4 +68,9 @@ namespace winrt::Microsoft::Management::Configuration::implementation { return m_unit; } + + void ConfigurationSetChangeData::Unit(const ConfigurationUnit& unit) + { + m_unit = unit; + } } diff --git a/src/Microsoft.Management.Configuration/ConfigurationSetChangeData.h b/src/Microsoft.Management.Configuration/ConfigurationSetChangeData.h index 161712d733..54cbcb8e0e 100644 --- a/src/Microsoft.Management.Configuration/ConfigurationSetChangeData.h +++ b/src/Microsoft.Management.Configuration/ConfigurationSetChangeData.h @@ -3,10 +3,11 @@ #pragma once #include "ConfigurationSetChangeData.g.h" #include "ConfigurationUnitResultInformation.h" +#include namespace winrt::Microsoft::Management::Configuration::implementation { - struct ConfigurationSetChangeData : ConfigurationSetChangeDataT + struct ConfigurationSetChangeData : ConfigurationSetChangeDataT, AppInstaller::WinRT::ModuleCountBase { using ConfigurationUnit = Configuration::ConfigurationUnit; @@ -19,6 +20,8 @@ namespace winrt::Microsoft::Management::Configuration::implementation void Initialize(ConfigurationSetState state); void Initialize(ConfigurationUnitState state, IConfigurationUnitResultInformation resultInformation, ConfigurationUnit unit); void Initialize(const IApplyGroupMemberSettingsResult& unitResult); + + void Unit(const ConfigurationUnit& unit); #endif ConfigurationSetChangeEventType Change(); diff --git a/src/Microsoft.Management.Configuration/ConfigurationStatus.cpp b/src/Microsoft.Management.Configuration/ConfigurationStatus.cpp new file mode 100644 index 0000000000..0ac3130ca6 --- /dev/null +++ b/src/Microsoft.Management.Configuration/ConfigurationStatus.cpp @@ -0,0 +1,410 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +#include "pch.h" +#include "ConfigurationStatus.h" +#include "ConfigurationChangeData.h" +#include "ConfigurationProcessor.h" +#include "ConfigurationSet.h" +#include "ConfigurationUnitResultInformation.h" +#include +#include + + +namespace winrt::Microsoft::Management::Configuration::implementation +{ + namespace details + { + // Implements the consuming side of the status signaling. + struct ChangeListener + { + struct SetStatusItem + { + ConfigurationDatabase::StatusItem Status; + com_ptr Set; + }; + + ChangeListener(ConfigurationStatus& status) : m_status(status) + { + ConfigurationDatabase::StatusBaseline baseline = m_status.Database().GetStatusBaseline(); + m_changeIdentifier = baseline.ChangeIdentifier; + + for (const auto& item : baseline.SetStatus) + { + m_lastSetStatus.emplace(item.SetInstanceIdentifier, SetStatusItem{ item }); + } + + std::wstring objectName = L"WinGetConfigListener_" + AppInstaller::Utility::CreateNewGuidNameWString(); + m_listenerEventName = AppInstaller::Utility::ConvertToUTF8(objectName); + m_listenerEvent.create(wil::EventOptions::None, objectName.c_str()); + + m_status.Database().AddListener(m_listenerEventName); + + m_threadPoolWait.reset(CreateThreadpoolWait(StaticWaitCallback, this, nullptr)); + THROW_LAST_ERROR_IF(!m_threadPoolWait); + + SetThreadpoolWait(m_threadPoolWait.get(), m_listenerEvent.get(), NULL); + } + + ~ChangeListener() + { + try + { + m_status.Database().RemoveListener(m_listenerEventName); + } + CATCH_LOG(); + } + + private: + static void NTAPI StaticWaitCallback(PTP_CALLBACK_INSTANCE, void* context, TP_WAIT*, TP_WAIT_RESULT) + { + reinterpret_cast(context)->WaitCallback(); + } + + void WaitCallback() try + { + std::vector changes = m_status.Database().GetStatusSince(m_changeIdentifier); + + // Convert status items to relevant change information + for (const auto& change : changes) + { + if (change.UnitInstanceIdentifier) + { + if (m_status.HasSetChangeRegistration(change.SetInstanceIdentifier)) + { + // A unit status change + ConfigurationUnitState state = AppInstaller::ToEnum(change.State); + + decltype(make_self>()) resultInformation; + + if (change.ResultCode) + { + resultInformation = make_self>(); + resultInformation->ResultCode(change.ResultCode.value()); + resultInformation->Description(hstring{ AppInstaller::Utility::ConvertToUTF16(change.ResultDescription) }); + resultInformation->Details(hstring{ AppInstaller::Utility::ConvertToUTF16(change.ResultDetails) }); + resultInformation->ResultSource(change.ResultSource); + } + + auto changeData = make_self(); + changeData->Initialize(state, *resultInformation, nullptr); + + m_status.SetChangeDetected(change.SetInstanceIdentifier, changeData, change.UnitInstanceIdentifier); + } + } + else + { + // A set status change + ConfigurationSetState state = AppInstaller::ToEnum(change.State); + ConfigurationChangeEventType changeType = ConfigurationChangeEventType::Unknown; + + SetStatusItem* setStatusItem = nullptr; + auto itr = m_lastSetStatus.find(change.SetInstanceIdentifier); + if (itr != m_lastSetStatus.end()) + { + setStatusItem = &itr->second; + } + + if (!setStatusItem) + { + changeType = ConfigurationChangeEventType::SetAdded; + + std::tie(itr, std::ignore) = m_lastSetStatus.emplace(change.SetInstanceIdentifier, SetStatusItem{ change }); + setStatusItem = &itr->second; + } + else + { + changeType = (change.InQueue ? ConfigurationChangeEventType::SetStateChanged : ConfigurationChangeEventType::SetRemoved); + } + + if (m_status.HasChangeRegistrations()) + { + if (!setStatusItem->Set) + { + setStatusItem->Set = m_status.Database().GetSet(change.SetInstanceIdentifier); + } + + auto changeData = make_self>(); + changeData->Initialize(changeType, change.SetInstanceIdentifier, state); + + m_status.ChangeDetected(*setStatusItem->Set, *changeData); + } + + auto setChangeData = make_self(); + setChangeData->Initialize(state); + + m_status.SetChangeDetected(change.SetInstanceIdentifier, setChangeData, std::nullopt); + } + + m_changeIdentifier = change.ChangeIdentifier; + } + + SetThreadpoolWait(m_threadPoolWait.get(), m_listenerEvent.get(), NULL); + } + CATCH_LOG_MSG("ChangeListener::WaitCallback exception"); + + ConfigurationStatus& m_status; + int64_t m_changeIdentifier; + std::map m_lastSetStatus; + wil::unique_event m_listenerEvent; + std::string m_listenerEventName; + + // Keep last to destroy first + wil::unique_threadpool_wait m_threadPoolWait; + }; + } + + ConfigurationStatus::ConfigurationStatus(private_construction) {} + + ConfigurationStatus::~ConfigurationStatus() = default; + + std::shared_ptr ConfigurationStatus::Instance() + { + static std::shared_ptr s_instance; + + std::shared_ptr result = std::atomic_load(&s_instance); + if (!result) + { + result = std::make_shared(private_construction{}); + std::shared_ptr empty; + + if (!std::atomic_compare_exchange_strong(&s_instance, &empty, result)) + { + result = empty; + } + } + + return result; + } + + ConfigurationSetState ConfigurationStatus::GetSetState(const winrt::guid& instanceIdentifier) + { + m_database.EnsureOpened(false); + return m_database.GetSetState(instanceIdentifier); + } + + clock::time_point ConfigurationStatus::GetSetFirstApply(const winrt::guid& instanceIdentifier) + { + m_database.EnsureOpened(false); + return clock::from_sys(m_database.GetSetFirstApply(instanceIdentifier)); + } + + clock::time_point ConfigurationStatus::GetSetApplyBegun(const winrt::guid& instanceIdentifier) + { + using system_clock = std::chrono::system_clock; + + m_database.EnsureOpened(false); + system_clock::time_point result = m_database.GetSetApplyBegun(instanceIdentifier); + return (result == system_clock::time_point{} ? clock::time_point{} : clock::from_sys(result)); + } + + clock::time_point ConfigurationStatus::GetSetApplyEnded(const winrt::guid& instanceIdentifier) + { + using system_clock = std::chrono::system_clock; + + m_database.EnsureOpened(false); + system_clock::time_point result = m_database.GetSetApplyEnded(instanceIdentifier); + return (result == system_clock::time_point{} ? clock::time_point{} : clock::from_sys(result)); + } + + ConfigurationUnitState ConfigurationStatus::GetUnitState(const winrt::guid& instanceIdentifier) + { + m_database.EnsureOpened(false); + return m_database.GetUnitState(instanceIdentifier); + } + + IConfigurationUnitResultInformation ConfigurationStatus::GetUnitResultInformation(const winrt::guid& instanceIdentifier) + { + m_database.EnsureOpened(false); + return m_database.GetUnitResultInformation(instanceIdentifier); + } + + void ConfigurationStatus::UpdateSetState(const guid& setInstanceIdentifier, ConfigurationSetState state) + { + m_database.EnsureOpened(); + m_database.UpdateSetState(setInstanceIdentifier, state); + SignalChangeListeners(); + } + + void ConfigurationStatus::UpdateSetState(const guid& setInstanceIdentifier, bool inQueue) + { + m_database.EnsureOpened(); + m_database.UpdateSetInQueue(setInstanceIdentifier, inQueue); + SignalChangeListeners(); + } + + void ConfigurationStatus::UpdateUnitState(const guid& setInstanceIdentifier, const com_ptr& changeData) + { + m_database.EnsureOpened(); + m_database.UpdateUnitState(setInstanceIdentifier, changeData); + SignalChangeListeners(); + } + + ConfigurationStatus::SetChangeRegistration::SetChangeRegistration(const winrt::guid& instanceIdentifier, ConfigurationSet* configurationSet) : + m_status(Instance()), m_instanceIdentifier(instanceIdentifier), m_configurationSet(configurationSet) {} + + ConfigurationStatus::SetChangeRegistration::~SetChangeRegistration() + { + m_status->RemoveSetChangeRegistration(m_instanceIdentifier, m_configurationSet); + } + + std::shared_ptr ConfigurationStatus::RegisterForSetChange(ConfigurationSet& set) + { + m_database.EnsureOpened(); + + winrt::guid instanceIdentifier = set.InstanceIdentifier(); + + { + std::lock_guard lock{ m_changeRegistrationsMutex }; + m_setChangeRegistrations.emplace(instanceIdentifier, &set); + EnableChangeListeningIfNeeded(); + } + + return std::make_shared(instanceIdentifier, &set); + } + + void ConfigurationStatus::RemoveSetChangeRegistration(const winrt::guid& instanceIdentifier, ConfigurationSet* configurationSet) noexcept + { + std::lock_guard lock{ m_changeRegistrationsMutex }; + + auto [begin, end] = m_setChangeRegistrations.equal_range(instanceIdentifier); + + for (; begin != end; ++begin) + { + if (begin->second == configurationSet) + { + m_setChangeRegistrations.erase(begin); + break; + } + } + + DisableChangeListeningIfNeeded(); + } + + ConfigurationStatus::ChangeRegistration::ChangeRegistration(const winrt::guid& instanceIdentifier) : + m_status(Instance()), m_instanceIdentifier(instanceIdentifier) {} + + ConfigurationStatus::ChangeRegistration::~ChangeRegistration() + { + m_status->RemoveChangeRegistration(m_instanceIdentifier); + } + + std::shared_ptr ConfigurationStatus::RegisterForChange(ConfigurationProcessor& processor) + { + m_database.EnsureOpened(); + + GUID instanceIdentifier; + std::ignore = CoCreateGuid(&instanceIdentifier); + + { + std::lock_guard lock{ m_changeRegistrationsMutex }; + m_changeRegistrations.emplace_back(instanceIdentifier, &processor); + EnableChangeListeningIfNeeded(); + } + + return std::make_shared(instanceIdentifier); + } + + void ConfigurationStatus::RemoveChangeRegistration(const winrt::guid& instanceIdentifier) noexcept + { + std::lock_guard lock{ m_changeRegistrationsMutex }; + + for (auto itr = m_changeRegistrations.begin(); itr != m_changeRegistrations.end(); ++itr) + { + if (itr->first == instanceIdentifier) + { + m_changeRegistrations.erase(itr); + DisableChangeListeningIfNeeded(); + return; + } + } + } + + void ConfigurationStatus::EnableChangeListeningIfNeeded() + { + if (!m_changeListener) + { + m_changeListener = std::make_unique(*this); + } + } + + void ConfigurationStatus::DisableChangeListeningIfNeeded() + { + if (m_changeListener && m_setChangeRegistrations.empty() && m_changeRegistrations.empty()) + { + m_changeListener.reset(); + } + } + + void ConfigurationStatus::SignalChangeListeners() + { + std::vector changeListeners = m_database.GetChangeListeners(); + + for (const auto& listener : changeListeners) + { + std::wstring objectName = AppInstaller::Utility::ConvertToUTF16(listener.ObjectName); + wil::unique_event listenerEvent; + if (listenerEvent.try_open(objectName.c_str(), EVENT_MODIFY_STATE)) + { + listenerEvent.SetEvent(); + } + else + { + m_database.RemoveListener(listener.ObjectName); + } + } + } + + ConfigurationDatabase& ConfigurationStatus::Database() + { + return m_database; + } + + bool ConfigurationStatus::HasSetChangeRegistration(const guid& setInstanceIdentifier) + { + std::lock_guard lock{ m_changeRegistrationsMutex }; + auto [begin, end] = m_setChangeRegistrations.equal_range(setInstanceIdentifier); + return begin != end; + } + + bool ConfigurationStatus::HasChangeRegistrations() + { + std::lock_guard lock{ m_changeRegistrationsMutex }; + return !m_changeRegistrations.empty(); + } + + void ConfigurationStatus::SetChangeDetected(const winrt::guid& setInstanceIdentifier, com_ptr& data, const std::optional& unitInstanceIdentifier) + { + std::vector setChangeRegistrations; + + { + std::lock_guard lock{ m_changeRegistrationsMutex }; + + auto [begin, end] = m_setChangeRegistrations.equal_range(setInstanceIdentifier); + + for (; begin != end; ++begin) + { + setChangeRegistrations.emplace_back(begin->second); + } + } + + for (ConfigurationSet* set : setChangeRegistrations) + { + set->ConfigurationSetChange(data, unitInstanceIdentifier); + } + } + + void ConfigurationStatus::ChangeDetected(const Configuration::ConfigurationSet& set, const Configuration::ConfigurationChangeData& data) + { + std::vector> changeRegistrations; + + { + std::lock_guard lock{ m_changeRegistrationsMutex }; + changeRegistrations = m_changeRegistrations; + } + + for (const auto& registration : changeRegistrations) + { + registration.second->ConfigurationChange(set, data); + } + } +} diff --git a/src/Microsoft.Management.Configuration/ConfigurationStatus.h b/src/Microsoft.Management.Configuration/ConfigurationStatus.h new file mode 100644 index 0000000000..af30c59f55 --- /dev/null +++ b/src/Microsoft.Management.Configuration/ConfigurationStatus.h @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +#pragma once +#include "Database/ConfigurationDatabase.h" +#include "ConfigurationSetChangeData.h" +#include +#include +#include +#include +#include +#include + + +namespace winrt::Microsoft::Management::Configuration::implementation +{ + // Forward declarations + struct ConfigurationProcessor; + struct ConfigurationSet; + struct ConfigurationSetChangeData; + + namespace details + { + struct ChangeListener; + } + + // Provides access to overall configuration status information. + struct ConfigurationStatus + { + private: + struct private_construction {}; + + public: + friend details::ChangeListener; + + ConfigurationStatus(private_construction); + + ConfigurationStatus(const ConfigurationStatus&) = delete; + ConfigurationStatus& operator=(const ConfigurationStatus&) = delete; + + ConfigurationStatus(ConfigurationStatus&&) = delete; + ConfigurationStatus& operator=(ConfigurationStatus&&) = delete; + + ~ConfigurationStatus(); + + // Gets the singleton instance. + static std::shared_ptr Instance(); + + // Get various set state information + ConfigurationSetState GetSetState(const guid& instanceIdentifier); + clock::time_point GetSetFirstApply(const guid& instanceIdentifier); + clock::time_point GetSetApplyBegun(const guid& instanceIdentifier); + clock::time_point GetSetApplyEnded(const guid& instanceIdentifier); + ConfigurationUnitState GetUnitState(const guid& instanceIdentifier); + IConfigurationUnitResultInformation GetUnitResultInformation(const guid& instanceIdentifier); + + // Record state changes + void UpdateSetState(const guid& setInstanceIdentifier, ConfigurationSetState state); + void UpdateSetState(const guid& setInstanceIdentifier, bool inQueue); + void UpdateUnitState(const guid& setInstanceIdentifier, const com_ptr& changeData); + + // Keeps data for a set change listener. + struct SetChangeRegistration + { + SetChangeRegistration(const guid& instanceIdentifier, ConfigurationSet* configurationSet); + + SetChangeRegistration(const SetChangeRegistration&) = delete; + SetChangeRegistration& operator=(const SetChangeRegistration&) = delete; + + SetChangeRegistration(SetChangeRegistration&&) = delete; + SetChangeRegistration& operator=(SetChangeRegistration&&) = delete; + + ~SetChangeRegistration(); + + private: + std::shared_ptr m_status; + guid m_instanceIdentifier; + ConfigurationSet* m_configurationSet; + }; + + std::shared_ptr RegisterForSetChange(ConfigurationSet& set); + void RemoveSetChangeRegistration(const guid& instanceIdentifier, ConfigurationSet* configurationSet) noexcept; + + // Keeps data for a change listener. + struct ChangeRegistration + { + ChangeRegistration(const guid& instanceIdentifier); + + ChangeRegistration(const ChangeRegistration&) = delete; + ChangeRegistration& operator=(const ChangeRegistration&) = delete; + + ChangeRegistration(ChangeRegistration&&) = delete; + ChangeRegistration& operator=(ChangeRegistration&&) = delete; + + ~ChangeRegistration(); + + private: + std::shared_ptr m_status; + guid m_instanceIdentifier; + }; + + std::shared_ptr RegisterForChange(ConfigurationProcessor& processor); + void RemoveChangeRegistration(const guid& instanceIdentifier) noexcept; + + private: + void EnableChangeListeningIfNeeded(); + void DisableChangeListeningIfNeeded(); + + void SignalChangeListeners(); + + ConfigurationDatabase& Database(); + + bool HasSetChangeRegistration(const guid& setInstanceIdentifier); + bool HasChangeRegistrations(); + + void SetChangeDetected(const guid& setInstanceIdentifier, com_ptr& data, const std::optional& unitInstanceIdentifier); + void ChangeDetected(const Configuration::ConfigurationSet& set, const Configuration::ConfigurationChangeData& data); + + ConfigurationDatabase m_database; + + std::mutex m_changeRegistrationsMutex; + std::multimap m_setChangeRegistrations; + std::vector> m_changeRegistrations; + + // Keep this last to ensure it is destroyed first + std::unique_ptr m_changeListener; + }; +} diff --git a/src/Microsoft.Management.Configuration/ConfigurationUnit.cpp b/src/Microsoft.Management.Configuration/ConfigurationUnit.cpp index 25043da53e..c50ab2939f 100644 --- a/src/Microsoft.Management.Configuration/ConfigurationUnit.cpp +++ b/src/Microsoft.Management.Configuration/ConfigurationUnit.cpp @@ -4,6 +4,7 @@ #include "ConfigurationUnit.h" #include "ConfigurationUnit.g.cpp" #include "ConfigurationSetParser.h" +#include "ConfigurationStatus.h" namespace winrt::Microsoft::Management::Configuration::implementation { @@ -137,12 +138,14 @@ namespace winrt::Microsoft::Management::Configuration::implementation ConfigurationUnitState ConfigurationUnit::State() { - return ConfigurationUnitState::Unknown; + auto status = ConfigurationStatus::Instance(); + return status->GetUnitState(m_instanceIdentifier); } IConfigurationUnitResultInformation ConfigurationUnit::ResultInformation() { - return nullptr; + auto status = ConfigurationStatus::Instance(); + return status->GetUnitResultInformation(m_instanceIdentifier); } bool ConfigurationUnit::IsActive() diff --git a/src/Microsoft.Management.Configuration/ConfigurationUnitResultInformation.cpp b/src/Microsoft.Management.Configuration/ConfigurationUnitResultInformation.cpp index e983f7143e..bc66181c3f 100644 --- a/src/Microsoft.Management.Configuration/ConfigurationUnitResultInformation.cpp +++ b/src/Microsoft.Management.Configuration/ConfigurationUnitResultInformation.cpp @@ -56,6 +56,14 @@ namespace winrt::Microsoft::Management::Configuration::implementation { m_resultCode = resultCode; m_resultSource = resultSource; + } + + void ConfigurationUnitResultInformation::Initialize(hresult resultCode, std::wstring_view description, std::wstring_view details, ConfigurationUnitResultSource resultSource) + { + m_resultCode = resultCode; + m_description = description; + m_details = details; + m_resultSource = resultSource; } hresult ConfigurationUnitResultInformation::ResultCode() const diff --git a/src/Microsoft.Management.Configuration/ConfigurationUnitResultInformation.h b/src/Microsoft.Management.Configuration/ConfigurationUnitResultInformation.h index 03ce3b139f..ee1fe23626 100644 --- a/src/Microsoft.Management.Configuration/ConfigurationUnitResultInformation.h +++ b/src/Microsoft.Management.Configuration/ConfigurationUnitResultInformation.h @@ -14,6 +14,7 @@ namespace winrt::Microsoft::Management::Configuration::implementation void Initialize(hresult resultCode, std::wstring_view description); void Initialize(hresult resultCode, hstring description); void Initialize(hresult resultCode, ConfigurationUnitResultSource resultSource); + void Initialize(hresult resultCode, std::wstring_view description, std::wstring_view details, ConfigurationUnitResultSource resultSource); #endif hresult ResultCode() const; diff --git a/src/Microsoft.Management.Configuration/Database/ConfigurationDatabase.cpp b/src/Microsoft.Management.Configuration/Database/ConfigurationDatabase.cpp index 8987e3758c..de9a2916ee 100644 --- a/src/Microsoft.Management.Configuration/Database/ConfigurationDatabase.cpp +++ b/src/Microsoft.Management.Configuration/Database/ConfigurationDatabase.cpp @@ -3,10 +3,13 @@ #include "pch.h" #include "Database/ConfigurationDatabase.h" #include "Database/Schema/IConfigurationDatabase.h" +#include "ConfigurationUnitResultInformation.h" +#include #include #include "Filesystem.h" using namespace AppInstaller::SQLite; +using namespace AppInstaller::Utility; namespace winrt::Microsoft::Management::Configuration::implementation { @@ -22,6 +25,30 @@ namespace winrt::Microsoft::Management::Configuration::implementation constexpr std::string_view s_Database_FileName = "config.db"sv; #define s_Database_MutexName L"WindowsPackageManager_Configuration_DatabaseMutex" + + std::vector ConvertStatusItems(const std::vector& input) + { + std::vector result; + + for (const auto& item : input) + { + ConfigurationDatabase::StatusItem statusItem{}; + std::tie( + statusItem.ChangeIdentifier, + statusItem.ChangeTime, + statusItem.SetInstanceIdentifier, + statusItem.InQueue, + statusItem.UnitInstanceIdentifier, + statusItem.State, + statusItem.ResultCode, + statusItem.ResultDescription, + statusItem.ResultDetails, + statusItem.ResultSource) = item; + result.emplace_back(std::move(statusItem)); + } + + return result; + } } ConfigurationDatabase::ConfigurationDatabase() = default; @@ -38,7 +65,7 @@ namespace winrt::Microsoft::Management::Configuration::implementation try { #endif - if (!m_database) + if (!std::atomic_load(&m_database)) { std::filesystem::path databaseDirectory = AppInstaller::Filesystem::GetPathTo(PathName::LocalState) / s_Database_DirectoryName; std::filesystem::path databaseFile = databaseDirectory / s_Database_FileName; @@ -57,16 +84,27 @@ namespace winrt::Microsoft::Management::Configuration::implementation std::filesystem::create_directories(databaseDirectory); - m_connection = std::make_shared(databaseFile, IConfigurationDatabase::GetLatestVersion()); - m_database = IConfigurationDatabase::CreateFor(m_connection); - m_database->InitializeDatabase(); + auto connection = std::make_shared(databaseFile, IConfigurationDatabase::GetLatestVersion()); + auto database = std::shared_ptr{ IConfigurationDatabase::CreateFor(connection) }; + database->InitializeDatabase(); + + std::atomic_store(&m_connection, connection); + std::atomic_store(&m_database, database); } } - if (!m_database && std::filesystem::is_regular_file(databaseFile)) + if (!std::atomic_load(&m_connection)) + { + std::shared_ptr empty; + auto connection = std::make_shared(databaseFile, SQLiteStorageBase::OpenDisposition::ReadWrite); + std::atomic_compare_exchange_strong(&m_connection, &empty, connection); + } + + if (!std::atomic_load(&m_database)) { - m_connection = std::make_shared(databaseFile, SQLiteStorageBase::OpenDisposition::ReadWrite); - m_database = IConfigurationDatabase::CreateFor(m_connection, true); + std::shared_ptr empty; + auto database = std::shared_ptr{ IConfigurationDatabase::CreateFor(std::atomic_load(&m_connection), true) }; + std::atomic_compare_exchange_strong(&m_database, &empty, database); } } #ifdef AICLI_DISABLE_TEST_HOOKS @@ -75,211 +113,356 @@ namespace winrt::Microsoft::Management::Configuration::implementation #endif } - std::vector ConfigurationDatabase::GetSetHistory() const + template + auto ConfigurationDatabase::ExecuteReadOperation(std::string_view operationName, OperationT&& operation, bool requireDatabase) const { + using ResultT = decltype(operation(std::declval&>())); + ResultT result{}; + #ifdef AICLI_DISABLE_TEST_HOOKS // While under development, treat errors escaping this function as a test hook. try { #endif - if (!m_database) - { - return {}; - } + auto database = std::atomic_load(&m_database); - auto transaction = BeginTransaction("GetSetHistory"); - return m_database->GetSets(); + if (database) + { + auto transaction = BeginTransaction(operationName, false, database); + result = operation(database); + } + else if (requireDatabase) + { + THROW_HR(E_NOT_VALID_STATE); + } #ifdef AICLI_DISABLE_TEST_HOOKS } CATCH_LOG(); - - return {}; #endif + + return result; } - void ConfigurationDatabase::WriteSetHistory(const Configuration::ConfigurationSet& configurationSet, bool preferNewHistory) + template + void ConfigurationDatabase::ExecuteWriteOperation(std::string_view operationName, OperationT&& operation, bool silentlyIgnoreNoDatabase) { #ifdef AICLI_DISABLE_TEST_HOOKS // While under development, treat errors escaping this function as a test hook. try { #endif - THROW_HR_IF_NULL(E_POINTER, configurationSet); - THROW_HR_IF_NULL(E_NOT_VALID_STATE, m_database); + auto database = std::atomic_load(&m_database); - auto transaction = BeginTransaction("WriteSetHistory"); - - std::optional setRowId = m_database->GetSetRowId(configurationSet.InstanceIdentifier()); - - if (!setRowId && !preferNewHistory) - { - // TODO: Use conflict detection code to check for a matching set - } - - if (setRowId) - { - m_database->UpdateSet(setRowId.value(), configurationSet); - } - else - { - m_database->AddSet(configurationSet); - } - - m_connection->SetLastWriteTime(); + if (!database) + { + THROW_HR_IF(E_NOT_VALID_STATE, !silentlyIgnoreNoDatabase); + return; + } - transaction->Commit(); + auto transaction = BeginTransaction(operationName, true, database); + operation(database); + std::atomic_load(&m_connection)->SetLastWriteTime(); + transaction->Commit(); #ifdef AICLI_DISABLE_TEST_HOOKS } CATCH_LOG(); #endif } - void ConfigurationDatabase::RemoveSetHistory(const Configuration::ConfigurationSet& configurationSet) + std::vector ConfigurationDatabase::GetSetHistory() const + { + return ExecuteReadOperation("GetSetHistory", + [&](std::shared_ptr& database) + { + return database->GetSets(); + }); + } + + ConfigurationDatabase::ConfigurationSetPtr ConfigurationDatabase::GetSet(const GUID& instanceIdentifier) const + { + return ExecuteReadOperation("GetSet", + [&](std::shared_ptr& database) + { + return database->GetSet(instanceIdentifier); + }); + } + + void ConfigurationDatabase::WriteSetHistory(const Configuration::ConfigurationSet& configurationSet, bool preferNewHistory) { -#ifdef AICLI_DISABLE_TEST_HOOKS - // While under development, treat errors escaping this function as a test hook. - try - { -#endif THROW_HR_IF_NULL(E_POINTER, configurationSet); - if (!m_database) - { - return; - } + ExecuteWriteOperation("WriteSetHistory", + [&](std::shared_ptr& database) + { + std::optional setRowId = database->GetSetRowId(configurationSet.InstanceIdentifier()); - auto transaction = BeginTransaction("RemoveSetHistory"); + if (!setRowId && !preferNewHistory) + { + // TODO: Use conflict detection code to check for a matching set + } - std::optional setRowId = m_database->GetSetRowId(configurationSet.InstanceIdentifier()); + if (setRowId) + { + database->UpdateSet(setRowId.value(), configurationSet); + } + else + { + database->AddSet(configurationSet); + } + }); + } - if (!setRowId) - { - // TODO: Use conflict detection code to check for a matching set - } + void ConfigurationDatabase::RemoveSetHistory(const Configuration::ConfigurationSet& configurationSet) + { + THROW_HR_IF_NULL(E_POINTER, configurationSet); - if (setRowId) - { - m_database->RemoveSet(setRowId.value()); - m_connection->SetLastWriteTime(); - } + ExecuteWriteOperation("RemoveSetHistory", + [&](std::shared_ptr& database) + { + std::optional setRowId = database->GetSetRowId(configurationSet.InstanceIdentifier()); - transaction->Commit(); -#ifdef AICLI_DISABLE_TEST_HOOKS - } - CATCH_LOG(); -#endif + if (!setRowId) + { + // TODO: Use conflict detection code to check for a matching set + } + + if (setRowId) + { + database->RemoveSet(setRowId.value()); + std::atomic_load(&m_connection)->SetLastWriteTime(); + } + }, true); } void ConfigurationDatabase::AddQueueItem(const Configuration::ConfigurationSet& configurationSet, const std::string& objectName) { -#ifdef AICLI_DISABLE_TEST_HOOKS - // While under development, treat errors escaping this function as a test hook. - try - { -#endif THROW_HR_IF_NULL(E_POINTER, configurationSet); - THROW_HR_IF_NULL(E_NOT_VALID_STATE, m_database); - auto transaction = BeginTransaction("AddQueueItem"); + ExecuteWriteOperation("AddQueueItem", + [&](std::shared_ptr& database) + { + database->AddQueueItem(configurationSet.InstanceIdentifier(), objectName); + }); + } - m_database->AddQueueItem(configurationSet.InstanceIdentifier(), objectName); - m_connection->SetLastWriteTime(); + void ConfigurationDatabase::SetActiveQueueItem(const std::string& objectName) + { + ExecuteWriteOperation("SetActiveQueueItem", + [&](std::shared_ptr& database) + { + database->SetActiveQueueItem(objectName); + }); + } - transaction->Commit(); -#ifdef AICLI_DISABLE_TEST_HOOKS - } - CATCH_LOG(); -#endif + std::vector ConfigurationDatabase::GetQueueItems() const + { + return ExecuteReadOperation("GetQueueItems", + [&](std::shared_ptr& database) + { + std::vector result; + auto queueItems = database->GetQueueItems(); + result.reserve(queueItems.size()); + + for (const auto& item : queueItems) + { + QueueItem resultItem; + std::tie(resultItem.SetInstanceIdentifier, resultItem.ObjectName, resultItem.QueuedAt, resultItem.ProcessId, resultItem.Active) = item; + result.emplace_back(std::move(resultItem)); + } + + return result; + }, true); } - void ConfigurationDatabase::SetActiveQueueItem(const std::string& objectName) + void ConfigurationDatabase::RemoveQueueItem(const std::string& objectName) { -#ifdef AICLI_DISABLE_TEST_HOOKS - // While under development, treat errors escaping this function as a test hook. - try - { -#endif - THROW_HR_IF_NULL(E_NOT_VALID_STATE, m_database); + ExecuteWriteOperation("RemoveQueueItem", + [&](std::shared_ptr& database) + { + database->RemoveQueueItem(objectName); + }); + } - auto transaction = BeginTransaction("SetActiveQueueItem"); + std::vector ConfigurationDatabase::GetStatusSince(int64_t changeIdentifier) const + { + return ExecuteReadOperation("GetStatusSince", + [&](std::shared_ptr& database) + { + return ConvertStatusItems(database->GetStatusSince(changeIdentifier)); + }); + } - m_database->SetActiveQueueItem(objectName); - m_connection->SetLastWriteTime(); + ConfigurationDatabase::StatusBaseline ConfigurationDatabase::GetStatusBaseline() const + { + return ExecuteReadOperation("GetStatusBaseline", + [&](std::shared_ptr& database) + { + auto [changeIdentifier, setStatus] = database->GetStatusBaseline(); - transaction->Commit(); -#ifdef AICLI_DISABLE_TEST_HOOKS - } - CATCH_LOG(); -#endif + StatusBaseline result{}; + result.ChangeIdentifier = changeIdentifier; + result.SetStatus = ConvertStatusItems(setStatus); + return result; + }); } - std::vector ConfigurationDatabase::GetQueueItems() const + void ConfigurationDatabase::AddListener(const std::string& objectName) { -#ifdef AICLI_DISABLE_TEST_HOOKS - // While under development, treat errors escaping this function as a test hook. - try - { -#endif - THROW_HR_IF_NULL(E_NOT_VALID_STATE, m_database); + ExecuteWriteOperation("AddListener", + [&](std::shared_ptr& database) + { + database->AddListener(objectName); + }); + } - auto transaction = BeginTransaction("GetQueueItems"); + void ConfigurationDatabase::RemoveListener(const std::string& objectName) + { + ExecuteWriteOperation("RemoveListener", + [&](std::shared_ptr& database) + { + database->RemoveListener(objectName); + }); + } - std::vector result; - auto queueItems = m_database->GetQueueItems(); - result.reserve(queueItems.size()); + std::vector ConfigurationDatabase::GetChangeListeners() const + { + return ExecuteReadOperation("GetChangeListeners", + [&](std::shared_ptr& database) + { + std::vector result; - for (const auto& item : queueItems) - { - QueueItem resultItem; - std::tie(resultItem.SetInstanceIdentifier, resultItem.ObjectName, resultItem.QueuedAt, resultItem.Active) = item; - result.emplace_back(std::move(resultItem)); - } + for (const auto& item : database->GetChangeListeners()) + { + StatusChangeListener listener{}; + std::tie(listener.ObjectName, listener.Started, listener.ProcessId) = item; + result.emplace_back(std::move(listener)); + } - return result; -#ifdef AICLI_DISABLE_TEST_HOOKS - } - CATCH_LOG(); + return result; + }); + } - return {}; -#endif + void ConfigurationDatabase::UpdateSetState(const guid& setInstanceIdentifier, ConfigurationSetState state) + { + ExecuteWriteOperation("UpdateSetState", + [&](std::shared_ptr& database) + { + database->UpdateSetState(setInstanceIdentifier, state); + }); } - void ConfigurationDatabase::RemoveQueueItem(const std::string& objectName) + void ConfigurationDatabase::UpdateSetInQueue(const guid& setInstanceIdentifier, bool inQueue) { -#ifdef AICLI_DISABLE_TEST_HOOKS - // While under development, treat errors escaping this function as a test hook. - try - { -#endif - THROW_HR_IF_NULL(E_NOT_VALID_STATE, m_database); + ExecuteWriteOperation("UpdateSetInQueue", + [&](std::shared_ptr& database) + { + database->UpdateSetInQueue(setInstanceIdentifier, inQueue); + }); + } - auto transaction = BeginTransaction("RemoveQueueItem"); + void ConfigurationDatabase::UpdateUnitState(const guid& setInstanceIdentifier, const com_ptr& changeData) + { + ExecuteWriteOperation("UpdateUnitState", + [&](std::shared_ptr& database) + { + database->UpdateUnitState(setInstanceIdentifier, changeData); + }); + } - m_database->RemoveQueueItem(objectName); - m_connection->SetLastWriteTime(); + ConfigurationSetState ConfigurationDatabase::GetSetState(const guid& instanceIdentifier) + { + return ExecuteReadOperation("GetSetState", + [&](std::shared_ptr& database) + { + return database->GetSetState(instanceIdentifier); + }); + } - transaction->Commit(); -#ifdef AICLI_DISABLE_TEST_HOOKS - } - CATCH_LOG(); -#endif + std::chrono::system_clock::time_point ConfigurationDatabase::GetSetFirstApply(const guid& instanceIdentifier) + { + return ExecuteReadOperation("GetSetFirstApply", + [&](std::shared_ptr& database) + { + return database->GetSetFirstApply(instanceIdentifier); + }); } - ConfigurationDatabase::TransactionLock ConfigurationDatabase::BeginTransaction(std::string_view name) const + std::chrono::system_clock::time_point ConfigurationDatabase::GetSetApplyBegun(const guid& instanceIdentifier) { - THROW_HR_IF_NULL(E_NOT_VALID_STATE, m_connection); + return ExecuteReadOperation("GetSetApplyBegun", + [&](std::shared_ptr& database) + { + return database->GetSetApplyBegun(instanceIdentifier); + }); + } - TransactionLock result = m_connection->TryBeginTransaction(name); + std::chrono::system_clock::time_point ConfigurationDatabase::GetSetApplyEnded(const guid& instanceIdentifier) + { + return ExecuteReadOperation("GetSetApplyEnded", + [&](std::shared_ptr& database) + { + return database->GetSetApplyEnded(instanceIdentifier); + }); + } + + ConfigurationUnitState ConfigurationDatabase::GetUnitState(const guid& instanceIdentifier) + { + return ExecuteReadOperation("GetUnitState", + [&](std::shared_ptr& database) + { + return database->GetUnitState(instanceIdentifier); + }); + } + + IConfigurationUnitResultInformation ConfigurationDatabase::GetUnitResultInformation(const guid& instanceIdentifier) + { + return ExecuteReadOperation("GetUnitResultInformation", + [&](std::shared_ptr& database) + { + com_ptr> result; + + auto resultInformation = database->GetUnitResultInformation(instanceIdentifier); + + if (resultInformation) + { + result = make_self>(); + result->Initialize( + std::get<0>(resultInformation.value()), + ConvertToUTF16(std::get<1>(resultInformation.value())), + ConvertToUTF16(std::get<2>(resultInformation.value())), + std::get<3>(resultInformation.value())); + } + + IConfigurationUnitResultInformation actualResult; + if (result) + { + actualResult = *result; + } + + return actualResult; + }); + } + + ConfigurationDatabase::TransactionLock ConfigurationDatabase::BeginTransaction(std::string_view name, bool forWrite, std::shared_ptr& database) const + { + auto connection = std::atomic_load(&m_connection); + THROW_HR_IF_NULL(E_NOT_VALID_STATE, connection); + + TransactionLock result = connection->TryBeginTransaction(name, forWrite); while (!result) { { - auto connectionLock = m_connection->LockConnection(); - m_database = IConfigurationDatabase::CreateFor(m_connection); + auto connectionLock = connection->LockConnection(); + auto newDatabase = std::shared_ptr{ IConfigurationDatabase::CreateFor(connection) }; + if (std::atomic_compare_exchange_strong(&m_database, &database, newDatabase)) + { + database = newDatabase; + } } - result = m_connection->TryBeginTransaction(name); + result = connection->TryBeginTransaction(name, forWrite); } return result; diff --git a/src/Microsoft.Management.Configuration/Database/ConfigurationDatabase.h b/src/Microsoft.Management.Configuration/Database/ConfigurationDatabase.h index 4f47bed757..d147090ca2 100644 --- a/src/Microsoft.Management.Configuration/Database/ConfigurationDatabase.h +++ b/src/Microsoft.Management.Configuration/Database/ConfigurationDatabase.h @@ -1,15 +1,18 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #pragma once -#include "ConfigurationSet.h" +#include "ConfigurationSetChangeData.h" #include #include +#include #include +#include #include namespace winrt::Microsoft::Management::Configuration::implementation { - // Forward declaration of internal interface. + // Forward declarations + struct ConfigurationSet; struct IConfigurationDatabase; // Allows access to the configuration database. @@ -35,6 +38,9 @@ namespace winrt::Microsoft::Management::Configuration::implementation // Gets all of the configuration sets from the database. std::vector GetSetHistory() const; + // Gets the set with the given identifier. + ConfigurationSetPtr GetSet(const GUID& instanceIdentifier) const; + // Writes the given set to the database history, attempting to merge with a matching set if one exists unless preferNewHistory is true. void WriteSetHistory(const Configuration::ConfigurationSet& configurationSet, bool preferNewHistory); @@ -53,6 +59,7 @@ namespace winrt::Microsoft::Management::Configuration::implementation GUID SetInstanceIdentifier{}; std::string ObjectName; std::chrono::system_clock::time_point QueuedAt; + DWORD ProcessId{}; bool Active = false; }; @@ -62,13 +69,83 @@ namespace winrt::Microsoft::Management::Configuration::implementation // Removes the queue item with the given object name. void RemoveQueueItem(const std::string& objectName); + // A status line item. + struct StatusItem + { + int64_t ChangeIdentifier; + std::chrono::system_clock::time_point ChangeTime; + GUID SetInstanceIdentifier; + bool InQueue; + std::optional UnitInstanceIdentifier; + int32_t State; + std::optional ResultCode; + std::string ResultDescription; + std::string ResultDetails; + ConfigurationUnitResultSource ResultSource; + }; + + // Gets all changed status items after the given change identifier. + std::vector GetStatusSince(int64_t changeIdentifier) const; + + // The status baseline data. + struct StatusBaseline + { + int64_t ChangeIdentifier = 0; + std::vector SetStatus; + }; + + // Gets the current status baseline. + StatusBaseline GetStatusBaseline() const; + + // Data about a status change listener. + struct StatusChangeListener + { + std::string ObjectName; + std::chrono::system_clock::time_point Started; + DWORD ProcessId{}; + }; + + // Adds a listener to the database. + void AddListener(const std::string& objectName); + + // Removes a listener from the database. + void RemoveListener(const std::string& objectName); + + // Gets all listeners in the database. + std::vector GetChangeListeners() const; + + // Updates the set state in the database. + void UpdateSetState(const guid& setInstanceIdentifier, ConfigurationSetState state); + + // Updates the set "in queue" state in the database. + void UpdateSetInQueue(const guid& setInstanceIdentifier, bool inQueue); + + // Updates the unit state in the database. + void UpdateUnitState(const guid& setInstanceIdentifier, const com_ptr& changeData); + + // Read various status values. + ConfigurationSetState GetSetState(const guid& instanceIdentifier); + std::chrono::system_clock::time_point GetSetFirstApply(const guid& instanceIdentifier); + std::chrono::system_clock::time_point GetSetApplyBegun(const guid& instanceIdentifier); + std::chrono::system_clock::time_point GetSetApplyEnded(const guid& instanceIdentifier); + ConfigurationUnitState GetUnitState(const guid& instanceIdentifier); + IConfigurationUnitResultInformation GetUnitResultInformation(const guid& instanceIdentifier); + private: std::shared_ptr m_connection; - mutable std::unique_ptr m_database; + mutable std::shared_ptr m_database; - using TransactionLock = decltype(m_connection->TryBeginTransaction({})); + using TransactionLock = decltype(m_connection->TryBeginTransaction({}, true)); // Begins a transaction, which may require upgrading to a newer schema version. - TransactionLock BeginTransaction(std::string_view name) const; + TransactionLock BeginTransaction(std::string_view name, bool forWrite, std::shared_ptr& database) const; + + // Performs the boilerplate setup for a read, then executes the given operation. + template + auto ExecuteReadOperation(std::string_view operationName, OperationT&& operation, bool requireDatabase = false) const; + + // Performs the boilerplate setup for a write, then executes the given operation. + template + void ExecuteWriteOperation(std::string_view operationName, OperationT&& operation, bool silentlyIgnoreNoDatabase = false); }; } diff --git a/src/Microsoft.Management.Configuration/Database/Schema/0_1/Interface.h b/src/Microsoft.Management.Configuration/Database/Schema/0_1/Interface.h index c86c1b450f..9729edbd56 100644 --- a/src/Microsoft.Management.Configuration/Database/Schema/0_1/Interface.h +++ b/src/Microsoft.Management.Configuration/Database/Schema/0_1/Interface.h @@ -22,6 +22,9 @@ namespace winrt::Microsoft::Management::Configuration::implementation::Database: // Version 0.2 bool MigrateFrom(IConfigurationDatabase* current) override; + // Version 0.3 + ConfigurationSetPtr GetSet(const GUID& instanceIdentifier) override; + protected: std::shared_ptr m_storage; }; diff --git a/src/Microsoft.Management.Configuration/Database/Schema/0_1/Interface_0_1.cpp b/src/Microsoft.Management.Configuration/Database/Schema/0_1/Interface_0_1.cpp index f6314e8a85..02a40427b6 100644 --- a/src/Microsoft.Management.Configuration/Database/Schema/0_1/Interface_0_1.cpp +++ b/src/Microsoft.Management.Configuration/Database/Schema/0_1/Interface_0_1.cpp @@ -83,4 +83,10 @@ namespace winrt::Microsoft::Management::Configuration::implementation::Database: { return current->GetSchemaVersion() == s_InterfaceVersion; } + + Interface::ConfigurationSetPtr Interface::GetSet(const GUID& instanceIdentifier) + { + SetInfoTable setInfoTable(*m_storage); + return setInfoTable.GetSet(instanceIdentifier); + } } diff --git a/src/Microsoft.Management.Configuration/Database/Schema/0_1/SetInfoTable.cpp b/src/Microsoft.Management.Configuration/Database/Schema/0_1/SetInfoTable.cpp index a959ef17f3..1637f3afc3 100644 --- a/src/Microsoft.Management.Configuration/Database/Schema/0_1/SetInfoTable.cpp +++ b/src/Microsoft.Management.Configuration/Database/Schema/0_1/SetInfoTable.cpp @@ -28,10 +28,61 @@ namespace winrt::Microsoft::Management::Configuration::implementation::Database: constexpr std::string_view s_SetInfoTable_Column_Metadata = "metadata"sv; constexpr std::string_view s_SetInfoTable_Column_Parameters = "parameters"sv; constexpr std::string_view s_SetInfoTable_Column_Variables = "variables"sv; + + void BuildBaseSetSelectStatement(StatementBuilder& builder) + { + builder.Select({ + RowIDName, // 0 + s_SetInfoTable_Column_InstanceIdentifier, // 1 + s_SetInfoTable_Column_Name, // 2 + s_SetInfoTable_Column_Origin, // 3 + s_SetInfoTable_Column_Path, // 4 + s_SetInfoTable_Column_SchemaVersion, // 5 + s_SetInfoTable_Column_Metadata, // 6 + s_SetInfoTable_Column_Parameters, // 7 + s_SetInfoTable_Column_Variables, // 8 + }).From(s_SetInfoTable_Table); + } + + IConfigurationDatabase::ConfigurationSetPtr GetSetFromStatement(Statement& statement, UnitInfoTable& unitInfoTable) + { + auto configurationSet = make_self(statement.GetColumn(1)); + + configurationSet->Name(hstring{ ConvertToUTF16(statement.GetColumn(2)) }); + configurationSet->Origin(hstring{ ConvertToUTF16(statement.GetColumn(3)) }); + configurationSet->Path(hstring{ ConvertToUTF16(statement.GetColumn(4)) }); + + std::string schemaVersion = statement.GetColumn(5); + configurationSet->SchemaVersion(hstring{ ConvertToUTF16(schemaVersion) }); + + auto parser = ConfigurationSetParser::CreateForSchemaVersion(schemaVersion); + configurationSet->Metadata(parser->ParseValueSet(statement.GetColumn(6))); + THROW_HR_IF(E_NOTIMPL, !statement.GetColumn(7).empty()); + configurationSet->Variables(parser->ParseValueSet(statement.GetColumn(8))); + + std::vector winrtUnits; + for (const auto& unit : unitInfoTable.GetAllUnitsForSet(statement.GetColumn(0), schemaVersion)) + { + winrtUnits.emplace_back(*unit); + } + configurationSet->Units(std::move(winrtUnits)); + + return configurationSet; + } } SetInfoTable::SetInfoTable(Connection& connection) : m_connection(connection) {} + std::string_view SetInfoTable::TableName() + { + return s_SetInfoTable_Table; + } + + std::string_view SetInfoTable::InstanceIdentifierColumn() + { + return s_SetInfoTable_Column_InstanceIdentifier; + } + void SetInfoTable::Create() { Savepoint savepoint = Savepoint::Create(m_connection, "SetInfoTable_Create_0_1"); @@ -151,18 +202,7 @@ namespace winrt::Microsoft::Management::Configuration::implementation::Database: std::vector result; StatementBuilder builder; - builder.Select({ - RowIDName, // 0 - s_SetInfoTable_Column_InstanceIdentifier, // 1 - s_SetInfoTable_Column_Name, // 2 - s_SetInfoTable_Column_Origin, // 3 - s_SetInfoTable_Column_Path, // 4 - s_SetInfoTable_Column_FirstApply, // 5 - s_SetInfoTable_Column_SchemaVersion, // 6 - s_SetInfoTable_Column_Metadata, // 7 - s_SetInfoTable_Column_Parameters, // 8 - s_SetInfoTable_Column_Variables, // 9 - }).From(s_SetInfoTable_Table); + BuildBaseSetSelectStatement(builder); Statement getAllSets = builder.Prepare(m_connection); @@ -170,29 +210,7 @@ namespace winrt::Microsoft::Management::Configuration::implementation::Database: while (getAllSets.Step()) { - auto configurationSet = make_self(getAllSets.GetColumn(1)); - - configurationSet->Name(hstring{ ConvertToUTF16(getAllSets.GetColumn(2)) }); - configurationSet->Origin(hstring{ ConvertToUTF16(getAllSets.GetColumn(3)) }); - configurationSet->Path(hstring{ ConvertToUTF16(getAllSets.GetColumn(4)) }); - configurationSet->FirstApply(clock::from_sys(ConvertUnixEpochToSystemClock(getAllSets.GetColumn(5)))); - - std::string schemaVersion = getAllSets.GetColumn(6); - configurationSet->SchemaVersion(hstring{ ConvertToUTF16(schemaVersion) }); - - auto parser = ConfigurationSetParser::CreateForSchemaVersion(schemaVersion); - configurationSet->Metadata(parser->ParseValueSet(getAllSets.GetColumn(7))); - THROW_HR_IF(E_NOTIMPL, !getAllSets.GetColumn(8).empty()); - configurationSet->Variables(parser->ParseValueSet(getAllSets.GetColumn(9))); - - std::vector winrtUnits; - for (const auto& unit : unitInfoTable.GetAllUnitsForSet(getAllSets.GetColumn(0), schemaVersion)) - { - winrtUnits.emplace_back(*unit); - } - configurationSet->Units(std::move(winrtUnits)); - - result.emplace_back(std::move(configurationSet)); + result.emplace_back(GetSetFromStatement(getAllSets, unitInfoTable)); } return result; @@ -212,4 +230,33 @@ namespace winrt::Microsoft::Management::Configuration::implementation::Database: return std::nullopt; } + + IConfigurationDatabase::ConfigurationSetPtr SetInfoTable::GetSet(const GUID& instanceIdentifier) + { + IConfigurationDatabase::ConfigurationSetPtr result; + + StatementBuilder builder; + BuildBaseSetSelectStatement(builder); + builder.Where(s_SetInfoTable_Column_InstanceIdentifier).Equals(instanceIdentifier); + + Statement getSet = builder.Prepare(m_connection); + + if (getSet.Step()) + { + UnitInfoTable unitInfoTable(m_connection); + result = GetSetFromStatement(getSet, unitInfoTable); + } + + return result; + } + + std::chrono::system_clock::time_point SetInfoTable::GetSetFirstApply(const GUID& instanceIdentifier) + { + StatementBuilder builder; + builder.Select(s_SetInfoTable_Column_FirstApply).From(s_SetInfoTable_Table).Where(s_SetInfoTable_Column_InstanceIdentifier).Equals(instanceIdentifier); + + Statement statement = builder.Prepare(m_connection); + + return (statement.Step() ? ConvertUnixEpochToSystemClock(statement.GetColumn(0)) : std::chrono::system_clock::time_point{}); + } } diff --git a/src/Microsoft.Management.Configuration/Database/Schema/0_1/SetInfoTable.h b/src/Microsoft.Management.Configuration/Database/Schema/0_1/SetInfoTable.h index 648582d618..67223bfc88 100644 --- a/src/Microsoft.Management.Configuration/Database/Schema/0_1/SetInfoTable.h +++ b/src/Microsoft.Management.Configuration/Database/Schema/0_1/SetInfoTable.h @@ -13,6 +13,9 @@ namespace winrt::Microsoft::Management::Configuration::implementation::Database: { SetInfoTable(AppInstaller::SQLite::Connection& connection); + static std::string_view TableName(); + static std::string_view InstanceIdentifierColumn(); + // Creates the set info table. void Create(); @@ -32,6 +35,12 @@ namespace winrt::Microsoft::Management::Configuration::implementation::Database: // Gets the row id of the set with the given instance identifier. std::optional GetSetRowId(const GUID& instanceIdentifier); + // Gets the set with the given instance identifier. + IConfigurationDatabase::ConfigurationSetPtr GetSet(const GUID& instanceIdentifier); + + // Gets a set's first apply time. + std::chrono::system_clock::time_point GetSetFirstApply(const GUID& instanceIdentifier); + private: AppInstaller::SQLite::Connection& m_connection; }; diff --git a/src/Microsoft.Management.Configuration/Database/Schema/0_2/Interface.h b/src/Microsoft.Management.Configuration/Database/Schema/0_2/Interface.h index 1befe62faa..9ce330c2b4 100644 --- a/src/Microsoft.Management.Configuration/Database/Schema/0_2/Interface.h +++ b/src/Microsoft.Management.Configuration/Database/Schema/0_2/Interface.h @@ -19,7 +19,7 @@ namespace winrt::Microsoft::Management::Configuration::implementation::Database: bool MigrateFrom(IConfigurationDatabase* current) override; void AddQueueItem(const GUID& instanceIdentifier, const std::string& objectName) override; void SetActiveQueueItem(const std::string& objectName) override; - std::vector> GetQueueItems() override; + std::vector> GetQueueItems() override; void RemoveQueueItem(const std::string& objectName) override; private: diff --git a/src/Microsoft.Management.Configuration/Database/Schema/0_2/Interface_0_2.cpp b/src/Microsoft.Management.Configuration/Database/Schema/0_2/Interface_0_2.cpp index 7e5da16db2..3825d6e769 100644 --- a/src/Microsoft.Management.Configuration/Database/Schema/0_2/Interface_0_2.cpp +++ b/src/Microsoft.Management.Configuration/Database/Schema/0_2/Interface_0_2.cpp @@ -20,7 +20,10 @@ namespace winrt::Microsoft::Management::Configuration::implementation::Database: void Interface::InitializeDatabase() { V0_1::Interface::InitializeDatabase(); + + Savepoint savepoint = Savepoint::Create(*m_storage, "InitializeDatabase_0_2"); MigrateFrom0_1(); + savepoint.Commit(); } bool Interface::MigrateFrom(IConfigurationDatabase* current) @@ -51,7 +54,7 @@ namespace winrt::Microsoft::Management::Configuration::implementation::Database: void Interface::AddQueueItem(const GUID& instanceIdentifier, const std::string& objectName) { QueueTable queueTable(*m_storage); - queueTable.AddQueueItem(instanceIdentifier, objectName); + queueTable.AddQueueItemWithoutProcess(instanceIdentifier, objectName); } void Interface::SetActiveQueueItem(const std::string& objectName) @@ -60,10 +63,10 @@ namespace winrt::Microsoft::Management::Configuration::implementation::Database: queueTable.SetActiveQueueItem(objectName); } - std::vector> Interface::GetQueueItems() + std::vector> Interface::GetQueueItems() { QueueTable queueTable(*m_storage); - return queueTable.GetQueueItems(); + return queueTable.GetQueueItemsWithoutProcess(); } void Interface::RemoveQueueItem(const std::string& objectName) diff --git a/src/Microsoft.Management.Configuration/Database/Schema/0_2/QueueTable.cpp b/src/Microsoft.Management.Configuration/Database/Schema/0_2/QueueTable.cpp index fc3ba68cc6..adcd41ccc4 100644 --- a/src/Microsoft.Management.Configuration/Database/Schema/0_2/QueueTable.cpp +++ b/src/Microsoft.Management.Configuration/Database/Schema/0_2/QueueTable.cpp @@ -19,6 +19,7 @@ namespace winrt::Microsoft::Management::Configuration::implementation::Database: constexpr std::string_view s_QueueTable_Column_ObjectName = "object_name"sv; constexpr std::string_view s_QueueTable_Column_QueuedAt = "queued_at"sv; constexpr std::string_view s_QueueTable_Column_Active = "active"sv; + constexpr std::string_view s_QueueTable_Column_Process = "process"sv; } QueueTable::QueueTable(Connection& connection) : m_connection(connection) {} @@ -41,7 +42,19 @@ namespace winrt::Microsoft::Management::Configuration::implementation::Database: savepoint.Commit(); } - void QueueTable::AddQueueItem(const GUID& instanceIdentifier, const std::string& objectName) + void QueueTable::AddProcessColumn() + { + Savepoint savepoint = Savepoint::Create(m_connection, "QueueTable_AddProcessColumn_0_3"); + + StatementBuilder builder; + builder.AlterTable(s_QueueTable_Table).Add(s_QueueTable_Column_Process, Type::Int64).NotNull().Default(0); + + builder.Execute(m_connection); + + savepoint.Commit(); + } + + void QueueTable::AddQueueItemWithoutProcess(const GUID& instanceIdentifier, const std::string& objectName) { StatementBuilder builder; builder.InsertInto(s_QueueTable_Table).Columns({ @@ -59,6 +72,26 @@ namespace winrt::Microsoft::Management::Configuration::implementation::Database: builder.Execute(m_connection); } + void QueueTable::AddQueueItemWithProcess(const GUID& instanceIdentifier, const std::string& objectName) + { + StatementBuilder builder; + builder.InsertInto(s_QueueTable_Table).Columns({ + s_QueueTable_Column_SetInstanceIdentifier, + s_QueueTable_Column_ObjectName, + s_QueueTable_Column_QueuedAt, + s_QueueTable_Column_Active, + s_QueueTable_Column_Process + }).Values( + instanceIdentifier, + objectName, + GetCurrentUnixEpoch(), + false, + static_cast(GetCurrentProcessId()) + ); + + builder.Execute(m_connection); + } + void QueueTable::SetActiveQueueItem(const std::string& objectName) { StatementBuilder builder; @@ -67,7 +100,7 @@ namespace winrt::Microsoft::Management::Configuration::implementation::Database: builder.Execute(m_connection); } - std::vector> QueueTable::GetQueueItems() + std::vector> QueueTable::GetQueueItemsWithoutProcess() { StatementBuilder builder; builder.Select({ @@ -75,15 +108,38 @@ namespace winrt::Microsoft::Management::Configuration::implementation::Database: s_QueueTable_Column_ObjectName, s_QueueTable_Column_QueuedAt, s_QueueTable_Column_Active + }).From(s_QueueTable_Table).OrderBy({ s_QueueTable_Column_QueuedAt, RowIDName }); + + Statement statement = builder.Prepare(m_connection); + + std::vector> result; + + while (statement.Step()) + { + result.emplace_back(std::make_tuple(statement.GetColumn(0), statement.GetColumn(1), ConvertUnixEpochToSystemClock(statement.GetColumn(2)), 0, statement.GetColumn(3))); + } + + return result; + } + + std::vector> QueueTable::GetQueueItemsWithProcess() + { + StatementBuilder builder; + builder.Select({ + s_QueueTable_Column_SetInstanceIdentifier, + s_QueueTable_Column_ObjectName, + s_QueueTable_Column_QueuedAt, + s_QueueTable_Column_Active, + s_QueueTable_Column_Process }).From(s_QueueTable_Table).OrderBy({ s_QueueTable_Column_QueuedAt, RowIDName }); Statement statement = builder.Prepare(m_connection); - std::vector> result; + std::vector> result; while (statement.Step()) { - result.emplace_back(std::make_tuple(statement.GetColumn(0), statement.GetColumn(1), ConvertUnixEpochToSystemClock(statement.GetColumn(2)), statement.GetColumn(3))); + result.emplace_back(std::make_tuple(statement.GetColumn(0), statement.GetColumn(1), ConvertUnixEpochToSystemClock(statement.GetColumn(2)), static_cast(statement.GetColumn(4)), statement.GetColumn(3))); } return result; diff --git a/src/Microsoft.Management.Configuration/Database/Schema/0_2/QueueTable.h b/src/Microsoft.Management.Configuration/Database/Schema/0_2/QueueTable.h index 29f45d3030..b2efb9e7db 100644 --- a/src/Microsoft.Management.Configuration/Database/Schema/0_2/QueueTable.h +++ b/src/Microsoft.Management.Configuration/Database/Schema/0_2/QueueTable.h @@ -14,14 +14,23 @@ namespace winrt::Microsoft::Management::Configuration::implementation::Database: // Creates the queue table. void Create(); + // Adds the process column to the table. + void AddProcessColumn(); + + // Adds a new queue item for the given configuration set and object name. + void AddQueueItemWithoutProcess(const GUID& instanceIdentifier, const std::string& objectName); + // Adds a new queue item for the given configuration set and object name. - void AddQueueItem(const GUID& instanceIdentifier, const std::string& objectName); + void AddQueueItemWithProcess(const GUID& instanceIdentifier, const std::string& objectName); // Sets the queue item with the given object name as active. void SetActiveQueueItem(const std::string& objectName); // Gets all queue items in queue order (item at index 0 is active/next). - std::vector> GetQueueItems(); + std::vector> GetQueueItemsWithoutProcess(); + + // Gets all queue items in queue order (item at index 0 is active/next). + std::vector> GetQueueItemsWithProcess(); // Removes the queue item with the given object name. void RemoveQueueItem(const std::string& objectName); diff --git a/src/Microsoft.Management.Configuration/Database/Schema/0_3/ChangeListenerTable.cpp b/src/Microsoft.Management.Configuration/Database/Schema/0_3/ChangeListenerTable.cpp new file mode 100644 index 0000000000..bc735d3a2a --- /dev/null +++ b/src/Microsoft.Management.Configuration/Database/Schema/0_3/ChangeListenerTable.cpp @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +#include "pch.h" +#include "ChangeListenerTable.h" +#include +#include + +using namespace AppInstaller::SQLite; +using namespace AppInstaller::SQLite::Builder; +using namespace AppInstaller::Utility; + +namespace winrt::Microsoft::Management::Configuration::implementation::Database::Schema::V0_3 +{ + namespace + { + constexpr std::string_view s_ChangeListenerTable_Table = "change_listeners"sv; + + constexpr std::string_view s_ChangeListenerTable_Column_ObjectName = "object_name"sv; + constexpr std::string_view s_ChangeListenerTable_Column_StartedAt = "started_at"sv; + constexpr std::string_view s_ChangeListenerTable_Column_Process = "process"sv; + } + + ChangeListenerTable::ChangeListenerTable(Connection& connection) : m_connection(connection) {} + + void ChangeListenerTable::Create() + { + Savepoint savepoint = Savepoint::Create(m_connection, "ChangeListenerTable_Create_0_3"); + + StatementBuilder tableBuilder; + tableBuilder.CreateTable(s_ChangeListenerTable_Table).Columns({ + IntegerPrimaryKey(), + ColumnBuilder(s_ChangeListenerTable_Column_ObjectName, Type::Text).Unique().NotNull(), + ColumnBuilder(s_ChangeListenerTable_Column_StartedAt, Type::Int64).NotNull(), + ColumnBuilder(s_ChangeListenerTable_Column_Process, Type::Int64).NotNull(), + }); + + tableBuilder.Execute(m_connection); + + savepoint.Commit(); + } + + void ChangeListenerTable::AddChangeListener(const std::string& objectName) + { + StatementBuilder builder; + builder.InsertInto(s_ChangeListenerTable_Table).Columns({ + s_ChangeListenerTable_Column_ObjectName, + s_ChangeListenerTable_Column_StartedAt, + s_ChangeListenerTable_Column_Process + }).Values( + objectName, + GetCurrentUnixEpoch(), + static_cast(GetCurrentProcessId()) + ); + + builder.Execute(m_connection); + } + + void ChangeListenerTable::RemoveChangeListener(const std::string& objectName) + { + StatementBuilder builder; + builder.DeleteFrom(s_ChangeListenerTable_Table).Where(s_ChangeListenerTable_Column_ObjectName).Equals(objectName); + + builder.Execute(m_connection); + } + + std::vector> ChangeListenerTable::GetChangeListeners() + { + StatementBuilder builder; + builder.Select({ + s_ChangeListenerTable_Column_ObjectName, + s_ChangeListenerTable_Column_StartedAt, + s_ChangeListenerTable_Column_Process + }).From(s_ChangeListenerTable_Table); + + Statement statement = builder.Prepare(m_connection); + + std::vector> result; + + while (statement.Step()) + { + result.emplace_back(std::make_tuple(statement.GetColumn(0), ConvertUnixEpochToSystemClock(statement.GetColumn(1)), static_cast(statement.GetColumn(2)))); + } + + return result; + } +} diff --git a/src/Microsoft.Management.Configuration/Database/Schema/0_3/ChangeListenerTable.h b/src/Microsoft.Management.Configuration/Database/Schema/0_3/ChangeListenerTable.h new file mode 100644 index 0000000000..30fad84e9b --- /dev/null +++ b/src/Microsoft.Management.Configuration/Database/Schema/0_3/ChangeListenerTable.h @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +#pragma once +#include +#include +#include + +namespace winrt::Microsoft::Management::Configuration::implementation::Database::Schema::V0_3 +{ + struct ChangeListenerTable + { + ChangeListenerTable(AppInstaller::SQLite::Connection& connection); + + // Creates the table. + void Create(); + + // Adds a new change listener to the table. + void AddChangeListener(const std::string& objectName); + + // Removes the change listener with the given name from the table. + void RemoveChangeListener(const std::string& objectName); + + // Gets all change listeners. + std::vector> GetChangeListeners(); + + private: + AppInstaller::SQLite::Connection& m_connection; + }; +} diff --git a/src/Microsoft.Management.Configuration/Database/Schema/0_3/Interface.h b/src/Microsoft.Management.Configuration/Database/Schema/0_3/Interface.h new file mode 100644 index 0000000000..6c7d33443a --- /dev/null +++ b/src/Microsoft.Management.Configuration/Database/Schema/0_3/Interface.h @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +#pragma once +#include "Database/Schema/IConfigurationDatabase.h" +#include "Database/Schema/0_2/Interface.h" + +namespace winrt::Microsoft::Management::Configuration::implementation::Database::Schema::V0_3 +{ + struct Interface : public V0_2::Interface + { + using V0_2::Interface::Interface; + + const AppInstaller::SQLite::Version& GetSchemaVersion() override; + + // Version 0.1 + void InitializeDatabase() override; + void RemoveSet(AppInstaller::SQLite::rowid_t target) override; + + // Version 0.2 + bool MigrateFrom(IConfigurationDatabase* current) override; + void AddQueueItem(const GUID& instanceIdentifier, const std::string& objectName) override; + std::vector> GetQueueItems() override; + + // Version 0.3 + std::vector GetStatusSince(int64_t changeIdentifier) override; + std::tuple> GetStatusBaseline() override; + void AddListener(const std::string& objectName) override; + void RemoveListener(const std::string& objectName) override; + std::vector> GetChangeListeners() override; + void UpdateSetState(const guid& setInstanceIdentifier, ConfigurationSetState state) override; + void UpdateSetInQueue(const guid& setInstanceIdentifier, bool inQueue) override; + void UpdateUnitState(const guid& setInstanceIdentifier, const ConfigurationSetChangeDataPtr& changeData) override; + ConfigurationSetState GetSetState(const guid& instanceIdentifier) override; + std::chrono::system_clock::time_point GetSetFirstApply(const guid& instanceIdentifier) override; + std::chrono::system_clock::time_point GetSetApplyBegun(const guid& instanceIdentifier) override; + std::chrono::system_clock::time_point GetSetApplyEnded(const guid& instanceIdentifier) override; + ConfigurationUnitState GetUnitState(const guid& instanceIdentifier) override; + std::optional> GetUnitResultInformation(const guid& instanceIdentifier) override; + + private: + // Unconditionally attempts to migrate from the 0.2 base. + void MigrateFrom0_2(); + }; +} diff --git a/src/Microsoft.Management.Configuration/Database/Schema/0_3/Interface_0_3.cpp b/src/Microsoft.Management.Configuration/Database/Schema/0_3/Interface_0_3.cpp new file mode 100644 index 0000000000..b9d56f1a36 --- /dev/null +++ b/src/Microsoft.Management.Configuration/Database/Schema/0_3/Interface_0_3.cpp @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +#include "pch.h" +#include "Interface.h" +#include "Database/Schema/0_1/SetInfoTable.h" +#include "Database/Schema/0_2/QueueTable.h" +#include "StatusItemTable.h" +#include "ChangeListenerTable.h" +#include + +using namespace AppInstaller::SQLite; +using namespace AppInstaller::Utility; + +namespace winrt::Microsoft::Management::Configuration::implementation::Database::Schema::V0_3 +{ + static constexpr AppInstaller::SQLite::Version s_InterfaceVersion{ 0, 3 }; + + const AppInstaller::SQLite::Version& Interface::GetSchemaVersion() + { + return s_InterfaceVersion; + } + + void Interface::InitializeDatabase() + { + V0_2::Interface::InitializeDatabase(); + + Savepoint savepoint = Savepoint::Create(*m_storage, "InitializeDatabase_0_3"); + MigrateFrom0_2(); + savepoint.Commit(); + } + + void Interface::RemoveSet(AppInstaller::SQLite::rowid_t target) + { + Savepoint savepoint = Savepoint::Create(*m_storage, "RemoveSet_0_3"); + + V0_2::Interface::RemoveSet(target); + + StatusItemTable statusItemTable(*m_storage); + statusItemTable.RemoveForSet(target); + + savepoint.Commit(); + } + + bool Interface::MigrateFrom(IConfigurationDatabase* current) + { + auto currentSchemaVersion = current->GetSchemaVersion(); + if (currentSchemaVersion < s_InterfaceVersion) + { + if (V0_2::Interface::MigrateFrom(current)) + { + Savepoint savepoint = Savepoint::Create(*m_storage, "MigrateFrom0_2"); + + MigrateFrom0_2(); + s_InterfaceVersion.SetSchemaVersion(*m_storage); + + savepoint.Commit(); + + return true; + } + } + else if (currentSchemaVersion == s_InterfaceVersion) + { + return true; + } + + return false; + } + + void Interface::AddQueueItem(const GUID& instanceIdentifier, const std::string& objectName) + { + V0_2::QueueTable queueTable(*m_storage); + queueTable.AddQueueItemWithProcess(instanceIdentifier, objectName); + } + + std::vector> Interface::GetQueueItems() + { + V0_2::QueueTable queueTable(*m_storage); + return queueTable.GetQueueItemsWithProcess(); + } + + void Interface::MigrateFrom0_2() + { + V0_2::QueueTable queueTable(*m_storage); + queueTable.AddProcessColumn(); + + ChangeListenerTable changeListenerTable(*m_storage); + changeListenerTable.Create(); + + StatusItemTable statusItemTable(*m_storage); + statusItemTable.Create(); + } + + std::vector Interface::GetStatusSince(int64_t changeIdentifier) + { + StatusItemTable statusItemTable(*m_storage); + return statusItemTable.GetStatusSince(changeIdentifier); + } + + std::tuple> Interface::GetStatusBaseline() + { + StatusItemTable statusItemTable(*m_storage); + return statusItemTable.GetStatusBaseline(); + } + + void Interface::AddListener(const std::string& objectName) + { + ChangeListenerTable changeListenerTable(*m_storage); + changeListenerTable.AddChangeListener(objectName); + } + + void Interface::RemoveListener(const std::string& objectName) + { + ChangeListenerTable changeListenerTable(*m_storage); + changeListenerTable.RemoveChangeListener(objectName); + } + + std::vector> Interface::GetChangeListeners() + { + ChangeListenerTable changeListenerTable(*m_storage); + return changeListenerTable.GetChangeListeners(); + } + + void Interface::UpdateSetState(const guid& setInstanceIdentifier, ConfigurationSetState state) + { + StatusItemTable statusItemTable(*m_storage); + statusItemTable.UpdateSetState(setInstanceIdentifier, state); + } + + void Interface::UpdateSetInQueue(const guid& setInstanceIdentifier, bool inQueue) + { + StatusItemTable statusItemTable(*m_storage); + statusItemTable.UpdateSetInQueue(setInstanceIdentifier, inQueue); + } + + void Interface::UpdateUnitState(const guid& setInstanceIdentifier, const ConfigurationSetChangeDataPtr& changeData) + { + StatusItemTable statusItemTable(*m_storage); + statusItemTable.UpdateUnitState(setInstanceIdentifier, changeData); + } + + ConfigurationSetState Interface::GetSetState(const guid& instanceIdentifier) + { + StatusItemTable statusItemTable(*m_storage); + return statusItemTable.GetSetState(instanceIdentifier); + } + + std::chrono::system_clock::time_point Interface::GetSetFirstApply(const guid& instanceIdentifier) + { + V0_1::SetInfoTable setInfoTable(*m_storage); + return setInfoTable.GetSetFirstApply(instanceIdentifier); + } + + std::chrono::system_clock::time_point Interface::GetSetApplyBegun(const guid& instanceIdentifier) + { + StatusItemTable statusItemTable(*m_storage); + return statusItemTable.GetSetApplyBegun(instanceIdentifier); + } + + std::chrono::system_clock::time_point Interface::GetSetApplyEnded(const guid& instanceIdentifier) + { + StatusItemTable statusItemTable(*m_storage); + return statusItemTable.GetSetApplyEnded(instanceIdentifier); + } + + ConfigurationUnitState Interface::GetUnitState(const guid& instanceIdentifier) + { + StatusItemTable statusItemTable(*m_storage); + return statusItemTable.GetUnitState(instanceIdentifier); + } + + std::optional> Interface::GetUnitResultInformation(const guid& instanceIdentifier) + { + StatusItemTable statusItemTable(*m_storage); + return statusItemTable.GetUnitResultInformation(instanceIdentifier); + } +} diff --git a/src/Microsoft.Management.Configuration/Database/Schema/0_3/StatusItemTable.cpp b/src/Microsoft.Management.Configuration/Database/Schema/0_3/StatusItemTable.cpp new file mode 100644 index 0000000000..8465f3b0e8 --- /dev/null +++ b/src/Microsoft.Management.Configuration/Database/Schema/0_3/StatusItemTable.cpp @@ -0,0 +1,365 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +#include "pch.h" +#include "StatusItemTable.h" +#include "Database/Schema/0_1/SetInfoTable.h" +#include +#include +#include +#include + +using namespace AppInstaller::SQLite; +using namespace AppInstaller::SQLite::Builder; +using namespace AppInstaller::Utility; + +namespace winrt::Microsoft::Management::Configuration::implementation::Database::Schema::V0_3 +{ + namespace + { + constexpr std::string_view s_StatusItemTable_Table = "status_items"sv; + constexpr std::string_view s_StatusItemTable_ChangeIdentifierIndex = "status_items_change_idx"sv; + constexpr std::string_view s_StatusItemTable_SetRowIdIndex = "status_items_set_idx"sv; + constexpr std::string_view s_StatusItemTable_UnitInstanceIndex = "status_items_unit_idx"sv; + + constexpr std::string_view s_StatusItemTable_Column_ChangeIdentifier = "change_identifier"sv; + constexpr std::string_view s_StatusItemTable_Column_ChangeTimeInitial = "change_time_initial"sv; + constexpr std::string_view s_StatusItemTable_Column_ChangeTimeLatest = "change_time_latest"sv; + constexpr std::string_view s_StatusItemTable_Column_SetRowId = "set_rowid"sv; + constexpr std::string_view s_StatusItemTable_Column_InQueue = "in_queue"sv; + constexpr std::string_view s_StatusItemTable_Column_UnitInstanceIdentifier = "unit_instance_identifier"sv; + constexpr std::string_view s_StatusItemTable_Column_State = "state"sv; + constexpr std::string_view s_StatusItemTable_Column_ResultCode = "result_code"sv; + constexpr std::string_view s_StatusItemTable_Column_ResultDescription = "result_description"sv; + constexpr std::string_view s_StatusItemTable_Column_ResultDetails = "result_details"sv; + constexpr std::string_view s_StatusItemTable_Column_ResultSource = "result_source"sv; + + void BuildBaseStatusSelectStatement(StatementBuilder& builder) + { + builder.Select({ + s_StatusItemTable_Column_ChangeIdentifier, // 0 + s_StatusItemTable_Column_ChangeTimeLatest, // 1 + V0_1::SetInfoTable::InstanceIdentifierColumn(), // 2 + s_StatusItemTable_Column_InQueue, // 3 + s_StatusItemTable_Column_UnitInstanceIdentifier, // 4 + s_StatusItemTable_Column_State, // 5 + s_StatusItemTable_Column_ResultCode, // 6 + s_StatusItemTable_Column_ResultDescription, // 7 + s_StatusItemTable_Column_ResultDetails, // 8 + s_StatusItemTable_Column_ResultSource, // 9 + }).From(s_StatusItemTable_Table).LeftOuterJoin(V0_1::SetInfoTable::TableName()).On(QualifiedColumn{ s_StatusItemTable_Table, s_StatusItemTable_Column_SetRowId }, QualifiedColumn{ V0_1::SetInfoTable::TableName(), RowIDName }); + } + + IConfigurationDatabase::StatusItemTuple GetTupleFromStatement(Statement& statement) + { + return std::make_tuple( + statement.GetColumn(0), + ConvertUnixEpochToSystemClock(statement.GetColumn(1)), + statement.GetColumn(2), + statement.GetColumn(3), + statement.GetColumnIsNull(4) ? std::nullopt : std::make_optional(statement.GetColumn(4)), + statement.GetColumn(5), + statement.GetColumnIsNull(6) ? std::nullopt : std::make_optional(statement.GetColumn(6)), + statement.GetColumnIsNull(7) ? std::string{} : statement.GetColumn(7), + statement.GetColumnIsNull(8) ? std::string{} : statement.GetColumn(8), + statement.GetColumnIsNull(9) ? ConfigurationUnitResultSource::None : statement.GetColumn(9) + ); + } + + int64_t GetLatestChangeIdentifier(Connection& connection) + { + StatementBuilder getLatestChangeBuilder; + getLatestChangeBuilder.Select().Column(Aggregate::Max, s_StatusItemTable_Column_ChangeIdentifier).From(s_StatusItemTable_Table); + + Statement getLatestChange = getLatestChangeBuilder.Prepare(connection); + + return (getLatestChange.Step() ? getLatestChange.GetColumn(0) : 0); + } + + int64_t GetNextChangeIdentifier(Connection& connection) + { + return GetLatestChangeIdentifier(connection) + 1; + } + + void UpdateStatus( + Connection& connection, + const GUID& setInstanceIdentifier, + const std::optional& state, + const std::optional& inQueue, + const std::optional& unitInstanceIdentifier = std::nullopt, + const std::optional& resultCode = std::nullopt, + const std::optional& resultDescription = std::nullopt, + const std::optional& resultDetails = std::nullopt, + const std::optional& resultSource = std::nullopt) + { + static constexpr std::string_view s_alias = "sub_expression"; + + int64_t changeIdentifier = GetNextChangeIdentifier(connection); + int64_t changeTime = GetCurrentUnixEpoch(); + + // Statement like: + // Update status_items set state = 1 from (Select rowid from set_info where instance_identifier = "foo") as sub where status_items.set_rowid = sub.rowid + StatementBuilder updateBuilder; + updateBuilder.Update(s_StatusItemTable_Table).Set(); + + if (state) + { + updateBuilder.Column(s_StatusItemTable_Column_State).Equals(state.value()); + } + + if (inQueue) + { + updateBuilder.Column(s_StatusItemTable_Column_InQueue).Equals(inQueue.value()); + } + + if (resultCode) + { + updateBuilder.Column(s_StatusItemTable_Column_ResultCode).Equals(resultCode.value()); + } + + if (resultDescription) + { + updateBuilder.Column(s_StatusItemTable_Column_ResultDescription).Equals(resultDescription.value()); + } + + if (resultDetails) + { + updateBuilder.Column(s_StatusItemTable_Column_ResultDetails).Equals(resultDetails.value()); + } + + if (resultSource) + { + updateBuilder.Column(s_StatusItemTable_Column_ResultSource).Equals(resultSource.value()); + } + + updateBuilder. + Column(s_StatusItemTable_Column_ChangeIdentifier).Equals(changeIdentifier). + Column(s_StatusItemTable_Column_ChangeTimeLatest).Equals(changeTime). + From().BeginParenthetical(). + Select(RowIDName).From(V0_1::SetInfoTable::TableName()).Where(V0_1::SetInfoTable::InstanceIdentifierColumn()).Equals(setInstanceIdentifier). + EndParenthetical().As(s_alias).Where(QualifiedColumn{ s_StatusItemTable_Table, s_StatusItemTable_Column_SetRowId }).Equals(QualifiedColumn{ s_alias, RowIDName }). + And(QualifiedColumn{ s_StatusItemTable_Table, s_StatusItemTable_Column_UnitInstanceIdentifier }).Equals(unitInstanceIdentifier); + + updateBuilder.Execute(connection); + + if (connection.GetChanges() == 0) + { + // No change; we need to insert the status row + StatementBuilder insertBuilder; + insertBuilder.InsertInto(s_StatusItemTable_Table).Columns({ + s_StatusItemTable_Column_ChangeIdentifier, + s_StatusItemTable_Column_ChangeTimeInitial, + s_StatusItemTable_Column_ChangeTimeLatest, + s_StatusItemTable_Column_SetRowId, + s_StatusItemTable_Column_InQueue, + s_StatusItemTable_Column_UnitInstanceIdentifier, + s_StatusItemTable_Column_State, + s_StatusItemTable_Column_ResultCode, + s_StatusItemTable_Column_ResultDescription, + s_StatusItemTable_Column_ResultDetails, + s_StatusItemTable_Column_ResultSource, + }).Select(). + Value(changeIdentifier). + Value(changeTime). + Value(changeTime). + Column(QualifiedColumn{ V0_1::SetInfoTable::TableName(), RowIDName }). + Value(inQueue.value_or(false)). + Value(unitInstanceIdentifier). + Value(state.value_or(0)). + Value(resultCode). + Value(resultDescription). + Value(resultDetails). + Value(resultSource). + From(V0_1::SetInfoTable::TableName()).Where(QualifiedColumn{ V0_1::SetInfoTable::TableName(), V0_1::SetInfoTable::InstanceIdentifierColumn() }).Equals(setInstanceIdentifier); + + insertBuilder.Execute(connection); + } + } + + Statement PrepareSelectStatusValues(Connection& connection, const std::optional& setInstanceIdentifier, const std::optional& unitInstanceIdentifier, std::initializer_list columns) + { + THROW_HR_IF(E_INVALIDARG, (setInstanceIdentifier && unitInstanceIdentifier) || (!setInstanceIdentifier && !unitInstanceIdentifier)); + + StatementBuilder builder; + builder.Select(columns).From(s_StatusItemTable_Table); + + if (setInstanceIdentifier) + { + builder.Join(V0_1::SetInfoTable::TableName()).On(QualifiedColumn{ s_StatusItemTable_Table, s_StatusItemTable_Column_SetRowId }, QualifiedColumn{ V0_1::SetInfoTable::TableName(), RowIDName }). + Where(QualifiedColumn{ V0_1::SetInfoTable::TableName(), V0_1::SetInfoTable::InstanceIdentifierColumn() }).Equals(setInstanceIdentifier). + And(s_StatusItemTable_Column_UnitInstanceIdentifier).IsNull(); + } + else + { + builder.Where(s_StatusItemTable_Column_UnitInstanceIdentifier).Equals(unitInstanceIdentifier.value()); + } + + return builder.Prepare(connection); + } + } + + StatusItemTable::StatusItemTable(Connection& connection) : m_connection(connection) {} + + void StatusItemTable::Create() + { + Savepoint savepoint = Savepoint::Create(m_connection, "StatusItemTable_Create_0_3"); + + StatementBuilder tableBuilder; + tableBuilder.CreateTable(s_StatusItemTable_Table).Columns({ + IntegerPrimaryKey(), + ColumnBuilder(s_StatusItemTable_Column_ChangeIdentifier, Type::Int64).NotNull(), + ColumnBuilder(s_StatusItemTable_Column_ChangeTimeInitial, Type::Int64).NotNull(), + ColumnBuilder(s_StatusItemTable_Column_ChangeTimeLatest, Type::Int64).NotNull(), + ColumnBuilder(s_StatusItemTable_Column_SetRowId, Type::RowId).NotNull(), + ColumnBuilder(s_StatusItemTable_Column_InQueue, Type::Bool).NotNull(), + ColumnBuilder(s_StatusItemTable_Column_UnitInstanceIdentifier, Type::Blob), + ColumnBuilder(s_StatusItemTable_Column_State, Type::Int).NotNull(), + ColumnBuilder(s_StatusItemTable_Column_ResultCode, Type::Int), + ColumnBuilder(s_StatusItemTable_Column_ResultDescription, Type::Text), + ColumnBuilder(s_StatusItemTable_Column_ResultDetails, Type::Text), + ColumnBuilder(s_StatusItemTable_Column_ResultSource, Type::Int), + }); + + tableBuilder.Execute(m_connection); + + { + StatementBuilder indexBuilder; + indexBuilder.CreateIndex(s_StatusItemTable_ChangeIdentifierIndex).On(s_StatusItemTable_Table).Columns(s_StatusItemTable_Column_ChangeIdentifier); + indexBuilder.Execute(m_connection); + } + + { + StatementBuilder indexBuilder; + indexBuilder.CreateIndex(s_StatusItemTable_SetRowIdIndex).On(s_StatusItemTable_Table).Columns(s_StatusItemTable_Column_SetRowId); + indexBuilder.Execute(m_connection); + } + + { + StatementBuilder indexBuilder; + indexBuilder.CreateUniqueIndex(s_StatusItemTable_UnitInstanceIndex).On(s_StatusItemTable_Table).Columns(s_StatusItemTable_Column_UnitInstanceIdentifier); + indexBuilder.Execute(m_connection); + } + + savepoint.Commit(); + } + + void StatusItemTable::RemoveForSet(AppInstaller::SQLite::rowid_t target) + { + StatementBuilder builder; + builder.DeleteFrom(s_StatusItemTable_Table).Where(s_StatusItemTable_Column_SetRowId).Equals(target); + builder.Execute(m_connection); + } + + std::vector StatusItemTable::GetStatusSince(int64_t changeIdentifier) + { + StatementBuilder builder; + BuildBaseStatusSelectStatement(builder); + builder.Where(s_StatusItemTable_Column_ChangeIdentifier).IsGreaterThan(changeIdentifier).OrderBy(s_StatusItemTable_Column_ChangeIdentifier); + + Statement statement = builder.Prepare(m_connection); + + std::vector result; + + while (statement.Step()) + { + result.emplace_back(GetTupleFromStatement(statement)); + } + + return result; + } + + std::tuple> StatusItemTable::GetStatusBaseline() + { + int64_t latestChange = GetLatestChangeIdentifier(m_connection); + std::vector setStatus; + + StatementBuilder builder; + BuildBaseStatusSelectStatement(builder); + builder.Where(s_StatusItemTable_Column_UnitInstanceIdentifier).IsNull(); + + Statement statement = builder.Prepare(m_connection); + + while (statement.Step()) + { + setStatus.emplace_back(GetTupleFromStatement(statement)); + } + + return std::make_tuple(latestChange, std::move(setStatus)); + } + + void StatusItemTable::UpdateSetState(const guid& setInstanceIdentifier, ConfigurationSetState state) + { + UpdateStatus(m_connection, setInstanceIdentifier, AppInstaller::ToIntegral(state), std::nullopt); + } + + void StatusItemTable::UpdateSetInQueue(const guid& setInstanceIdentifier, bool inQueue) + { + UpdateStatus(m_connection, setInstanceIdentifier, std::nullopt, inQueue); + } + + void StatusItemTable::UpdateUnitState(const guid& setInstanceIdentifier, const IConfigurationDatabase::ConfigurationSetChangeDataPtr& changeData) + { + const auto& resultInformation = changeData->ResultInformation(); + + std::optional resultCode; + std::optional resultDescription; + std::optional resultDetails; + std::optional resultSource; + + if (resultInformation) + { + resultCode = resultInformation.ResultCode(); + resultDescription = ConvertToUTF8(resultInformation.Description()); + resultDetails = ConvertToUTF8(resultInformation.Details()); + resultSource = resultInformation.ResultSource(); + } + + UpdateStatus(m_connection, setInstanceIdentifier, AppInstaller::ToIntegral(changeData->UnitState()), std::nullopt, changeData->Unit().InstanceIdentifier(), resultCode, resultDescription, resultDetails, resultSource); + } + + ConfigurationSetState StatusItemTable::GetSetState(const guid& instanceIdentifier) + { + Statement statement = PrepareSelectStatusValues(m_connection, instanceIdentifier, std::nullopt, { s_StatusItemTable_Column_State }); + + return (statement.Step() ? statement.GetColumn(0) : ConfigurationSetState::Unknown); + } + + std::chrono::system_clock::time_point StatusItemTable::GetSetApplyBegun(const GUID& instanceIdentifier) + { + Statement statement = PrepareSelectStatusValues(m_connection, instanceIdentifier, std::nullopt, { s_StatusItemTable_Column_ChangeTimeInitial }); + + return (statement.Step() ? ConvertUnixEpochToSystemClock(statement.GetColumn(0)) : std::chrono::system_clock::time_point{}); + } + + std::chrono::system_clock::time_point StatusItemTable::GetSetApplyEnded(const GUID& instanceIdentifier) + { + Statement statement = PrepareSelectStatusValues(m_connection, instanceIdentifier, std::nullopt, { s_StatusItemTable_Column_ChangeTimeLatest, s_StatusItemTable_Column_InQueue }); + + // Only return the end time if no longer in the queue + if (statement.Step() && !statement.GetColumn(1)) + { + return ConvertUnixEpochToSystemClock(statement.GetColumn(0)); + } + + return std::chrono::system_clock::time_point{}; + } + + ConfigurationUnitState StatusItemTable::GetUnitState(const guid& instanceIdentifier) + { + Statement statement = PrepareSelectStatusValues(m_connection, std::nullopt, instanceIdentifier, { s_StatusItemTable_Column_State }); + + return (statement.Step() ? statement.GetColumn(0) : ConfigurationUnitState::Unknown); + } + + std::optional> StatusItemTable::GetUnitResultInformation(const guid& instanceIdentifier) + { + Statement statement = PrepareSelectStatusValues(m_connection, std::nullopt, instanceIdentifier, + { s_StatusItemTable_Column_ResultCode, s_StatusItemTable_Column_ResultDescription, s_StatusItemTable_Column_ResultDetails, s_StatusItemTable_Column_ResultSource }); + + if (statement.Step() && !statement.GetColumnIsNull(0)) + { + return statement.GetRow(); + } + + return std::nullopt; + } +} diff --git a/src/Microsoft.Management.Configuration/Database/Schema/0_3/StatusItemTable.h b/src/Microsoft.Management.Configuration/Database/Schema/0_3/StatusItemTable.h new file mode 100644 index 0000000000..3354c6669d --- /dev/null +++ b/src/Microsoft.Management.Configuration/Database/Schema/0_3/StatusItemTable.h @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +#pragma once +#include "Database/Schema/IConfigurationDatabase.h" +#include +#include +#include + +namespace winrt::Microsoft::Management::Configuration::implementation::Database::Schema::V0_3 +{ + struct StatusItemTable + { + StatusItemTable(AppInstaller::SQLite::Connection& connection); + + // Creates the table. + void Create(); + + // Removes the status for the target set. + void RemoveForSet(AppInstaller::SQLite::rowid_t target); + + // Gets all status items that have changed since the given change identifier, in order of changes (last item is the new latest change to pass next). + std::vector GetStatusSince(int64_t changeIdentifier); + + // Gets the latest change identifier and the set status items. + std::tuple> GetStatusBaseline(); + + // Updates a set's state. + void UpdateSetState(const guid& setInstanceIdentifier, ConfigurationSetState state); + + // Updates whether a set is in the queue or not. + void UpdateSetInQueue(const guid& setInstanceIdentifier, bool inQueue); + + // Updates a unit's state. + void UpdateUnitState(const guid& setInstanceIdentifier, const IConfigurationDatabase::ConfigurationSetChangeDataPtr& changeData); + + // Gets a set's state. + ConfigurationSetState GetSetState(const guid& instanceIdentifier); + + // Gets a set's latest apply begin time. + std::chrono::system_clock::time_point GetSetApplyBegun(const GUID& instanceIdentifier); + + // Gets a set's latest apply end time. + std::chrono::system_clock::time_point GetSetApplyEnded(const GUID& instanceIdentifier); + + // Gets a unit's state. + ConfigurationUnitState GetUnitState(const guid& instanceIdentifier); + + // Gets a unit's latest result information. + std::optional> GetUnitResultInformation(const guid& instanceIdentifier); + + private: + AppInstaller::SQLite::Connection& m_connection; + }; +} diff --git a/src/Microsoft.Management.Configuration/Database/Schema/IConfigurationDatabase.cpp b/src/Microsoft.Management.Configuration/Database/Schema/IConfigurationDatabase.cpp index e2afd9e934..9581ba62a9 100644 --- a/src/Microsoft.Management.Configuration/Database/Schema/IConfigurationDatabase.cpp +++ b/src/Microsoft.Management.Configuration/Database/Schema/IConfigurationDatabase.cpp @@ -5,6 +5,7 @@ #include "Database/Schema/0_1/Interface.h" #include "Database/Schema/0_2/Interface.h" +#include "Database/Schema/0_3/Interface.h" namespace winrt::Microsoft::Management::Configuration::implementation { @@ -16,10 +17,11 @@ namespace winrt::Microsoft::Management::Configuration::implementation if (version.MajorVersion == 0) { - constexpr std::array(*)(const StorageT& s), 2> versionCreatorMap = + constexpr std::array(*)(const StorageT& s), 3> versionCreatorMap = { [](const StorageT& s) { return std::unique_ptr(std::make_unique(s)); }, [](const StorageT& s) { return std::unique_ptr(std::make_unique(s)); }, + [](const StorageT& s) { return std::unique_ptr(std::make_unique(s)); }, }; size_t minorVersion = static_cast(version.MinorVersion); @@ -36,7 +38,7 @@ namespace winrt::Microsoft::Management::Configuration::implementation AppInstaller::SQLite::Version IConfigurationDatabase::GetLatestVersion() { - return { 0, 2 }; + return { 0, 3 }; } std::unique_ptr IConfigurationDatabase::CreateFor(const std::shared_ptr& storage, bool allowMigration) @@ -66,7 +68,7 @@ namespace winrt::Microsoft::Management::Configuration::implementation { } - std::vector> IConfigurationDatabase::GetQueueItems() + std::vector> IConfigurationDatabase::GetQueueItems() { return {}; } @@ -74,4 +76,69 @@ namespace winrt::Microsoft::Management::Configuration::implementation void IConfigurationDatabase::RemoveQueueItem(const std::string&) { } + + std::vector IConfigurationDatabase::GetStatusSince(int64_t) + { + return {}; + } + + std::tuple> IConfigurationDatabase::GetStatusBaseline() + { + return { 0, {} }; + } + + void IConfigurationDatabase::AddListener(const std::string&) + { + } + + void IConfigurationDatabase::RemoveListener(const std::string&) + { + } + + std::vector> IConfigurationDatabase::GetChangeListeners() + { + return {}; + } + + void IConfigurationDatabase::UpdateSetState(const guid&, ConfigurationSetState) + { + } + + void IConfigurationDatabase::UpdateSetInQueue(const guid&, bool) + { + } + + void IConfigurationDatabase::UpdateUnitState(const guid&, const ConfigurationSetChangeDataPtr&) + { + } + + ConfigurationSetState IConfigurationDatabase::GetSetState(const guid&) + { + return ConfigurationSetState::Unknown; + } + + std::chrono::system_clock::time_point IConfigurationDatabase::GetSetFirstApply(const guid&) + { + return {}; + } + + std::chrono::system_clock::time_point IConfigurationDatabase::GetSetApplyBegun(const guid&) + { + return {}; + } + + std::chrono::system_clock::time_point IConfigurationDatabase::GetSetApplyEnded(const guid&) + { + return {}; + } + + ConfigurationUnitState IConfigurationDatabase::GetUnitState(const guid&) + { + return ConfigurationUnitState::Unknown; + } + + std::optional> IConfigurationDatabase::GetUnitResultInformation(const guid&) + { + return std::nullopt; + } } diff --git a/src/Microsoft.Management.Configuration/Database/Schema/IConfigurationDatabase.h b/src/Microsoft.Management.Configuration/Database/Schema/IConfigurationDatabase.h index 456e88831a..a924111734 100644 --- a/src/Microsoft.Management.Configuration/Database/Schema/IConfigurationDatabase.h +++ b/src/Microsoft.Management.Configuration/Database/Schema/IConfigurationDatabase.h @@ -4,6 +4,7 @@ #include "winrt/Microsoft.Management.Configuration.h" #include "ConfigurationSet.h" #include "ConfigurationUnit.h" +#include "ConfigurationSetChangeData.h" #include #include #include @@ -17,6 +18,7 @@ namespace winrt::Microsoft::Management::Configuration::implementation { using ConfigurationSetPtr = winrt::com_ptr; using ConfigurationUnitPtr = winrt::com_ptr; + using ConfigurationSetChangeDataPtr = winrt::com_ptr; virtual ~IConfigurationDatabase() = default; @@ -63,9 +65,69 @@ namespace winrt::Microsoft::Management::Configuration::implementation virtual void SetActiveQueueItem(const std::string& objectName); // Gets all queue items in queue order (item at index 0 is active/next). - virtual std::vector> GetQueueItems(); + virtual std::vector> GetQueueItems(); // Removes the queue item with the given object name. virtual void RemoveQueueItem(const std::string& objectName); + + // Version 0.3 + + // Gets a set from the database. + virtual ConfigurationSetPtr GetSet(const GUID& instanceIdentifier) = 0; + + // The tuple returned for status items. + using StatusItemTuple = std::tuple< + int64_t, + std::chrono::system_clock::time_point, + GUID, + bool, + std::optional, + int32_t, + std::optional, + std::string, + std::string, + ConfigurationUnitResultSource>; + + // Gets all status items that have changed since the given change identifier, in order of changes (last item is the new latest change to pass next). + virtual std::vector GetStatusSince(int64_t changeIdentifier); + + // Gets the latest change identifier and the set status items. + virtual std::tuple> GetStatusBaseline(); + + // Adds a new listener to the database. + virtual void AddListener(const std::string& objectName); + + // Removes a listener from the database. + virtual void RemoveListener(const std::string& objectName); + + // Gets all of the change listeners in the database. + virtual std::vector> GetChangeListeners(); + + // Updates a set's state. + virtual void UpdateSetState(const guid& setInstanceIdentifier, ConfigurationSetState state); + + // Updates whether a set is in the queue or not. + virtual void UpdateSetInQueue(const guid& setInstanceIdentifier, bool inQueue); + + // Updates a unit's state. + virtual void UpdateUnitState(const guid& setInstanceIdentifier, const ConfigurationSetChangeDataPtr& changeData); + + // Gets a set's state. + virtual ConfigurationSetState GetSetState(const guid& instanceIdentifier); + + // Gets a set's first apply time. + virtual std::chrono::system_clock::time_point GetSetFirstApply(const guid& instanceIdentifier); + + // Gets a set's latest apply begin time. + virtual std::chrono::system_clock::time_point GetSetApplyBegun(const guid& instanceIdentifier); + + // Gets a set's latest apply end time. + virtual std::chrono::system_clock::time_point GetSetApplyEnded(const guid& instanceIdentifier); + + // Gets a unit's state. + virtual ConfigurationUnitState GetUnitState(const guid& instanceIdentifier); + + // Gets a unit's latest result information. + virtual std::optional> GetUnitResultInformation(const guid& instanceIdentifier); }; } diff --git a/src/Microsoft.Management.Configuration/Microsoft.Management.Configuration.idl b/src/Microsoft.Management.Configuration/Microsoft.Management.Configuration.idl index fff916c7b2..88429d6b16 100644 --- a/src/Microsoft.Management.Configuration/Microsoft.Management.Configuration.idl +++ b/src/Microsoft.Management.Configuration/Microsoft.Management.Configuration.idl @@ -278,7 +278,7 @@ namespace Microsoft.Management.Configuration // The state of the configuration set for this event (the ConfigurationSet can be used to get the current state, which may be different). ConfigurationSetState SetState{ get; }; - + // The state of the configuration unit for this event (the ConfigurationUnit can be used to get the current state, which may be different). ConfigurationUnitState UnitState{ get; }; @@ -368,7 +368,7 @@ namespace Microsoft.Management.Configuration String SchemaVersion; // Only changes for this set are sent to this event. - // This includes things like: start/stop of the entire set for application or test, start/stop of a unit for application or test. + // This includes things like: start/stop of the entire set for application, start/stop of a unit for application. event Windows.Foundation.TypedEventHandler ConfigurationSetChange; // Writes the configuration set to the given stream. @@ -858,7 +858,7 @@ namespace Microsoft.Management.Configuration Boolean GenerateTelemetryEvents; // Only top level configuration changes are sent to this event. - // This includes things like: creation of a new set for intent to run, start/stop of a set for application or test, deletion of a not started set. + // This includes things like: creation of a new set for intent to run, start/stop of a set for application, deletion of a not started set. event Windows.Foundation.TypedEventHandler ConfigurationChange; // Gets the configuration sets that have already been applied or with the intent to be applied (this may include in progress sets or those that are waiting on others). diff --git a/src/Microsoft.Management.Configuration/Microsoft.Management.Configuration.vcxproj b/src/Microsoft.Management.Configuration/Microsoft.Management.Configuration.vcxproj index e910fab218..c5bb74e876 100644 --- a/src/Microsoft.Management.Configuration/Microsoft.Management.Configuration.vcxproj +++ b/src/Microsoft.Management.Configuration/Microsoft.Management.Configuration.vcxproj @@ -220,6 +220,7 @@ + @@ -228,6 +229,9 @@ + + + @@ -270,6 +274,7 @@ + @@ -278,6 +283,9 @@ + + + diff --git a/src/Microsoft.Management.Configuration/Microsoft.Management.Configuration.vcxproj.filters b/src/Microsoft.Management.Configuration/Microsoft.Management.Configuration.vcxproj.filters index ad372abd2b..6cc768f4d7 100644 --- a/src/Microsoft.Management.Configuration/Microsoft.Management.Configuration.vcxproj.filters +++ b/src/Microsoft.Management.Configuration/Microsoft.Management.Configuration.vcxproj.filters @@ -138,6 +138,18 @@ Database\Schema\0_2 + + Internals + + + Database\Schema\0_3 + + + Database\Schema\0_3 + + + Database\Schema\0_3 + @@ -285,6 +297,18 @@ Database\Schema\0_2 + + Internals + + + Database\Schema\0_3 + + + Database\Schema\0_3 + + + Database\Schema\0_3 + @@ -322,6 +346,9 @@ {f214d0f3-3e9c-469b-91ae-213315d39a69} + + {d059436d-cd54-4cf2-96bc-4db53c617537} + diff --git a/src/Microsoft.Management.Configuration/Telemetry/Telemetry.cpp b/src/Microsoft.Management.Configuration/Telemetry/Telemetry.cpp index 95866bab27..6f5e82cf4e 100644 --- a/src/Microsoft.Management.Configuration/Telemetry/Telemetry.cpp +++ b/src/Microsoft.Management.Configuration/Telemetry/Telemetry.cpp @@ -263,12 +263,12 @@ namespace winrt::Microsoft::Management::Configuration::implementation std::string_view action, const IConfigurationUnitResultInformation& resultInformation) const noexcept try { - // We only want to send telemetry for failures of publicly available units. - if (!IsTelemetryEnabled() || SUCCEEDED(static_cast(resultInformation.ResultCode()))) + if (!IsTelemetryEnabled()) { return; } + // We only want to send telemetry for publicly available units. IConfigurationUnitProcessorDetails details = unit.Details(); if (!details || !details.IsPublic()) { @@ -296,7 +296,6 @@ namespace winrt::Microsoft::Management::Configuration::implementation void TelemetryTraceLogger::LogConfigProcessingSummary( const guid& setIdentifier, std::string_view inputHash, - bool fromHistory, ConfigurationUnitIntent runIntent, hresult result, ConfigurationUnitResultSource failurePoint, @@ -310,7 +309,7 @@ namespace winrt::Microsoft::Management::Configuration::implementation "ConfigProcessingSummary", TraceLoggingGuid(setIdentifier, "SetID"), AICLI_TraceLoggingStringView(inputHash, "InputHash"), - TraceLoggingBool(fromHistory, "FromHistory"), + TraceLoggingBool(false, "FromHistory"), // deprecated TraceLoggingInt32(static_cast(runIntent), "RunIntent"), TraceLoggingHResult(result, "Result"), TraceLoggingInt32(static_cast(failurePoint), "FailurePoint"), @@ -325,7 +324,7 @@ namespace winrt::Microsoft::Management::Configuration::implementation "ConfigProcessingSummary", WinGet_EventItem(setIdentifier, "SetID"), WinGet_EventItem(inputHash, "InputHash"), - WinGet_EventItem(fromHistory, "FromHistory"), + WinGet_EventItem(false, "FromHistory"), // deprecated WinGet_EventItem(static_cast(runIntent), "RunIntent"), WinGet_EventItem(result, "Result"), WinGet_EventItem(static_cast(failurePoint), "FailurePoint"), @@ -347,7 +346,7 @@ namespace winrt::Microsoft::Management::Configuration::implementation ConfigRunSummaryData summaryData = ProcessRunResult(result.UnitResults()); - LogConfigProcessingSummary(configurationSet.InstanceIdentifier(), configurationSet.GetInputHash(), configurationSet.IsFromHistory(), ConfigurationUnitIntent::Assert, + LogConfigProcessingSummary(configurationSet.InstanceIdentifier(), configurationSet.GetInputHash(), ConfigurationUnitIntent::Assert, summaryData.Result, summaryData.FailurePoint, summaryData.AssertSummary, summaryData.InformSummary, summaryData.ApplySummary); } CATCH_LOG(); @@ -364,7 +363,7 @@ namespace winrt::Microsoft::Management::Configuration::implementation ConfigRunSummaryData summaryData = ProcessRunResult(result.UnitResults()); - LogConfigProcessingSummary(configurationSet.InstanceIdentifier(), configurationSet.GetInputHash(), configurationSet.IsFromHistory(), ConfigurationUnitIntent::Assert, + LogConfigProcessingSummary(configurationSet.InstanceIdentifier(), configurationSet.GetInputHash(), ConfigurationUnitIntent::Assert, error, ConfigurationUnitResultSource::Internal, summaryData.AssertSummary, summaryData.InformSummary, summaryData.ApplySummary); } CATCH_LOG(); @@ -380,7 +379,7 @@ namespace winrt::Microsoft::Management::Configuration::implementation ConfigRunSummaryData summaryData = ProcessRunResult(result.UnitResults()); - LogConfigProcessingSummary(configurationSet.InstanceIdentifier(), configurationSet.GetInputHash(), configurationSet.IsFromHistory(), ConfigurationUnitIntent::Apply, + LogConfigProcessingSummary(configurationSet.InstanceIdentifier(), configurationSet.GetInputHash(), ConfigurationUnitIntent::Apply, result.ResultCode(), summaryData.FailurePoint, summaryData.AssertSummary, summaryData.InformSummary, summaryData.ApplySummary); } CATCH_LOG(); @@ -397,7 +396,7 @@ namespace winrt::Microsoft::Management::Configuration::implementation ConfigRunSummaryData summaryData = ProcessRunResult(result.UnitResults()); - LogConfigProcessingSummary(configurationSet.InstanceIdentifier(), configurationSet.GetInputHash(), configurationSet.IsFromHistory(), ConfigurationUnitIntent::Apply, + LogConfigProcessingSummary(configurationSet.InstanceIdentifier(), configurationSet.GetInputHash(), ConfigurationUnitIntent::Apply, error, ConfigurationUnitResultSource::Internal, summaryData.AssertSummary, summaryData.InformSummary, summaryData.ApplySummary); } CATCH_LOG(); diff --git a/src/Microsoft.Management.Configuration/Telemetry/Telemetry.h b/src/Microsoft.Management.Configuration/Telemetry/Telemetry.h index 894e2fe4e6..8e40b7bdf6 100644 --- a/src/Microsoft.Management.Configuration/Telemetry/Telemetry.h +++ b/src/Microsoft.Management.Configuration/Telemetry/Telemetry.h @@ -86,7 +86,6 @@ namespace winrt::Microsoft::Management::Configuration::implementation void LogConfigProcessingSummary( const guid& setIdentifier, std::string_view inputHash, - bool fromHistory, ConfigurationUnitIntent runIntent, hresult result, ConfigurationUnitResultSource failurePoint, diff --git a/src/Microsoft.Management.Deployment.OutOfProc/Factory.cpp b/src/Microsoft.Management.Deployment.OutOfProc/Factory.cpp new file mode 100644 index 0000000000..a7d8c15c07 --- /dev/null +++ b/src/Microsoft.Management.Deployment.OutOfProc/Factory.cpp @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +#include "pch.h" +#include "Factory.h" +#include +#include +#include + +using namespace std::string_view_literals; + +namespace Microsoft::Management::Deployment::OutOfProc +{ + namespace + { +#if USE_PROD_CLSIDS + constexpr CLSID CLSID_PackageManager = { 0xC53A4F16, 0x787E, 0x42A4, { 0xB3, 0x04, 0x29, 0xEF, 0xFB, 0x4B, 0xF5, 0x97 } }; //C53A4F16-787E-42A4-B304-29EFFB4BF597 + constexpr CLSID CLSID_InstallOptions = { 0x1095f097, 0xEB96, 0x453B, { 0xB4, 0xE6, 0x16, 0x13, 0x63, 0x7F, 0x3B, 0x14 } }; //1095F097-EB96-453B-B4E6-1613637F3B14 + constexpr CLSID CLSID_UninstallOptions = { 0xE1D9A11E, 0x9F85, 0x4D87, { 0x9C, 0x17, 0x2B, 0x93, 0x14, 0x3A, 0xDB, 0x8D } }; //E1D9A11E-9F85-4D87-9C17-2B93143ADB8D + constexpr CLSID CLSID_FindPackagesOptions = { 0x572DED96, 0x9C60, 0x4526, { 0x8F, 0x92, 0xEE, 0x7D, 0x91, 0xD3, 0x8C, 0x1A } }; //572DED96-9C60-4526-8F92-EE7D91D38C1A + constexpr CLSID CLSID_PackageMatchFilter = { 0xD02C9DAF, 0x99DC, 0x429C, { 0xB5, 0x03, 0x4E, 0x50, 0x4E, 0x4A, 0xB0, 0x00 } }; //D02C9DAF-99DC-429C-B503-4E504E4AB000 + constexpr CLSID CLSID_CreateCompositePackageCatalogOptions = { 0x526534B8, 0x7E46, 0x47C8, { 0x84, 0x16, 0xB1, 0x68, 0x5C, 0x32, 0x7D, 0x37 } }; //526534B8-7E46-47C8-8416-B1685C327D37 + constexpr CLSID CLSID_DownloadOptions = { 0x4CBABE76, 0x7322, 0x4BE4, { 0x9C, 0xEA, 0x25, 0x89, 0xA8, 0x06, 0x82, 0xDC } }; //4CBABE76-7322-4BE4-9CEA-2589A80682DC + constexpr CLSID CLSID_AuthenticationArguments = { 0xBA580786, 0xBDE3, 0x4F6C, { 0xB8, 0xF3, 0x44, 0x69, 0x8A, 0xC8, 0x71, 0x1A } }; //BA580786-BDE3-4F6C-B8F3-44698AC8711A +#else + constexpr CLSID CLSID_PackageManager = { 0x74CB3139, 0xB7C5, 0x4B9E, { 0x93, 0x88, 0xE6, 0x61, 0x6D, 0xEA, 0x28, 0x8C } }; //74CB3139-B7C5-4B9E-9388-E6616DEA288C + constexpr CLSID CLSID_InstallOptions = { 0x44FE0580, 0x62F7, 0x44D4, { 0x9E, 0x91, 0xAA, 0x96, 0x14, 0xAB, 0x3E, 0x86 } }; //44FE0580-62F7-44D4-9E91-AA9614AB3E86 + constexpr CLSID CLSID_UninstallOptions = { 0xAA2A5C04, 0x1AD9, 0x46C4, { 0xB7, 0x4F, 0x6B, 0x33, 0x4A, 0xD7, 0xEB, 0x8C } }; //AA2A5C04-1AD9-46C4-B74F-6B334AD7EB8C + constexpr CLSID CLSID_FindPackagesOptions = { 0x1BD8FF3A, 0xEC50, 0x4F69, { 0xAE, 0xEE, 0xDF, 0x4C, 0x9D, 0x3B, 0xAA, 0x96 } }; //1BD8FF3A-EC50-4F69-AEEE-DF4C9D3BAA96 + constexpr CLSID CLSID_PackageMatchFilter = { 0x3F85B9F4, 0x487A, 0x4C48, { 0x90, 0x35, 0x29, 0x03, 0xF8, 0xA6, 0xD9, 0xE8 } }; //3F85B9F4-487A-4C48-9035-2903F8A6D9E8 + constexpr CLSID CLSID_CreateCompositePackageCatalogOptions = { 0xEE160901, 0xB317, 0x4EA7, { 0x9C, 0xC6, 0x53, 0x55, 0xC6, 0xD7, 0xD8, 0xA7 } }; //EE160901-B317-4EA7-9CC6-5355C6D7D8A7 + constexpr CLSID CLSID_DownloadOptions = { 0x8EF324ED, 0x367C, 0x4880, { 0x83, 0xE5, 0xBB, 0x2A, 0xBD, 0x0B, 0x72, 0xF6 } }; //8EF324ED-367C-4880-83E5-BB2ABD0B72F6 + constexpr CLSID CLSID_AuthenticationArguments = { 0x6484A61D, 0x50FA, 0x41F0, { 0xB7, 0x1E, 0xF4, 0x37, 0x0C, 0x6E, 0xB3, 0x7C } }; //6484A61D-50FA-41F0-B71E-F4370C6EB37C +#endif + + struct NameCLSIDPair + { + std::wstring_view Name; + GUID CLSID; + }; + + constexpr std::array s_nameCLSIDPairs + { + NameCLSIDPair{ L"Microsoft.Management.Deployment.PackageManager"sv, CLSID_PackageManager }, + NameCLSIDPair{ L"Microsoft.Management.Deployment.InstallOptions"sv, CLSID_InstallOptions }, + NameCLSIDPair{ L"Microsoft.Management.Deployment.UninstallOptions"sv, CLSID_UninstallOptions }, + NameCLSIDPair{ L"Microsoft.Management.Deployment.FindPackagesOptions"sv, CLSID_FindPackagesOptions }, + NameCLSIDPair{ L"Microsoft.Management.Deployment.PackageMatchFilter"sv, CLSID_PackageMatchFilter }, + NameCLSIDPair{ L"Microsoft.Management.Deployment.CreateCompositePackageCatalogOptions"sv, CLSID_CreateCompositePackageCatalogOptions }, + NameCLSIDPair{ L"Microsoft.Management.Deployment.DownloadOptions"sv, CLSID_DownloadOptions }, + NameCLSIDPair{ L"Microsoft.Management.Deployment.AuthenticationArguments"sv, CLSID_AuthenticationArguments }, + }; + + bool IsCLSIDPresent(const GUID& clsid) + { + for (const auto& pair : s_nameCLSIDPairs) + { + if (pair.CLSID == clsid) + { + return true; + } + } + + return false; + } + + const GUID* GetCLSIDFor(HSTRING clsid) + { + UINT32 length = 0; + PCWSTR buffer = WindowsGetStringRawBuffer(clsid, &length); + std::wstring_view clsidView{ buffer, length }; + + for (const auto& pair : s_nameCLSIDPairs) + { + if (pair.Name == clsidView) + { + return &pair.CLSID; + } + } + + return nullptr; + } + + winrt::Windows::Foundation::IInspectable CreateOOPObject(const GUID& clsid) + { + bool isAdmin = AppInstaller::Runtime::IsRunningAsAdmin(); + + try + { + return winrt::create_instance(clsid, CLSCTX_LOCAL_SERVER | CLSCTX_NO_CODE_DOWNLOAD); + } + catch (const winrt::hresult_error& hre) + { + // We only want to fall through to trying the manual activation if we are running as admin and couldn't find the registration. + if (!(isAdmin && hre.code() == REGDB_E_CLASSNOTREG)) + { + throw; + } + } + + winrt::com_ptr<::IUnknown> result; + THROW_IF_FAILED(WinGetServerManualActivation_CreateInstance(clsid, winrt::guid_of(), 0, result.put_void())); + return result.as(); + } + } + + Factory::Factory(const GUID& clsid) : m_clsid(clsid) + { + IncrementRefCount(); + } + + Factory::Factory(HSTRING clsid) : m_clsid(*GetCLSIDFor(clsid)) + { + IncrementRefCount(); + } + + Factory::~Factory() + { + DecrementRefCount(); + } + + bool Factory::HasReferences() + { + return s_referenceCount.load() != 0; + } + + void Factory::Terminate() + { + WinGetServerManualActivation_Terminate(); + } + + bool Factory::IsCLSID(const GUID& clsid) + { + return IsCLSIDPresent(clsid); + } + + bool Factory::IsCLSID(HSTRING clsid) + { + return GetCLSIDFor(clsid) != nullptr; + } + + winrt::Windows::Foundation::IInspectable Factory::ActivateInstance() + { + return CreateOOPObject(m_clsid); + } + + HRESULT STDMETHODCALLTYPE Factory::CreateInstance(::IUnknown* pUnkOuter, REFIID riid, void** ppvObject) try + { + RETURN_HR_IF(E_POINTER, !ppvObject); + *ppvObject = nullptr; + RETURN_HR_IF(CLASS_E_NOAGGREGATION, pUnkOuter != nullptr); + + return CreateOOPObject(m_clsid).as(riid, ppvObject); + } + CATCH_RETURN(); + + HRESULT STDMETHODCALLTYPE Factory::LockServer(BOOL fLock) + { + if (fLock) + { + IncrementRefCount(); + } + else + { + DecrementRefCount(); + } + + return S_OK; + } + + void Factory::IncrementRefCount() + { + ++s_referenceCount; + } + + void Factory::DecrementRefCount() + { + --s_referenceCount; + } + + std::atomic Factory::s_referenceCount = ATOMIC_VAR_INIT(0); +} diff --git a/src/Microsoft.Management.Deployment.OutOfProc/Factory.h b/src/Microsoft.Management.Deployment.OutOfProc/Factory.h new file mode 100644 index 0000000000..c50eb1fa17 --- /dev/null +++ b/src/Microsoft.Management.Deployment.OutOfProc/Factory.h @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +#pragma once +#include +#include +#include +#include + +namespace Microsoft::Management::Deployment::OutOfProc +{ + struct Factory : winrt::implements + { + Factory(const GUID& clsid); + Factory(HSTRING clsid); + ~Factory(); + + // Returns true if the reference count is not 0; false if it is. + static bool HasReferences(); + + // Forcibly destroys any static objects. + static void Terminate(); + + // Determines if the given CLSID is the CLSID for the factory. + static bool IsCLSID(const GUID& clsid); + + // Determines if the given CLSID is the CLSID for the factory. + static bool IsCLSID(HSTRING clsid); + + // IActivationFactory + winrt::Windows::Foundation::IInspectable ActivateInstance(); + + // IClassFactory + HRESULT STDMETHODCALLTYPE CreateInstance(::IUnknown *pUnkOuter, REFIID riid, void **ppvObject); + HRESULT STDMETHODCALLTYPE LockServer(BOOL fLock); + + private: + static void IncrementRefCount(); + static void DecrementRefCount(); + + static std::atomic s_referenceCount; + + GUID m_clsid; + }; +} diff --git a/src/Microsoft.Management.Deployment.OutOfProc/Microsoft.Management.Deployment.OutOfProc.vcxproj b/src/Microsoft.Management.Deployment.OutOfProc/Microsoft.Management.Deployment.OutOfProc.vcxproj new file mode 100644 index 0000000000..54054c4646 --- /dev/null +++ b/src/Microsoft.Management.Deployment.OutOfProc/Microsoft.Management.Deployment.OutOfProc.vcxproj @@ -0,0 +1,434 @@ + + + + + true + true + true + 15.0 + Win32Proj + MicrosoftManagementDeploymentOutOfProc + 10.0.22000.0 + 10.0.17763.0 + true + true + false + {0BA531C8-CF0C-405B-8221-0FE51BA529D1} + + + + + Debug + ARM64 + + + Debug + Win32 + + + ReleaseStatic + ARM64 + + + ReleaseStatic + Win32 + + + ReleaseStatic + x64 + + + Release + ARM64 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + DynamicLibrary + v140 + v141 + v142 + v143 + Unicode + + + true + true + + + false + true + false + + + false + true + false + + + Spectre + + + Spectre + + + Spectre + + + Spectre + + + Spectre + + + Spectre + + + + + + + + + + + + + + + true + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ + true + true + ..\CodeAnalysis.ruleset + + + true + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ + true + true + ..\CodeAnalysis.ruleset + + + true + $(SolutionDir)x86\$(Configuration)\$(ProjectName)\ + true + true + ..\CodeAnalysis.ruleset + + + false + $(SolutionDir)x86\$(Configuration)\$(ProjectName)\ + true + false + ..\CodeAnalysis.ruleset + + + false + $(SolutionDir)x86\$(Configuration)\$(ProjectName)\ + true + false + ..\CodeAnalysis.ruleset + + + false + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ + true + false + ..\CodeAnalysis.ruleset + + + false + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ + true + false + ..\CodeAnalysis.ruleset + + + false + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ + true + false + ..\CodeAnalysis.ruleset + + + false + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ + true + false + ..\CodeAnalysis.ruleset + + + + Use + pch.h + $(IntDir)pch.pch + _CONSOLE;%(PreprocessorDefinitions) + Level4 + %(AdditionalOptions) /permissive- /bigobj /D _SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING + + + + + USE_PROD_CLSIDS;%(PreprocessorDefinitions) + + + + + USE_PROD_WINGET_SERVER;%(PreprocessorDefinitions) + + + + + Disabled + _DEBUG;%(PreprocessorDefinitions) + $(ProjectDir)..\AppInstallerSharedLib\Public;$(ProjectDir)..\WinGetServer;%(AdditionalIncludeDirectories) + $(ProjectDir)..\AppInstallerSharedLib\Public;$(ProjectDir)..\WinGetServer;%(AdditionalIncludeDirectories) + true + true + false + false + stdcpp17 + stdcpp17 + true + true + true + true + 6001 + 6001 + false + false + + + false + Windows + Windows + Windows + Source.def + Source.def + Source.def + wininet.lib;shell32.lib;winsqlite3.lib;shlwapi.lib;icuuc.lib;icuin.lib;urlmon.lib;Advapi32.lib;winhttp.lib;onecoreuap.lib;msi.lib;%(AdditionalDependencies) + + + + $(ProjectDir)..\manifest\shared.manifest %(AdditionalManifestFiles) + + + $(ProjectDir)..\manifest\shared.manifest %(AdditionalManifestFiles) + + + + + WIN32;%(PreprocessorDefinitions) + $(ProjectDir)..\AppInstallerSharedLib\Public;$(ProjectDir)..\WinGetServer;%(AdditionalIncludeDirectories) + true + false + stdcpp17 + true + true + 6001 + false + + + $(ProjectDir)..\manifest\shared.manifest %(AdditionalManifestFiles) + + + + + MaxSpeed + true + true + NDEBUG;%(PreprocessorDefinitions) + $(ProjectDir)..\AppInstallerSharedLib\Public;$(ProjectDir)..\WinGetServer;%(AdditionalIncludeDirectories) + $(ProjectDir)..\AppInstallerSharedLib\Public;$(ProjectDir)..\WinGetServer;%(AdditionalIncludeDirectories) + $(ProjectDir)..\AppInstallerSharedLib\Public;$(ProjectDir)..\WinGetServer;%(AdditionalIncludeDirectories) + true + true + true + Guard + Guard + Guard + stdcpp17 + stdcpp17 + stdcpp17 + true + true + true + false + false + false + 6001 + 6001 + 6001 + false + false + false + + + true + true + false + Windows + Windows + Windows + Source.def + Source.def + Source.def + wininet.lib;shell32.lib;winsqlite3.lib;shlwapi.lib;icuuc.lib;icuin.lib;urlmon.lib;Advapi32.lib;winhttp.lib;onecoreuap.lib;msi.lib;%(AdditionalDependencies) + /debug:full /debugtype:cv,fixup /incremental:no %(AdditionalOptions) + /debug:full /debugtype:cv,fixup /incremental:no %(AdditionalOptions) + /debug:full /debugtype:cv,fixup /incremental:no %(AdditionalOptions) + + + + $(ProjectDir)..\manifest\shared.manifest %(AdditionalManifestFiles) + + + $(ProjectDir)..\manifest\shared.manifest %(AdditionalManifestFiles) + + + $(ProjectDir)..\manifest\shared.manifest %(AdditionalManifestFiles) + + + + + MaxSpeed + true + true + NDEBUG;%(PreprocessorDefinitions) + $(ProjectDir)..\AppInstallerSharedLib\Public;$(ProjectDir)..\WinGetServer;%(AdditionalIncludeDirectories) + $(ProjectDir)..\AppInstallerSharedLib\Public;$(ProjectDir)..\WinGetServer;%(AdditionalIncludeDirectories) + $(ProjectDir)..\AppInstallerSharedLib\Public;$(ProjectDir)..\WinGetServer;%(AdditionalIncludeDirectories) + true + true + true + Guard + Guard + Guard + stdcpp17 + stdcpp17 + stdcpp17 + true + true + true + false + false + false + MultiThreaded + MultiThreaded + MultiThreaded + 6001 + 6001 + 6001 + false + false + false + + + true + true + false + Windows + Windows + Windows + Source.def + Source.def + Source.def + wininet.lib;shell32.lib;winsqlite3.lib;shlwapi.lib;icuuc.lib;icuin.lib;urlmon.lib;Advapi32.lib;winhttp.lib;onecoreuap.lib;msi.lib;%(AdditionalDependencies) + /debug:full /debugtype:cv,fixup /incremental:no %(AdditionalOptions) + /debug:full /debugtype:cv,fixup /incremental:no %(AdditionalOptions) + /debug:full /debugtype:cv,fixup /incremental:no %(AdditionalOptions) + + + + $(ProjectDir)..\manifest\shared.manifest %(AdditionalManifestFiles) + + + $(ProjectDir)..\manifest\shared.manifest %(AdditionalManifestFiles) + + + $(ProjectDir)..\manifest\shared.manifest %(AdditionalManifestFiles) + + + + + + + + + NotUsing + NotUsing + NotUsing + NotUsing + NotUsing + NotUsing + NotUsing + NotUsing + NotUsing + + + NotUsing + NotUsing + NotUsing + NotUsing + NotUsing + NotUsing + NotUsing + NotUsing + NotUsing + + + NotUsing + NotUsing + NotUsing + NotUsing + NotUsing + NotUsing + NotUsing + NotUsing + NotUsing + + + + + Create + + + + + + + + + + {f3f6e699-bc5d-4950-8a05-e49dd9eb0d51} + + + {1cc41a9a-ae66-459d-9210-1e572dd7be69} + + + + + + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + + \ No newline at end of file diff --git a/src/Microsoft.Management.Deployment.OutOfProc/Microsoft.Management.Deployment.OutOfProc.vcxproj.filters b/src/Microsoft.Management.Deployment.OutOfProc/Microsoft.Management.Deployment.OutOfProc.vcxproj.filters new file mode 100644 index 0000000000..0bfd0542a9 --- /dev/null +++ b/src/Microsoft.Management.Deployment.OutOfProc/Microsoft.Management.Deployment.OutOfProc.vcxproj.filters @@ -0,0 +1,55 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + {6017fd94-3eb1-40bc-964f-5dd571077d3c} + + + + + Header Files + + + Header Files + + + + + Source Files + + + Source Files + + + Source Files + + + WinGetServerManualActivation + + + WinGetServerManualActivation + + + WinGetServerManualActivation + + + + + + + Source Files + + + \ No newline at end of file diff --git a/src/Microsoft.Management.Deployment.OutOfProc/PropertySheet.props b/src/Microsoft.Management.Deployment.OutOfProc/PropertySheet.props new file mode 100644 index 0000000000..c6b0691ddd --- /dev/null +++ b/src/Microsoft.Management.Deployment.OutOfProc/PropertySheet.props @@ -0,0 +1,16 @@ + + + + + + + + \ No newline at end of file diff --git a/src/Microsoft.Management.Deployment.OutOfProc/Source.def b/src/Microsoft.Management.Deployment.OutOfProc/Source.def new file mode 100644 index 0000000000..8e461eef04 --- /dev/null +++ b/src/Microsoft.Management.Deployment.OutOfProc/Source.def @@ -0,0 +1,4 @@ +EXPORTS +DllCanUnloadNow PRIVATE +DllGetClassObject PRIVATE +DllGetActivationFactory PRIVATE diff --git a/src/Microsoft.Management.Deployment.OutOfProc/dllmain.cpp b/src/Microsoft.Management.Deployment.OutOfProc/dllmain.cpp new file mode 100644 index 0000000000..b5275c0afa --- /dev/null +++ b/src/Microsoft.Management.Deployment.OutOfProc/dllmain.cpp @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +#include "pch.h" +#include "Factory.h" +#include + +using namespace Microsoft::Management::Deployment::OutOfProc; + +EXTERN_C BOOL WINAPI DllMain( + HMODULE /* hModule */, + DWORD reason, + LPVOID /* lpReserved */) +{ + switch (reason) + { + case DLL_PROCESS_DETACH: + Factory::Terminate(); + break; + } + + return TRUE; +} + +_Check_return_ +STDAPI DllGetClassObject(_In_ REFCLSID rclsid, _In_ REFIID riid, _Outptr_ LPVOID FAR* ppv) try +{ + RETURN_HR_IF(E_POINTER, !ppv); + *ppv = nullptr; + + winrt::Windows::Foundation::IUnknown result; + + if (Factory::IsCLSID(rclsid)) + { + result = winrt::make(rclsid).as(); + } + + if (result) + { + return result.as(riid, ppv); + } + + return REGDB_E_CLASSNOTREG; +} +CATCH_RETURN(); + +__control_entrypoint(DllExport) +STDAPI DllCanUnloadNow() +{ + return Factory::HasReferences() ? S_FALSE : S_OK; +} + +STDAPI DllGetActivationFactory(HSTRING classId, void** factory) try +{ + RETURN_HR_IF(E_POINTER, !factory); + *factory = nullptr; + + winrt::Windows::Foundation::IUnknown result; + + if (Factory::IsCLSID(classId)) + { + result = winrt::make(classId).as(); + } + + if (result) + { + return result.as(winrt::guid_of(), factory); + } + + return REGDB_E_CLASSNOTREG; +} +CATCH_RETURN(); diff --git a/src/Microsoft.Management.Deployment.OutOfProc/packages.config b/src/Microsoft.Management.Deployment.OutOfProc/packages.config new file mode 100644 index 0000000000..7aa172914d --- /dev/null +++ b/src/Microsoft.Management.Deployment.OutOfProc/packages.config @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/src/Microsoft.Management.Deployment.OutOfProc/pch.cpp b/src/Microsoft.Management.Deployment.OutOfProc/pch.cpp new file mode 100644 index 0000000000..855ee69a1e --- /dev/null +++ b/src/Microsoft.Management.Deployment.OutOfProc/pch.cpp @@ -0,0 +1,4 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +#include "pch.h" diff --git a/src/Microsoft.Management.Deployment.OutOfProc/pch.h b/src/Microsoft.Management.Deployment.OutOfProc/pch.h new file mode 100644 index 0000000000..4d676fbb5e --- /dev/null +++ b/src/Microsoft.Management.Deployment.OutOfProc/pch.h @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +#define WIN32_LEAN_AND_MEAN +#include +#include +#include +#include + +#include +#include + +#include +#include diff --git a/src/Microsoft.Management.Deployment/PackageCatalogInfo.cpp b/src/Microsoft.Management.Deployment/PackageCatalogInfo.cpp index 1ecdb03f5e..64d9df05a6 100644 --- a/src/Microsoft.Management.Deployment/PackageCatalogInfo.cpp +++ b/src/Microsoft.Management.Deployment/PackageCatalogInfo.cpp @@ -49,14 +49,16 @@ namespace winrt::Microsoft::Management::Deployment::implementation } } winrt::Microsoft::Management::Deployment::PackageCatalogTrustLevel PackageCatalogInfo::TrustLevel() - { - switch (m_sourceDetails.TrustLevel) + { + if (WI_IsFlagSet(m_sourceDetails.TrustLevel, ::AppInstaller::Repository::SourceTrustLevel::Trusted)) { - case ::AppInstaller::Repository::SourceTrustLevel::Trusted: - return PackageCatalogTrustLevel::Trusted; - case ::AppInstaller::Repository::SourceTrustLevel::None: - default: - return PackageCatalogTrustLevel::None; - } + return PackageCatalogTrustLevel::Trusted; + } + + return PackageCatalogTrustLevel::None; + } + bool PackageCatalogInfo::Explicit() + { + return m_sourceDetails.Explicit; } } diff --git a/src/Microsoft.Management.Deployment/PackageCatalogInfo.h b/src/Microsoft.Management.Deployment/PackageCatalogInfo.h index 1f720463f0..efee699c3a 100644 --- a/src/Microsoft.Management.Deployment/PackageCatalogInfo.h +++ b/src/Microsoft.Management.Deployment/PackageCatalogInfo.h @@ -22,6 +22,7 @@ namespace winrt::Microsoft::Management::Deployment::implementation winrt::Windows::Foundation::DateTime LastUpdateTime(); winrt::Microsoft::Management::Deployment::PackageCatalogOrigin Origin(); winrt::Microsoft::Management::Deployment::PackageCatalogTrustLevel TrustLevel(); + bool Explicit(); #if !defined(INCLUDE_ONLY_INTERFACE_METHODS) private: diff --git a/src/Microsoft.Management.Deployment/PackageManager.idl b/src/Microsoft.Management.Deployment/PackageManager.idl index bab9af2985..43ade7aa71 100644 --- a/src/Microsoft.Management.Deployment/PackageManager.idl +++ b/src/Microsoft.Management.Deployment/PackageManager.idl @@ -2,7 +2,7 @@ // Licensed under the MIT License. namespace Microsoft.Management.Deployment { - [contractversion(10)] + [contractversion(11)] // For version 1.9 apicontract WindowsPackageManagerContract{}; /// State of the install @@ -262,6 +262,12 @@ namespace Microsoft.Management.Deployment PackageCatalogOrigin Origin { get; }; /// The trust level of the package catalog PackageCatalogTrustLevel TrustLevel { get; }; + + [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 11)] + { + /// Excludes a source from discovery unless specified. + Boolean Explicit{ get; }; + } } /// A metadata item of a package version. diff --git a/src/PowerShell/CommonFiles/PowerShellCmdlet.cs b/src/PowerShell/CommonFiles/PowerShellCmdlet.cs index bd66db5ef7..1006e2cb58 100644 --- a/src/PowerShell/CommonFiles/PowerShellCmdlet.cs +++ b/src/PowerShell/CommonFiles/PowerShellCmdlet.cs @@ -97,11 +97,14 @@ internal Task RunOnMTA(Func func) this.Write(StreamType.Verbose, "Already running on MTA"); try { - return func(); + Task result = func(); + result.ContinueWith((task) => this.Complete(), TaskContinuationOptions.ExecuteSynchronously); + return result; } - finally + catch { this.Complete(); + throw; } } @@ -150,11 +153,14 @@ internal Task RunOnMTA(Func> func) this.Write(StreamType.Verbose, "Already running on MTA"); try { - return func(); + Task result = func(); + result.ContinueWith((task) => this.Complete(), TaskContinuationOptions.ExecuteSynchronously); + return result; } - finally + catch { this.Complete(); + throw; } } diff --git a/src/PowerShell/Help/Microsoft.WinGet.Client/Add-WinGetSource.md b/src/PowerShell/Help/Microsoft.WinGet.Client/Add-WinGetSource.md new file mode 100644 index 0000000000..3d15824d30 --- /dev/null +++ b/src/PowerShell/Help/Microsoft.WinGet.Client/Add-WinGetSource.md @@ -0,0 +1,145 @@ +--- +external help file: Microsoft.WinGet.Client.Cmdlets.dll-Help.xml +Module Name: Microsoft.WinGet.Client +ms.date: 08/01/2024 +online version: +schema: 2.0.0 +title: Add-WinGetSource +--- + +# Add-WinGetSource + +## SYNOPSIS +Adds a new source. + +## SYNTAX + +``` +Add-WinGetSource -Name -Argument [-Type ] [-TrustLevel {Default | None | Trusted}] [-Explicit] [] +``` + +## DESCRIPTION + +Adds a new source. A source provides the data for you to discover and install packages. Only add a +new source if you trust it as a secure location. This command must be executed with administrator permissions. + +## EXAMPLES + +### Example 1: Add new REST source named mysource + +```powershell +Add-WinGetSource -Name mysource -Argument https://contoso.com/ -Type Microsoft.Rest +``` + +This example adds a new REST source to WinGet named `mysource` with the root URL +`https://contoso.com/`. The source must respond with the WinGet REST source API. + +## PARAMETERS + +### -Argument + +The URL or UNC of either a pre-indexed WinGet source or a WinGet REST source API. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName, ByValue) +Accept wildcard characters: False +``` + +### -Name + +The name used to identify the WinGet source. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName, ByValue) +Accept wildcard characters: False +``` + +### -Explicit + +Excludes a source from discovery unless specified. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -TrustLevel + +Specify the trust level of the WinGet source. The parameter accepts the following values: + +- `None` +- `Trusted` + +```yaml +Type: Microsoft.WinGet.Client.PSObjects.PSSourceTrustLevel +Parameter Sets: (All) +Aliases: +Accepted values: None, Trusted + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Type + +The type of the WinGet source. Most sources are `Microsoft.Rest`. The WinGet community repository +is `Microsoft.PreIndexed.Package`. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName, ByValue) +Accept wildcard characters: False +``` + +### CommonParameters + +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, +-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, +-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### System.String + +## OUTPUTS + +### System.Object + +## NOTES + +## RELATED LINKS + +[Remove-WinGetSource](Remove-WinGetSource.md) + +[Reset-WinGetSource](Reset-WinGetSource.md) diff --git a/src/PowerShell/Help/Microsoft.WinGet.Client/Assert-WinGetPackageManager.md b/src/PowerShell/Help/Microsoft.WinGet.Client/Assert-WinGetPackageManager.md new file mode 100644 index 0000000000..176426fe28 --- /dev/null +++ b/src/PowerShell/Help/Microsoft.WinGet.Client/Assert-WinGetPackageManager.md @@ -0,0 +1,147 @@ +--- +external help file: Microsoft.WinGet.Client.Cmdlets.dll-Help.xml +Module Name: Microsoft.WinGet.Client +ms.date: 08/01/2024 +online version: +schema: 2.0.0 +title: Assert-WinGetPackageManager +--- + +# Assert-WinGetPackageManager + +## SYNOPSIS +Verifies that WinGet is installed properly. + +## SYNTAX + +### IntegrityVersionSet (Default) + +``` +Assert-WinGetPackageManager [-Version ] [] +``` + +### IntegrityLatestSet + +``` +Assert-WinGetPackageManager [-Latest] [-IncludePrerelease] [] +``` + +## DESCRIPTION + +Verifies that WinGet is installed properly. + +> [!NOTE] +> The cmdlet doesn't ensure that the latest version of WinGet is installed. It just verifies that +> the installed version of Winget is supported by installed version of the Microsoft.WinGet.Client +> module. + +## EXAMPLES + +### Example 1: Default usage + +```powershell +Assert-WinGetPackageManager +``` + +If the current version of WinGet is installed correctly, the command returns without error. + +### Example 2: Check if latest stable version is installed + +```powershell +Assert-WinGetPackageManager -Latest +``` + +If the latest version of WinGet is compatible with the installed Microsoft.WinGet.Client module, the +command returns without error. + +### Example 3: Check if latest preview version is installed + +```powershell +Assert-WinGetPackageManager -IncludePreRelease +``` + +If the prerelease version of WinGet is compatible with the installed Microsoft.WinGet.Client module, +the command returns without error. + +### Example 4: Check if specific version is installed + +```powershell +Assert-WinGetPackageManager -Version v1.8.1911 +``` + +If the specified version of WinGet is compatible with the installed Microsoft.WinGet.Client module, +the command returns without error. + +## PARAMETERS + +### -IncludePreRelease + +Include preview versions of WinGet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: IntegrityLatestSet +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Latest + +Verify that the latest version of WinGet is compatible with the installed version of the +Microsoft.WinGet.Client module. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: IntegrityLatestSet +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Version + +Verify that a specific version of WinGet is installed correctly. + +```yaml +Type: System.String +Parameter Sets: IntegrityVersionSet +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### CommonParameters + +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, +-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, +-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### System.String + +### System.Management.Automation.SwitchParameter + +## OUTPUTS + +### System.Object + +## NOTES + +## RELATED LINKS + +[Get-WinGetVersion](Get-WinGetVersion.md) diff --git a/src/PowerShell/Help/Microsoft.WinGet.Client/Disable-WinGetSetting.md b/src/PowerShell/Help/Microsoft.WinGet.Client/Disable-WinGetSetting.md new file mode 100644 index 0000000000..25e9c436e1 --- /dev/null +++ b/src/PowerShell/Help/Microsoft.WinGet.Client/Disable-WinGetSetting.md @@ -0,0 +1,86 @@ +--- +external help file: Microsoft.WinGet.Client.Cmdlets.dll-Help.xml +Module Name: Microsoft.WinGet.Client +ms.date: 08/01/2024 +online version: +schema: 2.0.0 +title: Disable-WinGetSetting +--- + +# Disable-WinGetSetting + +## SYNOPSIS +Disables an administrative setting. + +## SYNTAX + +``` +Disable-WinGetSetting [-Name] [] +``` + +## DESCRIPTION + +This command disables an administrative setting. The command must be run from an elevated session +using the **Run as Administrator** option. + +This command support the following administrative settings: + +- LocalManifestFiles +- BypassCertificatePinningForMicrosoftStore +- InstallerHashOverride +- LocalArchiveMalwareScanOverride +- ProxyCommandLineOptions + +Administrative settings are disabled by default. Administrative settings can also be managed using +Group Policy objects. + +## EXAMPLES + +### Example 1: Disable the use of local manifest files + +```powershell +Disable-WinGetSetting -Name LocalManifestFiles +``` + +This example shows how to disable the use of local manifest files. + +## PARAMETERS + +### -Name + +The name of the WinGet administrative setting. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 0 +Default value: None +Accept pipeline input: True (ByPropertyName, ByValue) +Accept wildcard characters: False +``` + +### CommonParameters + +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, +-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, +-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### System.String + +## OUTPUTS + +### System.Object + +## NOTES + +## RELATED LINKS + +[Get-WinGetSetting](Get-WinGetSetting.md) + +[Set-WinGetUserSetting](Set-WinGetUserSetting.md) diff --git a/src/PowerShell/Help/Microsoft.WinGet.Client/Enable-WinGetSetting.md b/src/PowerShell/Help/Microsoft.WinGet.Client/Enable-WinGetSetting.md new file mode 100644 index 0000000000..d1dd09213f --- /dev/null +++ b/src/PowerShell/Help/Microsoft.WinGet.Client/Enable-WinGetSetting.md @@ -0,0 +1,87 @@ +--- +external help file: Microsoft.WinGet.Client.Cmdlets.dll-Help.xml +Module Name: Microsoft.WinGet.Client +ms.date: 08/01/2024 +online version: +schema: 2.0.0 +title: Enable-WinGetSetting +--- + +# Enable-WinGetSetting + +## SYNOPSIS + +Enables WinGet administrative settings. + +## SYNTAX + +``` +Enable-WinGetSetting [-Name] [] +``` + +## DESCRIPTION + +This command enables an administrative setting. The command must be run from an elevated session +using the **Run as Administrator** option. + +This command support the following administrative settings: + +- LocalManifestFiles +- BypassCertificatePinningForMicrosoftStore +- InstallerHashOverride +- LocalArchiveMalwareScanOverride +- ProxyCommandLineOptions + +Administrative settings are disabled by default. Administrative settings can also be managed using +Group Policy objects. + +## EXAMPLES + +### Example 1 + +```powershell +Enable-WinGetSetting -Name LocalManifestFiles +``` + +This example shows how to enable the use of local manifest files. + +## PARAMETERS + +### -Name + +The name of the WinGet administrative setting. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 0 +Default value: None +Accept pipeline input: True (ByPropertyName, ByValue) +Accept wildcard characters: False +``` + +### CommonParameters + +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, +-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, +-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### System.String + +## OUTPUTS + +### System.Object + +## NOTES + +## RELATED LINKS + +[Get-WinGetSetting](Get-WinGetSetting.md) + +[Disable-WinGetSetting](Disable-WinGetSetting.md) diff --git a/src/PowerShell/Help/Microsoft.WinGet.Client/Export-WinGetPackage.md b/src/PowerShell/Help/Microsoft.WinGet.Client/Export-WinGetPackage.md new file mode 100644 index 0000000000..e6e81882b7 --- /dev/null +++ b/src/PowerShell/Help/Microsoft.WinGet.Client/Export-WinGetPackage.md @@ -0,0 +1,436 @@ +--- +external help file: Microsoft.WinGet.Client.Cmdlets.dll-Help.xml +Module Name: Microsoft.WinGet.Client +ms.date: 08/01/2024 +online version: +schema: 2.0.0 +title: Export-WinGetPackage +--- + +# Export-WinGetPackage + +## SYNOPSIS +Downloads a WinGet package and its dependencies. + +## SYNTAX + +### FoundSet (Default) + +``` +Export-WinGetPackage [-DownloadDirectory ] [-AllowHashMismatch] + [-Architecture ] [-InstallerType ] [-Locale ] + [-Scope ] [-SkipDependencies] [-Version ] [-Id ] [-Name ] + [-Moniker ] [-Source ] [[-Query] ] [-MatchOption ] + [-WhatIf] [-Confirm] [] +``` + +### GivenSet + +``` +Export-WinGetPackage [-DownloadDirectory ] [-AllowHashMismatch] + [-Architecture ] [-InstallerType ] [-Locale ] + [-Scope ] [-SkipDependencies] [[-PSCatalogPackage] ] + [-Version ] [-WhatIf] [-Confirm] [] +``` + +## DESCRIPTION + +This command downloads a WinGet package from a configured source. The command downloads the package, +its manifest, as well as its dependencies and their manifests. By default, the packages are +downloaded to your `Downloads` folder. You can use the **DownloadDirectory** parameter to change +the location. + +For Microsoft Azure users, if the package is coming from the Microsoft Store, the command also +downloads the package license file. The user needs to have one of the following Roles in Azure: + +- Global Administrator +- User Administrator +- License Administrator + +## EXAMPLES + +### Example 1: Download Microsoft.PowerShell to the default location + +```powershell +Export-WinGetPackage -Id Microsoft.PowerShell +``` + +```Output +Id Name Source Status ExtendedErrorCode CorrelationData +-- ---- ------ ------ ----------------- --------------- +Microsoft.PowerShell PowerShell winget Ok +``` + +```powershell +dir ~\Downloads\Microsoft.PowerShell_7.4.4.0 +``` + +```Output + Directory: C:\Users\user1\Downloads\Microsoft.PowerShell_7.4.4.0 + +Mode LastWriteTime Length Name +---- ------------- ------ ---- +-a--- 8/7/2024 2:05 PM 108404736 PowerShell_7.4.4.0_Machine_X64_wix_en-US.msi +-a--- 8/7/2024 2:05 PM 3838 PowerShell_7.4.4.0_Machine_X64_wix_en-US.yaml +``` + +This example shows how to download a package for the current machine and scope. For this example, +the command downloads the latest version of the installer package and manifest for +Microsoft.PowerShell. The command puts the files a new folder in your `Downloads` location. The +folder name is created by concatenating the package identifier and version number. + +## PARAMETERS + +### -AllowHashMismatch + +Allows you to download package even when the SHA256 hash for an installer or a dependency does not +match the SHA256 hash in the WinGet package manifest. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Architecture + +Specify the processor architecture for the WinGet package installer. + +```yaml +Type: Microsoft.WinGet.Client.PSObjects.PSProcessorArchitecture +Parameter Sets: (All) +Aliases: +Accepted values: Default, X86, Arm, X64, Arm64 + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -DownloadDirectory + +Specify the location where you want to store the downloaded files. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Id + +Specify the WinGet package identifier + +```yaml +Type: System.String +Parameter Sets: FoundSet +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -InstallerType + +Specify the type of installer package to download. This parameter accepts the following values: + +- `Default` +- `Inno` +- `Wix` +- `Msi` +- `Nullsoft` +- `Zip` +- `Msix` +- `Exe` +- `Burn` +- `MSStore` +- `Portable` + +> [!NOTE] +> The installer type must be available in the WinGet package manifest. + +```yaml +Type: Microsoft.WinGet.Client.PSObjects.PSPackageInstallerType +Parameter Sets: (All) +Aliases: +Accepted values: Default, Inno, Wix, Msi, Nullsoft, Zip, Msix, Exe, Burn, MSStore, Portable + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Locale + +Specify the locale of the installer package. The locale must provided in the BCP 47 format, such as +`en-US`. For more information, see +[Standard locale names](/globalization/locale/standard-locale-names). + +> [!NOTE] +> The locale must be available in the WinGet package manifest. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -MatchOption + +Specify the match option for a WinGet package query. This parameter accepts the following values: + +- `Equals` +- `EqualsCaseInsensitive` +- `StartsWithCaseInsensitive` +- `ContainsCaseInsensitive` + +```yaml +Type: Microsoft.WinGet.Client.PSObjects.PSPackageFieldMatchOption +Parameter Sets: FoundSet +Aliases: +Accepted values: Equals, EqualsCaseInsensitive, StartsWithCaseInsensitive, ContainsCaseInsensitive + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Moniker + +Specify the moniker of the WinGet package to download. For example, the moniker for the +Microsoft.PowerShell package is `pwsh`. + +```yaml +Type: System.String +Parameter Sets: FoundSet +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Name + +Specify the name of the WinGet package. + +```yaml +Type: System.String +Parameter Sets: FoundSet +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -PSCatalogPackage + +Provide **PSCatalogPackage** object. You can get a **PSCatalogPackage** object by using the +`Find-WinGetPackage` command. + +```yaml +Type: Microsoft.WinGet.Client.Engine.PSObjects.PSCatalogPackage +Parameter Sets: GivenSet +Aliases: InputObject + +Required: False +Position: 0 +Default value: None +Accept pipeline input: True (ByPropertyName, ByValue) +Accept wildcard characters: False +``` + +### -Query + +One or more strings to search for in the WinGet package. The command searches for matching strings +in the following properties of the package manifest: + +- `PackageName` +- `PackageIdentifier` +- `Moniker` +- `Tags` + +```yaml +Type: System.String[] +Parameter Sets: FoundSet +Aliases: + +Required: False +Position: 0 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Scope + +Specify WinGet package installer scope. The parameter accepts the following values: + +- `Any` +- `User` +- `System` +- `UserOrUnknown` +- `SystemOrUnknown` + +> [!NOTE] +> The installer scope must be available in the WinGet package manifest. + +```yaml +Type: Microsoft.WinGet.Client.PSObjects.PSPackageInstallScope +Parameter Sets: (All) +Aliases: +Accepted values: Any, User, System, UserOrUnknown, SystemOrUnknown + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -SkipDependencies + +Specifies that the command shouldn't download the WinGet package dependencies. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Source + +Specifies WinGet source. + +```yaml +Type: System.String +Parameter Sets: FoundSet +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Version + +Specifies the version of the WinGet package to download. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Confirm + +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf + +Shows what would happen if the cmdlet runs. The cmdlet isn't run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters + +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, +-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, +-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### System.String + +### System.Management.Automation.SwitchParameter + +### Microsoft.WinGet.Client.PSObjects.PSProcessorArchitecture + +### Microsoft.WinGet.Client.PSObjects.PSPackageInstallerType + +### Microsoft.WinGet.Client.PSObjects.PSPackageInstallScope + +### Microsoft.WinGet.Client.Engine.PSObjects.PSCatalogPackage + +### System.String[] + +### Microsoft.WinGet.Client.PSObjects.PSPackageFieldMatchOption + +## OUTPUTS + +### Microsoft.WinGet.Client.Engine.PSObjects.PSDownloadResult + +## NOTES + +## RELATED LINKS + +[Find-WinGetPackage](Find-WinGetPackage.md) diff --git a/src/PowerShell/Help/Microsoft.WinGet.Client/Find-WinGetPackage.md b/src/PowerShell/Help/Microsoft.WinGet.Client/Find-WinGetPackage.md new file mode 100644 index 0000000000..30e3ed283e --- /dev/null +++ b/src/PowerShell/Help/Microsoft.WinGet.Client/Find-WinGetPackage.md @@ -0,0 +1,252 @@ +--- +external help file: Microsoft.WinGet.Client.Cmdlets.dll-Help.xml +Module Name: Microsoft.WinGet.Client +ms.date: 08/01/2024 +online version: +schema: 2.0.0 +title: Find-WinGetPackage +--- + +# Find-WinGetPackage + +## SYNOPSIS +Searches for packages from configured sources. + +## SYNTAX + +``` +Find-WinGetPackage [-Tag ] [-Command ] [-Count ] [-Id ] [-Name ] + [-Moniker ] [-Source ] [[-Query] ] [-MatchOption ] + [] +``` + +## DESCRIPTION + +Searches for packages from configured sources. + +## EXAMPLES + +### Example 1: Search for PowerShell + +```powershell +Find-WinGetPackage PowerShell +``` + +This example shows how to search for packages related to PowerShell. By default, the command +searches all configured sources. The command compares the value provided to the following package +manifest properties: + +- `PackageIdentifier` +- `PackageName` +- `Moniker` +- `Tags` + +The command does a case-insensitive substring comparison of these properties. + +### Example 2: Search for Microsoft.PowerShell by id + +```powershell +Find-WinGetPackage -Id Microsoft.PowerShell +``` + +This example shows how to search for packages by package identifier. By default, the command +searches all configured sources. The command performs a case-insensitive substring match against the +**PackageIdentifier** property of the packages. + +### Example 3: Search for Microsoft.PowerShell by exact id + +```powershell +Find-WinGetPackage -Id Microsoft.PowerShell -MatchOption Equals +``` + +This example shows how to search for packages by exact package identifier. By default, the command +searches all configured sources. The command performs a case-sensitive full text match against the +**PackageIdentifier** property of the packages. + +## PARAMETERS + +### -Command + +Specify the name of the command defined in the package manifest. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Count + +Specify the maximum number of results to return. + +```yaml +Type: System.UInt32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Id + +Specify the package identifier to search for. By default, the command does a case-insensitive substring match. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -MatchOption + +Specify matching logic used for search. The parameter accepts the following values: + +- `Equals` +- `EqualsCaseInsensitive` +- `StartsWithCaseInsensitive` +- `ContainsCaseInsensitive` + +```yaml +Type: Microsoft.WinGet.Client.PSObjects.PSPackageFieldMatchOption +Parameter Sets: (All) +Aliases: +Accepted values: Equals, EqualsCaseInsensitive, StartsWithCaseInsensitive, ContainsCaseInsensitive + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Moniker + +Specify the moniker of the package you are searching for. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Name + +Specify the name of the package to search for. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Query + +Specify one or more strings to search for. By default, the command searches all configured sources. +The command compares the value provided to the following package manifest properties: +- `PackageIdentifier` +- `PackageName` +- `Moniker` +- `Tags` + +The command does a case-insensitive substring comparison of these properties. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: 0 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Source + +Specify the name of the WinGet source to search. The most common sources are `msstore` and `winget`. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Tag + +Specify a package tag to search for. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### CommonParameters + +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, +-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, +-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### System.String + +### System.UInt32 + +### System.String[] + +### Microsoft.WinGet.Client.PSObjects.PSPackageFieldMatchOption + +## OUTPUTS + +### Microsoft.WinGet.Client.Engine.PSObjects.PSFoundCatalogPackage + +## NOTES + +## RELATED LINKS + +[Export-WinGetPackage](Export-WinGetPackage.md) + +[Install-WinGetPackage](Install-WinGetPackage.md) diff --git a/src/PowerShell/Help/Microsoft.WinGet.Client/Get-WinGetPackage.md b/src/PowerShell/Help/Microsoft.WinGet.Client/Get-WinGetPackage.md new file mode 100644 index 0000000000..754712368f --- /dev/null +++ b/src/PowerShell/Help/Microsoft.WinGet.Client/Get-WinGetPackage.md @@ -0,0 +1,253 @@ +--- +external help file: Microsoft.WinGet.Client.Cmdlets.dll-Help.xml +Module Name: Microsoft.WinGet.Client +ms.date: 08/01/2024 +online version: +schema: 2.0.0 +title: Get-WinGetPackage +--- + +# Get-WinGetPackage + +## SYNOPSIS +Lists installed packages. + +## SYNTAX + +``` +Get-WinGetPackage [-Tag ] [-Command ] [-Count ] [-Id ] [-Name ] + [-Moniker ] [-Source ] [[-Query] ] [-MatchOption ] + [] +``` + +## DESCRIPTION + +This command lists all of the packages installed on your system. The output includes packages +installed from WinGet sources and packages installed by other methods. Packages that have package +identifiers starting with `MSIX` or `ARP` could not be correlated to a WinGet source. + +## EXAMPLES + +### Example 1: Default example + +```powershell +Get-WinGetPackage +``` + +This example shows how to list all packages installed on your system. + +### Example 2: Get package by Id + +```powershell +Get-WinGetPackage -Id "Microsoft.PowerShell" +``` + +This example shows how to get an installed package by its package identifier. + +### Example 3: Get package(s) by name + +```powershell +Get-WinGetPackage -Name "PowerShell" +``` + +This example shows how to get installed packages that match a name value. The command does a substring comparison of the provided name with +installed package names. + +### Example 4: List all packages with an available update + +```powershell +Get-WinGetPackage | Where-Object IsUpdateAvailable +``` + +This example shows how to list all packages that have an available upgrade from one of the configured sources. + +## PARAMETERS + +### -Command + +Specify the name of the command defined in the package manifest. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Count + +Limits the number of items returned by the command. + +```yaml +Type: System.UInt32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Id + +Specify the package identifier for the package you want to list. By default, the command does a +case-insensitive substring comparison on the package identifier. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -MatchOption + +Specify matching logic used for search. The parameter accepts the following values: + +- `Equals` +- `EqualsCaseInsensitive` +- `StartsWithCaseInsensitive` +- `ContainsCaseInsensitive` + +```yaml +Type: Microsoft.WinGet.Client.PSObjects.PSPackageFieldMatchOption +Parameter Sets: (All) +Aliases: +Accepted values: Equals, EqualsCaseInsensitive, StartsWithCaseInsensitive, ContainsCaseInsensitive + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Moniker + +Specify the moniker of the package you want to list. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Name + +Specify the name of the package to list. By default, the command does a case-insensitive comparison +of the package name. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Query + +Specify one or more strings to search for. By default, the command searches all configured sources. +The command compares the value provided to the following package manifest properties: + +- `PackageIdentifier` +- `PackageName` +- `Moniker` +- `Tags` + +The command does a case-insensitive substring comparison of these properties. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: 0 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Source + +Specify the name of the WinGet source of the package. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Tag + +Specify a package tag to search for. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### CommonParameters + +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, +-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, +-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### System.String + +### System.UInt32 + +### System.String[] + +### Microsoft.WinGet.Client.PSObjects.PSPackageFieldMatchOption + +## OUTPUTS + +### Microsoft.WinGet.Client.Engine.PSObjects.PSInstalledCatalogPackage + +## NOTES + +## RELATED LINKS + +[Uninstall-WinGetPackage](Uninstall-WinGetPackage.md) + +[Update-WinGetPackage](Update-WinGetPackage.md) diff --git a/src/PowerShell/Help/Microsoft.WinGet.Client/Get-WinGetSetting.md b/src/PowerShell/Help/Microsoft.WinGet.Client/Get-WinGetSetting.md new file mode 100644 index 0000000000..5f333f9b0d --- /dev/null +++ b/src/PowerShell/Help/Microsoft.WinGet.Client/Get-WinGetSetting.md @@ -0,0 +1,102 @@ +--- +external help file: Microsoft.WinGet.Client.Cmdlets.dll-Help.xml +Module Name: Microsoft.WinGet.Client +ms.date: 08/01/2024 +online version: +schema: 2.0.0 +title: Get-WinGetSetting +--- + +# Get-WinGetSetting + +## SYNOPSIS +Gets WinGet configuration settings. + +## SYNTAX + +``` +Get-WinGetSetting [-AsPlainText] [] +``` + +## DESCRIPTION + +This command gets the WinGet configuration settings. The settings include: +- the schema +- administrative settings +- the location of the user settings file +For more information about WinGet settings, see +[WinGet CLI Settings](https://aka.ms/winget-settings). + +## EXAMPLES + +### Example 1 - Display the WinGet configuration settings + +```powershell +Get-WinGetSetting +``` + +```Output + +Name Value +---- ----- +$schema https://aka.ms/winget-settings-export.schema.json +userSettingsFile C:\Users\user1\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\Local… +adminSettings {[ProxyCommandLineOptions, False], [LocalArchiveMalwareScanOverride, False], [InstallerH… +``` + +### Example 2 - Display the administrative settings in WinGet configuration + +```powershell +Get-WinGetSetting | Select-Object -ExpandProperty adminSettings +``` + +```Output +Name Value +---- ----- +InstallerHashOverride False +ProxyCommandLineOptions False +BypassCertificatePinningForMicrosoftStore False +LocalArchiveMalwareScanOverride False +LocalManifestFiles True +``` + +## PARAMETERS + +### -AsPlainText + +Output results as plain text + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### CommonParameters + +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, +-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, +-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### System.Management.Automation.SwitchParameter + +## OUTPUTS + +### System.Object + +## NOTES + +## RELATED LINKS + +[Get-WinGetUserSetting](Get-WinGetUserSetting.md) + +[Set-WinGetUserSetting](Set-WinGetUserSetting.md) diff --git a/src/PowerShell/Help/Microsoft.WinGet.Client/Get-WinGetSource.md b/src/PowerShell/Help/Microsoft.WinGet.Client/Get-WinGetSource.md new file mode 100644 index 0000000000..d0cb84a459 --- /dev/null +++ b/src/PowerShell/Help/Microsoft.WinGet.Client/Get-WinGetSource.md @@ -0,0 +1,79 @@ +--- +external help file: Microsoft.WinGet.Client.Cmdlets.dll-Help.xml +Module Name: Microsoft.WinGet.Client +ms.date: 08/01/2024 +online version: +schema: 2.0.0 +title: Get-WinGetSource +--- + +# Get-WinGetSource + +## SYNOPSIS +Lists configured WinGet sources. + +## SYNTAX + +``` +Get-WinGetSource [[-Name] ] [] +``` + +## DESCRIPTION + +Lists the configured WinGet sources. + +## EXAMPLES + +### Example 1: List all configured WinGet sources + +```powershell +Get-WinGetSource +``` + +```Output +Name Argument Type +---- -------- ---- +msstore https://storeedgefd.dsx.mp.microsoft.com/v9.0 Microsoft.Rest +winget https://cdn.winget.microsoft.com/cache Microsoft.PreIndexed.Package +``` + +## PARAMETERS + +### -Name + +Specify the name of the WinGet source to be displayed. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 0 +Default value: None +Accept pipeline input: True (ByPropertyName, ByValue) +Accept wildcard characters: False +``` + +### CommonParameters + +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, +-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, +-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### System.String + +## OUTPUTS + +### Microsoft.WinGet.Client.Engine.PSObjects.PSSourceResult + +## NOTES + +## RELATED LINKS + +[Add-WinGetSource](Add-WinGetSource.md) + +[Remove-WinGetSource](Remove-WinGetSource.md) diff --git a/src/PowerShell/Help/Microsoft.WinGet.Client/Get-WinGetUserSetting.md b/src/PowerShell/Help/Microsoft.WinGet.Client/Get-WinGetUserSetting.md new file mode 100644 index 0000000000..6cb4ade6d3 --- /dev/null +++ b/src/PowerShell/Help/Microsoft.WinGet.Client/Get-WinGetUserSetting.md @@ -0,0 +1,58 @@ +--- +external help file: Microsoft.WinGet.Client.Cmdlets.dll-Help.xml +Module Name: Microsoft.WinGet.Client +ms.date: 08/01/2024 +online version: +schema: 2.0.0 +title: Get-WinGetUserSetting +--- + +# Get-WinGetUserSetting + +## SYNOPSIS +Gets user settings for WinGet. + +## SYNTAX + +``` +Get-WinGetUserSetting [] +``` + +## DESCRIPTION + +This command displays the WinGet settings for the current user. The settings are stored in +`$env:LOCALAPPDATA\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\settings.json`. +This file only exists if you have changed a user setting, for example, using the `Set-WinGetUserSetting` command. + +## EXAMPLES + +### Example 1: Get the WinGet settings for the current user + +```powershell +Get-WinGetUserSetting +``` + +## PARAMETERS + +### CommonParameters + +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, +-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, +-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### None + +## OUTPUTS + +### System.Collections.Hashtable + +## NOTES + +## RELATED LINKS + +[Get-WinGetSetting](Get-WinGetSetting.md) + +[Set-WinGetUserSetting](Set-WinGetUserSetting.md) diff --git a/src/PowerShell/Help/Microsoft.WinGet.Client/Get-WinGetVersion.md b/src/PowerShell/Help/Microsoft.WinGet.Client/Get-WinGetVersion.md new file mode 100644 index 0000000000..dd216df198 --- /dev/null +++ b/src/PowerShell/Help/Microsoft.WinGet.Client/Get-WinGetVersion.md @@ -0,0 +1,54 @@ +--- +external help file: Microsoft.WinGet.Client.Cmdlets.dll-Help.xml +Module Name: Microsoft.WinGet.Client +ms.date: 08/01/2024 +online version: +schema: 2.0.0 +title: Get-WinGetVersion +--- + +# Get-WinGetVersion + +## SYNOPSIS +Gets the installed version of WinGet. + +## SYNTAX + +``` +Get-WinGetVersion [] +``` + +## DESCRIPTION + +Gets the installed version of WinGet. + +## EXAMPLES + +### Example 1: Default example + +```powershell +Get-WinGetVersion +``` + +Gets the installed version of WinGet. + +## PARAMETERS + +### CommonParameters + +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, +-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, +-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### None + +## OUTPUTS + +### System.String + +## NOTES + +## RELATED LINKS diff --git a/src/PowerShell/Help/Microsoft.WinGet.Client/Install-WinGetPackage.md b/src/PowerShell/Help/Microsoft.WinGet.Client/Install-WinGetPackage.md new file mode 100644 index 0000000000..037d872cd4 --- /dev/null +++ b/src/PowerShell/Help/Microsoft.WinGet.Client/Install-WinGetPackage.md @@ -0,0 +1,542 @@ +--- +external help file: Microsoft.WinGet.Client.Cmdlets.dll-Help.xml +Module Name: Microsoft.WinGet.Client +ms.date: 08/01/2024 +online version: +schema: 2.0.0 +title: Install-WinGetPackage +--- + +# Install-WinGetPackage + +## SYNOPSIS +Installs a WinGet Package. + +## SYNTAX + +### FoundSet (Default) + +``` +Install-WinGetPackage [-Mode ] [-Override ] [-Custom ] + [-Location ] [-Log ] [-Force] [-Header ] [-AllowHashMismatch] + [-Architecture ] [-InstallerType ] [-Locale ] + [-Scope ] [-SkipDependencies] [-Version ] [-Id ] [-Name ] + [-Moniker ] [-Source ] [[-Query] ] [-MatchOption ] + [-WhatIf] [-Confirm] [] +``` + +### GivenSet + +``` +Install-WinGetPackage [-Mode ] [-Override ] [-Custom ] + [-Location ] [-Log ] [-Force] [-Header ] [-AllowHashMismatch] + [-Architecture ] [-InstallerType ] [-Locale ] + [-Scope ] [-SkipDependencies] [[-PSCatalogPackage] ] + [-Version ] [-WhatIf] [-Confirm] [] +``` + +## DESCRIPTION + +This command installs a WinGet package from a configured source. The command includes parameters +to specify values used to search for packages in the configured sources. By default, the command +searches all sources. By default, all string-based searches are case-insensitive substring searches. +Wildcards are not supported. You can change the search behavior using the **MatchOption** parameter. + +## EXAMPLES + +### Example 1: Install a package using a query + +```powershell +Install-WinGetPackage Microsoft.PowerShell +``` + +This example show how to install a package using a query. The **Query** parameter is positional, so +you don't need to include the parameter name before the query string. + +### Example 2: Install a package by Id + +```powershell +Install-WinGetPackage -Id Microsoft.PowerShell +``` + +This example shows how to install a package by the specifying the package identifier. +If the package identifier is available from more than one source, you must provide additional search +criteria to select a specific instance of the package. + +> **If more than one source is configured with the same package identifier, the user must disambiguate** + +### Example 3: Install a package by Name + +```powershell +Install-WinGetPackage -Name "PowerToys (Preview)" +``` + +This example shows how to install a package by specifying the package name. + +### Example 4: Install a specific version of a package + +```powershell +Install-WinGetPackage Microsoft.PowerShell -Version 7.4.4.0 +``` + +This example shows how to install a specific version of a package using a query. The command does a +query search for packages matching `Microsoft.PowerShell`. The results of the search a limited to +matches with the version of `7.4.4.0`. + +## PARAMETERS + +### -AllowHashMismatch + +Allows you to download package even when the SHA256 hash for an installer or a dependency does not +match the SHA256 hash in the WinGet package manifest. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Architecture + +Specify the processor architecture for the WinGet package installer. + +```yaml +Type: Microsoft.WinGet.Client.PSObjects.PSProcessorArchitecture +Parameter Sets: (All) +Aliases: +Accepted values: Default, X86, Arm, X64, Arm64 + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Custom + +Use this parameter to pass additional arguments to the installer. The parameter takes a single string value. To add multiple arguments, include the arguments in the string. The arguments must be provided in the format expected by the installer. If the string contains spaces, it must be enclosed in quotes. This string is added to the arguments defined in the package manifest. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Force + +Force the installer to run even when other checks WinGet would perform would prevent this action. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Header + +Custom value to be passed via HTTP header to WinGet REST sources. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Id + +Specify the package identifier to search for. The command does a case-insensitive full text match, +rather than a substring match. + +```yaml +Type: System.String +Parameter Sets: FoundSet +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -InstallerType + +A package may contain multiple installer types. Use this parameter to select the installer you want +to use. The parameter accepts the following values: +- `Default` +- `Inno` +- `Wix` +- `Msi` +- `Nullsoft` +- `Zip` +- `Msix` +- `Exe` +- `Burn` +- `MSStore` +- `Portable` + +```yaml +Type: Microsoft.WinGet.Client.PSObjects.PSPackageInstallerType +Parameter Sets: (All) +Aliases: +Accepted values: Default, Inno, Wix, Msi, Nullsoft, Zip, Msix, Exe, Burn, MSStore, Portable + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Locale + +Specify the locale of the installer package. The locale must provided in the BCP 47 format, such as +`en-US`. For more information, see +[Standard locale names](/globalization/locale/standard-locale-names). + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Location + +Specify the file path where you want the packed to be installed. The installer must be able to +support alternate install locations. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Log + +Specify the location for the installer log. The value can be a fully-qualified or relative path and must include the file name. For example: `$env:TEMP\package.log`. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -MatchOption + +Specify the match option for a WinGet package query. This parameter accepts the following values: +- `Equals` +- `EqualsCaseInsensitive` +- `StartsWithCaseInsensitive` +- `ContainsCaseInsensitive` + +```yaml +Type: Microsoft.WinGet.Client.PSObjects.PSPackageFieldMatchOption +Parameter Sets: FoundSet +Aliases: +Accepted values: Equals, EqualsCaseInsensitive, StartsWithCaseInsensitive, ContainsCaseInsensitive + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Mode + +Specify the output mode for the installer. The parameter accepts the following values: +- `Default` +- `Silent` +- `Interactive` + +```yaml +Type: Microsoft.WinGet.Client.PSObjects.PSPackageInstallMode +Parameter Sets: (All) +Aliases: +Accepted values: Default, Silent, Interactive + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Moniker + +Specify the moniker of the WinGet package to install. For example, the moniker for the +Microsoft.PowerShell package is `pwsh`. + +```yaml +Type: System.String +Parameter Sets: FoundSet +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Name + +Specify the name of the package to be installed. + +```yaml +Type: System.String +Parameter Sets: FoundSet +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Override + +Use this parameter to override the existing arguments passed to the installer. The parameter takes a single string value. To add multiple arguments, include the arguments in the string. The arguments must be provided in the format expected by the installer. If the string contains spaces, it must be enclosed in quotes. This string overrides the arguments specified in the package manifest. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -PSCatalogPackage + +Provide **PSCatalogPackage** object. You can get a **PSCatalogPackage** object by using the +`Find-WinGetPackage` command. + +```yaml +Type: Microsoft.WinGet.Client.Engine.PSObjects.PSCatalogPackage +Parameter Sets: GivenSet +Aliases: InputObject + +Required: False +Position: 0 +Default value: None +Accept pipeline input: True (ByPropertyName, ByValue) +Accept wildcard characters: False +``` + +### -Query + +Specify one or more strings to search for. By default, the command searches all configured sources. +The command compares the value provided to the following package manifest properties: + - `PackageIdentifier` + - `PackageName` + - `Moniker` + - `Tags` + +The command does a case-insensitive substring comparison of these properties. + +```yaml +Type: System.String[] +Parameter Sets: FoundSet +Aliases: + +Required: False +Position: 0 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Scope + +Specify WinGet package installer scope. The parameter accepts the following values: + +- `Any` +- `User` +- `System` +- `UserOrUnknown` +- `SystemOrUnknown` + +> [!NOTE] +> The installer scope must be available in the WinGet package manifest. + +```yaml +Type: Microsoft.WinGet.Client.PSObjects.PSPackageInstallScope +Parameter Sets: (All) +Aliases: +Accepted values: Any, User, System, UserOrUnknown, SystemOrUnknown + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -SkipDependencies + +Specifies that the command shouldn't install the WinGet package dependencies. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Source + +Specify the name of the WinGet source from which the package should be installed. + +```yaml +Type: System.String +Parameter Sets: FoundSet +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Version + +Specify the version of the package. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Confirm + +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf + +Shows what would happen if the cmdlet runs. The cmdlet isn't run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters + +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, +-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, +-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.WinGet.Client.PSObjects.PSPackageInstallMode + +### System.String + +### System.Management.Automation.SwitchParameter + +### Microsoft.WinGet.Client.PSObjects.PSProcessorArchitecture + +### Microsoft.WinGet.Client.PSObjects.PSPackageInstallerType + +### Microsoft.WinGet.Client.PSObjects.PSPackageInstallScope + +### Microsoft.WinGet.Client.Engine.PSObjects.PSCatalogPackage + +### System.String[] + +### Microsoft.WinGet.Client.PSObjects.PSPackageFieldMatchOption + +## OUTPUTS + +### Microsoft.WinGet.Client.Engine.PSObjects.PSInstallResult + +## NOTES + +## RELATED LINKS + +[Find-WinGetPackage](Find-WinGetPackage.md) + +[Update-WinGetPackage](Update-WinGetPackage.md) + +[Uninstall-WinGetPackage](Uninstall-WinGetPackage.md) diff --git a/src/PowerShell/Help/Microsoft.WinGet.Client/Microsoft.WinGet.Client.md b/src/PowerShell/Help/Microsoft.WinGet.Client/Microsoft.WinGet.Client.md new file mode 100644 index 0000000000..c660a395a7 --- /dev/null +++ b/src/PowerShell/Help/Microsoft.WinGet.Client/Microsoft.WinGet.Client.md @@ -0,0 +1,71 @@ +--- +Module Name: Microsoft.WinGet.Client +ms.date: 08/01/2024 +Module Guid: e11157e2-cd24-4250-83b8-c6654ea4926a +Download Help Link: +Help Version: 1.8.0 +Locale: en-US +title: Microsoft.WinGet.Client Module +--- + +# Microsoft.WinGet.Client Module +## Description +Microsoft WinGet Client Module for the Windows Package Manager + +## Microsoft.WinGet.Client Cmdlets +### [Add-WinGetSource](Add-WinGetSource.md) +Adds a new WinGet source. + +### [Assert-WinGetPackageManager](Assert-WinGetPackageManager.md) +Verifies WinGet is installed properly. + +### [Disable-WinGetSetting](Disable-WinGetSetting.md) +Disables an administrative setting. + +### [Enable-WinGetSetting](Enable-WinGetSetting.md) +Enables WinGet administrative settings. + +### [Export-WinGetPackage](Export-WinGetPackage.md) +Downloads a package. + +### [Find-WinGetPackage](Find-WinGetPackage.md) +Searches configured sources for packages. + +### [Get-WinGetPackage](Get-WinGetPackage.md) +Gets installed packages. + +### [Get-WinGetSetting](Get-WinGetSetting.md) +Gets WinGet settings. + +### [Get-WinGetSource](Get-WinGetSource.md) +Gets configured WinGet sources. + +### [Get-WinGetUserSetting](Get-WinGetUserSetting.md) +Gets user settings for WinGet. + +### [Get-WinGetVersion](Get-WinGetVersion.md) +Gets the installed version of WinGet. + +### [Install-WinGetPackage](Install-WinGetPackage.md) +Install a WinGet Package. + +### [Remove-WinGetSource](Remove-WinGetSource.md) +Removes a configured source. + +### [Repair-WinGetPackageManager](Repair-WinGetPackageManager.md) +Repairs the WinGet client. + +### [Reset-WinGetSource](Reset-WinGetSource.md) +Resets default WinGet sources. + +### [Set-WinGetUserSetting](Set-WinGetUserSetting.md) +Sets WinGet settings. + +### [Test-WinGetUserSetting](Test-WinGetUserSetting.md) +Tests WinGet settings. + +### [Uninstall-WinGetPackage](Uninstall-WinGetPackage.md) +Uninstalls a WinGet Package. + +### [Update-WinGetPackage](Update-WinGetPackage.md) +Updates a WinGet Package. diff --git a/src/PowerShell/Help/Microsoft.WinGet.Client/Remove-WinGetSource.md b/src/PowerShell/Help/Microsoft.WinGet.Client/Remove-WinGetSource.md new file mode 100644 index 0000000000..99c85f981c --- /dev/null +++ b/src/PowerShell/Help/Microsoft.WinGet.Client/Remove-WinGetSource.md @@ -0,0 +1,75 @@ +--- +external help file: Microsoft.WinGet.Client.Cmdlets.dll-Help.xml +Module Name: Microsoft.WinGet.Client +ms.date: 08/01/2024 +online version: +schema: 2.0.0 +title: Remove-WinGetSource +--- + +# Remove-WinGetSource + +## SYNOPSIS +Removes a configured source. + +## SYNTAX + +``` +Remove-WinGetSource -Name [] +``` + +## DESCRIPTION + +This command removes a configured WinGet source. By default, there are two sources registered: +`msstore` and `winget`. You can add more sources using `Add-WinGetSource`. This command must be executed with administrator permissions. + +## EXAMPLES + +### Example 1: Remove a single source by name + +```powershell +Remove-WinGetSource -Name msstore +``` + +The example shows how to remove a WinGet source by name. + +## PARAMETERS + +### -Name + +Specify the name of the source to be removed. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName, ByValue) +Accept wildcard characters: False +``` + +### CommonParameters + +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, +-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, +-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### System.String + +## OUTPUTS + +### System.Object + +## NOTES + +## RELATED LINKS + +[Add-WinGetSource](Add-WinGetSource.md) + +[Reset-WinGetSource](Reset-WinGetSource.md) diff --git a/src/PowerShell/Help/Microsoft.WinGet.Client/Repair-WinGetPackageManager.md b/src/PowerShell/Help/Microsoft.WinGet.Client/Repair-WinGetPackageManager.md new file mode 100644 index 0000000000..b0f6e28a69 --- /dev/null +++ b/src/PowerShell/Help/Microsoft.WinGet.Client/Repair-WinGetPackageManager.md @@ -0,0 +1,162 @@ +--- +external help file: Microsoft.WinGet.Client.Cmdlets.dll-Help.xml +Module Name: Microsoft.WinGet.Client +ms.date: 08/01/2024 +online version: +schema: 2.0.0 +title: Repair-WinGetPackageManager +--- + +# Repair-WinGetPackageManager + +## SYNOPSIS +Repairs the installation of the WinGet client on your computer. + +## SYNTAX + +### IntegrityVersionSet (Default) + +``` +Repair-WinGetPackageManager [-AllUsers] [-Force] [-Version ] [] +``` + +### IntegrityLatestSet + +``` +Repair-WinGetPackageManager [-AllUsers] [-Force] [-Latest] [-IncludePreRelease] + [] +``` + +## DESCRIPTION + +This command repairs the installation of the WinGet client on your computer by installing the +specified version or the latest version of the client. This command can also install the WinGet +client if it is not already installed on your machine. It ensures that the client is installed +in a working state. + +## EXAMPLES + +### Example 1: Repair the WinGet client + +```powershell +Repair-WinGetPackageManager +``` + +Ensures that the current installed version of WinGet is functioning properly. + +### Example 2: Force install the latest version + +```powershell +Repair-WinGetPackageManager -Latest -Force +``` + +This example shows how to repair they WinGet client by installing the latest version and ensuring +it functions properly. The **Force** parameter shuts down the version that is currently running so +that it can update the application files. + +## PARAMETERS + +### -AllUsers + +Use this parameter to repair the WinGet client for all user accounts on the computer. The command +must run the command with administrator permissions. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Force + +The **Force** parameter shuts down the version that is currently running so that it can update the +application files. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -IncludePreRelease + +Use this parameter to include prerelease versions of the WinGet client. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: IntegrityLatestSet +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Latest + +Use this parameter to install the latest available version of the WinGet client. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: IntegrityLatestSet +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Version + +Use this parameter to specify the specific version of the WinGet client to install. + +```yaml +Type: System.String +Parameter Sets: IntegrityVersionSet +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### CommonParameters + +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, +-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, +-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### System.Management.Automation.SwitchParameter + +### System.String + +## OUTPUTS + +### System.Int32 + +## NOTES + +## RELATED LINKS + +[Get-WinGetVersion](Get-WinGetVersion.md) diff --git a/src/PowerShell/Help/Microsoft.WinGet.Client/Reset-WinGetSource.md b/src/PowerShell/Help/Microsoft.WinGet.Client/Reset-WinGetSource.md new file mode 100644 index 0000000000..7d4630ac6f --- /dev/null +++ b/src/PowerShell/Help/Microsoft.WinGet.Client/Reset-WinGetSource.md @@ -0,0 +1,107 @@ +--- +external help file: Microsoft.WinGet.Client.Cmdlets.dll-Help.xml +Module Name: Microsoft.WinGet.Client +ms.date: 08/01/2024 +online version: +schema: 2.0.0 +title: Reset-WinGetSource +--- + +# Reset-WinGetSource + +## SYNOPSIS +Resets WinGet sources. + +## SYNTAX + +### DefaultSet (Default) + +``` +Reset-WinGetSource -Name [] +``` + +### OptionalSet + +``` +Reset-WinGetSource -All [] +``` + +## DESCRIPTION + +Resets a named WinGet source by removing the source configuration. You can reset all configured sources and add the default source configurations using the **All** switch parameter. +This command must be executed with administrator permissions. + +## EXAMPLES + +### Example 1: Reset the msstore source + +```powershell +Reset-WinGetSource -Name msstore +``` + +This example resets the configured source named 'msstore' by removing it. + +### Example 2: Reset all sources + +```powershell +Reset-WinGetSource -All +``` + +This example resets all configured sources and adds the default sources. + +## PARAMETERS + +### -All + +Reset all sources and add the default sources. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (OptionalSet) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Name + +The name of the source. + +```yaml +Type: System.String +Parameter Sets: (DefaultSet) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName, ByValue) +Accept wildcard characters: False +``` + +### CommonParameters + +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, +-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, +-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### System.String + +## OUTPUTS + +### System.Object + +## NOTES + +## RELATED LINKS + +[Add-WinGetSource](Add-WinGetSource.md) + +[Remove-WinGetSource](Remove-WinGetSource.md) diff --git a/src/PowerShell/Help/Microsoft.WinGet.Client/Set-WinGetUserSetting.md b/src/PowerShell/Help/Microsoft.WinGet.Client/Set-WinGetUserSetting.md new file mode 100644 index 0000000000..cba5723f38 --- /dev/null +++ b/src/PowerShell/Help/Microsoft.WinGet.Client/Set-WinGetUserSetting.md @@ -0,0 +1,126 @@ +--- +external help file: Microsoft.WinGet.Client.Cmdlets.dll-Help.xml +Module Name: Microsoft.WinGet.Client +ms.date: 08/01/2024 +online version: +schema: 2.0.0 +title: Set-WinGetUserSetting +--- + +# Set-WinGetUserSetting + +## SYNOPSIS +Sets configuration settings of the WinGet client for the current user. + +## SYNTAX + +``` +Set-WinGetUserSetting -UserSettings [-Merge] [] +``` + +## DESCRIPTION + +This command sets configuration settings of the WinGet client for the current user. The user +settings file doesn't exist until you set a specific value. The file is stored in +`$env:LOCALAPPDATA\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\settings.json`. +For more information about WinGet settings, see +[WinGet CLI Settings](https://aka.ms/winget-settings). + +## EXAMPLES + +### Example 1: Set progress bar theme + +```powershell +Set-WinGetUserSetting -UserSettings @{ + visual = @{ + progressBar = 'rainbow' + } +} +``` + +Sets the theme of the progress bar to rainbow. + +### Example 2: Merge install behavior settings + +```powershell +Set-WinGetUserSetting -Merge -UserSettings @{ + installBehavior = @{ + preferences = @{ + scope = 'user' + } + } +} +``` + +Appends the user scope preference setting to the existing WinGet settings configuration. + +### Example 3: Change multiple settings + +```powershell +Set-WinGetUserSetting -UserSettings @{ + visual = @{ + progressBar = 'rainbow' + anonymizeDisplayedPaths = $true + } +} +``` + +## PARAMETERS + +### -Merge + +By default, the command overwrites the current setting with the values provided. Use this parameter +to append the new settings to the existing configuration. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -UserSettings + +A hashtable containing the key value pairs representing the WinGet settings. + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### CommonParameters + +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, +-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, +-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### System.Collections.Hashtable + +### System.Management.Automation.SwitchParameter + +## OUTPUTS + +### System.Collections.Hashtable + +## NOTES + +## RELATED LINKS + +[Get-WinGetUserSetting](Get-WinGetUserSetting.md) + +[Test-WinGetUserSetting](Test-WinGetUserSetting.md) diff --git a/src/PowerShell/Help/Microsoft.WinGet.Client/Test-WinGetUserSetting.md b/src/PowerShell/Help/Microsoft.WinGet.Client/Test-WinGetUserSetting.md new file mode 100644 index 0000000000..b90bebaf3f --- /dev/null +++ b/src/PowerShell/Help/Microsoft.WinGet.Client/Test-WinGetUserSetting.md @@ -0,0 +1,114 @@ +--- +external help file: Microsoft.WinGet.Client.Cmdlets.dll-Help.xml +Module Name: Microsoft.WinGet.Client +ms.date: 08/01/2024 +online version: +schema: 2.0.0 +title: Test-WinGetUserSetting +--- + +# Test-WinGetUserSetting + +## SYNOPSIS +Tests the current state of WinGet user settings. + +## SYNTAX + +``` +Test-WinGetUserSetting -UserSettings [-IgnoreNotSet] [] +``` + +## DESCRIPTION + +This command tests the current state of WinGet user settings against a provided set of values. + +## EXAMPLES + +### Example 1: Test for exact match + +```powershell +Test-WinGetUserSetting -UserSettings @{ + installBehavior = @{ + preferences = @{ + scope = 'user' + } + } +} +``` + +This example shows how to confirm that your current user settings match specific values. The +command returns `$false` if it is not an exact match. + +### Example 2: Test only progress bar setting + +```powershell +Test-WinGetUserSetting -IgnoreNotSet -UserSettings @{ + visual = @{ + progressBar = 'rainbow' + } +} +``` + +This examples tests whether the progress bar theme is set to `rainbow`. When you use the +**IgnoreNotSet** parameter, the command only tests the provide values and doesn't include other +WinGet settings in the comparison. + +## PARAMETERS + +### -IgnoreNotSet + +When you use the **IgnoreNotSet** parameter, the command only tests the provide values and doesn't +include other WinGet settings in the comparison. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -UserSettings + +A hashtable containing the key value pairs representing the WinGet settings. + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### CommonParameters + +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, +-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, +-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### System.Collections.Hashtable + +### System.Management.Automation.SwitchParameter + +## OUTPUTS + +### System.Boolean + +## NOTES + +## RELATED LINKS + +[Get-WinGetUserSetting](Get-WinGetUserSetting.md) + +[Set-WinGetUserSetting](Set-WinGetUserSetting.md) diff --git a/src/PowerShell/Help/Microsoft.WinGet.Client/Uninstall-WinGetPackage.md b/src/PowerShell/Help/Microsoft.WinGet.Client/Uninstall-WinGetPackage.md new file mode 100644 index 0000000000..91d92f7078 --- /dev/null +++ b/src/PowerShell/Help/Microsoft.WinGet.Client/Uninstall-WinGetPackage.md @@ -0,0 +1,350 @@ +--- +external help file: Microsoft.WinGet.Client.Cmdlets.dll-Help.xml +Module Name: Microsoft.WinGet.Client +ms.date: 08/01/2024 +online version: +schema: 2.0.0 +title: Uninstall-WinGetPackage +--- + +# Uninstall-WinGetPackage + +## SYNOPSIS +Uninstalls a WinGet Package. + +## SYNTAX + +### FoundSet (Default) + +``` +Uninstall-WinGetPackage [-Mode ] [-Force] [-Log ] [-Version ] + [-Id ] [-Name ] [-Moniker ] [-Source ] [[-Query] ] + [-MatchOption ] [-WhatIf] [-Confirm] [] +``` + +### GivenSet + +``` +Uninstall-WinGetPackage [-Mode ] [-Force] [-Log ] + [[-PSCatalogPackage] ] [-Version ] [-WhatIf] + [-Confirm] [] +``` + +## DESCRIPTION + +This command uninstalls a WinGet package from your computer. The command includes parameters to +specify values used to search for installed packages. By default, all string-based searches are +case-insensitive substring searches. Wildcards are not supported. You can change the search behavior +using the **MatchOption** parameter. + +## EXAMPLES + +### Example 1: Uninstall a package using a query + +```powershell +Uninstall-WinGetPackage Microsoft.PowerShell +``` + +This example show how to uninstall a package using a query. The **Query** parameter is positional, +so you don't need to include the parameter name before the query string. + +### Example 2: Uninstall a package by Id + +```powershell +Uninstall-WinGetPackage -Id Microsoft.PowerShell +``` + +This example shows how to uninstall a package by the specifying the package identifier. + +If the package identifier is available from more than one source, you must provide additional search +criteria to select a specific instance of the package. + +### Example 3: Uninstall a package by Name + +```powershell +Uninstall-WinGetPackage -Name "PowerToys (Preview)" +``` + +This sample uninstalls the PowerToys package by the specifying the package name. + +### Example 4: Uninstall a specific version of a package + +```powershell +Uninstall-WinGetPackage Microsoft.PowerShell -Version 7.4.4.0 +``` + +This example shows how to uninstall a specific version of a package using a query. The command does +a query search for packages matching `Microsoft.PowerShell`. The results of the search a limited to +matches with the version of `7.4.4.0`. + +## PARAMETERS + +### -Force + +Force the uninstall to run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Id + +Specify the package identifier to search for. By default, the command does a case-insensitive +substring match. + +```yaml +Type: System.String +Parameter Sets: FoundSet +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Log + +Specify the location for the uninstaller log. The value can be a fully-qualified or relative path and must include the file name. For example: `$env:TEMP\package.log`. + +> **Note: Not all uninstallers support this option.** + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -MatchOption + +Specify the match option for a WinGet package query. This parameter accepts the following values: + +- `Equals` +- `EqualsCaseInsensitive` +- `StartsWithCaseInsensitive` +- `ContainsCaseInsensitive` + +```yaml +Type: Microsoft.WinGet.Client.PSObjects.PSPackageFieldMatchOption +Parameter Sets: FoundSet +Aliases: +Accepted values: Equals, EqualsCaseInsensitive, StartsWithCaseInsensitive, ContainsCaseInsensitive + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Mode + +Specify the output mode for the installer. The parameter accepts the following values: + +- `Default` +- `Silent` +- `Interactive` + +> [!NOTE] +> Not all uninstallers support all modes. + +```yaml +Type: Microsoft.WinGet.Client.PSObjects.PSPackageUninstallMode +Parameter Sets: (All) +Aliases: +Accepted values: Default, Silent, Interactive + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Moniker + +Specify the moniker of the WinGet package to download. For example, the moniker for the +Microsoft.PowerShell package is `pwsh`. + +```yaml +Type: System.String +Parameter Sets: FoundSet +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Name + +Specify the name of the WinGet package name. The name contains space, you must enclose the name in +quotes. + +```yaml +Type: System.String +Parameter Sets: FoundSet +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -PSCatalogPackage + +Provide **PSCatalogPackage** object. You can get a **PSCatalogPackage** object by using the +`Find-WinGetPackage` or `Get-WingetPackage` commands. + +```yaml +Type: Microsoft.WinGet.Client.Engine.PSObjects.PSCatalogPackage +Parameter Sets: GivenSet +Aliases: InputObject + +Required: False +Position: 0 +Default value: None +Accept pipeline input: True (ByPropertyName, ByValue) +Accept wildcard characters: False +``` + +### -Query + +Specify one or more strings to search for. By default, the command searches all configured sources. +Wildcards are not supported. The command compares the value provided to the following package +manifest properties: + + - `PackageIdentifier` + - `PackageName` + - `Moniker` + - `Tags` + +The command does a case-insensitive substring comparison of these properties. + +```yaml +Type: System.String[] +Parameter Sets: FoundSet +Aliases: + +Required: False +Position: 0 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Source + +Specify the name of a configured WinGet source. + +```yaml +Type: System.String +Parameter Sets: FoundSet +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Version + +Specify the version of the package to be uninstalled. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Confirm + +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf + +Shows what would happen if the cmdlet runs. The cmdlet isn't run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters + +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, +-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, +-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.WinGet.Client.PSObjects.PSPackageUninstallMode + +### System.Management.Automation.SwitchParameter + +### System.String + +### Microsoft.WinGet.Client.Engine.PSObjects.PSCatalogPackage + +### System.String[] + +### Microsoft.WinGet.Client.PSObjects.PSPackageFieldMatchOption + +## OUTPUTS + +### Microsoft.WinGet.Client.Engine.PSObjects.PSUninstallResult + +## NOTES + +## RELATED LINKS + +[Get-WinGetPackage](Get-WinGetPackage.md) + +[Install-WinGetPackage](Install-WinGetPackage.md) diff --git a/src/PowerShell/Help/Microsoft.WinGet.Client/Update-WinGetPackage.md b/src/PowerShell/Help/Microsoft.WinGet.Client/Update-WinGetPackage.md new file mode 100644 index 0000000000..5e51d65de0 --- /dev/null +++ b/src/PowerShell/Help/Microsoft.WinGet.Client/Update-WinGetPackage.md @@ -0,0 +1,579 @@ +--- +external help file: Microsoft.WinGet.Client.Cmdlets.dll-Help.xml +Module Name: Microsoft.WinGet.Client +ms.date: 08/01/2024 +online version: +schema: 2.0.0 +title: Update-WinGetPackage +--- + +# Update-WinGetPackage + +## SYNOPSIS +Installs a newer version of a previously installed WinGet package. + +## SYNTAX + +### FoundSet (Default) + +``` +Update-WinGetPackage [-IncludeUnknown] [-Mode ] [-Override ] [-Custom ] + [-Location ] [-Log ] [-Force] [-Header ] [-AllowHashMismatch] + [-Architecture ] [-InstallerType ] [-Locale ] + [-Scope ] [-SkipDependencies] [-Version ] [-Id ] [-Name ] + [-Moniker ] [-Source ] [[-Query] ] [-MatchOption ] + [-WhatIf] [-Confirm] [] +``` + +### GivenSet + +``` +Update-WinGetPackage [-IncludeUnknown] [-Mode ] [-Override ] [-Custom ] + [-Location ] [-Log ] [-Force] [-Header ] [-AllowHashMismatch] + [-Architecture ] [-InstallerType ] [-Locale ] + [-Scope ] [-SkipDependencies] [[-PSCatalogPackage] ] + [-Version ] [-WhatIf] [-Confirm] [] +``` + +## DESCRIPTION + +This command searches the packages installed on your system and installs a newer version of the +matching WinGet package. The command includes parameters to specify values used to search for +packages in the configured sources. By default, the command searches all sources. By default, all string-based searches are case-insensitive substring searches. Wildcards are not supported. You can change the search behavior using the **MatchOption** parameter. + +## EXAMPLES + +### Example 1: Update a package using a query + +```powershell +Update-WinGetPackage Microsoft.PowerShell +``` + +This example show how to update a package using a query. The **Query** parameter is positional, so +you don't need to include the parameter name before the query string. + +### Example 2: Update a package by Id + +```powershell +Update-WinGetPackage -Id Microsoft.PowerShell +``` + +This example shows how to update a package by the specifying the package identifier. + +If the package identifier is available from more than one source, you must provide additional search +criteria to select a specific instance of the package. + +### Example 3: Update a package by Name + +```powershell +Update-WinGetPackage -Name "PowerToys (Preview)" +``` + +This sample updates the PowerToys package by the specifying the package name. + +### Example 4: Update to a specific version of a package + +```powershell +Update-WinGetPackage Microsoft.PowerShell -Version 7.4.4.0 +``` + +This example shows how to update a specific version of a package using a query. The command does a +query search for packages matching `Microsoft.PowerShell`. The results of the search a limited to +matches with the version of `7.4.4.0`. + +### Example 5: Update all packages + +```powershell +Get-WinGetPackage | Where-Object IsUpdateAvailable | Update-WinGetPackage +``` + +This example shows how to update all packages that have an available upgrade from one of the configured sources. + +## PARAMETERS + +### -AllowHashMismatch + +Allows you to download package even when the SHA256 hash for an installer or a dependency does not +match the SHA256 hash in the WinGet package manifest. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Architecture + +Specify the processor architecture for the WinGet package installer. The parameter accepts the +following values: + +- `Default` +- `X86` +- `Arm` +- `X64` +- `Arm64` + +```yaml +Type: Microsoft.WinGet.Client.PSObjects.PSProcessorArchitecture +Parameter Sets: (All) +Aliases: +Accepted values: Default, X86, Arm, X64, Arm64 + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Custom + +Use this parameter to pass additional arguments to the installer. The parameter takes a single string value. To add multiple arguments, include the arguments in the string. The arguments must be provided in the format expected by the installer. If the string contains spaces, it must be enclosed in quotes. This string is added to the arguments defined in the package manifest. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Force + +Force the update to run the installer. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Header + +Specify a custom value in the HTTP header to the REST source. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Id + +Specify the package identifier to search for. By default, the command does a case-insensitive +substring match. + +```yaml +Type: System.String +Parameter Sets: FoundSet +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -IncludeUnknown + +Use this parameter to upgrade the package when the installed version is not specified in the +registry. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -InstallerType + +A package may contain multiple installer types. Use this parameter to select the installer you want +to use. The parameter accepts the following values: + +- `Default` +- `Inno` +- `Wix` +- `Msi` +- `Nullsoft` +- `Zip` +- `Msix` +- `Exe` +- `Burn` +- `MSStore` +- `Portable` + +```yaml +Type: Microsoft.WinGet.Client.PSObjects.PSPackageInstallerType +Parameter Sets: (All) +Aliases: +Accepted values: Default, Inno, Wix, Msi, Nullsoft, Zip, Msix, Exe, Burn, MSStore, Portable + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Locale + +Specify the locale of the installer package. The locale must provided in the BCP 47 format, such as +`en-US`. For more information, see +[Standard locale names](/globalization/locale/standard-locale-names). + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Location + +Specify the file path where you want the packed to be installed. The installer must be able to +support alternate install locations. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Log + +Specify the location for the installer log. The value can be a fully-qualified or relative path and must include the file name. For example: `$env:TEMP\package.log`. + +> **Note: Not all installers support this property.** + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -MatchOption + +Specify the match option for a WinGet package query. This parameter accepts the following values: + +- `Equals` +- `EqualsCaseInsensitive` +- `StartsWithCaseInsensitive` +- `ContainsCaseInsensitive` + +```yaml +Type: Microsoft.WinGet.Client.PSObjects.PSPackageFieldMatchOption +Parameter Sets: FoundSet +Aliases: +Accepted values: Equals, EqualsCaseInsensitive, StartsWithCaseInsensitive, ContainsCaseInsensitive + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Mode + +Specify the output mode for the installer. The parameter accepts the following values: + +- `Default` +- `Silent` +- `Interactive` + +Not all installers support all modes. + +```yaml +Type: Microsoft.WinGet.Client.PSObjects.PSPackageInstallMode +Parameter Sets: (All) +Aliases: +Accepted values: Default, Silent, Interactive + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Moniker + +Specify the moniker of the WinGet package to update. For example, the moniker for the +Microsoft.PowerShell package is `pwsh`. + +```yaml +Type: System.String +Parameter Sets: FoundSet +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Name + +Specify the name of the package to be updated. + +```yaml +Type: System.String +Parameter Sets: FoundSet +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Override + +Use this parameter to override the existing arguments passed to the installer. The parameter takes a single string value. To add multiple arguments, include the arguments in the string. The arguments must be provided in the format expected by the installer. If the string contains spaces, it must be enclosed in quotes. This string overrides the arguments specified in the package manifest. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -PSCatalogPackage + +Provide **PSCatalogPackage** object. You can get a **PSCatalogPackage** object by using the +`Find-WinGetPackage` or `Get-WinGetPackage` commands. + +```yaml +Type: Microsoft.WinGet.Client.Engine.PSObjects.PSCatalogPackage +Parameter Sets: GivenSet +Aliases: InputObject + +Required: False +Position: 0 +Default value: None +Accept pipeline input: True (ByPropertyName, ByValue) +Accept wildcard characters: False +``` + +### -Query + +Specify one or more strings to search for. By default, the command searches all configured sources. +Wildcards are not supported. The command compares the value provided to the following package +manifest properties: + + - `PackageIdentifier` + - `PackageName` + - `Moniker` + - `Tags` + +The command does a case-insensitive substring comparison of these properties. + +```yaml +Type: System.String[] +Parameter Sets: FoundSet +Aliases: + +Required: False +Position: 0 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Scope + +Specify WinGet package installer scope. The parameter accepts the following values: + +- `Any` +- `User` +- `System` +- `UserOrUnknown` +- `SystemOrUnknown` + +> [!NOTE] +> The installer scope must be available in the WinGet package manifest. + +```yaml +Type: Microsoft.WinGet.Client.PSObjects.PSPackageInstallScope +Parameter Sets: (All) +Aliases: +Accepted values: Any, User, System, UserOrUnknown, SystemOrUnknown + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -SkipDependencies + +Specifies that the command shouldn't install the WinGet package dependencies. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Source + +Specify the name of a configured WinGet source. + +```yaml +Type: System.String +Parameter Sets: FoundSet +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Version + +Specify package version. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Confirm + +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf + +Shows what would happen if the cmdlet runs. The cmdlet isn't run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters + +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, +-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, +-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### System.Management.Automation.SwitchParameter + +### Microsoft.WinGet.Client.PSObjects.PSPackageInstallMode + +### System.String + +### Microsoft.WinGet.Client.PSObjects.PSProcessorArchitecture + +### Microsoft.WinGet.Client.PSObjects.PSPackageInstallerType + +### Microsoft.WinGet.Client.PSObjects.PSPackageInstallScope + +### Microsoft.WinGet.Client.Engine.PSObjects.PSCatalogPackage + +### System.String[] + +### Microsoft.WinGet.Client.PSObjects.PSPackageFieldMatchOption + +## OUTPUTS + +### Microsoft.WinGet.Client.Engine.PSObjects.PSInstallResult + +## NOTES + +## RELATED LINKS + +[Get-WinGetPackage](Get-WinGetPackage.md) + +[Uninstall-WinGetPackage](Uninstall-WinGetPackage.md) diff --git a/src/PowerShell/Help/Microsoft.WinGet.DSC/WinGetAdminSettings.md b/src/PowerShell/Help/Microsoft.WinGet.DSC/WinGetAdminSettings.md new file mode 100644 index 0000000000..908d61a29e --- /dev/null +++ b/src/PowerShell/Help/Microsoft.WinGet.DSC/WinGetAdminSettings.md @@ -0,0 +1,24 @@ +--- +external help file: Microsoft.WinGet.DSC.psm1-Help.xml +Module Name: Microsoft.WinGet.DSC +ms.date: 08/28/2024 +online version: +schema: 2.0.0 +title: WinGetAdminSettings +--- + +# WinGetAdminSettings + +## SYNOPSIS +Configures WinGet administrator settings. + +## DESCRIPTION + +Allows the administrator settings to be configured or retrieved. Setting administrator settings requires administrator privileges. + +## PARAMETERS + +**Parameter**|**Attribute**|**DataType**|**Description**|**Allowed Values** +:-----|:-----|:-----|:-----|:----- +`SID`|Key|String|The SID of the user to target, or an empty string to target the current user. **Only the empty string is currently supported.**|See [security identifiers](https://learn.microsoft.com/en-us/windows-server/identity/ad-ds/manage/understand-security-identifiers) +`Settings`|Mandatory|Hashtable|The administrator settings as a hashtable.|Inspect the `adminSettings` property of the output from `Get-WinGetSettings` diff --git a/src/PowerShell/Help/Microsoft.WinGet.DSC/WinGetPackage.md b/src/PowerShell/Help/Microsoft.WinGet.DSC/WinGetPackage.md new file mode 100644 index 0000000000..fab88c87ae --- /dev/null +++ b/src/PowerShell/Help/Microsoft.WinGet.DSC/WinGetPackage.md @@ -0,0 +1,29 @@ +--- +external help file: Microsoft.WinGet.DSC.psm1-Help.xml +Module Name: Microsoft.WinGet.DSC +ms.date: 08/28/2024 +online version: +schema: 2.0.0 +title: WinGetPackage +--- + +# WinGetPackage + +## SYNOPSIS +Configures packages through WinGet. + +## DESCRIPTION + +Allows WinGet package state to be configured. + +## PARAMETERS + +**Parameter**|**Attribute**|**DataType**|**Description**|**Allowed Values** +:-----|:-----|:-----|:-----|:----- +`Id`|Key, Mandatory|String|The identifier of a WinGet package.|Use `Find-WinGetPackage` to search for packages +`Source`|Key|String|The name of the source that provides the package. If not provided, all configured sources will be searched for the `Id`.|Use the `WinGetSources` resource to configure a source or `Get-WinGetSource` to discover the default sources +`Version`|Optional|String|The version of the package.|See the `AvailableVersions` property of output from `Find-WinGetPackage` +`Ensure`|Optional|WinGetEnsure|Whether the package should be installed (`Present`) or not (`Absent`).|`Present` (default), `Absent` +`MatchOption`|Optional|WinGetMatchOption|The method used to compare the `Id` parameter with available packages.|`Equals`, `EqualsCaseInsensitive` (default), `StartsWithCaseInsensitive`, `ContainsCaseInsensitive` +`UseLatest`|Optional|Boolean|Whether the package should updated to the latest available version. If true, takes precedence over `Version`.|`True`, `False` (default) +`InstallMode`|Optional|WinGetInstallMode|The interactivity level requested when installing.|`Default`, `Silent` (default), `Interactive` diff --git a/src/PowerShell/Help/Microsoft.WinGet.DSC/WinGetPackageManager.md b/src/PowerShell/Help/Microsoft.WinGet.DSC/WinGetPackageManager.md new file mode 100644 index 0000000000..ded325e778 --- /dev/null +++ b/src/PowerShell/Help/Microsoft.WinGet.DSC/WinGetPackageManager.md @@ -0,0 +1,26 @@ +--- +external help file: Microsoft.WinGet.DSC.psm1-Help.xml +Module Name: Microsoft.WinGet.DSC +ms.date: 08/28/2024 +online version: +schema: 2.0.0 +title: WinGetPackageManager +--- + +# WinGetPackageManager + +## SYNOPSIS +Configures the WinGet package manager package itself. + +## DESCRIPTION + +Allows the WinGet package manager package version to be configured. If multiple of the version targeting parameters are True/non-empty, they will take precedence in the following order: `UseLatest`, `UseLatestPreRelease`, `Version`. + +## PARAMETERS + +**Parameter**|**Attribute**|**DataType**|**Description**|**Allowed Values** +:-----|:-----|:-----|:-----|:----- +`SID`|Key|String|The SID of the user to target, or an empty string to target the current user. **Only the empty string is currently supported.**|See [security identifiers](https://learn.microsoft.com/en-us/windows-server/identity/ad-ds/manage/understand-security-identifiers) +`Version`|Optional|String|A version of the WinGet package manager package.|See [the WinGet release tags](https://github.com/microsoft/winget-cli/releases) +`UseLatest`|Optional|Boolean|The latest publicly available release should be used.|`True`, `False` (default) +`UseLatestPreRelease`|Optional|Boolean|The latest preview release should be used.|`True`, `False` (default) diff --git a/src/PowerShell/Help/Microsoft.WinGet.DSC/WinGetSource.md b/src/PowerShell/Help/Microsoft.WinGet.DSC/WinGetSource.md new file mode 100644 index 0000000000..7823851ad5 --- /dev/null +++ b/src/PowerShell/Help/Microsoft.WinGet.DSC/WinGetSource.md @@ -0,0 +1,28 @@ +--- +external help file: Microsoft.WinGet.DSC.psm1-Help.xml +Module Name: Microsoft.WinGet.DSC +ms.date: 08/28/2024 +online version: +schema: 2.0.0 +title: WinGetSource +--- + +# WinGetSource + +## SYNOPSIS +Configures a WinGet source. + +## DESCRIPTION + +Allows WinGet sources to be configured or retrieved. + +## PARAMETERS + +**Parameter**|**Attribute**|**DataType**|**Description**|**Allowed Values** +:-----|:-----|:-----|:-----|:----- +`Name`|Key, Mandatory|String|The name of the source.|Any string using valid characters for Windows file names +`Argument`|Mandatory|String|The primary data defining the source; typically the URI prefix of the source.|Source type specific value +`Type`|Optional|String|The type of the source.|`Microsoft.PreIndexed.Package`, `Microsoft.Rest` +`TrustLevel`|Optional|WinGetTrustLevel|The trust level of the source, which determines how much scrutiny is placed on it when used. If undefined and the source needs to be configured, the default value is `None`.|`Undefined` (default), `None`, `Trusted` +`Explicit`|Optional|WinGetOptionalBool|Whether the source is included (`False`) or not (`True`) in commands that do not specify a source. If undefined and the source needs to be configured, the default value is `False`.|`Undefined` (default), `False`, `True` +`Ensure`|Optional|WinGetEnsure|Whether the source should exist (`Present`) or not (`Absent`).|`Present` (default), `Absent` diff --git a/src/PowerShell/Help/Microsoft.WinGet.DSC/WinGetUserSettings.md b/src/PowerShell/Help/Microsoft.WinGet.DSC/WinGetUserSettings.md new file mode 100644 index 0000000000..4d1894e07d --- /dev/null +++ b/src/PowerShell/Help/Microsoft.WinGet.DSC/WinGetUserSettings.md @@ -0,0 +1,25 @@ +--- +external help file: Microsoft.WinGet.DSC.psm1-Help.xml +Module Name: Microsoft.WinGet.DSC +ms.date: 08/28/2024 +online version: +schema: 2.0.0 +title: WinGetUserSettings +--- + +# WinGetUserSettings + +## SYNOPSIS +Configures WinGet user settings. + +## DESCRIPTION + +Allows part or all of the user settings to be configured or retrieved. + +## PARAMETERS + +**Parameter**|**Attribute**|**DataType**|**Description**|**Allowed Values** +:-----|:-----|:-----|:-----|:----- +`SID`|Key|String|The SID of the user to target, or an empty string to target the current user. **Only the empty string is currently supported.**|See [security identifiers](https://learn.microsoft.com/en-us/windows-server/identity/ad-ds/manage/understand-security-identifiers) +`Settings`|Mandatory|Hashtable|The user settings as a hashtable.|See [the schema](https://github.com/microsoft/winget-cli/blob/master/schemas/JSON/settings/settings.schema.0.2.json) +`Action`|Optional|WinGetAction|Determines whether to overwrite (`Full`) or merge (`Partial`) the value provided in `Settings` with the current user settings.|`Full` (default), `Partial` diff --git a/src/PowerShell/Help/markdownlint.yaml b/src/PowerShell/Help/markdownlint.yaml new file mode 100644 index 0000000000..a794811c1f --- /dev/null +++ b/src/PowerShell/Help/markdownlint.yaml @@ -0,0 +1,117 @@ +docsmd.alert: true +docsmd.codesnippet: true +docsmd.column: true +docsmd.image: true +docsmd.moniker: true +docsmd.no-loc: true +docsmd.row: true +docsmd.securelinks: true +docsmd.syntax: true +docsmd.video: true +docsmd.xref: true +docsmd.zone: true + +MD001: true # header-increment +# MD002 # first-header-h1 - Superceded by MD041 +MD003: # header-style + style: atx +MD004: # ul-style + style: dash +MD005: true # list-indent +# MD006 # ul-start-left - Superceded by MD007's start_indented option +MD007: # ul-indent + indent: 2 + start_indented: false +# MD008 # Removed from linter; used to specify indentation for ul +MD009: # no-trailing-spaces + br_spaces: 2 + strict: true +MD010: true # no-hard-tabs +MD011: true # no-reversed-links +MD012: true # no-multiple-blanks +MD013: # line-length + code_block_line_length: 90 + code_blocks: true + heading_line_length: 100 + headings: true + line_length: 100 + stern: true + tables: false +MD014: true # commands-show-output +# MD015 # "Use of non-atx style headers" - Removed from linter, replaced by MD003 +# MD016 # "Use of non-closed-atx style headers" - Removed from linter, replaced by MD003 +# MD017 # "Use of non-setext style headers" - Removed from linter, replaced by MD003 +MD018: true # no-missing-space-atx +MD019: true # no-multiple-space-atx +MD020: true # no-missing-space-closed-atx +MD021: true # no-multiple-space-closed-atx +MD022: true # blanks-around-headers +MD023: true # header-start-left +MD024: # no-duplicate-header + siblings_only: true +MD025: # single-h1 + front_matter_title: '' + level: 1 +MD026: # no-trailing-punctuation + punctuation: '.,;:!。,;:!?' +MD027: true # no-multiple-space-blockquote +MD028: true # no-blanks-blockquote +MD029: # ol-prefix + style: one +MD030: true # list-marker-space +MD031: true # blanks-around-fences +MD032: true # blanks-around-lists +MD033: # no-inline-html + allowed_elements: + - a + - br + - code + - kbd + - li + - properties + - sup + - tags + - ul +MD034: true # no-bare-urls +MD035: # hr-style + style: '---' +MD036: true # no-emphasis-as-header +MD037: true # no-space-in-emphasis +MD038: true # no-space-in-code +MD039: true # no-space-in-links +MD040: false # fenced-code-language +MD041: # first-line-h1 + front_matter_title: '' +MD042: true # no-empty-links +MD043: false # required-headers +MD044: # proper-names + code_blocks: false + names: + - PowerShell + - IntelliSense + - Authenticode + - CentOS + - Contoso + - CoreOS + - Debian + - Ubuntu + - openSUSE + - RHEL + - JavaScript + - .NET + - NuGet + - VS Code + - Newtonsoft +MD045: true # no-alt-text +MD046: # code-block-style + style: fenced +MD047: true # single-trailing-newline +MD048: # code-fence-style + style: backtick +MD049: # emphasis-style + style: underscore +MD050: # strong-style + style: asterisk +MD051: true # link-fragments +MD052: true # reference-links-images +MD053: true # link-image-reference-definitions diff --git a/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/AddSourceCmdlet.cs b/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/AddSourceCmdlet.cs index fc7abd2da8..51b00270ef 100644 --- a/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/AddSourceCmdlet.cs +++ b/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/AddSourceCmdlet.cs @@ -1,4 +1,4 @@ -// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- // // Copyright (c) Microsoft Corporation. Licensed under the MIT License. // @@ -7,6 +7,7 @@ namespace Microsoft.WinGet.Client.Cmdlets.Cmdlets { using System.Management.Automation; + using Microsoft.WinGet.Client.Cmdlets.PSObjects; using Microsoft.WinGet.Client.Common; using Microsoft.WinGet.Client.Engine.Commands; @@ -14,6 +15,7 @@ namespace Microsoft.WinGet.Client.Cmdlets.Cmdlets /// Adds a source. Requires admin. /// [Cmdlet(VerbsCommon.Add, Constants.WinGetNouns.Source)] + [Alias("awgs")] public sealed class AddSourceCmdlet : PSCmdlet { /// @@ -42,13 +44,32 @@ public sealed class AddSourceCmdlet : PSCmdlet ValueFromPipelineByPropertyName = true)] public string Type { get; set; } + /// + /// Gets or sets the trust level of the source to add. + /// + [Parameter(ValueFromPipelineByPropertyName = true)] + public PSSourceTrustLevel TrustLevel { get; set; } = PSSourceTrustLevel.Default; + + /// + /// Gets or sets a value indicating whether the source to add is explicit. + /// + /// + [Parameter(ValueFromPipelineByPropertyName = true)] + public SwitchParameter Explicit { get; set; } + /// /// Adds source. /// protected override void ProcessRecord() { var command = new CliCommand(this); - command.AddSource(this.Name, this.Argument, this.Type); + command.AddSource(this.Name, this.Argument, this.Type, this.ConvertPSSourceTrustLevelToString(this.TrustLevel), this.Explicit.ToBool()); } + + private string ConvertPSSourceTrustLevelToString(PSSourceTrustLevel trustLevel) => trustLevel switch + { + PSSourceTrustLevel.Default => string.Empty, + _ => trustLevel.ToString(), + }; } } diff --git a/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/AssertWinGetPackageManagerCmdlet.cs b/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/AssertWinGetPackageManagerCmdlet.cs index 9111fc4ed1..b33bdbd502 100644 --- a/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/AssertWinGetPackageManagerCmdlet.cs +++ b/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/AssertWinGetPackageManagerCmdlet.cs @@ -1,4 +1,4 @@ -// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- // // Copyright (c) Microsoft Corporation. Licensed under the MIT License. // @@ -18,6 +18,7 @@ namespace Microsoft.WinGet.Client.Commands VerbsLifecycle.Assert, Constants.WinGetNouns.WinGetPackageManager, DefaultParameterSetName = Constants.IntegrityVersionSet)] + [Alias("awgpm")] public class AssertWinGetPackageManagerCmdlet : WinGetPackageManagerCmdlet { /// @@ -29,7 +30,7 @@ protected override void ProcessRecord() var command = new WinGetPackageManagerCommand(this); if (this.ParameterSetName == Constants.IntegrityLatestSet) { - command.AssertUsingLatest(this.IncludePreRelease.ToBool()); + command.AssertUsingLatest(this.IncludePrerelease.ToBool()); } else { diff --git a/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/Common/WinGetPackageManagerCmdlet.cs b/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/Common/WinGetPackageManagerCmdlet.cs index b21c6986e7..3d2f4d16d7 100644 --- a/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/Common/WinGetPackageManagerCmdlet.cs +++ b/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/Common/WinGetPackageManagerCmdlet.cs @@ -1,4 +1,4 @@ -// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- // // Copyright (c) Microsoft Corporation. Licensed under the MIT License. // @@ -36,6 +36,6 @@ public abstract class WinGetPackageManagerCmdlet : PSCmdlet [Parameter( ParameterSetName = Constants.IntegrityLatestSet, ValueFromPipelineByPropertyName = true)] - public SwitchParameter IncludePreRelease { get; set; } + public SwitchParameter IncludePrerelease { get; set; } } } diff --git a/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/DisableSettingCmdlet.cs b/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/DisableSettingCmdlet.cs index d2d3a42aa1..2ecaea93f1 100644 --- a/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/DisableSettingCmdlet.cs +++ b/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/DisableSettingCmdlet.cs @@ -14,6 +14,7 @@ namespace Microsoft.WinGet.Client.Cmdlets.Cmdlets /// Disables an admin setting. Requires admin. /// [Cmdlet(VerbsLifecycle.Disable, Constants.WinGetNouns.Setting)] + [Alias("dwgs")] public sealed class DisableSettingCmdlet : PSCmdlet { /// diff --git a/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/EnableSettingCmdlet.cs b/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/EnableSettingCmdlet.cs index 039d08415c..80590ec353 100644 --- a/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/EnableSettingCmdlet.cs +++ b/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/EnableSettingCmdlet.cs @@ -14,6 +14,7 @@ namespace Microsoft.WinGet.Client.Cmdlets.Cmdlets /// Enables an admin setting. Requires admin. /// [Cmdlet(VerbsLifecycle.Enable, Constants.WinGetNouns.Setting)] + [Alias("ewgs")] public sealed class EnableSettingCmdlet : PSCmdlet { /// diff --git a/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/ExportPackageCmdlet.cs b/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/ExportPackageCmdlet.cs index ac6c6929eb..6c012f682e 100644 --- a/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/ExportPackageCmdlet.cs +++ b/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/ExportPackageCmdlet.cs @@ -1,39 +1,40 @@ -// ----------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. Licensed under the MIT License. -// -// ----------------------------------------------------------------------------- - -namespace Microsoft.WinGet.Client.Commands -{ +// ----------------------------------------------------------------------------- +// +// Copyright (c) Microsoft Corporation. Licensed under the MIT License. +// +// ----------------------------------------------------------------------------- + +namespace Microsoft.WinGet.Client.Commands +{ using System.Management.Automation; - using Microsoft.WinGet.Client.Common; - using Microsoft.WinGet.Client.Engine.Commands; + using Microsoft.WinGet.Client.Common; + using Microsoft.WinGet.Client.Engine.Commands; using Microsoft.WinGet.Client.Engine.PSObjects; - /// - /// Downloads a package installer from the pipeline or from a configured source. - /// - [Cmdlet( - VerbsData.Export, - Constants.WinGetNouns.Package, - DefaultParameterSetName = Constants.FoundSet, - SupportsShouldProcess = true)] - [OutputType(typeof(PSDownloadResult))] - public sealed class ExportPackageCmdlet : InstallerSelectionCmdlet - { + /// + /// Downloads a package installer from the pipeline or from a configured source. + /// + [Cmdlet( + VerbsData.Export, + Constants.WinGetNouns.Package, + DefaultParameterSetName = Constants.FoundSet, + SupportsShouldProcess = true)] + [Alias("ewgp")] + [OutputType(typeof(PSDownloadResult))] + public sealed class ExportPackageCmdlet : InstallerSelectionCmdlet + { private DownloadCommand command = null; /// /// Gets or sets the directory where the installer will be downloaded to. - /// - [Parameter(ValueFromPipelineByPropertyName = true)] + /// + [Parameter(ValueFromPipelineByPropertyName = true)] public string DownloadDirectory { get; set; } - /// - /// Installs a package from the pipeline or from a configured source. - /// - protected override void ProcessRecord() + /// + /// Installs a package from the pipeline or from a configured source. + /// + protected override void ProcessRecord() { this.command = new DownloadCommand( this, @@ -47,7 +48,7 @@ protected override void ProcessRecord() this.AllowHashMismatch.ToBool(), this.SkipDependencies.ToBool(), this.Locale); - this.command.Download(this.DownloadDirectory, this.MatchOption.ToString(), this.Scope.ToString(), this.Architecture.ToString(), this.InstallerType.ToString()); + this.command.Download(this.DownloadDirectory, this.MatchOption.ToString(), this.Scope.ToString(), this.Architecture.ToString(), this.InstallerType.ToString()); } /// @@ -59,6 +60,6 @@ protected override void StopProcessing() { this.command.Cancel(); } - } - } -} + } + } +} diff --git a/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/FindPackageCmdlet.cs b/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/FindPackageCmdlet.cs index a16ac326a6..229fbe1831 100644 --- a/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/FindPackageCmdlet.cs +++ b/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/FindPackageCmdlet.cs @@ -1,28 +1,29 @@ -// ----------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. Licensed under the MIT License. -// -// ----------------------------------------------------------------------------- - -namespace Microsoft.WinGet.Client.Commands -{ +// ----------------------------------------------------------------------------- +// +// Copyright (c) Microsoft Corporation. Licensed under the MIT License. +// +// ----------------------------------------------------------------------------- + +namespace Microsoft.WinGet.Client.Commands +{ using System.Management.Automation; - using Microsoft.WinGet.Client.Commands.Common; + using Microsoft.WinGet.Client.Commands.Common; using Microsoft.WinGet.Client.Common; using Microsoft.WinGet.Client.Engine.Commands; - using Microsoft.WinGet.Client.Engine.PSObjects; - - /// - /// Searches configured sources for packages. - /// - [Cmdlet(VerbsCommon.Find, Constants.WinGetNouns.Package)] - [OutputType(typeof(PSFoundCatalogPackage))] - public sealed class FindPackageCmdlet : FinderExtendedCmdlet - { - /// - /// Searches for configured sources for packages. - /// - protected override void ProcessRecord() + using Microsoft.WinGet.Client.Engine.PSObjects; + + /// + /// Searches configured sources for packages. + /// + [Cmdlet(VerbsCommon.Find, Constants.WinGetNouns.Package)] + [Alias("fdwgp")] + [OutputType(typeof(PSFoundCatalogPackage))] + public sealed class FindPackageCmdlet : FinderExtendedCmdlet + { + /// + /// Searches for configured sources for packages. + /// + protected override void ProcessRecord() { var command = new FinderPackageCommand( this, @@ -35,7 +36,7 @@ protected override void ProcessRecord() this.Command, this.Count); - command.Find(this.MatchOption.ToString()); - } - } -} + command.Find(this.MatchOption.ToString()); + } + } +} diff --git a/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/GetPackageCmdlet.cs b/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/GetPackageCmdlet.cs index 01fab7ccdd..9338faba32 100644 --- a/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/GetPackageCmdlet.cs +++ b/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/GetPackageCmdlet.cs @@ -16,6 +16,7 @@ namespace Microsoft.WinGet.Client.Commands /// Searches configured sources for packages. /// [Cmdlet(VerbsCommon.Get, Constants.WinGetNouns.Package)] + [Alias("gwgp")] [OutputType(typeof(PSInstalledCatalogPackage))] public sealed class GetPackageCmdlet : FinderExtendedCmdlet { diff --git a/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/GetSettingsCmdlet.cs b/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/GetSettingCmdlet.cs similarity index 75% rename from src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/GetSettingsCmdlet.cs rename to src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/GetSettingCmdlet.cs index 6aacade5a2..39067d11d1 100644 --- a/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/GetSettingsCmdlet.cs +++ b/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/GetSettingCmdlet.cs @@ -1,34 +1,35 @@ -// ----------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. Licensed under the MIT License. -// -// ----------------------------------------------------------------------------- - -namespace Microsoft.WinGet.Client.Cmdlets.Cmdlets -{ - using System.Management.Automation; - using Microsoft.WinGet.Client.Common; - using Microsoft.WinGet.Client.Engine.Commands; - - /// - /// Gets winget settings. - /// - [Cmdlet(VerbsCommon.Get, Constants.WinGetNouns.Settings)] - public sealed class GetSettingsCmdlet : PSCmdlet - { - /// - /// Gets or sets a value indicating whether to output a string or a hashtable. - /// - [Parameter(ValueFromPipelineByPropertyName = true)] - public SwitchParameter AsPlainText { get; set; } - - /// - /// Get settings. - /// - protected override void ProcessRecord() - { - var command = new CliCommand(this); - command.GetSettings(this.AsPlainText.ToBool()); - } - } -} +// ----------------------------------------------------------------------------- +// +// Copyright (c) Microsoft Corporation. Licensed under the MIT License. +// +// ----------------------------------------------------------------------------- + +namespace Microsoft.WinGet.Client.Cmdlets.Cmdlets +{ + using System.Management.Automation; + using Microsoft.WinGet.Client.Common; + using Microsoft.WinGet.Client.Engine.Commands; + + /// + /// Gets winget settings. + /// + [Cmdlet(VerbsCommon.Get, Constants.WinGetNouns.Setting)] + [Alias("gwgse", "Get-WinGetSettings")] + public sealed class GetSettingCmdlet : PSCmdlet + { + /// + /// Gets or sets a value indicating whether to output a string or a hashtable. + /// + [Parameter(ValueFromPipelineByPropertyName = true)] + public SwitchParameter AsPlainText { get; set; } + + /// + /// Get settings. + /// + protected override void ProcessRecord() + { + var command = new CliCommand(this); + command.GetSettings(this.AsPlainText.ToBool()); + } + } +} diff --git a/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/GetSourceCmdlet.cs b/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/GetSourceCmdlet.cs index 4674456dfc..f19ee12f6a 100644 --- a/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/GetSourceCmdlet.cs +++ b/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/GetSourceCmdlet.cs @@ -1,39 +1,40 @@ -// ----------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. Licensed under the MIT License. -// -// ----------------------------------------------------------------------------- - -namespace Microsoft.WinGet.Client.Commands -{ - using System.Management.Automation; +// ----------------------------------------------------------------------------- +// +// Copyright (c) Microsoft Corporation. Licensed under the MIT License. +// +// ----------------------------------------------------------------------------- + +namespace Microsoft.WinGet.Client.Commands +{ + using System.Management.Automation; using Microsoft.WinGet.Client.Common; using Microsoft.WinGet.Client.Engine.Commands; using Microsoft.WinGet.Client.Engine.PSObjects; - /// - /// Retrieves the list of configured sources. - /// - [Cmdlet(VerbsCommon.Get, Constants.WinGetNouns.Source)] - [OutputType(typeof(PSSourceResult))] - public sealed class GetSourceCmdlet : PSCmdlet - { - /// - /// Gets or sets the name of the source to retrieve. - /// - [Parameter( - Position = 0, - ValueFromPipeline = true, - ValueFromPipelineByPropertyName = true)] - public string Name { get; set; } - - /// - /// Returns the list of configured sources. - /// - protected override void ProcessRecord() - { - var command = new SourceCommand(this); - command.Get(this.Name); - } - } -} + /// + /// Retrieves the list of configured sources. + /// + [Cmdlet(VerbsCommon.Get, Constants.WinGetNouns.Source)] + [Alias("gwgso")] + [OutputType(typeof(PSSourceResult))] + public sealed class GetSourceCmdlet : PSCmdlet + { + /// + /// Gets or sets the name of the source to retrieve. + /// + [Parameter( + Position = 0, + ValueFromPipeline = true, + ValueFromPipelineByPropertyName = true)] + public string Name { get; set; } + + /// + /// Returns the list of configured sources. + /// + protected override void ProcessRecord() + { + var command = new SourceCommand(this); + command.Get(this.Name); + } + } +} diff --git a/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/GetUserSettingsCmdlet.cs b/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/GetUserSettingCmdlet.cs similarity index 77% rename from src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/GetUserSettingsCmdlet.cs rename to src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/GetUserSettingCmdlet.cs index 200ef1b8b6..fe9dcdefef 100644 --- a/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/GetUserSettingsCmdlet.cs +++ b/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/GetUserSettingCmdlet.cs @@ -1,30 +1,31 @@ -// ----------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. Licensed under the MIT License. -// -// ----------------------------------------------------------------------------- - -namespace Microsoft.WinGet.Client.Commands -{ - using System.Collections; - using System.Management.Automation; - using Microsoft.WinGet.Client.Common; - using Microsoft.WinGet.Client.Engine.Commands; - - /// - /// Gets winget's user settings. - /// - [Cmdlet(VerbsCommon.Get, Constants.WinGetNouns.UserSettings)] - [OutputType(typeof(Hashtable))] - public sealed class GetUserSettingsCmdlet : PSCmdlet - { - /// - /// Gets the settings file contents. - /// - protected override void ProcessRecord() - { - var command = new UserSettingsCommand(this); - command.Get(); - } - } -} +// ----------------------------------------------------------------------------- +// +// Copyright (c) Microsoft Corporation. Licensed under the MIT License. +// +// ----------------------------------------------------------------------------- + +namespace Microsoft.WinGet.Client.Commands +{ + using System.Collections; + using System.Management.Automation; + using Microsoft.WinGet.Client.Common; + using Microsoft.WinGet.Client.Engine.Commands; + + /// + /// Gets winget's user settings. + /// + [Cmdlet(VerbsCommon.Get, Constants.WinGetNouns.UserSetting)] + [Alias("gwgus", "Get-WinGetUserSettings")] + [OutputType(typeof(Hashtable))] + public sealed class GetUserSettingCmdlet : PSCmdlet + { + /// + /// Gets the settings file contents. + /// + protected override void ProcessRecord() + { + var command = new UserSettingsCommand(this); + command.Get(); + } + } +} diff --git a/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/GetVersionCmdlet.cs b/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/GetVersionCmdlet.cs index 89c32e5ce7..c15cdbe5d2 100644 --- a/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/GetVersionCmdlet.cs +++ b/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/GetVersionCmdlet.cs @@ -14,6 +14,7 @@ namespace Microsoft.WinGet.Client.Commands /// Get-WinGetVersion. Gets the current version of winget. /// [Cmdlet(VerbsCommon.Get, Constants.WinGetNouns.Version)] + [Alias("gwgv")] [OutputType(typeof(string))] public class GetVersionCmdlet : PSCmdlet { diff --git a/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/InstallPackageCmdlet.cs b/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/InstallPackageCmdlet.cs index b5d07718ed..968319e891 100644 --- a/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/InstallPackageCmdlet.cs +++ b/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/InstallPackageCmdlet.cs @@ -20,6 +20,7 @@ namespace Microsoft.WinGet.Client.Commands Constants.WinGetNouns.Package, DefaultParameterSetName = Constants.FoundSet, SupportsShouldProcess = true)] + [Alias("iswgp")] [OutputType(typeof(PSInstallResult))] public sealed class InstallPackageCmdlet : InstallCmdlet { diff --git a/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/PSObjects/PSSourceTrustLevel.cs b/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/PSObjects/PSSourceTrustLevel.cs new file mode 100644 index 0000000000..02a32f6ac2 --- /dev/null +++ b/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/PSObjects/PSSourceTrustLevel.cs @@ -0,0 +1,29 @@ +// ----------------------------------------------------------------------------- +// +// Copyright (c) Microsoft Corporation. Licensed under the MIT License. +// +// ----------------------------------------------------------------------------- + +namespace Microsoft.WinGet.Client.Cmdlets.PSObjects +{ + /// + /// This is the powershell argument equivalent of AppInstaller::Repository::SourceTrustLevel. + /// + public enum PSSourceTrustLevel + { + /// + /// Let winget decide. + /// + Default, + + /// + /// None. + /// + None, + + /// + /// Trusted. + /// + Trusted, + } +} diff --git a/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/RemoveSourceCmdlet.cs b/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/RemoveSourceCmdlet.cs index fbcb392a75..cf30a7d016 100644 --- a/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/RemoveSourceCmdlet.cs +++ b/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/RemoveSourceCmdlet.cs @@ -1,4 +1,4 @@ -// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- // // Copyright (c) Microsoft Corporation. Licensed under the MIT License. // @@ -14,12 +14,14 @@ namespace Microsoft.WinGet.Client.Cmdlets /// Removes a source. Requires admin. /// [Cmdlet(VerbsCommon.Remove, Constants.WinGetNouns.Source)] + [Alias("rwgs")] public sealed class RemoveSourceCmdlet : PSCmdlet { /// /// Gets or sets the name of the source to remove. /// [Parameter( + Position = 0, Mandatory = true, ValueFromPipeline = true, ValueFromPipelineByPropertyName = true)] diff --git a/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/RepairWinGetPackageManagerCmdlet.cs b/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/RepairWinGetPackageManagerCmdlet.cs index f35700eb27..b3e6ae4df2 100644 --- a/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/RepairWinGetPackageManagerCmdlet.cs +++ b/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/RepairWinGetPackageManagerCmdlet.cs @@ -18,6 +18,7 @@ namespace Microsoft.WinGet.Client.Commands VerbsDiagnostic.Repair, Constants.WinGetNouns.WinGetPackageManager, DefaultParameterSetName = Constants.IntegrityVersionSet)] + [Alias("rpwgpm")] [OutputType(typeof(int))] public class RepairWinGetPackageManagerCmdlet : WinGetPackageManagerCmdlet { @@ -44,7 +45,7 @@ protected override void ProcessRecord() this.command = new WinGetPackageManagerCommand(this); if (this.ParameterSetName == Constants.IntegrityLatestSet) { - this.command.RepairUsingLatest(this.IncludePreRelease.ToBool(), this.AllUsers.ToBool(), this.Force.ToBool()); + this.command.RepairUsingLatest(this.IncludePrerelease.ToBool(), this.AllUsers.ToBool(), this.Force.ToBool()); } else { diff --git a/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/ResetSourceCmdlet.cs b/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/ResetSourceCmdlet.cs index ccac067979..1dfdcee6ad 100644 --- a/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/ResetSourceCmdlet.cs +++ b/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/ResetSourceCmdlet.cs @@ -1,4 +1,4 @@ -// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- // // Copyright (c) Microsoft Corporation. Licensed under the MIT License. // @@ -13,25 +13,42 @@ namespace Microsoft.WinGet.Client.Cmdlets.Cmdlets /// /// Resets a source. Requires admin. /// - [Cmdlet(VerbsCommon.Reset, Constants.WinGetNouns.Source)] + [Cmdlet(VerbsCommon.Reset, Constants.WinGetNouns.Source, DefaultParameterSetName = Constants.DefaultSet)] + [Alias("rswgs")] public sealed class ResetSourceCmdlet : PSCmdlet { /// /// Gets or sets the name of the source to reset. /// [Parameter( + Position = 0, Mandatory = true, + ParameterSetName = Constants.DefaultSet, ValueFromPipeline = true, ValueFromPipelineByPropertyName = true)] public string Name { get; set; } + /// + /// Gets or sets a value indicating whether to reset all sources. + /// + [Parameter(ParameterSetName = Constants.OptionalSet, ValueFromPipelineByPropertyName = true)] + public SwitchParameter All { get; set; } + /// /// Resets source. /// protected override void ProcessRecord() { var command = new CliCommand(this); - command.ResetSource(this.Name); + + if (!string.IsNullOrEmpty(this.Name)) + { + command.ResetSourceByName(this.Name); + } + else if (this.All) + { + command.ResetAllSources(); + } } } } diff --git a/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/SetUserSettingsCmdlet.cs b/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/SetUserSettingCmdlet.cs similarity index 86% rename from src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/SetUserSettingsCmdlet.cs rename to src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/SetUserSettingCmdlet.cs index 0a3f8e9178..12a0764dff 100644 --- a/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/SetUserSettingsCmdlet.cs +++ b/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/SetUserSettingCmdlet.cs @@ -1,45 +1,46 @@ -// ----------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. Licensed under the MIT License. -// -// ----------------------------------------------------------------------------- - -namespace Microsoft.WinGet.Client.Commands -{ - using System.Collections; - using System.Management.Automation; - using Microsoft.WinGet.Client.Common; - using Microsoft.WinGet.Client.Engine.Commands; - - /// - /// Sets the specified user settings into the winget user settings. If the merge switch is on, merges current user - /// settings with the input settings. Otherwise, overwrites the input settings. - /// - [Cmdlet(VerbsCommon.Set, Constants.WinGetNouns.UserSettings)] - [OutputType(typeof(Hashtable))] - public sealed class SetUserSettingsCmdlet : PSCmdlet - { - /// - /// Gets or sets the input user settings. - /// - [Parameter( - Mandatory = true, - ValueFromPipelineByPropertyName = true)] - public Hashtable UserSettings { get; set; } - - /// - /// Gets or sets a value indicating whether to merge the current user settings and the input settings. - /// - [Parameter(ValueFromPipelineByPropertyName = true)] - public SwitchParameter Merge { get; set; } - - /// - /// Process input of cmdlet. - /// - protected override void ProcessRecord() - { - var command = new UserSettingsCommand(this); - command.Set(this.UserSettings, this.Merge.ToBool()); - } - } -} +// ----------------------------------------------------------------------------- +// +// Copyright (c) Microsoft Corporation. Licensed under the MIT License. +// +// ----------------------------------------------------------------------------- + +namespace Microsoft.WinGet.Client.Commands +{ + using System.Collections; + using System.Management.Automation; + using Microsoft.WinGet.Client.Common; + using Microsoft.WinGet.Client.Engine.Commands; + + /// + /// Sets the specified user settings into the winget user settings. If the merge switch is on, merges current user + /// settings with the input settings. Otherwise, overwrites the input settings. + /// + [Cmdlet(VerbsCommon.Set, Constants.WinGetNouns.UserSetting)] + [Alias("swgus", "Set-WinGetUserSettings")] + [OutputType(typeof(Hashtable))] + public sealed class SetUserSettingCmdlet : PSCmdlet + { + /// + /// Gets or sets the input user settings. + /// + [Parameter( + Mandatory = true, + ValueFromPipelineByPropertyName = true)] + public Hashtable UserSettings { get; set; } + + /// + /// Gets or sets a value indicating whether to merge the current user settings and the input settings. + /// + [Parameter(ValueFromPipelineByPropertyName = true)] + public SwitchParameter Merge { get; set; } + + /// + /// Process input of cmdlet. + /// + protected override void ProcessRecord() + { + var command = new UserSettingsCommand(this); + command.Set(this.UserSettings, this.Merge.ToBool()); + } + } +} diff --git a/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/TestUserSettingsCmdlet.cs b/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/TestUserSettingCmdlet.cs similarity index 88% rename from src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/TestUserSettingsCmdlet.cs rename to src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/TestUserSettingCmdlet.cs index d938ff9312..8a9bf4910f 100644 --- a/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/TestUserSettingsCmdlet.cs +++ b/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/TestUserSettingCmdlet.cs @@ -1,44 +1,45 @@ -// ----------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. Licensed under the MIT License. -// -// ----------------------------------------------------------------------------- - -namespace Microsoft.WinGet.Client.Commands -{ - using System.Collections; - using System.Management.Automation; - using Microsoft.WinGet.Client.Common; - using Microsoft.WinGet.Client.Engine.Commands; - - /// - /// Compare the specified user settings with the winget user settings. - /// - [Cmdlet(VerbsDiagnostic.Test, Constants.WinGetNouns.UserSettings)] - [OutputType(typeof(bool))] - public sealed class TestUserSettingsCmdlet : PSCmdlet - { - /// - /// Gets or sets the input user settings. - /// - [Parameter( - Mandatory = true, - ValueFromPipelineByPropertyName = true)] - public Hashtable UserSettings { get; set; } - - /// - /// Gets or sets a value indicating whether to ignore comparing settings that are not part of the input. - /// - [Parameter(ValueFromPipelineByPropertyName = true)] - public SwitchParameter IgnoreNotSet { get; set; } - - /// - /// Process the cmdlet and writes the result of the comparison. - /// - protected override void ProcessRecord() - { - var command = new UserSettingsCommand(this); - command.Test(this.UserSettings, this.IgnoreNotSet.ToBool()); - } - } -} +// ----------------------------------------------------------------------------- +// +// Copyright (c) Microsoft Corporation. Licensed under the MIT License. +// +// ----------------------------------------------------------------------------- + +namespace Microsoft.WinGet.Client.Commands +{ + using System.Collections; + using System.Management.Automation; + using Microsoft.WinGet.Client.Common; + using Microsoft.WinGet.Client.Engine.Commands; + + /// + /// Compare the specified user settings with the winget user settings. + /// + [Cmdlet(VerbsDiagnostic.Test, Constants.WinGetNouns.UserSetting)] + [Alias("twgus", "Test-WinGetUserSettings")] + [OutputType(typeof(bool))] + public sealed class TestUserSettingCmdlet : PSCmdlet + { + /// + /// Gets or sets the input user settings. + /// + [Parameter( + Mandatory = true, + ValueFromPipelineByPropertyName = true)] + public Hashtable UserSettings { get; set; } + + /// + /// Gets or sets a value indicating whether to ignore comparing settings that are not part of the input. + /// + [Parameter(ValueFromPipelineByPropertyName = true)] + public SwitchParameter IgnoreNotSet { get; set; } + + /// + /// Process the cmdlet and writes the result of the comparison. + /// + protected override void ProcessRecord() + { + var command = new UserSettingsCommand(this); + command.Test(this.UserSettings, this.IgnoreNotSet.ToBool()); + } + } +} diff --git a/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/UninstallPackageCmdlet.cs b/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/UninstallPackageCmdlet.cs index f2b93beecf..46518a7d2d 100644 --- a/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/UninstallPackageCmdlet.cs +++ b/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/UninstallPackageCmdlet.cs @@ -1,53 +1,54 @@ -// ----------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. Licensed under the MIT License. -// -// ----------------------------------------------------------------------------- - -namespace Microsoft.WinGet.Client.Commands -{ +// ----------------------------------------------------------------------------- +// +// Copyright (c) Microsoft Corporation. Licensed under the MIT License. +// +// ----------------------------------------------------------------------------- + +namespace Microsoft.WinGet.Client.Commands +{ using System.Management.Automation; - using Microsoft.WinGet.Client.Commands.Common; - using Microsoft.WinGet.Client.Common; - using Microsoft.WinGet.Client.Engine.Commands; + using Microsoft.WinGet.Client.Commands.Common; + using Microsoft.WinGet.Client.Common; + using Microsoft.WinGet.Client.Engine.Commands; using Microsoft.WinGet.Client.Engine.PSObjects; using Microsoft.WinGet.Client.PSObjects; - /// - /// Uninstalls a package from the local system. - /// - [Cmdlet( - VerbsLifecycle.Uninstall, - Constants.WinGetNouns.Package, - DefaultParameterSetName = Constants.FoundSet, - SupportsShouldProcess = true)] - [OutputType(typeof(PSUninstallResult))] - public sealed class UninstallPackageCmdlet : PackageCmdlet - { - private UninstallPackageCommand command = null; - - /// - /// Gets or sets the desired mode for the uninstallation process. - /// - [Parameter(ValueFromPipelineByPropertyName = true)] - public PSPackageUninstallMode Mode { get; set; } = PSPackageUninstallMode.Default; - - /// - /// Gets or sets a value indicating whether to continue upon non security related failures. - /// - [Parameter(ValueFromPipelineByPropertyName = true)] + /// + /// Uninstalls a package from the local system. + /// + [Cmdlet( + VerbsLifecycle.Uninstall, + Constants.WinGetNouns.Package, + DefaultParameterSetName = Constants.FoundSet, + SupportsShouldProcess = true)] + [Alias("uswgp")] + [OutputType(typeof(PSUninstallResult))] + public sealed class UninstallPackageCmdlet : PackageCmdlet + { + private UninstallPackageCommand command = null; + + /// + /// Gets or sets the desired mode for the uninstallation process. + /// + [Parameter(ValueFromPipelineByPropertyName = true)] + public PSPackageUninstallMode Mode { get; set; } = PSPackageUninstallMode.Default; + + /// + /// Gets or sets a value indicating whether to continue upon non security related failures. + /// + [Parameter(ValueFromPipelineByPropertyName = true)] public SwitchParameter Force { get; set; } - /// - /// Gets or sets the path to the logging file. - /// - [Parameter(ValueFromPipelineByPropertyName = true)] - public string Log { get; set; } - - /// - /// Uninstalls a package from the local system. - /// - protected override void ProcessRecord() + /// + /// Gets or sets the path to the logging file. + /// + [Parameter(ValueFromPipelineByPropertyName = true)] + public string Log { get; set; } + + /// + /// Uninstalls a package from the local system. + /// + protected override void ProcessRecord() { this.command = new UninstallPackageCommand( this, @@ -59,7 +60,7 @@ protected override void ProcessRecord() this.Moniker, this.Source, this.Query); - this.command.Uninstall(this.MatchOption.ToString(), this.Mode.ToString(), this.Force.ToBool()); + this.command.Uninstall(this.MatchOption.ToString(), this.Mode.ToString(), this.Force.ToBool()); } /// @@ -71,6 +72,6 @@ protected override void StopProcessing() { this.command.Cancel(); } - } - } -} + } + } +} diff --git a/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/UpdatePackageCmdlet.cs b/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/UpdatePackageCmdlet.cs index 2dcc785975..bdcf9832d3 100644 --- a/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/UpdatePackageCmdlet.cs +++ b/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Cmdlets/UpdatePackageCmdlet.cs @@ -1,38 +1,39 @@ -// ----------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. Licensed under the MIT License. -// -// ----------------------------------------------------------------------------- - -namespace Microsoft.WinGet.Client.Commands -{ +// ----------------------------------------------------------------------------- +// +// Copyright (c) Microsoft Corporation. Licensed under the MIT License. +// +// ----------------------------------------------------------------------------- + +namespace Microsoft.WinGet.Client.Commands +{ using System.Management.Automation; using Microsoft.WinGet.Client.Commands.Common; using Microsoft.WinGet.Client.Common; using Microsoft.WinGet.Client.Engine.Commands; using Microsoft.WinGet.Client.Engine.PSObjects; - /// - /// This commands updates a package from the pipeline or from the local system. - /// - [Cmdlet( - VerbsData.Update, - Constants.WinGetNouns.Package, - DefaultParameterSetName = Constants.FoundSet, - SupportsShouldProcess = true)] - [OutputType(typeof(PSInstallResult))] - public sealed class UpdatePackageCmdlet : InstallCmdlet - { - /// - /// Gets or sets a value indicating whether updating to an unknown version is allowed. - /// - [Parameter(ValueFromPipelineByPropertyName = true)] - public SwitchParameter IncludeUnknown { get; set; } - - /// - /// Updates a package from the pipeline or from the local system. - /// - protected override void ProcessRecord() + /// + /// This commands updates a package from the pipeline or from the local system. + /// + [Cmdlet( + VerbsData.Update, + Constants.WinGetNouns.Package, + DefaultParameterSetName = Constants.FoundSet, + SupportsShouldProcess = true)] + [Alias("udwgp")] + [OutputType(typeof(PSInstallResult))] + public sealed class UpdatePackageCmdlet : InstallCmdlet + { + /// + /// Gets or sets a value indicating whether updating to an unknown version is allowed. + /// + [Parameter(ValueFromPipelineByPropertyName = true)] + public SwitchParameter IncludeUnknown { get; set; } + + /// + /// Updates a package from the pipeline or from the local system. + /// + protected override void ProcessRecord() { var command = new InstallerPackageCommand( this, @@ -51,7 +52,7 @@ protected override void ProcessRecord() this.Source, this.Query, this.SkipDependencies); - command.Update(this.IncludeUnknown.ToBool(), this.MatchOption.ToString(), this.Scope.ToString(), this.Architecture.ToString(), this.Mode.ToString(), this.InstallerType.ToString()); - } - } -} + command.Update(this.IncludeUnknown.ToBool(), this.MatchOption.ToString(), this.Scope.ToString(), this.Architecture.ToString(), this.Mode.ToString(), this.InstallerType.ToString()); + } + } +} diff --git a/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Common/Constants.cs b/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Common/Constants.cs index 78b0d850fa..62847c6567 100644 --- a/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Common/Constants.cs +++ b/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Common/Constants.cs @@ -1,4 +1,4 @@ -// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- // // Copyright (c) Microsoft Corporation. Licensed under the MIT License. // @@ -30,7 +30,17 @@ internal static class Constants /// This parameter set indicates that a package was not provided via a parameter or the pipeline and it /// needs to be found by searching a package source. /// - public const string FoundSet = "FoundSet"; + public const string FoundSet = "FoundSet"; + + /// + /// This parameter set indicates the default parameters associated with a cmdlet. + /// + public const string DefaultSet = "DefaultSet"; + + /// + /// This parameter set indicates the optional parameters associated with a cmdlet. + /// + public const string OptionalSet = "OptionalSet"; /// /// Parameter set for an specific version parameter. @@ -65,22 +75,17 @@ public static class WinGetNouns /// /// The noun for any user settings cmdlet. /// - public const string UserSettings = "WinGetUserSettings"; + public const string UserSetting = "WinGetUserSetting"; /// /// The noun for winget version. /// public const string Version = "WinGetVersion"; - /// - /// The noun for enable/disable winget admin settings. + /// + /// The noun for enable/disable winget admin settings. /// public const string Setting = "WinGetSetting"; - - /// - /// The noun to get the winget settings. - /// - public const string Settings = "WinGetSettings"; } } } diff --git a/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Microsoft.WinGet.Client.Cmdlets.csproj b/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Microsoft.WinGet.Client.Cmdlets.csproj index 7ee7922d13..faea6e8f56 100644 --- a/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Microsoft.WinGet.Client.Cmdlets.csproj +++ b/src/PowerShell/Microsoft.WinGet.Client.Cmdlets/Microsoft.WinGet.Client.Cmdlets.csproj @@ -1,4 +1,4 @@ - + diff --git a/src/PowerShell/Microsoft.WinGet.Client.Engine/Commands/CliCommand.cs b/src/PowerShell/Microsoft.WinGet.Client.Engine/Commands/CliCommand.cs index 452e36b447..b089e14531 100644 --- a/src/PowerShell/Microsoft.WinGet.Client.Engine/Commands/CliCommand.cs +++ b/src/PowerShell/Microsoft.WinGet.Client.Engine/Commands/CliCommand.cs @@ -1,4 +1,4 @@ -// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- // // Copyright (c) Microsoft Corporation. Licensed under the MIT License. // @@ -33,7 +33,7 @@ public CliCommand(PSCmdlet psCmdlet) public void EnableSetting(string name) { Utilities.VerifyAdmin(); - _ = this.Run("settings", $"--enable {name}"); + _ = this.Run("settings", $"--enable \"{name}\""); } /// @@ -43,7 +43,7 @@ public void EnableSetting(string name) public void DisableSetting(string name) { Utilities.VerifyAdmin(); - _ = this.Run("settings", $"--disable {name}"); + _ = this.Run("settings", $"--disable \"{name}\""); } /// @@ -70,17 +70,29 @@ public void GetSettings(bool asPlainText) /// Name of source. /// Arg of source. /// Type of source. - public void AddSource(string name, string arg, string type) + /// Trust level of source. + /// Make source explicit. + public void AddSource(string name, string arg, string type, string trustLevel, bool isExplicit) { Utilities.VerifyAdmin(); - if (string.IsNullOrEmpty(type)) + string parameters = $"add --name \"{name}\" --arg \"{arg}\""; + + if (!string.IsNullOrEmpty(type)) { - _ = this.Run("source", $"add --name {name} --arg {arg}", 300000); + parameters += $" --type \"{type}\""; } - else + + if (!string.IsNullOrEmpty(trustLevel)) + { + parameters += $" --trust-level \"{trustLevel}\""; + } + + if (isExplicit) { - _ = this.Run("source", $"add --name {name} --arg {arg} --type {type}", 300000); + parameters += " --explicit"; } + + _ = this.Run("source", parameters, 300000); } /// @@ -90,17 +102,26 @@ public void AddSource(string name, string arg, string type) public void RemoveSource(string name) { Utilities.VerifyAdmin(); - _ = this.Run("source", $"remove --name {name}"); + _ = this.Run("source", $"remove --name \"{name}\""); } /// - /// Resets source. + /// Resets a source. /// /// Name of source. - public void ResetSource(string name) + public void ResetSourceByName(string name) + { + Utilities.VerifyAdmin(); + _ = this.Run("source", $"reset --name \"{name}\" --force"); + } + + /// + /// Resets all sources and adds the defaults. + /// + public void ResetAllSources() { Utilities.VerifyAdmin(); - _ = this.Run("source", $"reset --name {name} --force"); + _ = this.Run("source", $"reset --force"); } private WinGetCLICommandResult Run(string command, string parameters, int timeOut = 60000) diff --git a/src/PowerShell/Microsoft.WinGet.Client.Engine/Commands/UserSettingsCommand.cs b/src/PowerShell/Microsoft.WinGet.Client.Engine/Commands/UserSettingsCommand.cs index 0c82256120..64433e0b6c 100644 --- a/src/PowerShell/Microsoft.WinGet.Client.Engine/Commands/UserSettingsCommand.cs +++ b/src/PowerShell/Microsoft.WinGet.Client.Engine/Commands/UserSettingsCommand.cs @@ -51,7 +51,7 @@ public UserSettingsCommand(PSCmdlet psCmdlet) } /// - /// Get-WinGetUserSettings. + /// Get-WinGetUserSetting. /// public void Get() { @@ -59,7 +59,7 @@ public void Get() } /// - /// Test-WinGetUserSettings. + /// Test-WinGetUserSetting. /// /// Input user settings. /// Ignore comparing settings that are not part of the input. @@ -69,7 +69,7 @@ public void Test(Hashtable userSettings, bool ignoreNotSet) } /// - /// Set-WinGetUserSettings. + /// Set-WinGetUserSetting. /// /// Input user settings. /// Merge the current user settings and the input settings. diff --git a/src/PowerShell/Microsoft.WinGet.Client.Engine/Helpers/AppxModuleHelper.cs b/src/PowerShell/Microsoft.WinGet.Client.Engine/Helpers/AppxModuleHelper.cs index 0e78005df8..16fc9d5d9d 100644 --- a/src/PowerShell/Microsoft.WinGet.Client.Engine/Helpers/AppxModuleHelper.cs +++ b/src/PowerShell/Microsoft.WinGet.Client.Engine/Helpers/AppxModuleHelper.cs @@ -59,6 +59,7 @@ internal class AppxModuleHelper private const string AppInstallerName = "Microsoft.DesktopAppInstaller"; private const string AppxManifest = "AppxManifest.xml"; private const string PackageFullName = "PackageFullName"; + private const string Version = "Version"; // Assets private const string MsixBundleName = "Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle"; @@ -130,6 +131,26 @@ public AppxModuleHelper(PowerShellCmdlet pwshCmdlet) /// Release tag of GitHub release. public void RegisterAppInstaller(string releaseTag) { + if (string.IsNullOrEmpty(releaseTag)) + { + string? versionFromLocalPackage = this.GetAppInstallerPropertyValue(Version); + + if (versionFromLocalPackage == null) + { + throw new ArgumentNullException(Version); + } + + var packageVersion = new Version(versionFromLocalPackage); + if (packageVersion.Major == 1 && packageVersion.Minor > 15) + { + releaseTag = $"1.{packageVersion.Minor - 15}.{packageVersion.Build}"; + } + else + { + releaseTag = $"{packageVersion.Major}.{packageVersion.Minor}.{packageVersion.Build}"; + } + } + // Ensure that all dependencies are present when attempting to register. // If dependencies are missing, a provisioned package can appear to only need registration, // but will fail to register. `InstallDependenciesAsync` checks for the packages before @@ -319,10 +340,32 @@ private async Task InstallVCLibsDependenciesAsync() // See if the minimum (or greater) version is installed. // TODO: Pull the minimum version from the target package - // TODO: This does not check architecture of the package Version minimumVersion = new Version(VCLibsUWPDesktopVersion); - bool isInstalled = false; + // Construct the list of frameworks that we want present. + Dictionary vcLibsDependencies = new Dictionary(); + var arch = RuntimeInformation.OSArchitecture; + if (arch == Architecture.X64) + { + vcLibsDependencies.Add("x64", VCLibsUWPDesktopX64); + } + else if (arch == Architecture.X86) + { + vcLibsDependencies.Add("x86", VCLibsUWPDesktopX86); + } + else if (arch == Architecture.Arm64) + { + // Deployment please figure out for me. + vcLibsDependencies.Add("x64", VCLibsUWPDesktopX64); + vcLibsDependencies.Add("x86", VCLibsUWPDesktopX86); + vcLibsDependencies.Add("arm", VCLibsUWPDesktopArm); + vcLibsDependencies.Add("arm64", VCLibsUWPDesktopArm64); + } + else + { + throw new PSNotSupportedException(arch.ToString()); + } + if (result != null && result.Count > 0) { @@ -338,42 +381,35 @@ private async Task InstallVCLibsDependenciesAsync() if (packageVersion >= minimumVersion) { - this.pwshCmdlet.Write(StreamType.Verbose, $"VCLibs dependency satisfied by: {psobject?.PackageFullName ?? ""}"); - isInstalled = true; - break; + string? architectureString = psobject?.Architecture?.ToString(); + if (architectureString == null) + { + this.pwshCmdlet.Write(StreamType.Verbose, $"VCLibs dependency has no architecture value: {psobject?.PackageFullName ?? ""}"); + continue; + } + + architectureString = architectureString.ToLower(); + + if (vcLibsDependencies.ContainsKey(architectureString)) + { + this.pwshCmdlet.Write(StreamType.Verbose, $"VCLibs {architectureString} dependency satisfied by: {psobject?.PackageFullName ?? ""}"); + vcLibsDependencies.Remove(architectureString); + } + } + else + { + this.pwshCmdlet.Write(StreamType.Verbose, $"VCLibs is lower than minimum required version [{minimumVersion}]: {psobject?.PackageFullName ?? ""}"); } } } - if (!isInstalled) + if (vcLibsDependencies.Count != 0) { - this.pwshCmdlet.Write(StreamType.Verbose, "Couldn't find required VCLibs package"); - - var vcLibsDependencies = new List(); - var arch = RuntimeInformation.OSArchitecture; - if (arch == Architecture.X64) - { - vcLibsDependencies.Add(VCLibsUWPDesktopX64); - } - else if (arch == Architecture.X86) - { - vcLibsDependencies.Add(VCLibsUWPDesktopX86); - } - else if (arch == Architecture.Arm64) - { - // Deployment please figure out for me. - vcLibsDependencies.Add(VCLibsUWPDesktopX64); - vcLibsDependencies.Add(VCLibsUWPDesktopX86); - vcLibsDependencies.Add(VCLibsUWPDesktopArm); - vcLibsDependencies.Add(VCLibsUWPDesktopArm64); - } - else - { - throw new PSNotSupportedException(arch.ToString()); - } + this.pwshCmdlet.Write(StreamType.Verbose, "Couldn't find required VCLibs packages"); - foreach (var vclib in vcLibsDependencies) + foreach (var vclibPair in vcLibsDependencies) { + string vclib = vclibPair.Value; await this.AddAppxPackageAsUriAsync(vclib, vclib.Substring(vclib.LastIndexOf('/') + 1)); } } diff --git a/src/PowerShell/Microsoft.WinGet.Client.Engine/Helpers/GitHubClient.cs b/src/PowerShell/Microsoft.WinGet.Client.Engine/Helpers/GitHubClient.cs index a7cc18c1b6..be2eddd2ec 100644 --- a/src/PowerShell/Microsoft.WinGet.Client.Engine/Helpers/GitHubClient.cs +++ b/src/PowerShell/Microsoft.WinGet.Client.Engine/Helpers/GitHubClient.cs @@ -1,4 +1,4 @@ -// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- // // Copyright (c) Microsoft Corporation. Licensed under the MIT License. // @@ -43,24 +43,24 @@ public async Task GetReleaseAsync(string releaseTag) /// /// Gets the latest released and waits. /// - /// Include prerelease. + /// Include prerelease. /// Latest version. - public async Task GetLatestReleaseTagNameAsync(bool includePreRelease) + public async Task GetLatestReleaseTagNameAsync(bool includePrerelease) { - return (await this.GetLatestReleaseAsync(includePreRelease)).TagName; + return (await this.GetLatestReleaseAsync(includePrerelease)).TagName; } /// /// Gets the latest released version. /// - /// Include prerelease. + /// Include prerelease. /// Latest version. - public async Task GetLatestReleaseAsync(bool includePreRelease) + public async Task GetLatestReleaseAsync(bool includePrerelease) { Release release; // GetLatest doesn't respect prerelease or gives an option to get it. - if (includePreRelease) + if (includePrerelease) { // GetAll orders by newest and includes pre releases. release = (await this.gitHubClient.Repository.Release.GetAll(this.owner, this.repo))[0]; diff --git a/src/PowerShell/Microsoft.WinGet.Client.Engine/PSObjects/PSSourceResult.cs b/src/PowerShell/Microsoft.WinGet.Client.Engine/PSObjects/PSSourceResult.cs index cdaeda9f47..bdea04a132 100644 --- a/src/PowerShell/Microsoft.WinGet.Client.Engine/PSObjects/PSSourceResult.cs +++ b/src/PowerShell/Microsoft.WinGet.Client.Engine/PSObjects/PSSourceResult.cs @@ -1,4 +1,4 @@ -// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- // // Copyright (c) Microsoft Corporation. Licensed under the MIT License. // @@ -6,8 +6,6 @@ namespace Microsoft.WinGet.Client.Engine.PSObjects { - using System.Management.Automation; - /// /// SourceResult wrapper object for displaying to PowerShell. /// @@ -23,6 +21,8 @@ internal PSSourceResult(Management.Deployment.PackageCatalogReference catalogRef this.Name = info.Name; this.Argument = info.Argument; this.Type = info.Type; + this.TrustLevel = info.TrustLevel.ToString(); + this.Explicit = info.Explicit; } /// @@ -39,5 +39,15 @@ internal PSSourceResult(Management.Deployment.PackageCatalogReference catalogRef /// Gets the type of the source. /// public string Type { get; private set; } + + /// + /// Gets the trust level of the source. + /// + public string TrustLevel { get; private set; } + + /// + /// Gets a value indicating whether the source must be explicitly specified for discovery. + /// + public bool Explicit { get; private set; } } } diff --git a/src/PowerShell/Microsoft.WinGet.Client/ModuleFiles/Format.ps1xml b/src/PowerShell/Microsoft.WinGet.Client/ModuleFiles/Format.ps1xml index 0578d18083..24f140d6ac 100644 --- a/src/PowerShell/Microsoft.WinGet.Client/ModuleFiles/Format.ps1xml +++ b/src/PowerShell/Microsoft.WinGet.Client/ModuleFiles/Format.ps1xml @@ -283,6 +283,12 @@ + + + + + + @@ -296,6 +302,12 @@ $_.Type + + $_.TrustLevel + + + $_.Explicit + diff --git a/src/PowerShell/Microsoft.WinGet.Client/ModuleFiles/Microsoft.WinGet.Client.psd1 b/src/PowerShell/Microsoft.WinGet.Client/ModuleFiles/Microsoft.WinGet.Client.psd1 index ffa344d55d..8c87e7d88f 100644 --- a/src/PowerShell/Microsoft.WinGet.Client/ModuleFiles/Microsoft.WinGet.Client.psd1 +++ b/src/PowerShell/Microsoft.WinGet.Client/ModuleFiles/Microsoft.WinGet.Client.psd1 @@ -1,9 +1,7 @@ # # Module manifest for module 'Microsoft.WinGet.Client' # -# Generated by: Microsoft Corporation -# -# Generated on: 7/7/2022 +# Created by: Microsoft Corporation # @{ @@ -22,7 +20,7 @@ else ModuleVersion = '0.1.0' # Supported PSEditions -CompatiblePSEditions = 'Core' +CompatiblePSEditions = @('Desktop', 'Core') # ID used to uniquely identify this module GUID = 'e11157e2-cd24-4250-83b8-c6654ea4926a' @@ -84,14 +82,14 @@ CmdletsToExport = @( 'Install-WinGetPackage' 'Uninstall-WinGetPackage' 'Update-WinGetPackage' - 'Get-WinGetUserSettings' - 'Set-WinGetUserSettings' - 'Test-WinGetUserSettings' + 'Get-WinGetUserSetting' + 'Set-WinGetUserSetting' + 'Test-WinGetUserSetting' 'Assert-WinGetPackageManager' 'Repair-WinGetPackageManager' 'Enable-WinGetSetting' 'Disable-WinGetSetting' - 'Get-WinGetSettings' + 'Get-WinGetSetting' 'Add-WinGetSource' 'Remove-WinGetSource' 'Reset-WinGetSource' @@ -102,7 +100,29 @@ CmdletsToExport = @( # VariablesToExport = @() # Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export. -AliasesToExport = @() + AliasesToExport = @('awgs' + 'awgpm' + 'dwgs' + 'ewgs' + 'ewgp' + 'fdwgp' + 'gwgp' + 'gwgse' + 'gwgso' + 'gwgus' + 'gwgv' + 'iswgp' + 'rwgs' + 'rpwgpm' + 'rswgs' + 'swgus' + 'twgus' + 'uswgp' + 'udwgp', + 'Get-WinGetSettings' + 'Get-WinGetUserSettings' + 'Set-WinGetUserSettings' + 'Test-WinGetUserSettings') # DSC resources to export from this module # DscResourcesToExport = @() @@ -120,7 +140,6 @@ PrivateData = @{ # Tags applied to this module. These help with module discovery in online galleries. Tags = @( - 'CrescendoBuilt', 'PSEdition_Desktop', 'PSEdition_Core', 'Windows', @@ -135,7 +154,7 @@ PrivateData = @{ ProjectUri = 'https://github.com/microsoft/winget-cli' # A URL to an icon representing this module. - # IconUri = '' + IconUri = 'https://aka.ms/winget-icon' # ReleaseNotes of this module # ReleaseNotes = '' @@ -151,13 +170,6 @@ PrivateData = @{ } # End of PSData hashtable - - # CrescendoVersion - CrescendoVersion = '1.0.0' - - # CrescendoGenerated - CrescendoGenerated = '07/07/2022 00:00:00' - } # End of PrivateData hashtable # HelpInfo URI of this module diff --git a/src/PowerShell/Microsoft.WinGet.Client/README.md b/src/PowerShell/Microsoft.WinGet.Client/README.md index 538afd1814..00f3d4ece3 100644 --- a/src/PowerShell/Microsoft.WinGet.Client/README.md +++ b/src/PowerShell/Microsoft.WinGet.Client/README.md @@ -27,18 +27,18 @@ If the new cmdlet introduces a new dependency, please make sure to add it in the - Find-WinGetPackage - Get-WinGetPackage - Get-WinGetSource -- Get-WinGetUserSettings +- Get-WinGetUserSetting - Get-WinGetVersion - Install-WinGetPackage - Repair-WinGetPackageManager -- Set-WinGetUserSettings -- Test-WinGetUserSettings +- Set-WinGetUserSetting +- Test-WinGetUserSetting - Uninstall-WinGetPackage - Update-WinGetPackage - Add-WinGetSource - Disable-WinGetSetting - Enable-WinGetSetting -- Get-WinGetSettings +- Get-WinGetSetting - Remove-WinGetSource - Reset-WinGetSource diff --git a/src/PowerShell/Microsoft.WinGet.Configuration.Cmdlets/Cmdlets/CompleteWinGetConfigurationCmdlet.cs b/src/PowerShell/Microsoft.WinGet.Configuration.Cmdlets/Cmdlets/CompleteWinGetConfigurationCmdlet.cs index e647279413..2fdb31c849 100644 --- a/src/PowerShell/Microsoft.WinGet.Configuration.Cmdlets/Cmdlets/CompleteWinGetConfigurationCmdlet.cs +++ b/src/PowerShell/Microsoft.WinGet.Configuration.Cmdlets/Cmdlets/CompleteWinGetConfigurationCmdlet.cs @@ -16,6 +16,7 @@ namespace Microsoft.WinGet.Configuration.Cmdlets /// Waits for completion. /// [Cmdlet(VerbsLifecycle.Complete, "WinGetConfiguration")] + [Alias("cmpwgc")] public sealed class CompleteWinGetConfigurationCmdlet : PSCmdlet { private ConfigurationCommand runningCommand = null; diff --git a/src/PowerShell/Microsoft.WinGet.Configuration.Cmdlets/Cmdlets/ConfirmWinGetConfigurationCmdlet.cs b/src/PowerShell/Microsoft.WinGet.Configuration.Cmdlets/Cmdlets/ConfirmWinGetConfigurationCmdlet.cs index d7b5fb2147..72df06d19a 100644 --- a/src/PowerShell/Microsoft.WinGet.Configuration.Cmdlets/Cmdlets/ConfirmWinGetConfigurationCmdlet.cs +++ b/src/PowerShell/Microsoft.WinGet.Configuration.Cmdlets/Cmdlets/ConfirmWinGetConfigurationCmdlet.cs @@ -15,6 +15,7 @@ namespace Microsoft.WinGet.Configuration.Cmdlets /// Validates winget configuration. /// [Cmdlet(VerbsLifecycle.Confirm, "WinGetConfiguration")] + [Alias("cnwgc")] public class ConfirmWinGetConfigurationCmdlet : PSCmdlet { private ConfigurationCommand runningCommand = null; diff --git a/src/PowerShell/Microsoft.WinGet.Configuration.Cmdlets/Cmdlets/ConvertToWinGetConfigurationYamlCmdlet.cs b/src/PowerShell/Microsoft.WinGet.Configuration.Cmdlets/Cmdlets/ConvertToWinGetConfigurationYamlCmdlet.cs index fbe0d65804..615075190d 100644 --- a/src/PowerShell/Microsoft.WinGet.Configuration.Cmdlets/Cmdlets/ConvertToWinGetConfigurationYamlCmdlet.cs +++ b/src/PowerShell/Microsoft.WinGet.Configuration.Cmdlets/Cmdlets/ConvertToWinGetConfigurationYamlCmdlet.cs @@ -15,6 +15,7 @@ namespace Microsoft.WinGet.Configuration.Cmdlets /// Serializes a PSConfigurationSet to a YAML string. /// [Cmdlet(VerbsData.ConvertTo, "WinGetConfigurationYaml")] + [Alias("ctwgcy")] public sealed class ConvertToWinGetConfigurationYamlCmdlet : PSCmdlet { /// diff --git a/src/PowerShell/Microsoft.WinGet.Configuration.Cmdlets/Cmdlets/GetWinGetConfigurationCmdlet.cs b/src/PowerShell/Microsoft.WinGet.Configuration.Cmdlets/Cmdlets/GetWinGetConfigurationCmdlet.cs index 03cf4162a9..39f9a914a0 100644 --- a/src/PowerShell/Microsoft.WinGet.Configuration.Cmdlets/Cmdlets/GetWinGetConfigurationCmdlet.cs +++ b/src/PowerShell/Microsoft.WinGet.Configuration.Cmdlets/Cmdlets/GetWinGetConfigurationCmdlet.cs @@ -15,6 +15,7 @@ namespace Microsoft.WinGet.Configuration.Cmdlets /// Opens a configuration set. /// [Cmdlet(VerbsCommon.Get, "WinGetConfiguration", DefaultParameterSetName = Helpers.Constants.ParameterSet.OpenConfigurationSetFromFile)] + [Alias("gwgc")] public sealed class GetWinGetConfigurationCmdlet : OpenConfiguration { /// diff --git a/src/PowerShell/Microsoft.WinGet.Configuration.Cmdlets/Cmdlets/GetWinGetConfigurationDetailsCmdlet.cs b/src/PowerShell/Microsoft.WinGet.Configuration.Cmdlets/Cmdlets/GetWinGetConfigurationDetailsCmdlet.cs index ec4b94fe82..a567637210 100644 --- a/src/PowerShell/Microsoft.WinGet.Configuration.Cmdlets/Cmdlets/GetWinGetConfigurationDetailsCmdlet.cs +++ b/src/PowerShell/Microsoft.WinGet.Configuration.Cmdlets/Cmdlets/GetWinGetConfigurationDetailsCmdlet.cs @@ -16,6 +16,7 @@ namespace Microsoft.WinGet.Configuration.Cmdlets /// Gets the details for the units in a configuration set. /// [Cmdlet(VerbsCommon.Get, "WinGetConfigurationDetails")] + [Alias("gwgcd")] public sealed class GetWinGetConfigurationDetailsCmdlet : PSCmdlet { private ConfigurationCommand runningCommand = null; diff --git a/src/PowerShell/Microsoft.WinGet.Configuration.Cmdlets/Cmdlets/InvokeWinGetConfigurationCmdlet.cs b/src/PowerShell/Microsoft.WinGet.Configuration.Cmdlets/Cmdlets/InvokeWinGetConfigurationCmdlet.cs index b22f07eb4b..1db374fea2 100644 --- a/src/PowerShell/Microsoft.WinGet.Configuration.Cmdlets/Cmdlets/InvokeWinGetConfigurationCmdlet.cs +++ b/src/PowerShell/Microsoft.WinGet.Configuration.Cmdlets/Cmdlets/InvokeWinGetConfigurationCmdlet.cs @@ -17,6 +17,7 @@ namespace Microsoft.WinGet.Configuration.Cmdlets /// Wait for completion. /// [Cmdlet(VerbsLifecycle.Invoke, "WinGetConfiguration")] + [Alias("iwgc")] public sealed class InvokeWinGetConfigurationCmdlet : PSCmdlet { private bool acceptedAgreements = false; diff --git a/src/PowerShell/Microsoft.WinGet.Configuration.Cmdlets/Cmdlets/RemoveWinGetConfigurationHistoryCmdlet.cs b/src/PowerShell/Microsoft.WinGet.Configuration.Cmdlets/Cmdlets/RemoveWinGetConfigurationHistoryCmdlet.cs index 5d12307af0..7f69b91aaa 100644 --- a/src/PowerShell/Microsoft.WinGet.Configuration.Cmdlets/Cmdlets/RemoveWinGetConfigurationHistoryCmdlet.cs +++ b/src/PowerShell/Microsoft.WinGet.Configuration.Cmdlets/Cmdlets/RemoveWinGetConfigurationHistoryCmdlet.cs @@ -15,6 +15,7 @@ namespace Microsoft.WinGet.Configuration.Cmdlets /// Removes the given configuration set from history. /// [Cmdlet(VerbsCommon.Remove, "WinGetConfigurationHistory")] + [Alias("rwgch")] public sealed class RemoveWinGetConfigurationHistoryCmdlet : PSCmdlet { /// diff --git a/src/PowerShell/Microsoft.WinGet.Configuration.Cmdlets/Cmdlets/StartWinGetConfigurationCmdlet.cs b/src/PowerShell/Microsoft.WinGet.Configuration.Cmdlets/Cmdlets/StartWinGetConfigurationCmdlet.cs index 2e40575611..494cfc66d7 100644 --- a/src/PowerShell/Microsoft.WinGet.Configuration.Cmdlets/Cmdlets/StartWinGetConfigurationCmdlet.cs +++ b/src/PowerShell/Microsoft.WinGet.Configuration.Cmdlets/Cmdlets/StartWinGetConfigurationCmdlet.cs @@ -16,6 +16,7 @@ namespace Microsoft.WinGet.Configuration.Cmdlets /// Does not wait for completion. /// [Cmdlet(VerbsLifecycle.Start, "WinGetConfiguration")] + [Alias("sawgc")] public sealed class StartWinGetConfigurationCmdlet : PSCmdlet { private bool acceptedAgreements = false; diff --git a/src/PowerShell/Microsoft.WinGet.Configuration.Cmdlets/Cmdlets/StopWinGetConfigurationCmdlet.cs b/src/PowerShell/Microsoft.WinGet.Configuration.Cmdlets/Cmdlets/StopWinGetConfigurationCmdlet.cs index 5b59cc44f0..da367b4fa2 100644 --- a/src/PowerShell/Microsoft.WinGet.Configuration.Cmdlets/Cmdlets/StopWinGetConfigurationCmdlet.cs +++ b/src/PowerShell/Microsoft.WinGet.Configuration.Cmdlets/Cmdlets/StopWinGetConfigurationCmdlet.cs @@ -15,6 +15,7 @@ namespace Microsoft.WinGet.Configuration.Cmdlets /// Cancels a configuration previously started by Start-WinGetConfiguration. /// [Cmdlet(VerbsLifecycle.Stop, "WinGetConfiguration")] + [Alias("spwgc")] public sealed class StopWinGetConfigurationCmdlet : PSCmdlet { /// diff --git a/src/PowerShell/Microsoft.WinGet.Configuration.Cmdlets/Cmdlets/TestWinGetConfigurationCmdlet.cs b/src/PowerShell/Microsoft.WinGet.Configuration.Cmdlets/Cmdlets/TestWinGetConfigurationCmdlet.cs index 8aaab94f15..772c132320 100644 --- a/src/PowerShell/Microsoft.WinGet.Configuration.Cmdlets/Cmdlets/TestWinGetConfigurationCmdlet.cs +++ b/src/PowerShell/Microsoft.WinGet.Configuration.Cmdlets/Cmdlets/TestWinGetConfigurationCmdlet.cs @@ -15,6 +15,7 @@ namespace Microsoft.WinGet.Configuration.Cmdlets /// Tests configuration. /// [Cmdlet(VerbsDiagnostic.Test, "WinGetConfiguration")] + [Alias("twgc")] public class TestWinGetConfigurationCmdlet : PSCmdlet { private bool acceptedAgreements = false; diff --git a/src/PowerShell/Microsoft.WinGet.Configuration/ModuleFiles/Microsoft.WinGet.Configuration.psd1 b/src/PowerShell/Microsoft.WinGet.Configuration/ModuleFiles/Microsoft.WinGet.Configuration.psd1 index b05169f759..b652ad1df9 100644 --- a/src/PowerShell/Microsoft.WinGet.Configuration/ModuleFiles/Microsoft.WinGet.Configuration.psd1 +++ b/src/PowerShell/Microsoft.WinGet.Configuration/ModuleFiles/Microsoft.WinGet.Configuration.psd1 @@ -1,42 +1,40 @@ @{ + RootModule = "Microsoft.WinGet.Configuration.Cmdlets.dll" + ModuleVersion = '0.0.1' + CompatiblePSEditions = 'Core' + GUID = '79b6b07b-7be5-4673-9cd1-fcbe3d79ba82' + Author = 'Microsoft Corporation' + CompanyName = 'Microsoft Corporation' + Copyright = '(c) Microsoft Corporation. All rights reserved.' + Description = 'PowerShell Module for the Windows Package Manager Configuration.' + PowerShellVersion = '7.2.8' -RootModule = "Microsoft.WinGet.Configuration.Cmdlets.dll" -ModuleVersion = '0.0.1' -CompatiblePSEditions = 'Core' -GUID = '79b6b07b-7be5-4673-9cd1-fcbe3d79ba82' -Author = 'Microsoft Corporation' -CompanyName = 'Microsoft Corporation' -Copyright = '(c) Microsoft Corporation. All rights reserved.' -Description = 'PowerShell Module for the Windows Package Manager Configuration.' -PowerShellVersion = '7.2.8' + FunctionsToExport = @() + AliasesToExport = @('cmpwgc', 'cnwgc', 'ctwgcy', 'gwgc', 'gwgcd', 'iwgc', 'rwgch', 'sawgc', 'spwgc','twgc') -# FormatsToProcess = @() -FunctionsToExport = @() -AliasesToExport = @() + CmdletsToExport = @( + "Complete-WinGetConfiguration" + "Get-WinGetConfiguration" + "Get-WinGetConfigurationDetails" + "Invoke-WinGetConfiguration" + "Start-WinGetConfiguration" + "Test-WinGetConfiguration" + "Confirm-WinGetConfiguration" + "Stop-WinGetConfiguration" + "Remove-WinGetConfigurationHistory" + "ConvertTo-WinGetConfigurationYaml" + ) -CmdletsToExport = @( - "Complete-WinGetConfiguration" - "Get-WinGetConfiguration" - "Get-WinGetConfigurationDetails" - "Invoke-WinGetConfiguration" - "Start-WinGetConfiguration" - "Test-WinGetConfiguration" - "Confirm-WinGetConfiguration" - "Stop-WinGetConfiguration" - "Remove-WinGetConfigurationHistory" - "ConvertTo-WinGetConfigurationYaml" -) - -PrivateData = @{ - PSData = @{ - Tags = @( - 'WindowsPackageManager', - 'WinGet' - ) - ProjectUri = 'https://github.com/microsoft/winget-cli' - Prerelease = 'alpha' + PrivateData = @{ + PSData = @{ + Tags = @( + 'WindowsPackageManager', + 'WinGet' + ) + ProjectUri = 'https://github.com/microsoft/winget-cli' + IconUri = 'https://aka.ms/winget-icon' + Prerelease = 'alpha' + } } } -} - diff --git a/src/PowerShell/Microsoft.WinGet.DSC/Microsoft.WinGet.DSC.psd1 b/src/PowerShell/Microsoft.WinGet.DSC/Microsoft.WinGet.DSC.psd1 index bc09b66054..fcbe96f023 100644 --- a/src/PowerShell/Microsoft.WinGet.DSC/Microsoft.WinGet.DSC.psd1 +++ b/src/PowerShell/Microsoft.WinGet.DSC/Microsoft.WinGet.DSC.psd1 @@ -1,9 +1,7 @@ # # Module manifest for module 'Microsoft.WinGet.DSC' # -# Generated by: Microsoft Corporation -# -# Generated on: 11/1/2022 +# Created by: Microsoft Corporation # @{ @@ -84,7 +82,7 @@ DscResourcesToExport = @( 'WinGetUserSettings' 'WinGetAdminSettings' - 'WinGetSources' + 'WinGetSource' 'WinGetPackageManager' 'WinGetPackage' ) @@ -114,7 +112,7 @@ ProjectUri = 'https://github.com/microsoft/winget-cli' # A URL to an icon representing this module. - # IconUri = '' + IconUri = 'https://aka.ms/winget-icon' # ReleaseNotes of this module # ReleaseNotes = '' diff --git a/src/PowerShell/Microsoft.WinGet.DSC/Microsoft.WinGet.DSC.psm1 b/src/PowerShell/Microsoft.WinGet.DSC/Microsoft.WinGet.DSC.psm1 index 0a5d8ddebd..9873bfa4b8 100644 --- a/src/PowerShell/Microsoft.WinGet.DSC/Microsoft.WinGet.DSC.psm1 +++ b/src/PowerShell/Microsoft.WinGet.DSC/Microsoft.WinGet.DSC.psm1 @@ -3,21 +3,17 @@ using namespace System.Collections.Generic -try +# Check that we are running as an administrator +function Assert-IsAdministrator { - # Load all non-test .ps1 files in the script's directory. - Get-ChildItem -Path $PSScriptRoot\* -Filter *.ps1 -Exclude *.Tests.ps1 -Recurse | ForEach-Object { Import-Module $_.FullName } -} catch -{ - $e = $_.Exception - while ($e.InnerException) - { - $e = $e.InnerException - } + $windowsIdentity = [System.Security.Principal.WindowsIdentity]::GetCurrent() + $windowsPrincipal = New-Object -TypeName 'System.Security.Principal.WindowsPrincipal' -ArgumentList @( $windowsIdentity ) - if (-not [string]::IsNullOrWhiteSpace($e.Message)) + $adminRole = [System.Security.Principal.WindowsBuiltInRole]::Administrator + + if (-not $windowsPrincipal.IsInRole($adminRole)) { - Write-Host $e.Message -ForegroundColor Red -BackgroundColor Black + New-InvalidOperationException -Message "This resource must run as an Administrator." } } @@ -28,13 +24,13 @@ enum WinGetAction Full } -enum Ensure +enum WinGetEnsure { Absent Present } -enum MatchOption +enum WinGetMatchOption { Equals EqualsCaseInsensitive @@ -42,13 +38,20 @@ enum MatchOption ContainsCaseInsensitive } -enum InstallMode +enum WinGetInstallMode { Default Silent Interactive } +enum WinGetTrustLevel +{ + Undefined + None + Trusted +} + #endregion enums #region DscResources @@ -74,9 +77,7 @@ class WinGetUserSettings # Gets the current UserSettings by looking at the settings.json file for the current user. [WinGetUserSettings] Get() { - Assert-WinGetCommand "Get-WinGetUserSettings" - - $userSettings = Get-WinGetUserSettings + $userSettings = Get-WinGetUserSetting $result = @{ SID = '' Settings = $userSettings @@ -87,8 +88,6 @@ class WinGetUserSettings # Tests if desired properties match. [bool] Test() { - Assert-WinGetCommand "Test-WinGetUserSettings" - $hashArgs = @{ UserSettings = $this.Settings } @@ -98,14 +97,12 @@ class WinGetUserSettings $hashArgs.Add('IgnoreNotSet', $true) } - return Test-WinGetUserSettings @hashArgs + return Test-WinGetUserSetting @hashArgs } # Sets the desired properties. [void] Set() { - Assert-WinGetCommand "Set-WinGetUserSettings" - $hashArgs = @{ UserSettings = $this.Settings } @@ -115,7 +112,7 @@ class WinGetUserSettings $hashArgs.Add('Merge', $true) } - Set-WinGetUserSettings @hashArgs + Set-WinGetUserSetting @hashArgs } } @@ -134,8 +131,7 @@ class WinGetAdminSettings # Gets the administrator settings. [WinGetAdminSettings] Get() { - Assert-WinGetCommand "Get-WinGetSettings" - $settingsJson = Get-WinGetSettings + $settingsJson = Get-WinGetSetting # Get admin setting values. $result = @{ @@ -169,8 +165,6 @@ class WinGetAdminSettings [void] Set() { Assert-IsAdministrator - Assert-WinGetCommand "Enable-WinGetSetting" - Assert-WinGetCommand "Disable-WinGetSetting" # It might be better to implement an internal Test with one value, or # create a new instances with only one setting than calling Enable/Disable @@ -193,130 +187,168 @@ class WinGetAdminSettings } [DSCResource()] -class WinGetSources +class WinGetSource { - # We need a key. Do not set. - [DscProperty(Key)] - [string]$SID - - # An array of Hashtable with the key value properties that follows the source's group policy schema. + [DscProperty(Key, Mandatory)] + [ValidateNotNullOrWhiteSpace()] + [string]$Name + [DscProperty(Mandatory)] - [Hashtable[]]$Sources - + [string]$Argument + [DscProperty()] - [Ensure]$Ensure = [Ensure]::Present - + [string]$Type + [DscProperty()] - [bool]$Reset = $false + [WinGetTrustLevel]$TrustLevel = [WinGetTrustLevel]::Undefined + + [DscProperty()] + [nullable[bool]]$Explicit = $null [DscProperty()] - [WinGetAction]$Action = [WinGetAction]::Full + [WinGetEnsure]$Ensure = [WinGetEnsure]::Present - # Gets the current sources on winget. - [WinGetSources] Get() + [WinGetSource] Get() { - Assert-WinGetCommand "Get-WinGetSource" - $packageCatalogReferences = Get-WinGetSource - $wingetSources = [List[Hashtable]]::new() - foreach ($packageCatalogReference in $packageCatalogReferences) - { - $source = @{ - $packageCatalogReference.Name = @{ - Identifier = $packageCatalogReference.Id - Arg = $packageCatalogReference.Argument - Type = $packageCatalogReference.Type - } - } - $wingetSources.Add($source) + $currentSource = $null + + try { + $currentSource = Get-WinGetSource -Name $this.Name + } + catch { } - $result = @{ - SID = '' - Sources = $wingetSources + $result = [WinGetSource]::new() + + if ($currentSource) + { + $result.Ensure = [WinGetEnsure]::Present + $result.Name = $currentSource.Name + $result.Argument = $currentSource.Argument + $result.Type = $currentSource.Type + $result.TrustLevel = $currentSource.TrustLevel + $result.Explicit = $currentSource.Explicit } + else + { + $result.Ensure = [WinGetEnsure]::Absent + $result.Name = $this.Name + } + return $result } - # Tests if desired properties match. [bool] Test() { - $currentSources = $this.Get().Sources - $currentState = [Ensure]::Present + return $this.TestAgainstCurrent($this.Get()) + } + + [void] Set() + { + Assert-IsAdministrator - # If this is a full match and the counts are different return false. This only applies if we want to ensure the full source is present. - if (($this.Action -eq [WinGetAction]::Full) -and ($this.Sources.Count -ne $currentSources.Count) -and ($this.Ensure -eq [Ensure]::Present)) + $currentSource = $this.Get() + + $removeSource = $false + $resetSource = $false + $addSource = $false + + if ($this.Ensure -eq [WinGetEnsure]::Present) { - return $false + if ($currentSource.Ensure -eq [WinGetEnsure]::Present) + { + if (-not $this.TestAgainstCurrent($currentSource)) + { + $resetSource = $true + $addSource = $true + } + # else in desired state + } + else + { + $addSource = $true + } + } + else + { + if ($currentSource.Ensure -eq [WinGetEnsure]::Present) + { + $removeSource = $true + } + # else in desired state (Absent) } - foreach ($sourceName in $this.Sources.Keys) + if ($removeSource) { - #Check if the source name exists, if it doesn't, then return false. - $result = $currentSources.Keys | Where-Object { $_ -eq $sourceName } - if ($null -eq $result) + Remove-WinGetSource -Name $this.Name + } + # Only remove OR reset should be true, not both + elseif ($resetSource) + { + Reset-WinGetSource -Name $this.Name + } + + if ($addSource) + { + $hashArgs = @{ + Name = $this.Name + Argument = $this.Argument + } + + if (-not [string]::IsNullOrWhiteSpace($this.Type)) { - $currentState = [Ensure]::Absent + $hashArgs.Add("Type", $this.Type) } - # Type has a default value. - $source = $this.Sources.$($sourceName) - $sourceType = "Microsoft.PreIndexed.Package" # default source type - if ($source.ContainsKey("Type") -and (-not([string]::IsNullOrWhiteSpace($source.Type)))) + if ($this.TrustLevel -ne [WinGetTrustLevel]::Undefined) { - $sourceType = $source.Type + $hashArgs.Add("TrustLevel", $this.TrustLevel) } - $existingSource = $currentSources.$($sourceName) - if ($source.Arg -ne $existingSource.Arg -or $sourceType -ne $existingSource.Type) + if ($null -ne $this.Explicit) { - $currentState = [Ensure]::Absent + $hashArgs.Add("Explicit", $this.Explicit) } - } - return $currentState -eq $this.Ensure + Add-WinGetSource @hashArgs + } } - - # Sets the desired properties. - [void] Set() + + # Test $this against a value retrieved from Get + # We don't need to check Name because it is the Key for Get + [bool] hidden TestAgainstCurrent([WinGetSource]$currentSource) { - Assert-IsAdministrator - Assert-WinGetCommand "Add-WinGetSource" - Assert-WinGetCommand "Reset-WinGetSource" - Assert-WinGetCommand "Remove-WinGetSource" + if ($this.Ensure -eq [WinGetEnsure]::Absent -and + $currentSource.Ensure -eq [WinGetEnsure]::Absent) + { + return $true + } - if (-not $this.Test()) + if ($this.Ensure -ne $currentSource.Ensure -or + $this.Argument -ne $currentSource.Argument) { - foreach ($sourceName in $this.Sources.Keys) - { - $sourceType = "Microsoft.PreIndexed.Package" - $source = $this.Sources.$($sourceName) - - if ((-not $source.ContainsKey("Arg")) -or [string]::IsNullOrWhiteSpace($source.Arg)) - { - # TODO: Localize. - throw "Invalid source input. Arg is required." - } - - if ($source.ContainsKey("Type") -and (-not([string]::IsNullOrWhiteSpace($source.Type)))) - { - $sourceType = $source.Type - } - - if ($this.Ensure -eq [Ensure]::Present) - { - Add-WinGetSource -Name $sourceName -Argument $source.Arg -Type $sourceType - - if ($this.Reset) - { - Reset-WinGetSource -Name $sourceName - } - } - else - { - Remove-WinGetSource -Name $sourceName - } - } + return $false + } + + if (-not([string]::IsNullOrWhiteSpace($this.Type)) -and + $this.Type -ne $currentSource.Type) + { + return $false + } + + if ($this.TrustLevel -ne [WinGetTrustLevel]::Undefined -and + $this.TrustLevel -ne $currentSource.TrustLevel) + { + return $false } + + if ($null -ne $this.Explicit -and + $this.Explicit -ne $currentSource.Explicit) + { + return $false + } + + return $true } } @@ -353,9 +385,6 @@ class WinGetPackageManager # Tests winget is installed. [bool] Test() { - Assert-WinGetCommand "Assert-WinGetPackageManager" - Assert-WinGetCommand "Get-WinGetVersion" - try { $hashArgs = @{} @@ -366,7 +395,7 @@ class WinGetPackageManager } elseif ($this.UseLatestPreRelease) { $hashArgs.Add("Latest", $true) - $hashArgs.Add("IncludePreRelease", $true) + $hashArgs.Add("IncludePrerelease", $true) } elseif (-not [string]::IsNullOrWhiteSpace($this.Version)) { $hashArgs.Add("Version", $this.Version) @@ -385,8 +414,6 @@ class WinGetPackageManager # Repairs Winget. [void] Set() { - Assert-WinGetCommand "Repair-WinGetPackageManager" - if (-not $this.Test()) { $result = -1 @@ -398,7 +425,7 @@ class WinGetPackageManager } elseif ($this.UseLatestPreRelease) { $hashArgs.Add("Latest", $true) - $hashArgs.Add("IncludePreRelease", $true) + $hashArgs.Add("IncludePrerelease", $true) } elseif (-not [string]::IsNullOrWhiteSpace($this.Version)) { $hashArgs.Add("Version", $this.Version) @@ -419,119 +446,73 @@ class WinGetPackageManager class WinGetPackage { [DscProperty(Key, Mandatory)] + [ValidateNotNullOrWhiteSpace()] [string]$Id - [DscProperty()] - [string]$Version + [DscProperty(Key)] + [string]$Source [DscProperty()] - [string]$Source + [string]$Version [DscProperty()] - [Ensure]$Ensure = [Ensure]::Present + [WinGetEnsure]$Ensure = [WinGetEnsure]::Present [DscProperty()] - [MatchOption]$MatchOption = [MatchOption]::EqualsCaseInsensitive + [WinGetMatchOption]$MatchOption = [WinGetMatchOption]::EqualsCaseInsensitive [DscProperty()] [bool]$UseLatest = $false [DSCProperty()] - [InstallMode]$InstallMode = [InstallMode]::Silent - - [DscProperty(NotConfigurable)] - [string]$InstalledVersion - - [DscProperty(NotConfigurable)] - [bool]$IsInstalled = $false - - [DscProperty(NotConfigurable)] - [bool]$IsUpdateAvailable = $false + [WinGetInstallMode]$InstallMode = [WinGetInstallMode]::Silent [PSObject] hidden $CatalogPackage = $null - hidden Initialize() - { - # DSC only validates keys and mandatories in a Set call. - if ([string]::IsNullOrWhiteSpace($this.Id)) - { - # TODO: Localize. - throw "WinGetPackage: Id is required" - } - - if (($this.UseLatest -eq $true) -and (-not[string]::IsNullOrWhiteSpace($this.Version))) - { - # TODO: Localize. - throw "WinGetPackage: Version and UseLatest cannot be set at the same time" - } - - # This has to use MatchOption equals. Otherwise, it might find other package where the - # id starts with. - $this.CatalogPackage = Get-WinGetPackage -Id $this.Id -MatchOption $this.MatchOption - if ($null -ne $this.CatalogPackage) - { - $this.InstalledVersion = $this.CatalogPackage.InstalledVersion - $this.IsInstalled = $true - $this.IsUpdateAvailable = $this.CatalogPackage.IsUpdateAvailable - } - } - - # Get. [WinGetPackage] Get() { - Assert-WinGetCommand "Get-WinGetPackage" - $this.Initialize() - return $this - } + $result = [WinGetPackage]::new() - # Test. - [bool] Test() - { - $this.Initialize() - $ensureInstalled = $this.Ensure -eq [Ensure]::Present - - # Not installed, doesn't have to. - if (-not($this.IsInstalled -or $ensureInstalled)) - { - return $true + $hashArgs = @{ + Id = $this.Id + MatchOption = $this.MatchOption } - # Not install, need to ensure installed. - # Installed, need to ensure not installed. - if ($this.IsInstalled -ne $ensureInstalled) + if (-not([string]::IsNullOrWhiteSpace($this.Source))) { - return $false + $hashArgs.Add("Source", $this.Source) } - # At this point we know is installed. - # If asked for latests, but there are updates available. - if ($this.UseLatest -and - $this.CatalogPackage.IsUpdateAvailable) + $result.CatalogPackage = Get-WinGetPackage @hashArgs + if ($null -ne $result.CatalogPackage) { - return $false + $result.Ensure = [WinGetEnsure]::Present + $result.Id = $result.CatalogPackage.Id + $result.Source = $result.CatalogPackage.Source + $result.Version = $result.CatalogPackage.InstalledVersion + $result.UseLatest = -not $result.CatalogPackage.IsUpdateAvailable } - - # If there is an specific version, compare with the current installed version. - if (-not ([string]::IsNullOrWhiteSpace($this.Version))) + else { - $compareResult = $this.CatalogPackage.CompareToVersion($this.Version) - if ($compareResult -ne 'Equal') - { - return $false - } + $result.Ensure = [WinGetEnsure]::Absent + $result.Id = $this.Id + $result.MatchOption = $this.MatchOption + $result.Source = $this.Source } - # For now this is all. - return $true + return $result + } + + [bool] Test() + { + return $this.TestAgainstCurrent($this.Get()) } - # Set. [void] Set() { - Assert-WinGetCommand "Install-WinGetPackage" - Assert-WinGetCommand "Uninstall-WinGetPackage" + $currentPackage = $this.Get() - if (-not $this.Test()) + if (-not $this.TestAgainstCurrent($currentPackage)) { $hashArgs = @{ Id = $this.Id @@ -539,14 +520,14 @@ class WinGetPackage Mode = $this.InstallMode } - if ($this.Ensure -eq [Ensure]::Present) + if ($this.Ensure -eq [WinGetEnsure]::Present) { if (-not([string]::IsNullOrWhiteSpace($this.Source))) { $hashArgs.Add("Source", $this.Source) } - if ($this.IsInstalled) + if ($currentPackage.Ensure -eq [WinGetEnsure]::Present) { if ($this.UseLatest) { @@ -556,7 +537,7 @@ class WinGetPackage { $hashArgs.Add("Version", $this.Version) - $compareResult = $this.CatalogPackage.CompareToVersion($this.Version) + $compareResult = $currentPackage.CatalogPackage.CompareToVersion($this.Version) switch ($compareResult) { 'Lesser' @@ -590,6 +571,43 @@ class WinGetPackage } } } + + [bool] hidden TestAgainstCurrent([WinGetPackage]$currentPackage) + { + if ($this.Ensure -eq [WinGetEnsure]::Absent -and + $currentPackage.Ensure -eq [WinGetEnsure]::Absent) + { + return $true + } + + $this.CatalogPackage = $currentPackage.CatalogPackage + + if ($this.Ensure -ne $currentPackage.Ensure) + { + return $false + } + + # At this point we know is installed. + # If asked for latest, but there are updates available. + if ($this.UseLatest) + { + if (-not $currentPackage.UseLatest) + { + return $false + } + } + # If there is an specific version, compare with the current installed version. + elseif (-not ([string]::IsNullOrWhiteSpace($this.Version))) + { + $compareResult = $currentPackage.CatalogPackage.CompareToVersion($this.Version) + if ($compareResult -ne 'Equal') + { + return $false + } + } + + return $true + } hidden Install([Hashtable]$hashArgs) { diff --git a/src/PowerShell/Microsoft.WinGet.DSC/Private/HelperFunctions.ps1 b/src/PowerShell/Microsoft.WinGet.DSC/Private/HelperFunctions.ps1 deleted file mode 100644 index 0af9fabfc3..0000000000 --- a/src/PowerShell/Microsoft.WinGet.DSC/Private/HelperFunctions.ps1 +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. - -# Check that we are running as an administrator -function Assert-IsAdministrator -{ - $windowsIdentity = [System.Security.Principal.WindowsIdentity]::GetCurrent() - $windowsPrincipal = New-Object -TypeName 'System.Security.Principal.WindowsPrincipal' -ArgumentList @( $windowsIdentity ) - - $adminRole = [System.Security.Principal.WindowsBuiltInRole]::Administrator - - if (-not $windowsPrincipal.IsInRole($adminRole)) - { - New-InvalidOperationException -Message "This resource must run as an Administrator." - } -} - -# Verify the command is present in the Microsoft.WinGet.Client Module -function Assert-WinGetCommand([string]$cmdletName) -{ - $null = Get-Command -Module "Microsoft.WinGet.Client" -Name $cmdletName -ErrorAction Stop -} diff --git a/src/PowerShell/scripts/samples/WinGetPackageResourceSample.ps1 b/src/PowerShell/scripts/samples/WinGetPackageResourceSample.ps1 index 046871b9d5..1af5d0d439 100644 --- a/src/PowerShell/scripts/samples/WinGetPackageResourceSample.ps1 +++ b/src/PowerShell/scripts/samples/WinGetPackageResourceSample.ps1 @@ -26,11 +26,11 @@ $resource = @{ $testResult = Invoke-DscResource @resource -Method Test if ($testResult.InDesiredState) { - Write-Host "PowerToys is installed." + Write-Host "PowerToys is not installed." } else { - Write-Host "PowerToys is not installed." + Write-Host "PowerToys is installed." } # Default value of Ensure is present. diff --git a/src/PowerShell/scripts/samples/WinGetSourceSample.ps1 b/src/PowerShell/scripts/samples/WinGetSourceSample.ps1 new file mode 100644 index 0000000000..1ea136065c --- /dev/null +++ b/src/PowerShell/scripts/samples/WinGetSourceSample.ps1 @@ -0,0 +1,79 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +<# + .SYNOPSIS + Simple sample on how to use WinGetSourceResource DSC resource. + Requires PSDesiredStateConfiguration version 2.0.6 + + IMPORTANT: This deletes the main winget source and add it again. + Run as admin for set. +#> + +#Requires -Modules Microsoft.WinGet.Client, Microsoft.WinGet.DSC + +using module Microsoft.WinGet.DSC +using namespace System.Collections.Generic + +[CmdletBinding()] +param ( + [Parameter()] + [string] + $SourceName = "winget", + + [Parameter()] + [string] + $Argument = "https://cdn.winget.microsoft.com/cache", + + [Parameter()] + [string] + $Type = "" +) + +$resource = @{ + Name = 'WinGetSourceResource' + ModuleName = 'Microsoft.WinGet.DSC' + Property = @{ + Name = $SourceName + } +} + +$getResult = Invoke-DscResource @resource -Method Get +Write-Host "Current sources" +Format-List $getResult -Force + +$resource.Property = @{ + Argument = $Argument + Type = $Type +} + +# The default value comparison for test is Partial, so if you have the winget source this should succeed. +$testResult = Invoke-DscResource @resource -Method Test +if ($testResult.InDesiredState) +{ + Write-Host "winget source is present" +} +else +{ + Write-Host "winget source is not present" + return +} + +# Removing winget. Note this will fail if not run as admin. +$resource.Property = @{ + Ensure = [Ensure]::Absent +} + +Invoke-DscResource @resource -Method Set | Out-Null +Write-Host "winget source removed" + +# Test again +$testResult = Invoke-DscResource @resource -Method Test +if (-not $testResult.InDesiredState) +{ + Write-Host "winget source is still present." +} +else +{ + Write-Host "winget was removed." +} diff --git a/src/PowerShell/scripts/samples/WinGetSourcesSample.ps1 b/src/PowerShell/scripts/samples/WinGetSourcesSample.ps1 deleted file mode 100644 index 3148671266..0000000000 --- a/src/PowerShell/scripts/samples/WinGetSourcesSample.ps1 +++ /dev/null @@ -1,112 +0,0 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. - -<# - .SYNOPSIS - Simple sample on how to use WinGetSourcesResource DSC resource. - Requires PSDesiredStateConfiguration version 2.0.6 - - IMPORTANT: This deletes the main winget source and add it again. - Run as admin for set. -#> - -#Requires -Modules Microsoft.WinGet.Client, Microsoft.WinGet.DSC - -using module Microsoft.WinGet.DSC -using namespace System.Collections.Generic - -[CmdletBinding()] -param ( - [Parameter()] - [string] - $SourceName = "winget", - - [Parameter()] - [string] - $Argument = "https://cdn.winget.microsoft.com/cache", - - [Parameter()] - [string] - $Type = "" -) - -$resource = @{ - Name = 'WinGetSourcesResource' - ModuleName = 'Microsoft.WinGet.DSC' - Property = @{ - } -} - -$getResult = Invoke-DscResource @resource -Method Get -Write-Host "Current sources" - -foreach ($source in $getResult.Sources) -{ - Write-Host "Name '$($source.Name)' Arg '$($source.Arg)' Type '$($source.Type)'" -} - -$expectedSources = [List[Hashtable]]::new() -$expectedSources.Add(@{ - Name = "winget" - Arg = "https://cdn.winget.microsoft.com/cache" -}) - -$resource.Property = @{ - Sources = $expectedSources - Action = [WinGetAction]::Partial -} - -# The default value comparison for test is Partial, so if you have the winget source this should succeed. -$testResult = Invoke-DscResource @resource -Method Test -if ($testResult.InDesiredState) -{ - Write-Host "winget source is present" -} -else -{ - Write-Host "winget source is not present" - return -} - -# A full match will fail if there are more sources. -$resource.Property = @{ - Sources = $expectedSources - Action = [WinGetAction]::Full -} -$testResult = Invoke-DscResource @resource -Method Test -if (-not $testResult.InDesiredState) -{ - Write-Host "winget source is not the only source" -} -else -{ - Write-Host "winget source is the only source" -} - -# Breaking winget. Note this will fail if not run as admin. -$resource.Property = @{ - Sources = $expectedSources - Action = [WinGetAction]::Partial - Ensure = [Ensure]::Absent -} - -Invoke-DscResource @resource -Method Set | Out-Null -Write-Host "winget source removed" - -# Test again -$testResult = Invoke-DscResource @resource -Method Test -if (-not $testResult.InDesiredState) -{ - Write-Host "winget source is gone." - - # Add it again - $resource.Property.Command = [SourceCommand]::Add - Invoke-DscResource @resource -Method Set | Out-Null -} -else -{ - # TODO: debug. Basically when `winget source remove winget` happens if the - # commands prints the progress bar the source was not removed. I think that - # it was actually removed but readded updating the package. - Write-Host "winget was not removed." -} diff --git a/src/PowerShell/tests/Microsoft.WinGet.Client.Tests.ps1 b/src/PowerShell/tests/Microsoft.WinGet.Client.Tests.ps1 index 46f9603586..cc08e83906 100644 --- a/src/PowerShell/tests/Microsoft.WinGet.Client.Tests.ps1 +++ b/src/PowerShell/tests/Microsoft.WinGet.Client.Tests.ps1 @@ -42,10 +42,7 @@ BeforeAll { Get-WinGetSource -Name 'TestSource' } catch { - # TODO: Add-WinGetSource does not support setting trust level yet. - # Add-WinGetSource -Name 'TestSource' -Arg 'https://localhost:5001/TestKit/' - $sourceAddCommand = "${wingetExeName} source add TestSource https://localhost:5001/TestKit/ --trust-level trusted" - Invoke-Expression -Command $sourceAddCommand + Add-WinGetSource -Name 'TestSource' -Arg 'https://localhost:5001/TestKit/' -TrustLevel 'Trusted' } } @@ -136,10 +133,25 @@ Describe 'Get-WinGetVersion' { } } +Describe 'Reset-WinGetSource' { + BeforeAll { + AddTestSource + } + + # Requires admin + It 'Resets all sources' { + Reset-WinGetSource -All + } + + It 'Test source should be removed' { + { Get-WinGetSource -Name 'TestSource' } | Should -Throw + } +} + Describe 'Get|Add|Reset-WinGetSource' { BeforeAll { - AddTestSource + Add-WinGetSource -Name 'TestSource' -Arg 'https://localhost:5001/TestKit/' -TrustLevel 'Trusted' -Explicit } It 'Get Test source' { @@ -149,6 +161,8 @@ Describe 'Get|Add|Reset-WinGetSource' { $source.Name | Should -Be 'TestSource' $source.Argument | Should -Be 'https://localhost:5001/TestKit/' $source.Type | Should -Be 'Microsoft.PreIndexed.Package' + $source.TrustLevel | Should -Be 'Trusted' + $source.Explicit | Should -Be $true } It 'Get fake source' { @@ -427,13 +441,13 @@ Describe 'Export-WinGetPackage' { } } -Describe 'Get-WinGetUserSettings' { +Describe 'Get-WinGetUserSetting' { - It 'Get settings' { + It 'Get setting' { $ogSettings = @{ visual= @{ progressBar="rainbow"} ; experimentalFeatures= @{experimentalArg=$false ; experimentalCmd=$true}} SetWinGetSettingsHelper $ogSettings - $userSettings = Get-WinGetUserSettings + $userSettings = Get-WinGetUserSetting $userSettings | Should -Not -BeNullOrEmpty -ErrorAction Stop $userSettings.Count | Should -Be 2 $userSettings.visual.progressBar | Should -Be 'rainbow' @@ -443,31 +457,31 @@ Describe 'Get-WinGetUserSettings' { It 'Get settings. Bad json file' { Set-Content -Path $settingsFilePath -Value "Hi, im not a json. Thank you, Test." - { Get-WinGetUserSettings } | Should -Throw + { Get-WinGetUserSetting } | Should -Throw } } -Describe 'Test-WinGetUserSettings' { +Describe 'Test-WinGetUserSetting' { It 'Bad json file' { Set-Content -Path $settingsFilePath -Value "Hi, im not a json. Thank you, Test." $inputSettings = @{ visual= @{ progressBar="retro"} } - Test-WinGetUserSettings -UserSettings $inputSettings | Should -Be $false + Test-WinGetUserSetting -UserSettings $inputSettings | Should -Be $false } It 'Equal' { $ogSettings = @{ visual= @{ progressBar="retro"} ; experimentalFeatures= @{experimentalArg=$false ; experimentalCmd=$true}} SetWinGetSettingsHelper $ogSettings - Test-WinGetUserSettings -UserSettings $ogSettings | Should -Be $true + Test-WinGetUserSetting -UserSettings $ogSettings | Should -Be $true } It 'Equal. Ignore schema' { Set-Content -Path $settingsFilePath -Value '{ "$schema": "https://aka.ms/winget-settings.schema.json", "visual": { "progressBar": "retro" } }' $inputSettings = @{ visual= @{ progressBar="retro"} } - Test-WinGetUserSettings -UserSettings $inputSettings | Should -Be $true + Test-WinGetUserSetting -UserSettings $inputSettings | Should -Be $true } It 'Not Equal string' { @@ -475,7 +489,7 @@ Describe 'Test-WinGetUserSettings' { SetWinGetSettingsHelper $ogSettings $inputSettings = @{ visual= @{ progressBar="retro"} ; experimentalFeatures= @{experimentalArg=$false ; experimentalCmd=$true}} - Test-WinGetUserSettings -UserSettings $inputSettings | Should -Be $false + Test-WinGetUserSetting -UserSettings $inputSettings | Should -Be $false } It 'Not Equal bool' { @@ -483,7 +497,7 @@ Describe 'Test-WinGetUserSettings' { SetWinGetSettingsHelper $ogSettings $inputSettings = @{ visual= @{ progressBar="rainbow"} ; experimentalFeatures= @{experimentalArg=$false ; experimentalCmd=$true}} - Test-WinGetUserSettings -UserSettings $inputSettings | Should -Be $false + Test-WinGetUserSetting -UserSettings $inputSettings | Should -Be $false } It 'Not Equal. More settings' { @@ -491,7 +505,7 @@ Describe 'Test-WinGetUserSettings' { SetWinGetSettingsHelper $ogSettings $inputSettings = @{ visual= @{ progressBar="rainbow"} ; experimentalFeatures= @{experimentalArg=$false }} - Test-WinGetUserSettings -UserSettings $inputSettings | Should -Be $false + Test-WinGetUserSetting -UserSettings $inputSettings | Should -Be $false } It 'Not Equal. More settings input' { @@ -499,14 +513,14 @@ Describe 'Test-WinGetUserSettings' { SetWinGetSettingsHelper $ogSettings $inputSettings = @{ visual= @{ progressBar="rainbow"} ; experimentalFeatures= @{experimentalArg=$false ; experimentalCmd=$true}} - Test-WinGetUserSettings -UserSettings $inputSettings | Should -Be $false + Test-WinGetUserSetting -UserSettings $inputSettings | Should -Be $false } It 'Equal IgnoreNotSet' { $ogSettings = @{ visual= @{ progressBar="retro"} ; experimentalFeatures= @{experimentalArg=$false ; experimentalCmd=$true}} SetWinGetSettingsHelper $ogSettings - Test-WinGetUserSettings -UserSettings $ogSettings -IgnoreNotSet | Should -Be $true + Test-WinGetUserSetting -UserSettings $ogSettings -IgnoreNotSet | Should -Be $true } It 'Equal IgnoreNotSet. More settings' { @@ -514,7 +528,7 @@ Describe 'Test-WinGetUserSettings' { SetWinGetSettingsHelper $ogSettings $inputSettings = @{ visual= @{ progressBar="rainbow"} ; experimentalFeatures= @{experimentalArg=$false }} - Test-WinGetUserSettings -UserSettings $inputSettings -IgnoreNotSet | Should -Be $true + Test-WinGetUserSetting -UserSettings $inputSettings -IgnoreNotSet | Should -Be $true } It 'Not Equal IgnoreNotSet. More settings input' { @@ -522,7 +536,7 @@ Describe 'Test-WinGetUserSettings' { SetWinGetSettingsHelper $ogSettings $inputSettings = @{ visual= @{ progressBar="rainbow"} ; experimentalFeatures= @{experimentalArg=$false ; experimentalCmd=$true}} - Test-WinGetUserSettings -UserSettings $inputSettings -IgnoreNotSet | Should -Be $false + Test-WinGetUserSetting -UserSettings $inputSettings -IgnoreNotSet | Should -Be $false } It 'Not Equal bool IgnoreNotSet' { @@ -530,7 +544,7 @@ Describe 'Test-WinGetUserSettings' { SetWinGetSettingsHelper $ogSettings $inputSettings = @{ visual= @{ progressBar="rainbow"} ; experimentalFeatures= @{experimentalArg=$false ; experimentalCmd=$true}} - Test-WinGetUserSettings -UserSettings $inputSettings -IgnoreNotSet | Should -Be $false + Test-WinGetUserSetting -UserSettings $inputSettings -IgnoreNotSet | Should -Be $false } It 'Not Equal array IgnoreNotSet' { @@ -538,7 +552,7 @@ Describe 'Test-WinGetUserSettings' { SetWinGetSettingsHelper $ogSettings $inputSettings = @{ installBehavior= @{ preferences= @{ architectures = @("x86", "arm64")} }} - Test-WinGetUserSettings -UserSettings $inputSettings -IgnoreNotSet | Should -Be $false + Test-WinGetUserSetting -UserSettings $inputSettings -IgnoreNotSet | Should -Be $false } It 'Not Equal wrong type IgnoreNotSet' { @@ -546,22 +560,23 @@ Describe 'Test-WinGetUserSettings' { SetWinGetSettingsHelper $ogSettings $inputSettings = @{ visual= @{ progressBar="rainbow"} ; experimentalFeatures= @{experimentalArg=4 ; experimentalCmd=$true}} - Test-WinGetUserSettings -UserSettings $inputSettings -IgnoreNotSet | Should -Be $false + Test-WinGetUserSetting -UserSettings $inputSettings -IgnoreNotSet | Should -Be $false } + AfterAll { SetWinGetSettingsHelper @{ debugging= @{ enableSelfInitiatedMinidump=$true ; keepAllLogFiles=$true } } } } -Describe 'Set-WinGetUserSettings' { +Describe 'Set-WinGetUserSetting' { It 'Overwrites' { $ogSettings = @{ source= @{ autoUpdateIntervalInMinutes=3}} SetWinGetSettingsHelper $ogSettings $inputSettings = @{ visual= @{ progressBar="rainbow"} ; experimentalFeatures= @{experimentalArg=$true ; experimentalCmd=$false}} - $result = Set-WinGetUserSettings -UserSettings $inputSettings + $result = Set-WinGetUserSetting -UserSettings $inputSettings $result | Should -Not -BeNullOrEmpty -ErrorAction Stop $result.'$schema' | Should -Not -BeNullOrEmpty @@ -578,7 +593,7 @@ Describe 'Set-WinGetUserSettings' { SetWinGetSettingsHelper $ogSettings $inputSettings = @{ visual= @{ progressBar="rainbow"} ; experimentalFeatures= @{experimentalArg=$true ; experimentalCmd=$false}} - $result = Set-WinGetUserSettings -UserSettings $inputSettings -Merge + $result = Set-WinGetUserSetting -UserSettings $inputSettings -Merge $result | Should -Not -BeNullOrEmpty -ErrorAction Stop $result.'$schema' | Should -Not -BeNullOrEmpty @@ -595,7 +610,7 @@ Describe 'Set-WinGetUserSettings' { Set-Content -Path $settingsFilePath -Value '{ "$schema": "https://aka.ms/winget-settings.schema.json", "visual": { "progressBar": "retro" } }' $inputSettings = @{ visual= @{ progressBar="retro"} } - $result = Set-WinGetUserSettings -UserSettings $inputSettings + $result = Set-WinGetUserSetting -UserSettings $inputSettings $result | Should -Not -BeNullOrEmpty -ErrorAction Stop $result.'$schema' | Should -Not -BeNullOrEmpty @@ -606,7 +621,7 @@ Describe 'Set-WinGetUserSettings' { Set-Content -Path $settingsFilePath -Value "Hi, im not a json. Thank you, Test." $inputSettings = @{ visual= @{ progressBar="retro"} } - $result = Set-WinGetUserSettings -UserSettings $inputSettings + $result = Set-WinGetUserSetting -UserSettings $inputSettings $result | Should -Not -BeNullOrEmpty -ErrorAction Stop $result.'$schema' | Should -Not -BeNullOrEmpty @@ -617,7 +632,7 @@ Describe 'Set-WinGetUserSettings' { Set-Content -Path $settingsFilePath -Value "Hi, im not a json. Thank you, Test." $inputSettings = @{ visual= @{ progressBar="retro"} } - { Set-WinGetUserSettings -UserSettings $inputSettings -Merge } | Should -Throw + { Set-WinGetUserSetting -UserSettings $inputSettings -Merge } | Should -Throw } AfterAll { @@ -628,7 +643,7 @@ Describe 'Set-WinGetUserSettings' { Describe 'Get|Enable|Disable-WinGetSetting' { It 'Get-WinGetSetting' { - $settings = Get-WinGetSettings + $settings = Get-WinGetSetting $settings | Should -Not -BeNullOrEmpty -ErrorAction Stop $settings.'$schema' | Should -Not -BeNullOrEmpty $settings.adminSettings | Should -Not -BeNullOrEmpty @@ -637,21 +652,21 @@ Describe 'Get|Enable|Disable-WinGetSetting' { # This tests require admin It 'Enable|Disable' { - $settings = Get-WinGetSettings + $settings = Get-WinGetSetting $settings | Should -Not -BeNullOrEmpty -ErrorAction Stop $settings.adminSettings | Should -Not -BeNullOrEmpty $settings.adminSettings.LocalManifestFiles | Should -Be $false Enable-WinGetSetting -Name LocalManifestFiles - $afterEnable = Get-WinGetSettings + $afterEnable = Get-WinGetSetting $afterEnable | Should -Not -BeNullOrEmpty -ErrorAction Stop $afterEnable.adminSettings | Should -Not -BeNullOrEmpty $afterEnable.adminSettings.LocalManifestFiles | Should -Be $true Disable-WingetSetting -Name LocalManifestFiles - $afterDisable = Get-WinGetSettings + $afterDisable = Get-WinGetSetting $afterDisable | Should -Not -BeNullOrEmpty -ErrorAction Stop $afterDisable.adminSettings | Should -Not -BeNullOrEmpty $afterDisable.adminSettings.LocalManifestFiles | Should -Be $false diff --git a/src/PowerShell/tests/Microsoft.WinGet.Configuration.Tests.ps1 b/src/PowerShell/tests/Microsoft.WinGet.Configuration.Tests.ps1 index 49a25e0a9f..e58815af4f 100644 --- a/src/PowerShell/tests/Microsoft.WinGet.Configuration.Tests.ps1 +++ b/src/PowerShell/tests/Microsoft.WinGet.Configuration.Tests.ps1 @@ -351,7 +351,8 @@ Describe 'Invoke-WinGetConfiguration' { BeforeEach { DeleteConfigTxtFiles } - + +<# PS Gallery tests are unreliable. It 'From Gallery' { EnsureModuleState "XmlContentDsc" $false @@ -366,6 +367,7 @@ Describe 'Invoke-WinGetConfiguration' { $result.UnitResults[0].State | Should -Be "Completed" $result.UnitResults[0].ResultCode | Should -Be -1978285819 } +#> It 'From TestRepo' { EnsureModuleState $e2eTestModule $false @@ -530,7 +532,8 @@ Describe 'Start|Complete-WinGetConfiguration' { BeforeEach { DeleteConfigTxtFiles } - + +<# PS Gallery tests are unreliable. It 'From Gallery' { EnsureModuleState "XmlContentDsc" $false @@ -548,6 +551,7 @@ Describe 'Start|Complete-WinGetConfiguration' { $result.UnitResults[0].State | Should -Be "Completed" $result.UnitResults[0].ResultCode | Should -Be -1978285819 } +#> It 'From TestRepo' { $testFile = GetConfigTestDataFile "Configure_TestRepo.yml" diff --git a/src/PowerShell/tests/Microsoft.WinGet.DSC.Tests.ps1 b/src/PowerShell/tests/Microsoft.WinGet.DSC.Tests.ps1 index 9c78a64dfc..0dc01f6dd8 100644 --- a/src/PowerShell/tests/Microsoft.WinGet.DSC.Tests.ps1 +++ b/src/PowerShell/tests/Microsoft.WinGet.DSC.Tests.ps1 @@ -28,23 +28,11 @@ BeforeAll { return Invoke-DscResource -Name $Name -ModuleName Microsoft.WinGet.DSC -Method $Method -Property $Property } - - function AddTestSource { - try { - Get-WinGetSource -Name 'TestSource' - } - catch { - # TODO: Add-WinGetSource does not support setting trust level yet. - # Add-WinGetSource -Name 'TestSource' -Arg 'https://localhost:5001/TestKit/' - $sourceAddCommand = "wingetdev.exe source add TestSource https://localhost:5001/TestKit/ --trust-level trusted" - Invoke-Expression -Command $sourceAddCommand - } - } } Describe 'List available DSC resources'{ It 'Shows DSC Resources'{ - $expectedDSCResources = "WinGetAdminSettings", "WinGetPackage", "WinGetPackageManager", "WinGetSources", "WinGetUserSettings" + $expectedDSCResources = "WinGetAdminSettings", "WinGetPackage", "WinGetPackageManager", "WinGetSource", "WinGetUserSettings" $availableDSCResources = (Get-DscResource -Module Microsoft.WinGet.DSC).Name $availableDSCResources.length | Should -Be 5 $availableDSCResources | Where-Object {$expectedDSCResources -notcontains $_} | Should -BeNullOrEmpty -ErrorAction Stop @@ -54,7 +42,7 @@ Describe 'List available DSC resources'{ Describe 'WinGetAdminSettings' { BeforeAll { - $initialAdminSettings = (Get-WinGetSettings).adminSettings + $initialAdminSettings = (Get-WinGetSetting).adminSettings $adminSettingsHash = @{ BypassCertificatePinningForMicrosoftStore = !$initialAdminSettings.BypassCertificatePinningForMicrosoftStore; InstallerHashOverride = !$initialAdminSettings.InstallerHashOverride; @@ -100,7 +88,7 @@ Describe 'WinGetAdminSettings' { Describe 'WinGetUserSettings' { BeforeAll { # Delete existing user settings file. - $settingsFilePath = (Get-WinGetSettings).userSettingsFile + $settingsFilePath = (Get-WinGetSetting).userSettingsFile $backupSettingsFilePath = $settingsFilePath + ".backup" if (Test-Path -Path $settingsFilePath) @@ -140,58 +128,55 @@ Describe 'WinGetUserSettings' { } } -Describe 'WinGetSources' { +Describe 'WinGetSource' { BeforeAll { $testSourceName = 'TestSource' + $testSourceArg = 'https://localhost:5001/TestKit/' + $testSourceType = 'Microsoft.PreIndexed.Package' - $testSourceValue = @{ - Type = 'Microsoft.PreIndexed.Package' - Arg = 'https://localhost:5001/TestKit/' - } - - InvokeWinGetDSC -Name WinGetSources -Method Set -Property @{ Action = 'Partial'; Ensure = 'Absent'; Sources = @{ $testSourceName = $testSourceValue }} + InvokeWinGetDSC -Name WinGetSource -Method Set -Property @{ Ensure = 'Absent'; Name = $testSourceName } } It 'Get WinGet source' { - $result = InvokeWinGetDSC -Name WinGetSources -Method Get -Property @{ Sources = @{ $testSourceName = $testSourceValue }} - $result.Sources.Keys | Should -Not -Contain $testSourceName + $result = InvokeWinGetDSC -Name WinGetSource -Method Get -Property @{ Name = $testSourceName } + $result.Ensure | Should -Be 'Absent' } It 'Test WinGet source' { - $result = InvokeWinGetDSC -Name WinGetSources -Method Test -Property @{ Ensure='Present'; Sources = @{ $testSourceName = $testSourceValue }} + $result = InvokeWinGetDSC -Name WinGetSource -Method Test -Property @{ Ensure='Present'; Name = $testSourceName; Argument = $testSourceArg; Type = $testSourceType } $result.InDesiredState | Should -Be $false } It 'Set WinGet source' { - # InvokeWinGetDSC -Name WinGetSources -Method Set -Property @{ Ensure = 'Present'; Sources = @{ $testSourceName = $testSourceValue }} - # TODO: Replace with DSC once '--trust-level' is supported - AddTestSource + InvokeWinGetDSC -Name WinGetSource -Method Set -Property @{ Name = $testSourceName; Argument = $testSourceArg; Type = $testSourceType; TrustLevel = 'Trusted'; Explicit = $true } - $result = InvokeWinGetDSC -Name WinGetSources -Method Get -Property @{ Sources = @{ $testSourceName = $testSourceValue }} - $result.Sources.Keys | Should -Contain $testSourceName + $result = InvokeWinGetDSC -Name WinGetSource -Method Test -Property @{ Name = $testSourceName; Argument = $testSourceArg; Type = $testSourceType } + $result.InDesiredState | Should -Be $true - $testSource = $result.Sources.$($testSourceName) - $testSource.Type | Should -Be 'Microsoft.PreIndexed.Package' - $testSource.Arg | Should -Be 'https://localhost:5001/TestKit/' - $testSource.Identifier | Should -Be $null + $result = InvokeWinGetDSC -Name WinGetSource -Method Get -Property @{ Name = $testSourceName } + $result.Name | Should -Be $testSourceName + $result.Type | Should -Be $testSourceType + $result.Argument | Should -Be $testSourceArg + $result.TrustLevel | Should -Be 'Trusted' + $result.Explicit | Should -Be $true } } Describe 'WinGetPackage' { BeforeAll { + $testSourceName = 'TestSource' + $testSourceArg = 'https://localhost:5001/TestKit/' + $testSourceType = 'Microsoft.PreIndexed.Package' + $testPackageId = 'AppInstallerTest.TestExeInstaller' $testPackageVersion = '1.0.0.0' - # Add test source. - # InvokeWinGetDSC -Name WinGetSources -Method Set -Property @{ Action = 'Partial'; Ensure = 'Present'; Sources = @{ TestSource = @{ Arg = 'https://localhost:5001/TestKit/'; Type = 'Microsoft.PreIndexed.Package' }}} - - # TODO: Replace with DSC once '--trust-level' is supported. - AddTestSource + InvokeWinGetDSC -Name WinGetSource -Method Set -Property @{ Name = $testSourceName; Argument = $testSourceArg; Type = $testSourceType; TrustLevel = 'Trusted' } } It 'Get WinGetPackage' { $result = InvokeWinGetDSC -Name WinGetPackage -Method Get -Property @{ Id = $testPackageId; Version = $testPackageVersion } - $result.IsInstalled | Should -Be $false + $result.Ensure | Should -Be 'Absent' } It 'Test WinGetPackage' { @@ -204,9 +189,9 @@ Describe 'WinGetPackage' { # Verify package installed. $result = InvokeWinGetDSC -Name WinGetPackage -Method Get -Property @{ Id = $testPackageId; Version = $testPackageVersion } - $result.IsInstalled | Should -Be $true - $result.IsUpdateAvailable | Should -Be $true - $result.InstalledVersion | Should -Be 1.0.0.0 + $result.Ensure | Should -Be 'Present' + $result.UseLatest | Should -Be $false + $result.Version | Should -Be $testPackageVersion } It 'Update WinGetPackage' { @@ -217,9 +202,9 @@ Describe 'WinGetPackage' { # Verify package updated. $result = InvokeWinGetDSC -Name WinGetPackage -Method Get -Property @{ Id = $testPackageId; UseLatest = $true } - $result.IsInstalled | Should -Be $true - $result.IsUpdateAvailable | Should -Be $false - $result.InstalledVersion | Should -Not -Be 1.0.0.0 + $result.Ensure | Should -Be 'Present' + $result.UseLatest | Should -Be $true + $result.Version | Should -Not -Be $testPackageVersion } It 'Uninstall WinGetPackage' { @@ -232,7 +217,7 @@ Describe 'WinGetPackage' { # Verify package uninstalled. $result = InvokeWinGetDSC -Name WinGetPackage -Method Get -Property @{ Ensure = 'Absent'; Id = $testPackageId } - $result.IsInstalled | Should -Be $false + $result.Ensure | Should -Be 'Absent' } AfterAll { diff --git a/src/PureLib/pure/README_zlib.md b/src/PureLib/pure/README_zlib.md index 8ed05abf7c..417349bed8 100644 --- a/src/PureLib/pure/README_zlib.md +++ b/src/PureLib/pure/README_zlib.md @@ -2,8 +2,8 @@ Do not change code under the zlib directory; it contains madler/zlib source code. -It is created using git subtree command and points to this specific commit [04f42ceca40f73e2978b50e93806c2a18c1281fc]: +It is created using git subtree command and points to this specific commit [51b7f2abdade71cd9bb0e7a373ef2610ec6f9daf]: - git subtree add --prefix=src/PureLib/pure/zlib https://github.com/madler/zlib.git 04f42ceca40f73e2978b50e93806c2a18c1281fc --squash + git subtree add --prefix=src/PureLib/pure/zlib https://github.com/madler/zlib.git 51b7f2abdade71cd9bb0e7a373ef2610ec6f9daf --squash -PureLib already has existing project files that compiles as part of the WinGet solution. Since PureLib has a dependency on the zlib library, the git subtree command is needed to keep the zlib library updated. Current zlib version: [1.2.13] \ No newline at end of file +PureLib already has existing project files that compiles as part of the WinGet solution. Since PureLib has a dependency on the zlib library, the git subtree command is needed to keep the zlib library updated. Current zlib version: [1.3.1] \ No newline at end of file diff --git a/src/PureLib/pure/zlib/.github/workflows/cmake.yml b/src/PureLib/pure/zlib/.github/workflows/cmake.yml index 64aa12c6f0..d15fda860c 100644 --- a/src/PureLib/pure/zlib/.github/workflows/cmake.yml +++ b/src/PureLib/pure/zlib/.github/workflows/cmake.yml @@ -54,7 +54,7 @@ jobs: - name: macOS GCC os: macos-latest - compiler: gcc-9 + compiler: gcc-11 steps: - name: Checkout repository diff --git a/src/PureLib/pure/zlib/.github/workflows/configure.yml b/src/PureLib/pure/zlib/.github/workflows/configure.yml index 712c723444..e783921122 100644 --- a/src/PureLib/pure/zlib/.github/workflows/configure.yml +++ b/src/PureLib/pure/zlib/.github/workflows/configure.yml @@ -85,7 +85,7 @@ jobs: - name: macOS GCC os: macos-latest - compiler: gcc-9 + compiler: gcc-11 configure-args: --warn - name: macOS Clang diff --git a/src/PureLib/pure/zlib/.gitignore b/src/PureLib/pure/zlib/.gitignore index b1c7422fed..bd44d84afd 100644 --- a/src/PureLib/pure/zlib/.gitignore +++ b/src/PureLib/pure/zlib/.gitignore @@ -16,7 +16,7 @@ /example /example64 /examplesh -/libz.so* +**/libz.so* /minigzip /minigzip64 /minigzipsh @@ -24,3 +24,13 @@ /configure.log .DS_Store +.vs +*.user +*.nupkg +contrib/vstudio/vc143/x86 +contrib/vstudio/vc143/x64 +contrib/vstudio/vc143/arm +contrib/vstudio/vc143/arm64 +contrib/nuget/bin +contrib/nuget/obj +*.included diff --git a/src/PureLib/pure/zlib/CMakeLists.txt b/src/PureLib/pure/zlib/CMakeLists.txt index b412dc7feb..15ceebe787 100644 --- a/src/PureLib/pure/zlib/CMakeLists.txt +++ b/src/PureLib/pure/zlib/CMakeLists.txt @@ -1,9 +1,11 @@ -cmake_minimum_required(VERSION 2.4.4) +cmake_minimum_required(VERSION 2.4.4...3.15.0) set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS ON) project(zlib C) -set(VERSION "1.2.13") +set(VERSION "1.3.1") + +option(ZLIB_BUILD_EXAMPLES "Enable Zlib Examples" ON) set(INSTALL_BIN_DIR "${CMAKE_INSTALL_PREFIX}/bin" CACHE PATH "Installation directory for executables") set(INSTALL_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib" CACHE PATH "Installation directory for libraries") @@ -148,7 +150,9 @@ if(MINGW) endif(MINGW) add_library(zlib SHARED ${ZLIB_SRCS} ${ZLIB_DLL_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS}) +target_include_directories(zlib PUBLIC ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) add_library(zlibstatic STATIC ${ZLIB_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS}) +target_include_directories(zlibstatic PUBLIC ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) set_target_properties(zlib PROPERTIES DEFINE_SYMBOL ZLIB_DLL) set_target_properties(zlib PROPERTIES SOVERSION 1) @@ -166,7 +170,7 @@ endif() if(UNIX) # On unix-like platforms the library is almost always called libz set_target_properties(zlib zlibstatic PROPERTIES OUTPUT_NAME z) - if(NOT APPLE) + if(NOT APPLE AND NOT(CMAKE_SYSTEM_NAME STREQUAL AIX)) set_target_properties(zlib PROPERTIES LINK_FLAGS "-Wl,--version-script,\"${CMAKE_CURRENT_SOURCE_DIR}/zlib.map\"") endif() elseif(BUILD_SHARED_LIBS AND WIN32) @@ -193,21 +197,22 @@ endif() #============================================================================ # Example binaries #============================================================================ - -add_executable(example test/example.c) -target_link_libraries(example zlib) -add_test(example example) - -add_executable(minigzip test/minigzip.c) -target_link_libraries(minigzip zlib) - -if(HAVE_OFF64_T) - add_executable(example64 test/example.c) - target_link_libraries(example64 zlib) - set_target_properties(example64 PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64") - add_test(example64 example64) - - add_executable(minigzip64 test/minigzip.c) - target_link_libraries(minigzip64 zlib) - set_target_properties(minigzip64 PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64") +if(ZLIB_BUILD_EXAMPLES) + add_executable(example test/example.c) + target_link_libraries(example zlib) + add_test(example example) + + add_executable(minigzip test/minigzip.c) + target_link_libraries(minigzip zlib) + + if(HAVE_OFF64_T) + add_executable(example64 test/example.c) + target_link_libraries(example64 zlib) + set_target_properties(example64 PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64") + add_test(example64 example64) + + add_executable(minigzip64 test/minigzip.c) + target_link_libraries(minigzip64 zlib) + set_target_properties(minigzip64 PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64") + endif() endif() diff --git a/src/PureLib/pure/zlib/ChangeLog b/src/PureLib/pure/zlib/ChangeLog index 457526bc6a..b801a1031e 100644 --- a/src/PureLib/pure/zlib/ChangeLog +++ b/src/PureLib/pure/zlib/ChangeLog @@ -1,6 +1,34 @@ ChangeLog file for zlib +Changes in 1.3.1 (22 Jan 2024) +- Reject overflows of zip header fields in minizip +- Fix bug in inflateSync() for data held in bit buffer +- Add LIT_MEM define to use more memory for a small deflate speedup +- Fix decision on the emission of Zip64 end records in minizip +- Add bounds checking to ERR_MSG() macro, used by zError() +- Neutralize zip file traversal attacks in miniunz +- Fix a bug in ZLIB_DEBUG compiles in check_match() +- Various portability and appearance improvements + +Changes in 1.3 (18 Aug 2023) +- Remove K&R function definitions and zlib2ansi +- Fix bug in deflateBound() for level 0 and memLevel 9 +- Fix bug when gzungetc() is used immediately after gzopen() +- Fix bug when using gzflush() with a very small buffer +- Fix crash when gzsetparams() attempted for transparent write +- Fix test/example.c to work with FORCE_STORED +- Rewrite of zran in examples (see zran.c version history) +- Fix minizip to allow it to open an empty zip file +- Fix reading disk number start on zip64 files in minizip +- Fix logic error in minizip argument processing +- Add minizip testing to Makefile +- Read multiple bytes instead of byte-by-byte in minizip unzip.c +- Add memory sanitizer to configure (--memory) +- Various portability improvements +- Various documentation improvements +- Various spelling and typo corrections + Changes in 1.2.13 (13 Oct 2022) - Fix configure issue that discarded provided CC definition - Correct incorrect inputs provided to the CRC functions @@ -1445,7 +1473,7 @@ Changes in 0.99 (27 Jan 96) - fix typo in Make_vms.com (f$trnlnm -> f$getsyi) - in fcalloc, normalize pointer if size > 65520 bytes - don't use special fcalloc for 32 bit Borland C++ -- use STDC instead of __GO32__ to avoid redeclaring exit, calloc, etc... +- use STDC instead of __GO32__ to avoid redeclaring exit, calloc, etc. - use Z_BINARY instead of BINARY - document that gzclose after gzdopen will close the file - allow "a" as mode in gzopen diff --git a/src/PureLib/pure/zlib/FAQ b/src/PureLib/pure/zlib/FAQ index 99b7cf92e4..92f5d3e29f 100644 --- a/src/PureLib/pure/zlib/FAQ +++ b/src/PureLib/pure/zlib/FAQ @@ -4,7 +4,7 @@ If your question is not there, please check the zlib home page http://zlib.net/ which may have more recent information. -The lastest zlib FAQ is at http://zlib.net/zlib_faq.html +The latest zlib FAQ is at http://zlib.net/zlib_faq.html 1. Is zlib Y2K-compliant? @@ -14,8 +14,7 @@ The lastest zlib FAQ is at http://zlib.net/zlib_faq.html 2. Where can I get a Windows DLL version? The zlib sources can be compiled without change to produce a DLL. See the - file win32/DLL_FAQ.txt in the zlib distribution. Pointers to the - precompiled DLL are found in the zlib web site at http://zlib.net/ . + file win32/DLL_FAQ.txt in the zlib distribution. 3. Where can I get a Visual Basic interface to zlib? diff --git a/src/PureLib/pure/zlib/Makefile.in b/src/PureLib/pure/zlib/Makefile.in index 7d2713f4c5..cb8b00a9b0 100644 --- a/src/PureLib/pure/zlib/Makefile.in +++ b/src/PureLib/pure/zlib/Makefile.in @@ -1,5 +1,5 @@ # Makefile for zlib -# Copyright (C) 1995-2017 Jean-loup Gailly, Mark Adler +# Copyright (C) 1995-2024 Jean-loup Gailly, Mark Adler # For conditions of distribution and use, see copyright notice in zlib.h # To compile and test, type: @@ -22,13 +22,13 @@ CFLAGS=-O SFLAGS=-O LDFLAGS= -TEST_LDFLAGS=$(LDFLAGS) -L. libz.a +TEST_LIBS=-L. libz.a LDSHARED=$(CC) CPP=$(CC) -E STATICLIB=libz.a SHAREDLIB=libz.so -SHAREDLIBV=libz.so.1.2.13 +SHAREDLIBV=libz.so.1.3.1 SHAREDLIBM=libz.so.1 LIBS=$(STATICLIB) $(SHAREDLIBV) @@ -282,10 +282,10 @@ placebo $(SHAREDLIBV): $(PIC_OBJS) libz.a -@rmdir objs example$(EXE): example.o $(STATICLIB) - $(CC) $(CFLAGS) -o $@ example.o $(TEST_LDFLAGS) + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ example.o $(TEST_LIBS) minigzip$(EXE): minigzip.o $(STATICLIB) - $(CC) $(CFLAGS) -o $@ minigzip.o $(TEST_LDFLAGS) + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ minigzip.o $(TEST_LIBS) examplesh$(EXE): example.o $(SHAREDLIBV) $(CC) $(CFLAGS) -o $@ example.o $(LDFLAGS) -L. $(SHAREDLIBV) @@ -294,10 +294,10 @@ minigzipsh$(EXE): minigzip.o $(SHAREDLIBV) $(CC) $(CFLAGS) -o $@ minigzip.o $(LDFLAGS) -L. $(SHAREDLIBV) example64$(EXE): example64.o $(STATICLIB) - $(CC) $(CFLAGS) -o $@ example64.o $(TEST_LDFLAGS) + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ example64.o $(TEST_LIBS) minigzip64$(EXE): minigzip64.o $(STATICLIB) - $(CC) $(CFLAGS) -o $@ minigzip64.o $(TEST_LDFLAGS) + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ minigzip64.o $(TEST_LIBS) install-libs: $(LIBS) -@if [ ! -d $(DESTDIR)$(exec_prefix) ]; then mkdir -p $(DESTDIR)$(exec_prefix); fi @@ -359,8 +359,14 @@ zconf.h.cmakein: $(SRCDIR)zconf.h.in zconf: $(SRCDIR)zconf.h.in cp -p $(SRCDIR)zconf.h.in zconf.h +minizip-test: static + cd contrib/minizip && { CC="$(CC)" CFLAGS="$(CFLAGS)" $(MAKE) test ; cd ../.. ; } + +minizip-clean: + cd contrib/minizip && { $(MAKE) clean ; cd ../.. ; } + mostlyclean: clean -clean: +clean: minizip-clean rm -f *.o *.lo *~ \ example$(EXE) minigzip$(EXE) examplesh$(EXE) minigzipsh$(EXE) \ example64$(EXE) minigzip64$(EXE) \ diff --git a/src/PureLib/pure/zlib/README b/src/PureLib/pure/zlib/README index ba34d1894a..c5f917540b 100644 --- a/src/PureLib/pure/zlib/README +++ b/src/PureLib/pure/zlib/README @@ -1,6 +1,6 @@ ZLIB DATA COMPRESSION LIBRARY -zlib 1.2.13 is a general purpose data compression library. All the code is +zlib 1.3.1 is a general purpose data compression library. All the code is thread safe. The data format used by the zlib library is described by RFCs (Request for Comments) 1950 to 1952 in the files http://tools.ietf.org/html/rfc1950 (zlib format), rfc1951 (deflate format) and @@ -29,18 +29,17 @@ PLEASE read the zlib FAQ http://zlib.net/zlib_faq.html before asking for help. Mark Nelson wrote an article about zlib for the Jan. 1997 issue of Dr. Dobb's Journal; a copy of the article is available at -http://marknelson.us/1997/01/01/zlib-engine/ . +https://marknelson.us/posts/1997/01/01/zlib-engine.html . -The changes made in version 1.2.13 are documented in the file ChangeLog. +The changes made in version 1.3.1 are documented in the file ChangeLog. Unsupported third party contributions are provided in directory contrib/ . -zlib is available in Java using the java.util.zip package, documented at -http://java.sun.com/developer/technicalArticles/Programming/compression/ . +zlib is available in Java using the java.util.zip package. Follow the API +Documentation link at: https://docs.oracle.com/search/?q=java.util.zip . -A Perl interface to zlib written by Paul Marquess is available -at CPAN (Comprehensive Perl Archive Network) sites, including -http://search.cpan.org/~pmqs/IO-Compress-Zlib/ . +A Perl interface to zlib and bzip2 written by Paul Marquess +can be found at https://github.com/pmqs/IO-Compress . A Python interface to zlib written by A.M. Kuchling is available in Python 1.5 and later versions, see @@ -64,7 +63,7 @@ Notes for some targets: - zlib doesn't work with gcc 2.6.3 on a DEC 3000/300LX under OSF/1 2.1 it works when compiled with cc. -- On Digital Unix 4.0D (formely OSF/1) on AlphaServer, the cc option -std1 is +- On Digital Unix 4.0D (formerly OSF/1) on AlphaServer, the cc option -std1 is necessary to get gzprintf working correctly. This is done by configure. - zlib doesn't work on HP-UX 9.05 with some versions of /bin/cc. It works with @@ -84,7 +83,7 @@ Acknowledgments: Copyright notice: - (C) 1995-2022 Jean-loup Gailly and Mark Adler + (C) 1995-2024 Jean-loup Gailly and Mark Adler This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/PureLib/pure/zlib/adler32.c b/src/PureLib/pure/zlib/adler32.c index d0be4380a3..04b81d29ba 100644 --- a/src/PureLib/pure/zlib/adler32.c +++ b/src/PureLib/pure/zlib/adler32.c @@ -7,8 +7,6 @@ #include "zutil.h" -local uLong adler32_combine_ OF((uLong adler1, uLong adler2, z_off64_t len2)); - #define BASE 65521U /* largest prime smaller than 65536 */ #define NMAX 5552 /* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */ @@ -60,11 +58,7 @@ local uLong adler32_combine_ OF((uLong adler1, uLong adler2, z_off64_t len2)); #endif /* ========================================================================= */ -uLong ZEXPORT adler32_z(adler, buf, len) - uLong adler; - const Bytef *buf; - z_size_t len; -{ +uLong ZEXPORT adler32_z(uLong adler, const Bytef *buf, z_size_t len) { unsigned long sum2; unsigned n; @@ -131,20 +125,12 @@ uLong ZEXPORT adler32_z(adler, buf, len) } /* ========================================================================= */ -uLong ZEXPORT adler32(adler, buf, len) - uLong adler; - const Bytef *buf; - uInt len; -{ +uLong ZEXPORT adler32(uLong adler, const Bytef *buf, uInt len) { return adler32_z(adler, buf, len); } /* ========================================================================= */ -local uLong adler32_combine_(adler1, adler2, len2) - uLong adler1; - uLong adler2; - z_off64_t len2; -{ +local uLong adler32_combine_(uLong adler1, uLong adler2, z_off64_t len2) { unsigned long sum1; unsigned long sum2; unsigned rem; @@ -169,18 +155,10 @@ local uLong adler32_combine_(adler1, adler2, len2) } /* ========================================================================= */ -uLong ZEXPORT adler32_combine(adler1, adler2, len2) - uLong adler1; - uLong adler2; - z_off_t len2; -{ +uLong ZEXPORT adler32_combine(uLong adler1, uLong adler2, z_off_t len2) { return adler32_combine_(adler1, adler2, len2); } -uLong ZEXPORT adler32_combine64(adler1, adler2, len2) - uLong adler1; - uLong adler2; - z_off64_t len2; -{ +uLong ZEXPORT adler32_combine64(uLong adler1, uLong adler2, z_off64_t len2) { return adler32_combine_(adler1, adler2, len2); } diff --git a/src/PureLib/pure/zlib/compress.c b/src/PureLib/pure/zlib/compress.c index 2ad5326c14..f43bacf7ab 100644 --- a/src/PureLib/pure/zlib/compress.c +++ b/src/PureLib/pure/zlib/compress.c @@ -19,13 +19,8 @@ memory, Z_BUF_ERROR if there was not enough room in the output buffer, Z_STREAM_ERROR if the level parameter is invalid. */ -int ZEXPORT compress2(dest, destLen, source, sourceLen, level) - Bytef *dest; - uLongf *destLen; - const Bytef *source; - uLong sourceLen; - int level; -{ +int ZEXPORT compress2(Bytef *dest, uLongf *destLen, const Bytef *source, + uLong sourceLen, int level) { z_stream stream; int err; const uInt max = (uInt)-1; @@ -65,12 +60,8 @@ int ZEXPORT compress2(dest, destLen, source, sourceLen, level) /* =========================================================================== */ -int ZEXPORT compress(dest, destLen, source, sourceLen) - Bytef *dest; - uLongf *destLen; - const Bytef *source; - uLong sourceLen; -{ +int ZEXPORT compress(Bytef *dest, uLongf *destLen, const Bytef *source, + uLong sourceLen) { return compress2(dest, destLen, source, sourceLen, Z_DEFAULT_COMPRESSION); } @@ -78,9 +69,7 @@ int ZEXPORT compress(dest, destLen, source, sourceLen) If the default memLevel or windowBits for deflateInit() is changed, then this function needs to be updated. */ -uLong ZEXPORT compressBound(sourceLen) - uLong sourceLen; -{ +uLong ZEXPORT compressBound(uLong sourceLen) { return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) + (sourceLen >> 25) + 13; } diff --git a/src/PureLib/pure/zlib/configure b/src/PureLib/pure/zlib/configure index fa4d5daaba..c55098afc4 100755 --- a/src/PureLib/pure/zlib/configure +++ b/src/PureLib/pure/zlib/configure @@ -25,7 +25,7 @@ if test $SRCDIR = "."; then ZINCOUT="-I." SRCDIR="" else - ZINC='-include zconf.h' + ZINC='-I. -include zconf.h' ZINCOUT='-I. -I$(SRCDIR)' SRCDIR="$SRCDIR/" fi @@ -44,9 +44,8 @@ STATICLIB=libz.a # extract zlib version numbers from zlib.h VER=`sed -n -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < ${SRCDIR}zlib.h` -VER3=`sed -n -e '/VERSION "/s/.*"\([0-9]*\\.[0-9]*\\.[0-9]*\).*/\1/p' < ${SRCDIR}zlib.h` -VER2=`sed -n -e '/VERSION "/s/.*"\([0-9]*\\.[0-9]*\)\\..*/\1/p' < ${SRCDIR}zlib.h` -VER1=`sed -n -e '/VERSION "/s/.*"\([0-9]*\)\\..*/\1/p' < ${SRCDIR}zlib.h` +VER3=`echo ${VER}|sed -n -e 's/\([0-9]\{1,\}\(\\.[0-9]\{1,\}\)\{1,2\}\).*/\1/p'` +VER1=`echo ${VER}|sed -n -e 's/\([0-9]\{1,\}\)\\..*/\1/p'` # establish commands for library building if "${CROSS_PREFIX}ar" --version >/dev/null 2>/dev/null || test $? -lt 126; then @@ -90,7 +89,8 @@ build64=0 gcc=0 warn=0 debug=0 -sanitize=0 +address=0 +memory=0 old_cc="$CC" old_cflags="$CFLAGS" OBJC='$(OBJZ) $(OBJG)' @@ -102,7 +102,7 @@ leave() if test "$*" != "0"; then echo "** $0 aborting." | tee -a configure.log fi - rm -f $test.[co] $test $test$shared_ext $test.gcno ./--version + rm -rf $test.[co] $test $test$shared_ext $test.gcno $test.dSYM ./--version echo -------------------- >> configure.log echo >> configure.log echo >> configure.log @@ -141,7 +141,9 @@ case "$1" in -c* | --const) zconst=1; shift ;; -w* | --warn) warn=1; shift ;; -d* | --debug) debug=1; shift ;; - --sanitize) sanitize=1; shift ;; + --sanitize) address=1; shift ;; + --address) address=1; shift ;; + --memory) memory=1; shift ;; *) echo "unknown option: $1" | tee -a configure.log echo "$0 --help for help" | tee -a configure.log @@ -211,8 +213,11 @@ if test "$gcc" -eq 1 && ($cc -c $test.c) >> configure.log 2>&1; then CFLAGS="${CFLAGS} -Wall -Wextra" fi fi - if test $sanitize -eq 1; then - CFLAGS="${CFLAGS} -g -fsanitize=address" + if test $address -eq 1; then + CFLAGS="${CFLAGS} -g -fsanitize=address -fno-omit-frame-pointer" + fi + if test $memory -eq 1; then + CFLAGS="${CFLAGS} -g -fsanitize=memory -fno-omit-frame-pointer" fi if test $debug -eq 1; then CFLAGS="${CFLAGS} -DZLIB_DEBUG" @@ -260,7 +265,9 @@ if test "$gcc" -eq 1 && ($cc -c $test.c) >> configure.log 2>&1; then SHAREDLIBV=libz.$VER$shared_ext SHAREDLIBM=libz.$VER1$shared_ext LDSHARED=${LDSHARED-"$cc -dynamiclib -install_name $libdir/$SHAREDLIBM -compatibility_version $VER1 -current_version $VER3"} - if libtool -V 2>&1 | grep Apple > /dev/null; then + if "${CROSS_PREFIX}libtool" -V 2>&1 | grep Apple > /dev/null; then + AR="${CROSS_PREFIX}libtool" + elif libtool -V 2>&1 | grep Apple > /dev/null; then AR="libtool" else AR="/usr/bin/libtool" @@ -435,7 +442,7 @@ EOF if test $shared -eq 1; then echo Checking for shared library support... | tee -a configure.log # we must test in two steps (cc then ld), required at least on SunOS 4.x - if try $CC -w -c $SFLAGS $test.c && + if try $CC -c $SFLAGS $test.c && try $LDSHARED $SFLAGS -o $test$shared_ext $test.o; then echo Building shared library $SHAREDLIBV with $CC. | tee -a configure.log elif test -z "$old_cc" -a -z "$old_cflags"; then @@ -860,7 +867,7 @@ echo prefix = $prefix >> configure.log echo sharedlibdir = $sharedlibdir >> configure.log echo uname = $uname >> configure.log -# udpate Makefile with the configure results +# update Makefile with the configure results sed < ${SRCDIR}Makefile.in " /^CC *=/s#=.*#=$CC# /^CFLAGS *=/s#=.*#=$CFLAGS# diff --git a/src/PureLib/pure/zlib/contrib/ada/readme.txt b/src/PureLib/pure/zlib/contrib/ada/readme.txt index ce4d2cadf0..efdd639fba 100644 --- a/src/PureLib/pure/zlib/contrib/ada/readme.txt +++ b/src/PureLib/pure/zlib/contrib/ada/readme.txt @@ -8,8 +8,8 @@ It provides Ada-style access to the ZLib C library. Here are the main changes since ZLib.Ada 1.2: -- Attension: ZLib.Read generic routine have a initialization requirement - for Read_Last parameter now. It is a bit incompartible with previous version, +- Attention: ZLib.Read generic routine have a initialization requirement + for Read_Last parameter now. It is a bit incompatible with previous version, but extends functionality, we could use new parameters Allow_Read_Some and Flush now. diff --git a/src/PureLib/pure/zlib/contrib/ada/test.adb b/src/PureLib/pure/zlib/contrib/ada/test.adb index 90773acfa1..8b35031508 100644 --- a/src/PureLib/pure/zlib/contrib/ada/test.adb +++ b/src/PureLib/pure/zlib/contrib/ada/test.adb @@ -65,12 +65,12 @@ procedure Test is Time_Stamp : Ada.Calendar.Time; procedure Generate_File; - -- Generate file of spetsified size with some random data. + -- Generate file of specified size with some random data. -- The random data is repeatable, for the good compression. procedure Compare_Streams (Left, Right : in out Root_Stream_Type'Class); - -- The procedure compearing data in 2 streams. + -- The procedure comparing data in 2 streams. -- It is for compare data before and after compression/decompression. procedure Compare_Files (Left, Right : String); diff --git a/src/PureLib/pure/zlib/contrib/ada/zlib-streams.ads b/src/PureLib/pure/zlib/contrib/ada/zlib-streams.ads index 8e26cd4508..af136933e1 100644 --- a/src/PureLib/pure/zlib/contrib/ada/zlib-streams.ads +++ b/src/PureLib/pure/zlib/contrib/ada/zlib-streams.ads @@ -62,7 +62,7 @@ package ZLib.Streams is := Default_Buffer_Size; Write_Buffer_Size : in Ada.Streams.Stream_Element_Offset := Default_Buffer_Size); - -- Create the Comression/Decompression stream. + -- Create the Compression/Decompression stream. -- If mode is In_Stream then Write operation is disabled. -- If mode is Out_Stream then Read operation is disabled. diff --git a/src/PureLib/pure/zlib/contrib/ada/zlib.adb b/src/PureLib/pure/zlib/contrib/ada/zlib.adb index 8b6fd686ac..c1abe791d6 100644 --- a/src/PureLib/pure/zlib/contrib/ada/zlib.adb +++ b/src/PureLib/pure/zlib/contrib/ada/zlib.adb @@ -204,7 +204,7 @@ package body ZLib is end if; -- We allow ZLib to make header only in case of default header type. - -- Otherwise we would either do header by ourselfs, or do not do + -- Otherwise we would either do header by ourselves, or do not do -- header at all. if Header = None or else Header = GZip then diff --git a/src/PureLib/pure/zlib/contrib/ada/zlib.ads b/src/PureLib/pure/zlib/contrib/ada/zlib.ads index 79ffc4095c..81aaf1b6ae 100644 --- a/src/PureLib/pure/zlib/contrib/ada/zlib.ads +++ b/src/PureLib/pure/zlib/contrib/ada/zlib.ads @@ -114,7 +114,7 @@ package ZLib is -- Compression strategy constants -- ------------------------------------ - -- RLE stategy could be used only in version 1.2.0 and later. + -- RLE strategy could be used only in version 1.2.0 and later. Filtered : constant Strategy_Type; Huffman_Only : constant Strategy_Type; diff --git a/src/PureLib/pure/zlib/contrib/delphi/ZLib.pas b/src/PureLib/pure/zlib/contrib/delphi/ZLib.pas index 8be5fa22c4..93fa4c9edb 100644 --- a/src/PureLib/pure/zlib/contrib/delphi/ZLib.pas +++ b/src/PureLib/pure/zlib/contrib/delphi/ZLib.pas @@ -152,7 +152,7 @@ procedure DecompressToUserBuf(const InBuf: Pointer; InBytes: Integer; const OutBuf: Pointer; BufSize: Integer); const - zlib_version = '1.2.13'; + zlib_version = '1.3.1'; type EZlibError = class(Exception); diff --git a/src/PureLib/pure/zlib/contrib/dotzlib/DotZLib/ChecksumImpl.cs b/src/PureLib/pure/zlib/contrib/dotzlib/DotZLib/ChecksumImpl.cs index 788b2fcece..de88dcf116 100644 --- a/src/PureLib/pure/zlib/contrib/dotzlib/DotZLib/ChecksumImpl.cs +++ b/src/PureLib/pure/zlib/contrib/dotzlib/DotZLib/ChecksumImpl.cs @@ -34,7 +34,7 @@ public ChecksumGeneratorBase() } /// - /// Initializes a new instance of the checksum generator basewith a specified value + /// Initializes a new instance of the checksum generator base with a specified value /// /// The value to set the current checksum to public ChecksumGeneratorBase(uint initialValue) @@ -61,7 +61,7 @@ public ChecksumGeneratorBase(uint initialValue) /// The sum of offset and count is larger than the length of data /// data is a null reference /// Offset or count is negative. - /// All the other Update methods are implmeneted in terms of this one. + /// All the other Update methods are implemented in terms of this one. /// This is therefore the only method a derived class has to implement public abstract void Update(byte[] data, int offset, int count); diff --git a/src/PureLib/pure/zlib/contrib/dotzlib/DotZLib/CodecBase.cs b/src/PureLib/pure/zlib/contrib/dotzlib/DotZLib/CodecBase.cs index 42e6da3a56..c4bc8b8796 100644 --- a/src/PureLib/pure/zlib/contrib/dotzlib/DotZLib/CodecBase.cs +++ b/src/PureLib/pure/zlib/contrib/dotzlib/DotZLib/CodecBase.cs @@ -139,7 +139,7 @@ public void Dispose() /// This must be implemented by a derived class protected abstract void CleanUp(); - // performs the release of the handles and calls the dereived CleanUp() + // performs the release of the handles and calls the derived CleanUp() private void CleanUp(bool isDisposing) { if (!_isDisposed) @@ -160,7 +160,7 @@ private void CleanUp(bool isDisposing) #region Helper methods /// - /// Copies a number of bytes to the internal codec buffer - ready for proccesing + /// Copies a number of bytes to the internal codec buffer - ready for processing /// /// The byte array that contains the data to copy /// The index of the first byte to copy diff --git a/src/PureLib/pure/zlib/contrib/dotzlib/DotZLib/GZipStream.cs b/src/PureLib/pure/zlib/contrib/dotzlib/DotZLib/GZipStream.cs index b161300b18..58091d3a3e 100644 --- a/src/PureLib/pure/zlib/contrib/dotzlib/DotZLib/GZipStream.cs +++ b/src/PureLib/pure/zlib/contrib/dotzlib/DotZLib/GZipStream.cs @@ -246,7 +246,7 @@ public override void SetLength(long value) } /// - /// Not suppported. + /// Not supported. /// /// /// @@ -268,7 +268,7 @@ public override void Flush() } /// - /// Gets/sets the current position in the GZipStream. Not suppported. + /// Gets/sets the current position in the GZipStream. Not supported. /// /// In this implementation this property is not supported /// Always thrown @@ -285,7 +285,7 @@ public override long Position } /// - /// Gets the size of the stream. Not suppported. + /// Gets the size of the stream. Not supported. /// /// In this implementation this property is not supported /// Always thrown diff --git a/src/PureLib/pure/zlib/contrib/dotzlib/DotZLib/UnitTests.cs b/src/PureLib/pure/zlib/contrib/dotzlib/DotZLib/UnitTests.cs index 16a0ebb072..d4f0980237 100644 --- a/src/PureLib/pure/zlib/contrib/dotzlib/DotZLib/UnitTests.cs +++ b/src/PureLib/pure/zlib/contrib/dotzlib/DotZLib/UnitTests.cs @@ -156,7 +156,7 @@ public class InfoTests public void Info_Version() { Info info = new Info(); - Assert.AreEqual("1.2.13", Info.Version); + Assert.AreEqual("1.3.1", Info.Version); Assert.AreEqual(32, info.SizeOfUInt); Assert.AreEqual(32, info.SizeOfULong); Assert.AreEqual(32, info.SizeOfPointer); diff --git a/src/PureLib/pure/zlib/contrib/dotzlib/readme.txt b/src/PureLib/pure/zlib/contrib/dotzlib/readme.txt index b2395720d4..47454fce37 100644 --- a/src/PureLib/pure/zlib/contrib/dotzlib/readme.txt +++ b/src/PureLib/pure/zlib/contrib/dotzlib/readme.txt @@ -36,7 +36,7 @@ Build instructions: in the same directory as the DotZLib.build file. You can define 2 properties on the nant command-line to control the build: debug={true|false} to toggle between release/debug builds (default=true). - nunit={true|false} to include or esclude unit tests (default=true). + nunit={true|false} to include or exclude unit tests (default=true). Also the target clean will remove binaries. Output file (DotZLib.dll) will be found in either ./DotZLib/bin/release or ./DotZLib/bin/debug, depending on whether you are building the release diff --git a/src/PureLib/pure/zlib/contrib/infback9/infback9.c b/src/PureLib/pure/zlib/contrib/infback9/infback9.c index 05fb3e3380..742a39214a 100644 --- a/src/PureLib/pure/zlib/contrib/infback9/infback9.c +++ b/src/PureLib/pure/zlib/contrib/infback9/infback9.c @@ -16,12 +16,8 @@ window is a user-supplied window and output buffer that is 64K bytes. */ -int ZEXPORT inflateBack9Init_(strm, window, version, stream_size) -z_stream FAR *strm; -unsigned char FAR *window; -const char *version; -int stream_size; -{ +int ZEXPORT inflateBack9Init_(z_stream FAR *strm, unsigned char FAR *window, + const char *version, int stream_size) { struct inflate_state FAR *state; if (version == Z_NULL || version[0] != ZLIB_VERSION[0] || @@ -51,8 +47,7 @@ int stream_size; #ifdef MAKEFIXED #include -void makefixed9(void) -{ +void makefixed9(void) { unsigned sym, bits, low, size; code *next, *lenfix, *distfix; struct inflate_state state; @@ -214,13 +209,8 @@ void makefixed9(void) inflateBack() can also return Z_STREAM_ERROR if the input parameters are not correct, i.e. strm is Z_NULL or the state was not initialized. */ -int ZEXPORT inflateBack9(strm, in, in_desc, out, out_desc) -z_stream FAR *strm; -in_func in; -void FAR *in_desc; -out_func out; -void FAR *out_desc; -{ +int ZEXPORT inflateBack9(z_stream FAR *strm, in_func in, void FAR *in_desc, + out_func out, void FAR *out_desc) { struct inflate_state FAR *state; z_const unsigned char FAR *next; /* next input */ unsigned char FAR *put; /* next output */ @@ -603,9 +593,7 @@ void FAR *out_desc; return ret; } -int ZEXPORT inflateBack9End(strm) -z_stream FAR *strm; -{ +int ZEXPORT inflateBack9End(z_stream FAR *strm) { if (strm == Z_NULL || strm->state == Z_NULL || strm->zfree == (free_func)0) return Z_STREAM_ERROR; ZFREE(strm, strm->state); diff --git a/src/PureLib/pure/zlib/contrib/infback9/infback9.h b/src/PureLib/pure/zlib/contrib/infback9/infback9.h index 1073c0a38e..8371b4ec7d 100644 --- a/src/PureLib/pure/zlib/contrib/infback9/infback9.h +++ b/src/PureLib/pure/zlib/contrib/infback9/infback9.h @@ -20,14 +20,14 @@ extern "C" { #endif -ZEXTERN int ZEXPORT inflateBack9 OF((z_stream FAR *strm, - in_func in, void FAR *in_desc, - out_func out, void FAR *out_desc)); -ZEXTERN int ZEXPORT inflateBack9End OF((z_stream FAR *strm)); -ZEXTERN int ZEXPORT inflateBack9Init_ OF((z_stream FAR *strm, - unsigned char FAR *window, - const char *version, - int stream_size)); +ZEXTERN int ZEXPORT inflateBack9(z_stream FAR *strm, + in_func in, void FAR *in_desc, + out_func out, void FAR *out_desc); +ZEXTERN int ZEXPORT inflateBack9End(z_stream FAR *strm); +ZEXTERN int ZEXPORT inflateBack9Init_(z_stream FAR *strm, + unsigned char FAR *window, + const char *version, + int stream_size); #define inflateBack9Init(strm, window) \ inflateBack9Init_((strm), (window), \ ZLIB_VERSION, sizeof(z_stream)) diff --git a/src/PureLib/pure/zlib/contrib/infback9/inftree9.c b/src/PureLib/pure/zlib/contrib/infback9/inftree9.c index 10827a6aa0..ac707ed3fb 100644 --- a/src/PureLib/pure/zlib/contrib/infback9/inftree9.c +++ b/src/PureLib/pure/zlib/contrib/infback9/inftree9.c @@ -1,5 +1,5 @@ /* inftree9.c -- generate Huffman trees for efficient decoding - * Copyright (C) 1995-2022 Mark Adler + * Copyright (C) 1995-2024 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -9,7 +9,7 @@ #define MAXBITS 15 const char inflate9_copyright[] = - " inflate9 1.2.13 Copyright 1995-2022 Mark Adler "; + " inflate9 1.3.1 Copyright 1995-2024 Mark Adler "; /* If you use the zlib library in a product, an acknowledgment is welcome in the documentation of your product. If for some reason you cannot @@ -29,14 +29,9 @@ const char inflate9_copyright[] = table index bits. It will differ if the request is greater than the longest code or if it is less than the shortest code. */ -int inflate_table9(type, lens, codes, table, bits, work) -codetype type; -unsigned short FAR *lens; -unsigned codes; -code FAR * FAR *table; -unsigned FAR *bits; -unsigned short FAR *work; -{ +int inflate_table9(codetype type, unsigned short FAR *lens, unsigned codes, + code FAR * FAR *table, unsigned FAR *bits, + unsigned short FAR *work) { unsigned len; /* a code's length in bits */ unsigned sym; /* index of code symbols */ unsigned min, max; /* minimum and maximum code lengths */ @@ -64,7 +59,7 @@ unsigned short FAR *work; static const unsigned short lext[31] = { /* Length codes 257..285 extra */ 128, 128, 128, 128, 128, 128, 128, 128, 129, 129, 129, 129, 130, 130, 130, 130, 131, 131, 131, 131, 132, 132, 132, 132, - 133, 133, 133, 133, 144, 194, 65}; + 133, 133, 133, 133, 144, 203, 77}; static const unsigned short dbase[32] = { /* Distance codes 0..31 base */ 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, diff --git a/src/PureLib/pure/zlib/contrib/infback9/inftree9.h b/src/PureLib/pure/zlib/contrib/infback9/inftree9.h index 3b394978e3..ab2ea28b2b 100644 --- a/src/PureLib/pure/zlib/contrib/infback9/inftree9.h +++ b/src/PureLib/pure/zlib/contrib/infback9/inftree9.h @@ -41,8 +41,8 @@ typedef struct { examples/enough.c found in the zlib distribution. The arguments to that program are the number of symbols, the initial root table size, and the maximum bit length of a code. "enough 286 9 15" for literal/length codes - returns returns 852, and "enough 32 6 15" for distance codes returns 594. - The initial root table size (9 or 6) is found in the fifth argument of the + returns 852, and "enough 32 6 15" for distance codes returns 594. The + initial root table size (9 or 6) is found in the fifth argument of the inflate_table() calls in infback9.c. If the root table size is changed, then these maximum sizes would be need to be recalculated and updated. */ #define ENOUGH_LENS 852 @@ -56,6 +56,6 @@ typedef enum { DISTS } codetype; -extern int inflate_table9 OF((codetype type, unsigned short FAR *lens, - unsigned codes, code FAR * FAR *table, - unsigned FAR *bits, unsigned short FAR *work)); +extern int inflate_table9(codetype type, unsigned short FAR *lens, + unsigned codes, code FAR * FAR *table, + unsigned FAR *bits, unsigned short FAR *work); diff --git a/src/PureLib/pure/zlib/contrib/iostream3/zfstream.h b/src/PureLib/pure/zlib/contrib/iostream3/zfstream.h index 8574479ae1..3dabc0f97d 100644 --- a/src/PureLib/pure/zlib/contrib/iostream3/zfstream.h +++ b/src/PureLib/pure/zlib/contrib/iostream3/zfstream.h @@ -413,7 +413,7 @@ template class gzomanip2 { public: - // Allows insertor to peek at internals + // Allows inserter to peek at internals template friend gzofstream& operator<<(gzofstream&, @@ -452,7 +452,7 @@ template : func(f), val1(v1), val2(v2) { } -// Insertor applies underlying manipulator function to stream +// Inserter applies underlying manipulator function to stream template inline gzofstream& operator<<(gzofstream& s, const gzomanip2& m) diff --git a/src/PureLib/pure/zlib/contrib/minizip/Makefile b/src/PureLib/pure/zlib/contrib/minizip/Makefile index aac76e07f6..3d927ec149 100644 --- a/src/PureLib/pure/zlib/contrib/minizip/Makefile +++ b/src/PureLib/pure/zlib/contrib/minizip/Makefile @@ -1,4 +1,4 @@ -CC=cc +CC?=cc CFLAGS := $(CFLAGS) -O -I../.. UNZ_OBJS = miniunz.o unzip.o ioapi.o ../../libz.a diff --git a/src/PureLib/pure/zlib/contrib/minizip/MiniZip64_Changes.txt b/src/PureLib/pure/zlib/contrib/minizip/MiniZip64_Changes.txt index 13a1bd91a9..3759468113 100644 --- a/src/PureLib/pure/zlib/contrib/minizip/MiniZip64_Changes.txt +++ b/src/PureLib/pure/zlib/contrib/minizip/MiniZip64_Changes.txt @@ -1,5 +1,5 @@ -MiniZip 1.1 was derrived from MiniZip at version 1.01f +MiniZip 1.1 was derived from MiniZip at version 1.01f Change in 1.0 (Okt 2009) - **TODO - Add history** diff --git a/src/PureLib/pure/zlib/contrib/minizip/configure.ac b/src/PureLib/pure/zlib/contrib/minizip/configure.ac index bff300b304..15ec917189 100644 --- a/src/PureLib/pure/zlib/contrib/minizip/configure.ac +++ b/src/PureLib/pure/zlib/contrib/minizip/configure.ac @@ -1,7 +1,7 @@ # -*- Autoconf -*- # Process this file with autoconf to produce a configure script. -AC_INIT([minizip], [1.2.13], [bugzilla.redhat.com]) +AC_INIT([minizip], [1.3.1], [bugzilla.redhat.com]) AC_CONFIG_SRCDIR([minizip.c]) AM_INIT_AUTOMAKE([foreign]) LT_INIT diff --git a/src/PureLib/pure/zlib/contrib/minizip/crypt.h b/src/PureLib/pure/zlib/contrib/minizip/crypt.h index 1cc41f19d7..f4b93b78dc 100644 --- a/src/PureLib/pure/zlib/contrib/minizip/crypt.h +++ b/src/PureLib/pure/zlib/contrib/minizip/crypt.h @@ -32,8 +32,7 @@ /*********************************************************************** * Return the next byte in the pseudo-random sequence */ -static int decrypt_byte(unsigned long* pkeys, const z_crc_t* pcrc_32_tab) -{ +static int decrypt_byte(unsigned long* pkeys, const z_crc_t* pcrc_32_tab) { unsigned temp; /* POTENTIAL BUG: temp*(temp^1) may overflow in an * unpredictable manner on 16-bit systems; not a problem * with any known compiler so far, though */ @@ -46,8 +45,7 @@ static int decrypt_byte(unsigned long* pkeys, const z_crc_t* pcrc_32_tab) /*********************************************************************** * Update the encryption keys with the next byte of plain text */ -static int update_keys(unsigned long* pkeys,const z_crc_t* pcrc_32_tab,int c) -{ +static int update_keys(unsigned long* pkeys, const z_crc_t* pcrc_32_tab, int c) { (*(pkeys+0)) = CRC32((*(pkeys+0)), c); (*(pkeys+1)) += (*(pkeys+0)) & 0xff; (*(pkeys+1)) = (*(pkeys+1)) * 134775813L + 1; @@ -63,8 +61,7 @@ static int update_keys(unsigned long* pkeys,const z_crc_t* pcrc_32_tab,int c) * Initialize the encryption keys and the random header according to * the given password. */ -static void init_keys(const char* passwd,unsigned long* pkeys,const z_crc_t* pcrc_32_tab) -{ +static void init_keys(const char* passwd, unsigned long* pkeys, const z_crc_t* pcrc_32_tab) { *(pkeys+0) = 305419896L; *(pkeys+1) = 591751049L; *(pkeys+2) = 878082192L; @@ -93,8 +90,7 @@ static unsigned crypthead(const char* passwd, /* password string */ int bufSize, unsigned long* pkeys, const z_crc_t* pcrc_32_tab, - unsigned long crcForCrypting) -{ + unsigned long crcForCrypting) { unsigned n; /* index in random header */ int t; /* temporary */ int c; /* random byte */ diff --git a/src/PureLib/pure/zlib/contrib/minizip/ioapi.c b/src/PureLib/pure/zlib/contrib/minizip/ioapi.c index 814a6fd38c..782d32469a 100644 --- a/src/PureLib/pure/zlib/contrib/minizip/ioapi.c +++ b/src/PureLib/pure/zlib/contrib/minizip/ioapi.c @@ -14,7 +14,7 @@ #define _CRT_SECURE_NO_WARNINGS #endif -#if defined(__APPLE__) || defined(IOAPI_NO_64) +#if defined(__APPLE__) || defined(IOAPI_NO_64) || defined(__HAIKU__) || defined(MINIZIP_FOPEN_NO_64) // In darwin and perhaps other BSD variants off_t is a 64 bit value, hence no need for specific 64 bit functions #define FOPEN_FUNC(filename, mode) fopen(filename, mode) #define FTELLO_FUNC(stream) ftello(stream) @@ -28,8 +28,7 @@ #include "ioapi.h" -voidpf call_zopen64 (const zlib_filefunc64_32_def* pfilefunc,const void*filename,int mode) -{ +voidpf call_zopen64 (const zlib_filefunc64_32_def* pfilefunc, const void*filename, int mode) { if (pfilefunc->zfile_func64.zopen64_file != NULL) return (*(pfilefunc->zfile_func64.zopen64_file)) (pfilefunc->zfile_func64.opaque,filename,mode); else @@ -38,8 +37,7 @@ voidpf call_zopen64 (const zlib_filefunc64_32_def* pfilefunc,const void*filename } } -long call_zseek64 (const zlib_filefunc64_32_def* pfilefunc,voidpf filestream, ZPOS64_T offset, int origin) -{ +long call_zseek64 (const zlib_filefunc64_32_def* pfilefunc,voidpf filestream, ZPOS64_T offset, int origin) { if (pfilefunc->zfile_func64.zseek64_file != NULL) return (*(pfilefunc->zfile_func64.zseek64_file)) (pfilefunc->zfile_func64.opaque,filestream,offset,origin); else @@ -52,8 +50,7 @@ long call_zseek64 (const zlib_filefunc64_32_def* pfilefunc,voidpf filestream, ZP } } -ZPOS64_T call_ztell64 (const zlib_filefunc64_32_def* pfilefunc,voidpf filestream) -{ +ZPOS64_T call_ztell64 (const zlib_filefunc64_32_def* pfilefunc, voidpf filestream) { if (pfilefunc->zfile_func64.zseek64_file != NULL) return (*(pfilefunc->zfile_func64.ztell64_file)) (pfilefunc->zfile_func64.opaque,filestream); else @@ -66,11 +63,9 @@ ZPOS64_T call_ztell64 (const zlib_filefunc64_32_def* pfilefunc,voidpf filestream } } -void fill_zlib_filefunc64_32_def_from_filefunc32(zlib_filefunc64_32_def* p_filefunc64_32,const zlib_filefunc_def* p_filefunc32) -{ +void fill_zlib_filefunc64_32_def_from_filefunc32(zlib_filefunc64_32_def* p_filefunc64_32, const zlib_filefunc_def* p_filefunc32) { p_filefunc64_32->zfile_func64.zopen64_file = NULL; p_filefunc64_32->zopen32_file = p_filefunc32->zopen_file; - p_filefunc64_32->zfile_func64.zerror_file = p_filefunc32->zerror_file; p_filefunc64_32->zfile_func64.zread_file = p_filefunc32->zread_file; p_filefunc64_32->zfile_func64.zwrite_file = p_filefunc32->zwrite_file; p_filefunc64_32->zfile_func64.ztell64_file = NULL; @@ -84,16 +79,7 @@ void fill_zlib_filefunc64_32_def_from_filefunc32(zlib_filefunc64_32_def* p_filef -static voidpf ZCALLBACK fopen_file_func OF((voidpf opaque, const char* filename, int mode)); -static uLong ZCALLBACK fread_file_func OF((voidpf opaque, voidpf stream, void* buf, uLong size)); -static uLong ZCALLBACK fwrite_file_func OF((voidpf opaque, voidpf stream, const void* buf,uLong size)); -static ZPOS64_T ZCALLBACK ftell64_file_func OF((voidpf opaque, voidpf stream)); -static long ZCALLBACK fseek64_file_func OF((voidpf opaque, voidpf stream, ZPOS64_T offset, int origin)); -static int ZCALLBACK fclose_file_func OF((voidpf opaque, voidpf stream)); -static int ZCALLBACK ferror_file_func OF((voidpf opaque, voidpf stream)); - -static voidpf ZCALLBACK fopen_file_func (voidpf opaque, const char* filename, int mode) -{ +static voidpf ZCALLBACK fopen_file_func(voidpf opaque, const char* filename, int mode) { FILE* file = NULL; const char* mode_fopen = NULL; (void)opaque; @@ -111,8 +97,7 @@ static voidpf ZCALLBACK fopen_file_func (voidpf opaque, const char* filename, in return file; } -static voidpf ZCALLBACK fopen64_file_func (voidpf opaque, const void* filename, int mode) -{ +static voidpf ZCALLBACK fopen64_file_func(voidpf opaque, const void* filename, int mode) { FILE* file = NULL; const char* mode_fopen = NULL; (void)opaque; @@ -131,24 +116,21 @@ static voidpf ZCALLBACK fopen64_file_func (voidpf opaque, const void* filename, } -static uLong ZCALLBACK fread_file_func (voidpf opaque, voidpf stream, void* buf, uLong size) -{ +static uLong ZCALLBACK fread_file_func(voidpf opaque, voidpf stream, void* buf, uLong size) { uLong ret; (void)opaque; ret = (uLong)fread(buf, 1, (size_t)size, (FILE *)stream); return ret; } -static uLong ZCALLBACK fwrite_file_func (voidpf opaque, voidpf stream, const void* buf, uLong size) -{ +static uLong ZCALLBACK fwrite_file_func(voidpf opaque, voidpf stream, const void* buf, uLong size) { uLong ret; (void)opaque; ret = (uLong)fwrite(buf, 1, (size_t)size, (FILE *)stream); return ret; } -static long ZCALLBACK ftell_file_func (voidpf opaque, voidpf stream) -{ +static long ZCALLBACK ftell_file_func(voidpf opaque, voidpf stream) { long ret; (void)opaque; ret = ftell((FILE *)stream); @@ -156,16 +138,14 @@ static long ZCALLBACK ftell_file_func (voidpf opaque, voidpf stream) } -static ZPOS64_T ZCALLBACK ftell64_file_func (voidpf opaque, voidpf stream) -{ +static ZPOS64_T ZCALLBACK ftell64_file_func(voidpf opaque, voidpf stream) { ZPOS64_T ret; (void)opaque; ret = (ZPOS64_T)FTELLO_FUNC((FILE *)stream); return ret; } -static long ZCALLBACK fseek_file_func (voidpf opaque, voidpf stream, uLong offset, int origin) -{ +static long ZCALLBACK fseek_file_func(voidpf opaque, voidpf stream, uLong offset, int origin) { int fseek_origin=0; long ret; (void)opaque; @@ -188,8 +168,7 @@ static long ZCALLBACK fseek_file_func (voidpf opaque, voidpf stream, uLong offs return ret; } -static long ZCALLBACK fseek64_file_func (voidpf opaque, voidpf stream, ZPOS64_T offset, int origin) -{ +static long ZCALLBACK fseek64_file_func(voidpf opaque, voidpf stream, ZPOS64_T offset, int origin) { int fseek_origin=0; long ret; (void)opaque; @@ -208,32 +187,28 @@ static long ZCALLBACK fseek64_file_func (voidpf opaque, voidpf stream, ZPOS64_T } ret = 0; - if(FSEEKO_FUNC((FILE *)stream, (z_off_t)offset, fseek_origin) != 0) + if(FSEEKO_FUNC((FILE *)stream, (z_off64_t)offset, fseek_origin) != 0) ret = -1; return ret; } -static int ZCALLBACK fclose_file_func (voidpf opaque, voidpf stream) -{ +static int ZCALLBACK fclose_file_func(voidpf opaque, voidpf stream) { int ret; (void)opaque; ret = fclose((FILE *)stream); return ret; } -static int ZCALLBACK ferror_file_func (voidpf opaque, voidpf stream) -{ +static int ZCALLBACK ferror_file_func(voidpf opaque, voidpf stream) { int ret; (void)opaque; ret = ferror((FILE *)stream); return ret; } -void fill_fopen_filefunc (pzlib_filefunc_def) - zlib_filefunc_def* pzlib_filefunc_def; -{ +void fill_fopen_filefunc(zlib_filefunc_def* pzlib_filefunc_def) { pzlib_filefunc_def->zopen_file = fopen_file_func; pzlib_filefunc_def->zread_file = fread_file_func; pzlib_filefunc_def->zwrite_file = fwrite_file_func; @@ -244,8 +219,7 @@ void fill_fopen_filefunc (pzlib_filefunc_def) pzlib_filefunc_def->opaque = NULL; } -void fill_fopen64_filefunc (zlib_filefunc64_def* pzlib_filefunc_def) -{ +void fill_fopen64_filefunc(zlib_filefunc64_def* pzlib_filefunc_def) { pzlib_filefunc_def->zopen64_file = fopen64_file_func; pzlib_filefunc_def->zread_file = fread_file_func; pzlib_filefunc_def->zwrite_file = fwrite_file_func; diff --git a/src/PureLib/pure/zlib/contrib/minizip/ioapi.h b/src/PureLib/pure/zlib/contrib/minizip/ioapi.h index ae9ca7e833..a2d2e6e60d 100644 --- a/src/PureLib/pure/zlib/contrib/minizip/ioapi.h +++ b/src/PureLib/pure/zlib/contrib/minizip/ioapi.h @@ -50,7 +50,7 @@ #define ftello64 ftell #define fseeko64 fseek #else -#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) +#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__HAIKU__) || defined(MINIZIP_FOPEN_NO_64) #define fopen64 fopen #define ftello64 ftello #define fseeko64 fseeko @@ -82,7 +82,7 @@ #include "mz64conf.h" #endif -/* a type choosen by DEFINE */ +/* a type chosen by DEFINE */ #ifdef HAVE_64BIT_INT_CUSTOM typedef 64BIT_INT_CUSTOM_TYPE ZPOS64_T; #else @@ -134,17 +134,17 @@ extern "C" { -typedef voidpf (ZCALLBACK *open_file_func) OF((voidpf opaque, const char* filename, int mode)); -typedef uLong (ZCALLBACK *read_file_func) OF((voidpf opaque, voidpf stream, void* buf, uLong size)); -typedef uLong (ZCALLBACK *write_file_func) OF((voidpf opaque, voidpf stream, const void* buf, uLong size)); -typedef int (ZCALLBACK *close_file_func) OF((voidpf opaque, voidpf stream)); -typedef int (ZCALLBACK *testerror_file_func) OF((voidpf opaque, voidpf stream)); +typedef voidpf (ZCALLBACK *open_file_func) (voidpf opaque, const char* filename, int mode); +typedef uLong (ZCALLBACK *read_file_func) (voidpf opaque, voidpf stream, void* buf, uLong size); +typedef uLong (ZCALLBACK *write_file_func) (voidpf opaque, voidpf stream, const void* buf, uLong size); +typedef int (ZCALLBACK *close_file_func) (voidpf opaque, voidpf stream); +typedef int (ZCALLBACK *testerror_file_func) (voidpf opaque, voidpf stream); -typedef long (ZCALLBACK *tell_file_func) OF((voidpf opaque, voidpf stream)); -typedef long (ZCALLBACK *seek_file_func) OF((voidpf opaque, voidpf stream, uLong offset, int origin)); +typedef long (ZCALLBACK *tell_file_func) (voidpf opaque, voidpf stream); +typedef long (ZCALLBACK *seek_file_func) (voidpf opaque, voidpf stream, uLong offset, int origin); -/* here is the "old" 32 bits structure structure */ +/* here is the "old" 32 bits structure */ typedef struct zlib_filefunc_def_s { open_file_func zopen_file; @@ -157,9 +157,9 @@ typedef struct zlib_filefunc_def_s voidpf opaque; } zlib_filefunc_def; -typedef ZPOS64_T (ZCALLBACK *tell64_file_func) OF((voidpf opaque, voidpf stream)); -typedef long (ZCALLBACK *seek64_file_func) OF((voidpf opaque, voidpf stream, ZPOS64_T offset, int origin)); -typedef voidpf (ZCALLBACK *open64_file_func) OF((voidpf opaque, const void* filename, int mode)); +typedef ZPOS64_T (ZCALLBACK *tell64_file_func) (voidpf opaque, voidpf stream); +typedef long (ZCALLBACK *seek64_file_func) (voidpf opaque, voidpf stream, ZPOS64_T offset, int origin); +typedef voidpf (ZCALLBACK *open64_file_func) (voidpf opaque, const void* filename, int mode); typedef struct zlib_filefunc64_def_s { @@ -173,8 +173,8 @@ typedef struct zlib_filefunc64_def_s voidpf opaque; } zlib_filefunc64_def; -void fill_fopen64_filefunc OF((zlib_filefunc64_def* pzlib_filefunc_def)); -void fill_fopen_filefunc OF((zlib_filefunc_def* pzlib_filefunc_def)); +void fill_fopen64_filefunc(zlib_filefunc64_def* pzlib_filefunc_def); +void fill_fopen_filefunc(zlib_filefunc_def* pzlib_filefunc_def); /* now internal definition, only for zip.c and unzip.h */ typedef struct zlib_filefunc64_32_def_s @@ -193,11 +193,11 @@ typedef struct zlib_filefunc64_32_def_s #define ZCLOSE64(filefunc,filestream) ((*((filefunc).zfile_func64.zclose_file)) ((filefunc).zfile_func64.opaque,filestream)) #define ZERROR64(filefunc,filestream) ((*((filefunc).zfile_func64.zerror_file)) ((filefunc).zfile_func64.opaque,filestream)) -voidpf call_zopen64 OF((const zlib_filefunc64_32_def* pfilefunc,const void*filename,int mode)); -long call_zseek64 OF((const zlib_filefunc64_32_def* pfilefunc,voidpf filestream, ZPOS64_T offset, int origin)); -ZPOS64_T call_ztell64 OF((const zlib_filefunc64_32_def* pfilefunc,voidpf filestream)); +voidpf call_zopen64(const zlib_filefunc64_32_def* pfilefunc,const void*filename,int mode); +long call_zseek64(const zlib_filefunc64_32_def* pfilefunc,voidpf filestream, ZPOS64_T offset, int origin); +ZPOS64_T call_ztell64(const zlib_filefunc64_32_def* pfilefunc,voidpf filestream); -void fill_zlib_filefunc64_32_def_from_filefunc32(zlib_filefunc64_32_def* p_filefunc64_32,const zlib_filefunc_def* p_filefunc32); +void fill_zlib_filefunc64_32_def_from_filefunc32(zlib_filefunc64_32_def* p_filefunc64_32,const zlib_filefunc_def* p_filefunc32); #define ZOPEN64(filefunc,filename,mode) (call_zopen64((&(filefunc)),(filename),(mode))) #define ZTELL64(filefunc,filestream) (call_ztell64((&(filefunc)),(filestream))) diff --git a/src/PureLib/pure/zlib/contrib/minizip/iowin32.c b/src/PureLib/pure/zlib/contrib/minizip/iowin32.c index 7df525172b..08536e94b8 100644 --- a/src/PureLib/pure/zlib/contrib/minizip/iowin32.c +++ b/src/PureLib/pure/zlib/contrib/minizip/iowin32.c @@ -38,14 +38,6 @@ #endif #endif -voidpf ZCALLBACK win32_open_file_func OF((voidpf opaque, const char* filename, int mode)); -uLong ZCALLBACK win32_read_file_func OF((voidpf opaque, voidpf stream, void* buf, uLong size)); -uLong ZCALLBACK win32_write_file_func OF((voidpf opaque, voidpf stream, const void* buf, uLong size)); -ZPOS64_T ZCALLBACK win32_tell64_file_func OF((voidpf opaque, voidpf stream)); -long ZCALLBACK win32_seek64_file_func OF((voidpf opaque, voidpf stream, ZPOS64_T offset, int origin)); -int ZCALLBACK win32_close_file_func OF((voidpf opaque, voidpf stream)); -int ZCALLBACK win32_error_file_func OF((voidpf opaque, voidpf stream)); - typedef struct { HANDLE hf; @@ -57,8 +49,7 @@ static void win32_translate_open_mode(int mode, DWORD* lpdwDesiredAccess, DWORD* lpdwCreationDisposition, DWORD* lpdwShareMode, - DWORD* lpdwFlagsAndAttributes) -{ + DWORD* lpdwFlagsAndAttributes) { *lpdwDesiredAccess = *lpdwShareMode = *lpdwFlagsAndAttributes = *lpdwCreationDisposition = 0; if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ) @@ -79,8 +70,7 @@ static void win32_translate_open_mode(int mode, } } -static voidpf win32_build_iowin(HANDLE hFile) -{ +static voidpf win32_build_iowin(HANDLE hFile) { voidpf ret=NULL; if ((hFile != NULL) && (hFile != INVALID_HANDLE_VALUE)) @@ -98,8 +88,7 @@ static voidpf win32_build_iowin(HANDLE hFile) return ret; } -voidpf ZCALLBACK win32_open64_file_func (voidpf opaque,const void* filename,int mode) -{ +voidpf ZCALLBACK win32_open64_file_func(voidpf opaque, const void* filename, int mode) { const char* mode_fopen = NULL; DWORD dwDesiredAccess,dwCreationDisposition,dwShareMode,dwFlagsAndAttributes ; HANDLE hFile = NULL; @@ -127,8 +116,7 @@ voidpf ZCALLBACK win32_open64_file_func (voidpf opaque,const void* filename,int } -voidpf ZCALLBACK win32_open64_file_funcA (voidpf opaque,const void* filename,int mode) -{ +voidpf ZCALLBACK win32_open64_file_funcA(voidpf opaque, const void* filename, int mode) { const char* mode_fopen = NULL; DWORD dwDesiredAccess,dwCreationDisposition,dwShareMode,dwFlagsAndAttributes ; HANDLE hFile = NULL; @@ -151,8 +139,7 @@ voidpf ZCALLBACK win32_open64_file_funcA (voidpf opaque,const void* filename,int } -voidpf ZCALLBACK win32_open64_file_funcW (voidpf opaque,const void* filename,int mode) -{ +voidpf ZCALLBACK win32_open64_file_funcW(voidpf opaque, const void* filename, int mode) { const char* mode_fopen = NULL; DWORD dwDesiredAccess,dwCreationDisposition,dwShareMode,dwFlagsAndAttributes ; HANDLE hFile = NULL; @@ -171,8 +158,7 @@ voidpf ZCALLBACK win32_open64_file_funcW (voidpf opaque,const void* filename,int } -voidpf ZCALLBACK win32_open_file_func (voidpf opaque,const char* filename,int mode) -{ +voidpf ZCALLBACK win32_open_file_func(voidpf opaque, const char* filename, int mode) { const char* mode_fopen = NULL; DWORD dwDesiredAccess,dwCreationDisposition,dwShareMode,dwFlagsAndAttributes ; HANDLE hFile = NULL; @@ -200,8 +186,7 @@ voidpf ZCALLBACK win32_open_file_func (voidpf opaque,const char* filename,int mo } -uLong ZCALLBACK win32_read_file_func (voidpf opaque, voidpf stream, void* buf,uLong size) -{ +uLong ZCALLBACK win32_read_file_func(voidpf opaque, voidpf stream, void* buf,uLong size) { uLong ret=0; HANDLE hFile = NULL; if (stream!=NULL) @@ -222,8 +207,7 @@ uLong ZCALLBACK win32_read_file_func (voidpf opaque, voidpf stream, void* buf,uL } -uLong ZCALLBACK win32_write_file_func (voidpf opaque,voidpf stream,const void* buf,uLong size) -{ +uLong ZCALLBACK win32_write_file_func(voidpf opaque, voidpf stream, const void* buf, uLong size) { uLong ret=0; HANDLE hFile = NULL; if (stream!=NULL) @@ -243,8 +227,7 @@ uLong ZCALLBACK win32_write_file_func (voidpf opaque,voidpf stream,const void* b return ret; } -static BOOL MySetFilePointerEx(HANDLE hFile, LARGE_INTEGER pos, LARGE_INTEGER *newPos, DWORD dwMoveMethod) -{ +static BOOL MySetFilePointerEx(HANDLE hFile, LARGE_INTEGER pos, LARGE_INTEGER *newPos, DWORD dwMoveMethod) { #ifdef IOWIN32_USING_WINRT_API return SetFilePointerEx(hFile, pos, newPos, dwMoveMethod); #else @@ -263,8 +246,7 @@ static BOOL MySetFilePointerEx(HANDLE hFile, LARGE_INTEGER pos, LARGE_INTEGER *n #endif } -long ZCALLBACK win32_tell_file_func (voidpf opaque,voidpf stream) -{ +long ZCALLBACK win32_tell_file_func(voidpf opaque, voidpf stream) { long ret=-1; HANDLE hFile = NULL; if (stream!=NULL) @@ -286,8 +268,7 @@ long ZCALLBACK win32_tell_file_func (voidpf opaque,voidpf stream) return ret; } -ZPOS64_T ZCALLBACK win32_tell64_file_func (voidpf opaque, voidpf stream) -{ +ZPOS64_T ZCALLBACK win32_tell64_file_func(voidpf opaque, voidpf stream) { ZPOS64_T ret= (ZPOS64_T)-1; HANDLE hFile = NULL; if (stream!=NULL) @@ -311,8 +292,7 @@ ZPOS64_T ZCALLBACK win32_tell64_file_func (voidpf opaque, voidpf stream) } -long ZCALLBACK win32_seek_file_func (voidpf opaque,voidpf stream,uLong offset,int origin) -{ +long ZCALLBACK win32_seek_file_func(voidpf opaque, voidpf stream, uLong offset, int origin) { DWORD dwMoveMethod=0xFFFFFFFF; HANDLE hFile = NULL; @@ -349,8 +329,7 @@ long ZCALLBACK win32_seek_file_func (voidpf opaque,voidpf stream,uLong offset,in return ret; } -long ZCALLBACK win32_seek64_file_func (voidpf opaque, voidpf stream,ZPOS64_T offset,int origin) -{ +long ZCALLBACK win32_seek64_file_func(voidpf opaque, voidpf stream, ZPOS64_T offset, int origin) { DWORD dwMoveMethod=0xFFFFFFFF; HANDLE hFile = NULL; long ret=-1; @@ -388,8 +367,7 @@ long ZCALLBACK win32_seek64_file_func (voidpf opaque, voidpf stream,ZPOS64_T off return ret; } -int ZCALLBACK win32_close_file_func (voidpf opaque, voidpf stream) -{ +int ZCALLBACK win32_close_file_func(voidpf opaque, voidpf stream) { int ret=-1; if (stream!=NULL) @@ -406,8 +384,7 @@ int ZCALLBACK win32_close_file_func (voidpf opaque, voidpf stream) return ret; } -int ZCALLBACK win32_error_file_func (voidpf opaque,voidpf stream) -{ +int ZCALLBACK win32_error_file_func(voidpf opaque, voidpf stream) { int ret=-1; if (stream!=NULL) { @@ -416,8 +393,7 @@ int ZCALLBACK win32_error_file_func (voidpf opaque,voidpf stream) return ret; } -void fill_win32_filefunc (zlib_filefunc_def* pzlib_filefunc_def) -{ +void fill_win32_filefunc(zlib_filefunc_def* pzlib_filefunc_def) { pzlib_filefunc_def->zopen_file = win32_open_file_func; pzlib_filefunc_def->zread_file = win32_read_file_func; pzlib_filefunc_def->zwrite_file = win32_write_file_func; @@ -428,8 +404,7 @@ void fill_win32_filefunc (zlib_filefunc_def* pzlib_filefunc_def) pzlib_filefunc_def->opaque = NULL; } -void fill_win32_filefunc64(zlib_filefunc64_def* pzlib_filefunc_def) -{ +void fill_win32_filefunc64(zlib_filefunc64_def* pzlib_filefunc_def) { pzlib_filefunc_def->zopen64_file = win32_open64_file_func; pzlib_filefunc_def->zread_file = win32_read_file_func; pzlib_filefunc_def->zwrite_file = win32_write_file_func; @@ -441,8 +416,7 @@ void fill_win32_filefunc64(zlib_filefunc64_def* pzlib_filefunc_def) } -void fill_win32_filefunc64A(zlib_filefunc64_def* pzlib_filefunc_def) -{ +void fill_win32_filefunc64A(zlib_filefunc64_def* pzlib_filefunc_def) { pzlib_filefunc_def->zopen64_file = win32_open64_file_funcA; pzlib_filefunc_def->zread_file = win32_read_file_func; pzlib_filefunc_def->zwrite_file = win32_write_file_func; @@ -454,8 +428,7 @@ void fill_win32_filefunc64A(zlib_filefunc64_def* pzlib_filefunc_def) } -void fill_win32_filefunc64W(zlib_filefunc64_def* pzlib_filefunc_def) -{ +void fill_win32_filefunc64W(zlib_filefunc64_def* pzlib_filefunc_def) { pzlib_filefunc_def->zopen64_file = win32_open64_file_funcW; pzlib_filefunc_def->zread_file = win32_read_file_func; pzlib_filefunc_def->zwrite_file = win32_write_file_func; diff --git a/src/PureLib/pure/zlib/contrib/minizip/iowin32.h b/src/PureLib/pure/zlib/contrib/minizip/iowin32.h index 0ca0969a7d..a23a65d433 100644 --- a/src/PureLib/pure/zlib/contrib/minizip/iowin32.h +++ b/src/PureLib/pure/zlib/contrib/minizip/iowin32.h @@ -18,10 +18,10 @@ extern "C" { #endif -void fill_win32_filefunc OF((zlib_filefunc_def* pzlib_filefunc_def)); -void fill_win32_filefunc64 OF((zlib_filefunc64_def* pzlib_filefunc_def)); -void fill_win32_filefunc64A OF((zlib_filefunc64_def* pzlib_filefunc_def)); -void fill_win32_filefunc64W OF((zlib_filefunc64_def* pzlib_filefunc_def)); +void fill_win32_filefunc(zlib_filefunc_def* pzlib_filefunc_def); +void fill_win32_filefunc64(zlib_filefunc64_def* pzlib_filefunc_def); +void fill_win32_filefunc64A(zlib_filefunc64_def* pzlib_filefunc_def); +void fill_win32_filefunc64W(zlib_filefunc64_def* pzlib_filefunc_def); #ifdef __cplusplus } diff --git a/src/PureLib/pure/zlib/contrib/minizip/miniunz.c b/src/PureLib/pure/zlib/contrib/minizip/miniunz.c index 0dc9b50815..d627c4226b 100644 --- a/src/PureLib/pure/zlib/contrib/minizip/miniunz.c +++ b/src/PureLib/pure/zlib/contrib/minizip/miniunz.c @@ -27,7 +27,7 @@ #endif #endif -#ifdef __APPLE__ +#if defined(__APPLE__) || defined(__HAIKU__) || defined(MINIZIP_FOPEN_NO_64) // In darwin and perhaps other BSD variants off_t is a 64 bit value, hence no need for specific 64 bit functions #define FOPEN_FUNC(filename, mode) fopen(filename, mode) #define FTELLO_FUNC(stream) ftello(stream) @@ -79,13 +79,9 @@ /* change_file_date : change the date/time of a file filename : the filename of the file where date/time must be modified - dosdate : the new date at the MSDos format (4 bytes) + dosdate : the new date at the MSDOS format (4 bytes) tmu_date : the SAME new date at the tm_unz format */ -static void change_file_date(filename,dosdate,tmu_date) - const char *filename; - uLong dosdate; - tm_unz tmu_date; -{ +static void change_file_date(const char *filename, uLong dosdate, tm_unz tmu_date) { #ifdef _WIN32 HANDLE hFile; FILETIME ftm,ftLocal,ftCreate,ftLastAcc,ftLastWrite; @@ -115,6 +111,10 @@ static void change_file_date(filename,dosdate,tmu_date) ut.actime=ut.modtime=mktime(&newdate); utime(filename,&ut); +#else + (void)filename; + (void)dosdate; + (void)tmu_date; #endif #endif } @@ -123,9 +123,7 @@ static void change_file_date(filename,dosdate,tmu_date) /* mymkdir and change_file_date are not 100 % portable As I don't know well Unix, I wait feedback for the unix portion */ -static int mymkdir(dirname) - const char* dirname; -{ +static int mymkdir(const char* dirname) { int ret=0; #ifdef _WIN32 ret = _mkdir(dirname); @@ -133,13 +131,13 @@ static int mymkdir(dirname) ret = mkdir (dirname,0775); #elif __APPLE__ ret = mkdir (dirname,0775); +#else + (void)dirname; #endif return ret; } -static int makedir (newdir) - const char *newdir; -{ +static int makedir(const char *newdir) { char *buffer ; char *p; size_t len = strlen(newdir); @@ -187,14 +185,12 @@ static int makedir (newdir) return 1; } -static void do_banner() -{ - printf("MiniUnz 1.01b, demo of zLib + Unz package written by Gilles Vollant\n"); +static void do_banner(void) { + printf("MiniUnz 1.1, demo of zLib + Unz package written by Gilles Vollant\n"); printf("more info at http://www.winimage.com/zLibDll/unzip.html\n\n"); } -static void do_help() -{ +static void do_help(void) { printf("Usage : miniunz [-e] [-x] [-v] [-l] [-o] [-p password] file.zip [file_to_extr.] [-d extractdir]\n\n" \ " -e Extract without pathname (junk paths)\n" \ " -x Extract with pathname\n" \ @@ -202,11 +198,10 @@ static void do_help() " -l list files\n" \ " -d directory to extract into\n" \ " -o overwrite files without prompting\n" \ - " -p extract crypted file using password\n\n"); + " -p extract encrypted file using password\n\n"); } -static void Display64BitsSize(ZPOS64_T n, int size_char) -{ +static void Display64BitsSize(ZPOS64_T n, int size_char) { /* to avoid compatibility problem , we do here the conversion */ char number[21]; int offset=19; @@ -233,9 +228,7 @@ static void Display64BitsSize(ZPOS64_T n, int size_char) printf("%s",&number[pos_string]); } -static int do_list(uf) - unzFile uf; -{ +static int do_list(unzFile uf) { uLong i; unz_global_info64 gi; int err; @@ -250,7 +243,7 @@ static int do_list(uf) char filename_inzip[256]; unz_file_info64 file_info; uLong ratio=0; - const char *string_method; + const char *string_method = ""; char charCrypt=' '; err = unzGetCurrentFileInfo64(uf,&file_info,filename_inzip,sizeof(filename_inzip),NULL,0,NULL,0); if (err!=UNZ_OK) @@ -261,7 +254,7 @@ static int do_list(uf) if (file_info.uncompressed_size>0) ratio = (uLong)((file_info.compressed_size*100)/file_info.uncompressed_size); - /* display a '*' if the file is crypted */ + /* display a '*' if the file is encrypted */ if ((file_info.flag & 1) != 0) charCrypt='*'; @@ -311,12 +304,7 @@ static int do_list(uf) } -static int do_extract_currentfile(uf,popt_extract_without_path,popt_overwrite,password) - unzFile uf; - const int* popt_extract_without_path; - int* popt_overwrite; - const char* password; -{ +static int do_extract_currentfile(unzFile uf, const int* popt_extract_without_path, int* popt_overwrite, const char* password) { char filename_inzip[256]; char* filename_withoutpath; char* p; @@ -368,6 +356,20 @@ static int do_extract_currentfile(uf,popt_extract_without_path,popt_overwrite,pa else write_filename = filename_withoutpath; + if (write_filename[0]!='\0') + { + const char* relative_check = write_filename; + while (relative_check[1]!='\0') + { + if (relative_check[0]=='.' && relative_check[1]=='.') + write_filename = relative_check; + relative_check++; + } + } + + while (write_filename[0]=='/' || write_filename[0]=='.') + write_filename++; + err = unzOpenCurrentFilePassword(uf,password); if (err!=UNZ_OK) { @@ -473,12 +475,7 @@ static int do_extract_currentfile(uf,popt_extract_without_path,popt_overwrite,pa } -static int do_extract(uf,opt_extract_without_path,opt_overwrite,password) - unzFile uf; - int opt_extract_without_path; - int opt_overwrite; - const char* password; -{ +static int do_extract(unzFile uf, int opt_extract_without_path, int opt_overwrite, const char* password) { uLong i; unz_global_info64 gi; int err; @@ -508,13 +505,7 @@ static int do_extract(uf,opt_extract_without_path,opt_overwrite,password) return 0; } -static int do_extract_onefile(uf,filename,opt_extract_without_path,opt_overwrite,password) - unzFile uf; - const char* filename; - int opt_extract_without_path; - int opt_overwrite; - const char* password; -{ +static int do_extract_onefile(unzFile uf, const char* filename, int opt_extract_without_path, int opt_overwrite, const char* password) { if (unzLocateFile(uf,filename,CASESENSITIVITY)!=UNZ_OK) { printf("file %s not found in the zipfile\n",filename); @@ -530,10 +521,7 @@ static int do_extract_onefile(uf,filename,opt_extract_without_path,opt_overwrite } -int main(argc,argv) - int argc; - char *argv[]; -{ +int main(int argc, char *argv[]) { const char *zipfilename=NULL; const char *filename_to_extract=NULL; const char *password=NULL; @@ -606,7 +594,7 @@ int main(argc,argv) # endif strncpy(filename_try, zipfilename,MAXFILENAME-1); - /* strncpy doesnt append the trailing NULL, of the string is too long. */ + /* strncpy doesn't append the trailing NULL, of the string is too long. */ filename_try[ MAXFILENAME ] = '\0'; # ifdef USEWIN32IOAPI diff --git a/src/PureLib/pure/zlib/contrib/minizip/minizip.c b/src/PureLib/pure/zlib/contrib/minizip/minizip.c index e8561b15f9..26ee8d029e 100644 --- a/src/PureLib/pure/zlib/contrib/minizip/minizip.c +++ b/src/PureLib/pure/zlib/contrib/minizip/minizip.c @@ -28,7 +28,7 @@ #endif #endif -#ifdef __APPLE__ +#if defined(__APPLE__) || defined(__HAIKU__) || defined(MINIZIP_FOPEN_NO_64) // In darwin and perhaps other BSD variants off_t is a 64 bit value, hence no need for specific 64 bit functions #define FOPEN_FUNC(filename, mode) fopen(filename, mode) #define FTELLO_FUNC(stream) ftello(stream) @@ -71,11 +71,9 @@ #define MAXFILENAME (256) #ifdef _WIN32 -static int filetime(f, tmzip, dt) - const char *f; /* name of file to get info on */ - tm_zip *tmzip; /* return value: access, modific. and creation times */ - uLong *dt; /* dostime */ -{ +/* f: name of file to get info on, tmzip: return value: access, + modification and creation times, dt: dostime */ +static int filetime(const char *f, tm_zip *tmzip, uLong *dt) { int ret = 0; { FILETIME ftLocal; @@ -95,11 +93,9 @@ static int filetime(f, tmzip, dt) } #else #if defined(unix) || defined(__APPLE__) -static int filetime(f, tmzip, dt) - const char *f; /* name of file to get info on */ - tm_zip *tmzip; /* return value: access, modific. and creation times */ - uLong *dt; /* dostime */ -{ +/* f: name of file to get info on, tmzip: return value: access, + modification and creation times, dt: dostime */ +static int filetime(const char *f, tm_zip *tmzip, uLong *dt) { (void)dt; int ret=0; struct stat s; /* results of stat() */ @@ -114,7 +110,7 @@ static int filetime(f, tmzip, dt) len = MAXFILENAME; strncpy(name, f,MAXFILENAME-1); - /* strncpy doesnt append the trailing NULL, of the string is too long. */ + /* strncpy doesn't append the trailing NULL, of the string is too long. */ name[ MAXFILENAME ] = '\0'; if (name[len - 1] == '/') @@ -138,11 +134,12 @@ static int filetime(f, tmzip, dt) return ret; } #else -uLong filetime(f, tmzip, dt) - const char *f; /* name of file to get info on */ - tm_zip *tmzip; /* return value: access, modific. and creation times */ - uLong *dt; /* dostime */ -{ +/* f: name of file to get info on, tmzip: return value: access, + modification and creation times, dt: dostime */ +static int filetime(const char *f, tm_zip *tmzip, uLong *dt) { + (void)f; + (void)tmzip; + (void)dt; return 0; } #endif @@ -151,9 +148,7 @@ uLong filetime(f, tmzip, dt) -static int check_exist_file(filename) - const char* filename; -{ +static int check_exist_file(const char* filename) { FILE* ftestexist; int ret = 1; ftestexist = FOPEN_FUNC(filename,"rb"); @@ -164,14 +159,12 @@ static int check_exist_file(filename) return ret; } -static void do_banner() -{ +static void do_banner(void) { printf("MiniZip 1.1, demo of zLib + MiniZip64 package, written by Gilles Vollant\n"); printf("more info on MiniZip at http://www.winimage.com/zLibDll/minizip.html\n\n"); } -static void do_help() -{ +static void do_help(void) { printf("Usage : minizip [-o] [-a] [-0 to -9] [-p password] [-j] file.zip [files_to_add]\n\n" \ " -o Overwrite existing file.zip\n" \ " -a Append to existing file.zip\n" \ @@ -183,8 +176,7 @@ static void do_help() /* calculate the CRC32 of a file, because to encrypt a file, we need known the CRC32 of the file before */ -static int getFileCrc(const char* filenameinzip,void*buf,unsigned long size_buf,unsigned long* result_crc) -{ +static int getFileCrc(const char* filenameinzip, void* buf, unsigned long size_buf, unsigned long* result_crc) { unsigned long calculate_crc=0; int err=ZIP_OK; FILE * fin = FOPEN_FUNC(filenameinzip,"rb"); @@ -222,8 +214,7 @@ static int getFileCrc(const char* filenameinzip,void*buf,unsigned long size_buf, return err; } -static int isLargeFile(const char* filename) -{ +static int isLargeFile(const char* filename) { int largeFile = 0; ZPOS64_T pos = 0; FILE* pFile = FOPEN_FUNC(filename, "rb"); @@ -233,7 +224,7 @@ static int isLargeFile(const char* filename) FSEEKO_FUNC(pFile, 0, SEEK_END); pos = (ZPOS64_T)FTELLO_FUNC(pFile); - printf("File : %s is %lld bytes\n", filename, pos); + printf("File : %s is %llu bytes\n", filename, pos); if(pos >= 0xffffffff) largeFile = 1; @@ -244,10 +235,7 @@ static int isLargeFile(const char* filename) return largeFile; } -int main(argc,argv) - int argc; - char *argv[]; -{ +int main(int argc, char *argv[]) { int i; int opt_overwrite=0; int opt_compress_level=Z_DEFAULT_COMPRESSION; @@ -323,7 +311,7 @@ int main(argc,argv) zipok = 1 ; strncpy(filename_try, argv[zipfilenamearg],MAXFILENAME-1); - /* strncpy doesnt append the trailing NULL, of the string is too long. */ + /* strncpy doesn't append the trailing NULL, of the string is too long. */ filename_try[ MAXFILENAME ] = '\0'; len=(int)strlen(filename_try); @@ -393,10 +381,10 @@ int main(argc,argv) ((argv[i][1]=='o') || (argv[i][1]=='O') || (argv[i][1]=='a') || (argv[i][1]=='A') || (argv[i][1]=='p') || (argv[i][1]=='P') || - ((argv[i][1]>='0') || (argv[i][1]<='9'))) && + ((argv[i][1]>='0') && (argv[i][1]<='9'))) && (strlen(argv[i]) == 2))) { - FILE * fin; + FILE * fin = NULL; size_t size_read; const char* filenameinzip = argv[i]; const char *savefilenameinzip; diff --git a/src/PureLib/pure/zlib/contrib/minizip/mztools.c b/src/PureLib/pure/zlib/contrib/minizip/mztools.c index 96891c2e0b..c8d2375615 100644 --- a/src/PureLib/pure/zlib/contrib/minizip/mztools.c +++ b/src/PureLib/pure/zlib/contrib/minizip/mztools.c @@ -27,13 +27,7 @@ WRITE_16((unsigned char*)(buff) + 2, (n) >> 16); \ } while(0) -extern int ZEXPORT unzRepair(file, fileOut, fileOutTmp, nRecovered, bytesRecovered) -const char* file; -const char* fileOut; -const char* fileOutTmp; -uLong* nRecovered; -uLong* bytesRecovered; -{ +extern int ZEXPORT unzRepair(const char* file, const char* fileOut, const char* fileOutTmp, uLong* nRecovered, uLong* bytesRecovered) { int err = Z_OK; FILE* fpZip = fopen(file, "rb"); FILE* fpOut = fopen(fileOut, "wb"); diff --git a/src/PureLib/pure/zlib/contrib/minizip/unzip.c b/src/PureLib/pure/zlib/contrib/minizip/unzip.c index 3036b470b7..ea05b7d62a 100644 --- a/src/PureLib/pure/zlib/contrib/minizip/unzip.c +++ b/src/PureLib/pure/zlib/contrib/minizip/unzip.c @@ -49,12 +49,12 @@ Copyright (C) 2007-2008 Even Rouault - Oct-2009 - Mathias Svensson - Removed cpl_* from symbol names (Even Rouault added them but since this is now moved to a new project (minizip64) I renamed them again). + Oct-2009 - Mathias Svensson - Removed cpl_* from symbol names (Even Rouault added them but since this is now moved to a new project (minizip64) I renamed them again). Oct-2009 - Mathias Svensson - Fixed problem if uncompressed size was > 4G and compressed size was <4G should only read the compressed/uncompressed size from the Zip64 format if the size from normal header was 0xFFFFFFFF - Oct-2009 - Mathias Svensson - Applied some bug fixes from paches recived from Gilles Vollant - Oct-2009 - Mathias Svensson - Applied support to unzip files with compression mathod BZIP2 (bzip2 lib is required) + Oct-2009 - Mathias Svensson - Applied some bug fixes from patches received from Gilles Vollant + Oct-2009 - Mathias Svensson - Applied support to unzip files with compression method BZIP2 (bzip2 lib is required) Patch created by Daniel Borca Jan-2010 - back to unzip and minizip 1.0 name scheme, with compatibility layer @@ -77,8 +77,6 @@ #ifdef STDC # include -# include -# include #endif #ifdef NO_ERRNO_H extern int errno; @@ -111,9 +109,6 @@ #ifndef ALLOC # define ALLOC(size) (malloc(size)) #endif -#ifndef TRYFREE -# define TRYFREE(p) { free(p);} -#endif #define SIZECENTRALDIRITEM (0x2e) #define SIZEZIPLOCALHEADER (0x1e) @@ -122,7 +117,7 @@ const char unz_copyright[] = " unzip 1.01 Copyright 1998-2004 Gilles Vollant - http://www.winimage.com/zLibDll"; -/* unz_file_info_interntal contain internal info about a file in zipfile*/ +/* unz_file_info64_internal contain internal info about a file in zipfile*/ typedef struct unz_file_info64_internal_s { ZPOS64_T offset_curfile;/* relative offset of local header 8 bytes */ @@ -153,7 +148,7 @@ typedef struct ZPOS64_T rest_read_compressed; /* number of byte to be decompressed */ ZPOS64_T rest_read_uncompressed;/*number of byte to be obtained after decomp*/ zlib_filefunc64_32_def z_filefunc; - voidpf filestream; /* io structore of the zipfile */ + voidpf filestream; /* io structure of the zipfile */ uLong compression_method; /* compression method (0==store) */ ZPOS64_T byte_before_the_zipfile;/* byte before the zipfile, (>0 for sfx)*/ int raw; @@ -166,7 +161,7 @@ typedef struct { zlib_filefunc64_32_def z_filefunc; int is64bitOpenFunction; - voidpf filestream; /* io structore of the zipfile */ + voidpf filestream; /* io structure of the zipfile */ unz_global_info64 gi; /* public global information */ ZPOS64_T byte_before_the_zipfile;/* byte before the zipfile, (>0 for sfx)*/ ZPOS64_T num_file; /* number of the current file in the zipfile*/ @@ -197,29 +192,24 @@ typedef struct #include "crypt.h" #endif + /* =========================================================================== - Read a byte from a gz_stream; update next_in and avail_in. Return EOF - for end of file. - IN assertion: the stream s has been successfully opened for reading. + Reads a long in LSB order from the given gz_stream. Sets */ - -local int unz64local_getByte OF(( - const zlib_filefunc64_32_def* pzlib_filefunc_def, - voidpf filestream, - int *pi)); - -local int unz64local_getByte(const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream, int *pi) -{ - unsigned char c; - int err = (int)ZREAD64(*pzlib_filefunc_def,filestream,&c,1); - if (err==1) +local int unz64local_getShort(const zlib_filefunc64_32_def* pzlib_filefunc_def, + voidpf filestream, + uLong *pX) { + unsigned char c[2]; + int err = (int)ZREAD64(*pzlib_filefunc_def,filestream,c,2); + if (err==2) { - *pi = (int)c; + *pX = c[0] | ((uLong)c[1] << 8); return UNZ_OK; } else { + *pX = 0; if (ZERROR64(*pzlib_filefunc_def,filestream)) return UNZ_ERRNO; else @@ -227,127 +217,50 @@ local int unz64local_getByte(const zlib_filefunc64_32_def* pzlib_filefunc_def, v } } - -/* =========================================================================== - Reads a long in LSB order from the given gz_stream. Sets -*/ -local int unz64local_getShort OF(( - const zlib_filefunc64_32_def* pzlib_filefunc_def, - voidpf filestream, - uLong *pX)); - -local int unz64local_getShort (const zlib_filefunc64_32_def* pzlib_filefunc_def, +local int unz64local_getLong(const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream, - uLong *pX) -{ - uLong x ; - int i = 0; - int err; - - err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); - x = (uLong)i; - - if (err==UNZ_OK) - err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); - x |= ((uLong)i)<<8; - - if (err==UNZ_OK) - *pX = x; - else - *pX = 0; - return err; -} - -local int unz64local_getLong OF(( - const zlib_filefunc64_32_def* pzlib_filefunc_def, - voidpf filestream, - uLong *pX)); - -local int unz64local_getLong (const zlib_filefunc64_32_def* pzlib_filefunc_def, - voidpf filestream, - uLong *pX) -{ - uLong x ; - int i = 0; - int err; - - err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); - x = (uLong)i; - - if (err==UNZ_OK) - err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); - x |= ((uLong)i)<<8; - - if (err==UNZ_OK) - err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); - x |= ((uLong)i)<<16; - - if (err==UNZ_OK) - err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); - x += ((uLong)i)<<24; - - if (err==UNZ_OK) - *pX = x; + uLong *pX) { + unsigned char c[4]; + int err = (int)ZREAD64(*pzlib_filefunc_def,filestream,c,4); + if (err==4) + { + *pX = c[0] | ((uLong)c[1] << 8) | ((uLong)c[2] << 16) | ((uLong)c[3] << 24); + return UNZ_OK; + } else + { *pX = 0; - return err; + if (ZERROR64(*pzlib_filefunc_def,filestream)) + return UNZ_ERRNO; + else + return UNZ_EOF; + } } -local int unz64local_getLong64 OF(( - const zlib_filefunc64_32_def* pzlib_filefunc_def, - voidpf filestream, - ZPOS64_T *pX)); - - -local int unz64local_getLong64 (const zlib_filefunc64_32_def* pzlib_filefunc_def, - voidpf filestream, - ZPOS64_T *pX) -{ - ZPOS64_T x ; - int i = 0; - int err; - - err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); - x = (ZPOS64_T)i; - - if (err==UNZ_OK) - err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); - x |= ((ZPOS64_T)i)<<8; - - if (err==UNZ_OK) - err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); - x |= ((ZPOS64_T)i)<<16; - - if (err==UNZ_OK) - err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); - x |= ((ZPOS64_T)i)<<24; - - if (err==UNZ_OK) - err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); - x |= ((ZPOS64_T)i)<<32; - - if (err==UNZ_OK) - err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); - x |= ((ZPOS64_T)i)<<40; - if (err==UNZ_OK) - err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); - x |= ((ZPOS64_T)i)<<48; - - if (err==UNZ_OK) - err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); - x |= ((ZPOS64_T)i)<<56; - - if (err==UNZ_OK) - *pX = x; +local int unz64local_getLong64(const zlib_filefunc64_32_def* pzlib_filefunc_def, + voidpf filestream, + ZPOS64_T *pX) { + unsigned char c[8]; + int err = (int)ZREAD64(*pzlib_filefunc_def,filestream,c,8); + if (err==8) + { + *pX = c[0] | ((ZPOS64_T)c[1] << 8) | ((ZPOS64_T)c[2] << 16) | ((ZPOS64_T)c[3] << 24) + | ((ZPOS64_T)c[4] << 32) | ((ZPOS64_T)c[5] << 40) | ((ZPOS64_T)c[6] << 48) | ((ZPOS64_T)c[7] << 56); + return UNZ_OK; + } else + { *pX = 0; - return err; + if (ZERROR64(*pzlib_filefunc_def,filestream)) + return UNZ_ERRNO; + else + return UNZ_EOF; + } } /* My own strcmpi / strcasecmp */ -local int strcmpcasenosensitive_internal (const char* fileName1, const char* fileName2) -{ +local int strcmpcasenosensitive_internal(const char* fileName1, const char* fileName2) { for (;;) { char c1=*(fileName1++); @@ -379,19 +292,17 @@ local int strcmpcasenosensitive_internal (const char* fileName1, const char* fil #endif /* - Compare two filename (fileName1,fileName2). - If iCaseSenisivity = 1, comparision is case sensitivity (like strcmp) - If iCaseSenisivity = 2, comparision is not case sensitivity (like strcmpi + Compare two filenames (fileName1,fileName2). + If iCaseSensitivity = 1, comparison is case sensitive (like strcmp) + If iCaseSensitivity = 2, comparison is not case sensitive (like strcmpi or strcasecmp) - If iCaseSenisivity = 0, case sensitivity is defaut of your operating system + If iCaseSensitivity = 0, case sensitivity is default of your operating system (like 1 on Unix, 2 on Windows) */ extern int ZEXPORT unzStringFileNameCompare (const char* fileName1, - const char* fileName2, - int iCaseSensitivity) - -{ + const char* fileName2, + int iCaseSensitivity) { if (iCaseSensitivity==0) iCaseSensitivity=CASESENSITIVITYDEFAULTVALUE; @@ -405,21 +316,23 @@ extern int ZEXPORT unzStringFileNameCompare (const char* fileName1, #define BUFREADCOMMENT (0x400) #endif +#ifndef CENTRALDIRINVALID +#define CENTRALDIRINVALID ((ZPOS64_T)(-1)) +#endif + /* Locate the Central directory of a zipfile (at the end, just before the global comment) */ -local ZPOS64_T unz64local_SearchCentralDir OF((const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream)); -local ZPOS64_T unz64local_SearchCentralDir(const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream) -{ +local ZPOS64_T unz64local_SearchCentralDir(const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream) { unsigned char* buf; ZPOS64_T uSizeFile; ZPOS64_T uBackRead; ZPOS64_T uMaxBack=0xffff; /* maximum size of global comment */ - ZPOS64_T uPosFound=0; + ZPOS64_T uPosFound=CENTRALDIRINVALID; if (ZSEEK64(*pzlib_filefunc_def,filestream,0,ZLIB_FILEFUNC_SEEK_END) != 0) - return 0; + return CENTRALDIRINVALID; uSizeFile = ZTELL64(*pzlib_filefunc_def,filestream); @@ -429,7 +342,7 @@ local ZPOS64_T unz64local_SearchCentralDir(const zlib_filefunc64_32_def* pzlib_f buf = (unsigned char*)ALLOC(BUFREADCOMMENT+4); if (buf==NULL) - return 0; + return CENTRALDIRINVALID; uBackRead = 4; while (uBackReadz_filefunc, s->filestream); - TRYFREE(s); + free(s); return UNZ_OK; } @@ -825,8 +727,7 @@ extern int ZEXPORT unzClose (unzFile file) Write info about the ZipFile in the *pglobal_info structure. No preparation of the structure is needed return UNZ_OK if there is no problem. */ -extern int ZEXPORT unzGetGlobalInfo64 (unzFile file, unz_global_info64* pglobal_info) -{ +extern int ZEXPORT unzGetGlobalInfo64(unzFile file, unz_global_info64* pglobal_info) { unz64_s* s; if (file==NULL) return UNZ_PARAMERROR; @@ -835,8 +736,7 @@ extern int ZEXPORT unzGetGlobalInfo64 (unzFile file, unz_global_info64* pglobal_ return UNZ_OK; } -extern int ZEXPORT unzGetGlobalInfo (unzFile file, unz_global_info* pglobal_info32) -{ +extern int ZEXPORT unzGetGlobalInfo(unzFile file, unz_global_info* pglobal_info32) { unz64_s* s; if (file==NULL) return UNZ_PARAMERROR; @@ -847,10 +747,9 @@ extern int ZEXPORT unzGetGlobalInfo (unzFile file, unz_global_info* pglobal_info return UNZ_OK; } /* - Translate date/time from Dos format to tm_unz (readable more easilty) + Translate date/time from Dos format to tm_unz (readable more easily) */ -local void unz64local_DosDateToTmuDate (ZPOS64_T ulDosDate, tm_unz* ptm) -{ +local void unz64local_DosDateToTmuDate(ZPOS64_T ulDosDate, tm_unz* ptm) { ZPOS64_T uDate; uDate = (ZPOS64_T)(ulDosDate>>16); ptm->tm_mday = (int)(uDate&0x1f) ; @@ -865,28 +764,16 @@ local void unz64local_DosDateToTmuDate (ZPOS64_T ulDosDate, tm_unz* ptm) /* Get Info about the current file in the zipfile, with internal only info */ -local int unz64local_GetCurrentFileInfoInternal OF((unzFile file, - unz_file_info64 *pfile_info, - unz_file_info64_internal - *pfile_info_internal, - char *szFileName, - uLong fileNameBufferSize, - void *extraField, - uLong extraFieldBufferSize, - char *szComment, - uLong commentBufferSize)); - -local int unz64local_GetCurrentFileInfoInternal (unzFile file, - unz_file_info64 *pfile_info, - unz_file_info64_internal - *pfile_info_internal, - char *szFileName, - uLong fileNameBufferSize, - void *extraField, - uLong extraFieldBufferSize, - char *szComment, - uLong commentBufferSize) -{ +local int unz64local_GetCurrentFileInfoInternal(unzFile file, + unz_file_info64 *pfile_info, + unz_file_info64_internal + *pfile_info_internal, + char *szFileName, + uLong fileNameBufferSize, + void *extraField, + uLong extraFieldBufferSize, + char *szComment, + uLong commentBufferSize) { unz64_s* s; unz_file_info64 file_info; unz_file_info64_internal file_info_internal; @@ -1038,33 +925,31 @@ local int unz64local_GetCurrentFileInfoInternal (unzFile file, /* ZIP64 extra fields */ if (headerId == 0x0001) { - uLong uL; - - if(file_info.uncompressed_size == MAXU32) - { - if (unz64local_getLong64(&s->z_filefunc, s->filestream,&file_info.uncompressed_size) != UNZ_OK) - err=UNZ_ERRNO; - } - - if(file_info.compressed_size == MAXU32) - { - if (unz64local_getLong64(&s->z_filefunc, s->filestream,&file_info.compressed_size) != UNZ_OK) - err=UNZ_ERRNO; - } - - if(file_info_internal.offset_curfile == MAXU32) - { - /* Relative Header offset */ - if (unz64local_getLong64(&s->z_filefunc, s->filestream,&file_info_internal.offset_curfile) != UNZ_OK) - err=UNZ_ERRNO; - } - - if(file_info.disk_num_start == MAXU32) - { - /* Disk Start Number */ - if (unz64local_getLong(&s->z_filefunc, s->filestream,&uL) != UNZ_OK) - err=UNZ_ERRNO; - } + if(file_info.uncompressed_size == MAXU32) + { + if (unz64local_getLong64(&s->z_filefunc, s->filestream,&file_info.uncompressed_size) != UNZ_OK) + err=UNZ_ERRNO; + } + + if(file_info.compressed_size == MAXU32) + { + if (unz64local_getLong64(&s->z_filefunc, s->filestream,&file_info.compressed_size) != UNZ_OK) + err=UNZ_ERRNO; + } + + if(file_info_internal.offset_curfile == MAXU32) + { + /* Relative Header offset */ + if (unz64local_getLong64(&s->z_filefunc, s->filestream,&file_info_internal.offset_curfile) != UNZ_OK) + err=UNZ_ERRNO; + } + + if(file_info.disk_num_start == 0xffff) + { + /* Disk Start Number */ + if (unz64local_getLong(&s->z_filefunc, s->filestream,&file_info.disk_num_start) != UNZ_OK) + err=UNZ_ERRNO; + } } else @@ -1121,24 +1006,22 @@ local int unz64local_GetCurrentFileInfoInternal (unzFile file, No preparation of the structure is needed return UNZ_OK if there is no problem. */ -extern int ZEXPORT unzGetCurrentFileInfo64 (unzFile file, - unz_file_info64 * pfile_info, - char * szFileName, uLong fileNameBufferSize, - void *extraField, uLong extraFieldBufferSize, - char* szComment, uLong commentBufferSize) -{ +extern int ZEXPORT unzGetCurrentFileInfo64(unzFile file, + unz_file_info64 * pfile_info, + char * szFileName, uLong fileNameBufferSize, + void *extraField, uLong extraFieldBufferSize, + char* szComment, uLong commentBufferSize) { return unz64local_GetCurrentFileInfoInternal(file,pfile_info,NULL, - szFileName,fileNameBufferSize, - extraField,extraFieldBufferSize, - szComment,commentBufferSize); + szFileName,fileNameBufferSize, + extraField,extraFieldBufferSize, + szComment,commentBufferSize); } -extern int ZEXPORT unzGetCurrentFileInfo (unzFile file, - unz_file_info * pfile_info, - char * szFileName, uLong fileNameBufferSize, - void *extraField, uLong extraFieldBufferSize, - char* szComment, uLong commentBufferSize) -{ +extern int ZEXPORT unzGetCurrentFileInfo(unzFile file, + unz_file_info * pfile_info, + char * szFileName, uLong fileNameBufferSize, + void *extraField, uLong extraFieldBufferSize, + char* szComment, uLong commentBufferSize) { int err; unz_file_info64 file_info64; err = unz64local_GetCurrentFileInfoInternal(file,&file_info64,NULL, @@ -1162,7 +1045,7 @@ extern int ZEXPORT unzGetCurrentFileInfo (unzFile file, pfile_info->internal_fa = file_info64.internal_fa; pfile_info->external_fa = file_info64.external_fa; - pfile_info->tmu_date = file_info64.tmu_date, + pfile_info->tmu_date = file_info64.tmu_date; pfile_info->compressed_size = (uLong)file_info64.compressed_size; @@ -1175,8 +1058,7 @@ extern int ZEXPORT unzGetCurrentFileInfo (unzFile file, Set the current file of the zipfile to the first file. return UNZ_OK if there is no problem */ -extern int ZEXPORT unzGoToFirstFile (unzFile file) -{ +extern int ZEXPORT unzGoToFirstFile(unzFile file) { int err=UNZ_OK; unz64_s* s; if (file==NULL) @@ -1196,8 +1078,7 @@ extern int ZEXPORT unzGoToFirstFile (unzFile file) return UNZ_OK if there is no problem return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest. */ -extern int ZEXPORT unzGoToNextFile (unzFile file) -{ +extern int ZEXPORT unzGoToNextFile(unzFile file) { unz64_s* s; int err; @@ -1229,8 +1110,7 @@ extern int ZEXPORT unzGoToNextFile (unzFile file) UNZ_OK if the file is found. It becomes the current file. UNZ_END_OF_LIST_OF_FILE if the file is not found */ -extern int ZEXPORT unzLocateFile (unzFile file, const char *szFileName, int iCaseSensitivity) -{ +extern int ZEXPORT unzLocateFile(unzFile file, const char *szFileName, int iCaseSensitivity) { unz64_s* s; int err; @@ -1305,8 +1185,7 @@ typedef struct unz_file_pos_s } unz_file_pos; */ -extern int ZEXPORT unzGetFilePos64(unzFile file, unz64_file_pos* file_pos) -{ +extern int ZEXPORT unzGetFilePos64(unzFile file, unz64_file_pos* file_pos) { unz64_s* s; if (file==NULL || file_pos==NULL) @@ -1321,10 +1200,7 @@ extern int ZEXPORT unzGetFilePos64(unzFile file, unz64_file_pos* file_pos) return UNZ_OK; } -extern int ZEXPORT unzGetFilePos( - unzFile file, - unz_file_pos* file_pos) -{ +extern int ZEXPORT unzGetFilePos(unzFile file, unz_file_pos* file_pos) { unz64_file_pos file_pos64; int err = unzGetFilePos64(file,&file_pos64); if (err==UNZ_OK) @@ -1335,8 +1211,7 @@ extern int ZEXPORT unzGetFilePos( return err; } -extern int ZEXPORT unzGoToFilePos64(unzFile file, const unz64_file_pos* file_pos) -{ +extern int ZEXPORT unzGoToFilePos64(unzFile file, const unz64_file_pos* file_pos) { unz64_s* s; int err; @@ -1357,10 +1232,7 @@ extern int ZEXPORT unzGoToFilePos64(unzFile file, const unz64_file_pos* file_pos return err; } -extern int ZEXPORT unzGoToFilePos( - unzFile file, - unz_file_pos* file_pos) -{ +extern int ZEXPORT unzGoToFilePos(unzFile file, unz_file_pos* file_pos) { unz64_file_pos file_pos64; if (file_pos == NULL) return UNZ_PARAMERROR; @@ -1382,10 +1254,9 @@ extern int ZEXPORT unzGoToFilePos( store in *piSizeVar the size of extra info in local header (filename and size of extra field data) */ -local int unz64local_CheckCurrentFileCoherencyHeader (unz64_s* s, uInt* piSizeVar, - ZPOS64_T * poffset_local_extrafield, - uInt * psize_local_extrafield) -{ +local int unz64local_CheckCurrentFileCoherencyHeader(unz64_s* s, uInt* piSizeVar, + ZPOS64_T * poffset_local_extrafield, + uInt * psize_local_extrafield) { uLong uMagic,uData,uFlags; uLong size_filename; uLong size_extra_field; @@ -1469,9 +1340,8 @@ local int unz64local_CheckCurrentFileCoherencyHeader (unz64_s* s, uInt* piSizeVa Open for reading data the current file in the zipfile. If there is no error and the file is opened, the return value is UNZ_OK. */ -extern int ZEXPORT unzOpenCurrentFile3 (unzFile file, int* method, - int* level, int raw, const char* password) -{ +extern int ZEXPORT unzOpenCurrentFile3(unzFile file, int* method, + int* level, int raw, const char* password) { int err=UNZ_OK; uInt iSizeVar; unz64_s* s; @@ -1509,7 +1379,7 @@ extern int ZEXPORT unzOpenCurrentFile3 (unzFile file, int* method, if (pfile_in_zip_read_info->read_buffer==NULL) { - TRYFREE(pfile_in_zip_read_info); + free(pfile_in_zip_read_info); return UNZ_INTERNALERROR; } @@ -1566,8 +1436,8 @@ extern int ZEXPORT unzOpenCurrentFile3 (unzFile file, int* method, pfile_in_zip_read_info->stream_initialised=Z_BZIP2ED; else { - TRYFREE(pfile_in_zip_read_info->read_buffer); - TRYFREE(pfile_in_zip_read_info); + free(pfile_in_zip_read_info->read_buffer); + free(pfile_in_zip_read_info); return err; } #else @@ -1587,8 +1457,8 @@ extern int ZEXPORT unzOpenCurrentFile3 (unzFile file, int* method, pfile_in_zip_read_info->stream_initialised=Z_DEFLATED; else { - TRYFREE(pfile_in_zip_read_info->read_buffer); - TRYFREE(pfile_in_zip_read_info); + free(pfile_in_zip_read_info->read_buffer); + free(pfile_in_zip_read_info); return err; } /* windowBits is passed < 0 to tell that there is no zlib header. @@ -1640,25 +1510,21 @@ extern int ZEXPORT unzOpenCurrentFile3 (unzFile file, int* method, return UNZ_OK; } -extern int ZEXPORT unzOpenCurrentFile (unzFile file) -{ +extern int ZEXPORT unzOpenCurrentFile(unzFile file) { return unzOpenCurrentFile3(file, NULL, NULL, 0, NULL); } -extern int ZEXPORT unzOpenCurrentFilePassword (unzFile file, const char* password) -{ +extern int ZEXPORT unzOpenCurrentFilePassword(unzFile file, const char* password) { return unzOpenCurrentFile3(file, NULL, NULL, 0, password); } -extern int ZEXPORT unzOpenCurrentFile2 (unzFile file, int* method, int* level, int raw) -{ +extern int ZEXPORT unzOpenCurrentFile2(unzFile file, int* method, int* level, int raw) { return unzOpenCurrentFile3(file, method, level, raw, NULL); } /** Addition for GDAL : START */ -extern ZPOS64_T ZEXPORT unzGetCurrentFileZStreamPos64( unzFile file) -{ +extern ZPOS64_T ZEXPORT unzGetCurrentFileZStreamPos64(unzFile file) { unz64_s* s; file_in_zip64_read_info_s* pfile_in_zip_read_info; s=(unz64_s*)file; @@ -1678,13 +1544,12 @@ extern ZPOS64_T ZEXPORT unzGetCurrentFileZStreamPos64( unzFile file) buf contain buffer where data must be copied len the size of buf. - return the number of byte copied if somes bytes are copied + return the number of byte copied if some bytes are copied return 0 if the end of file was reached return <0 with error code if there is an error (UNZ_ERRNO for IO error, or zLib error for uncompress error) */ -extern int ZEXPORT unzReadCurrentFile (unzFile file, voidp buf, unsigned len) -{ +extern int ZEXPORT unzReadCurrentFile(unzFile file, voidp buf, unsigned len) { int err=UNZ_OK; uInt iRead = 0; unz64_s* s; @@ -1891,8 +1756,7 @@ extern int ZEXPORT unzReadCurrentFile (unzFile file, voidp buf, unsigned len) /* Give the current position in uncompressed data */ -extern z_off_t ZEXPORT unztell (unzFile file) -{ +extern z_off_t ZEXPORT unztell(unzFile file) { unz64_s* s; file_in_zip64_read_info_s* pfile_in_zip_read_info; if (file==NULL) @@ -1906,8 +1770,7 @@ extern z_off_t ZEXPORT unztell (unzFile file) return (z_off_t)pfile_in_zip_read_info->stream.total_out; } -extern ZPOS64_T ZEXPORT unztell64 (unzFile file) -{ +extern ZPOS64_T ZEXPORT unztell64(unzFile file) { unz64_s* s; file_in_zip64_read_info_s* pfile_in_zip_read_info; @@ -1926,8 +1789,7 @@ extern ZPOS64_T ZEXPORT unztell64 (unzFile file) /* return 1 if the end of file was reached, 0 elsewhere */ -extern int ZEXPORT unzeof (unzFile file) -{ +extern int ZEXPORT unzeof(unzFile file) { unz64_s* s; file_in_zip64_read_info_s* pfile_in_zip_read_info; if (file==NULL) @@ -1958,8 +1820,7 @@ more info in the local-header version than in the central-header) the return value is the number of bytes copied in buf, or (if <0) the error code */ -extern int ZEXPORT unzGetLocalExtrafield (unzFile file, voidp buf, unsigned len) -{ +extern int ZEXPORT unzGetLocalExtrafield(unzFile file, voidp buf, unsigned len) { unz64_s* s; file_in_zip64_read_info_s* pfile_in_zip_read_info; uInt read_now; @@ -2006,8 +1867,7 @@ extern int ZEXPORT unzGetLocalExtrafield (unzFile file, voidp buf, unsigned len) Close the file in zip opened with unzOpenCurrentFile Return UNZ_CRCERROR if all the file was read but the CRC is not good */ -extern int ZEXPORT unzCloseCurrentFile (unzFile file) -{ +extern int ZEXPORT unzCloseCurrentFile(unzFile file) { int err=UNZ_OK; unz64_s* s; @@ -2029,7 +1889,7 @@ extern int ZEXPORT unzCloseCurrentFile (unzFile file) } - TRYFREE(pfile_in_zip_read_info->read_buffer); + free(pfile_in_zip_read_info->read_buffer); pfile_in_zip_read_info->read_buffer = NULL; if (pfile_in_zip_read_info->stream_initialised == Z_DEFLATED) inflateEnd(&pfile_in_zip_read_info->stream); @@ -2040,7 +1900,7 @@ extern int ZEXPORT unzCloseCurrentFile (unzFile file) pfile_in_zip_read_info->stream_initialised = 0; - TRYFREE(pfile_in_zip_read_info); + free(pfile_in_zip_read_info); s->pfile_in_zip_read=NULL; @@ -2053,8 +1913,7 @@ extern int ZEXPORT unzCloseCurrentFile (unzFile file) uSizeBuf is the size of the szComment buffer. return the number of byte copied or an error code <0 */ -extern int ZEXPORT unzGetGlobalComment (unzFile file, char * szComment, uLong uSizeBuf) -{ +extern int ZEXPORT unzGetGlobalComment(unzFile file, char * szComment, uLong uSizeBuf) { unz64_s* s; uLong uReadThis ; if (file==NULL) @@ -2081,8 +1940,7 @@ extern int ZEXPORT unzGetGlobalComment (unzFile file, char * szComment, uLong uS } /* Additions by RX '2004 */ -extern ZPOS64_T ZEXPORT unzGetOffset64(unzFile file) -{ +extern ZPOS64_T ZEXPORT unzGetOffset64(unzFile file) { unz64_s* s; if (file==NULL) @@ -2096,8 +1954,7 @@ extern ZPOS64_T ZEXPORT unzGetOffset64(unzFile file) return s->pos_in_central_dir; } -extern uLong ZEXPORT unzGetOffset (unzFile file) -{ +extern uLong ZEXPORT unzGetOffset(unzFile file) { ZPOS64_T offset64; if (file==NULL) @@ -2106,8 +1963,7 @@ extern uLong ZEXPORT unzGetOffset (unzFile file) return (uLong)offset64; } -extern int ZEXPORT unzSetOffset64(unzFile file, ZPOS64_T pos) -{ +extern int ZEXPORT unzSetOffset64(unzFile file, ZPOS64_T pos) { unz64_s* s; int err; @@ -2124,7 +1980,6 @@ extern int ZEXPORT unzSetOffset64(unzFile file, ZPOS64_T pos) return err; } -extern int ZEXPORT unzSetOffset (unzFile file, uLong pos) -{ +extern int ZEXPORT unzSetOffset (unzFile file, uLong pos) { return unzSetOffset64(file,pos); } diff --git a/src/PureLib/pure/zlib/contrib/minizip/unzip.h b/src/PureLib/pure/zlib/contrib/minizip/unzip.h index 6f95e94d75..5cfc9c6274 100644 --- a/src/PureLib/pure/zlib/contrib/minizip/unzip.h +++ b/src/PureLib/pure/zlib/contrib/minizip/unzip.h @@ -150,21 +150,21 @@ typedef struct unz_file_info_s tm_unz tmu_date; } unz_file_info; -extern int ZEXPORT unzStringFileNameCompare OF ((const char* fileName1, - const char* fileName2, - int iCaseSensitivity)); +extern int ZEXPORT unzStringFileNameCompare(const char* fileName1, + const char* fileName2, + int iCaseSensitivity); /* - Compare two filename (fileName1,fileName2). - If iCaseSenisivity = 1, comparision is case sensitivity (like strcmp) - If iCaseSenisivity = 2, comparision is not case sensitivity (like strcmpi + Compare two filenames (fileName1,fileName2). + If iCaseSensitivity = 1, comparison is case sensitive (like strcmp) + If iCaseSensitivity = 2, comparison is not case sensitive (like strcmpi or strcasecmp) - If iCaseSenisivity = 0, case sensitivity is defaut of your operating system + If iCaseSensitivity = 0, case sensitivity is default of your operating system (like 1 on Unix, 2 on Windows) */ -extern unzFile ZEXPORT unzOpen OF((const char *path)); -extern unzFile ZEXPORT unzOpen64 OF((const void *path)); +extern unzFile ZEXPORT unzOpen(const char *path); +extern unzFile ZEXPORT unzOpen64(const void *path); /* Open a Zip file. path contain the full pathname (by example, on a Windows XP computer "c:\\zlib\\zlib113.zip" or on an Unix computer @@ -181,41 +181,41 @@ extern unzFile ZEXPORT unzOpen64 OF((const void *path)); */ -extern unzFile ZEXPORT unzOpen2 OF((const char *path, - zlib_filefunc_def* pzlib_filefunc_def)); +extern unzFile ZEXPORT unzOpen2(const char *path, + zlib_filefunc_def* pzlib_filefunc_def); /* Open a Zip file, like unzOpen, but provide a set of file low level API for read/write the zip file (see ioapi.h) */ -extern unzFile ZEXPORT unzOpen2_64 OF((const void *path, - zlib_filefunc64_def* pzlib_filefunc_def)); +extern unzFile ZEXPORT unzOpen2_64(const void *path, + zlib_filefunc64_def* pzlib_filefunc_def); /* Open a Zip file, like unz64Open, but provide a set of file low level API for read/write the zip file (see ioapi.h) */ -extern int ZEXPORT unzClose OF((unzFile file)); +extern int ZEXPORT unzClose(unzFile file); /* Close a ZipFile opened with unzOpen. If there is files inside the .Zip opened with unzOpenCurrentFile (see later), these files MUST be closed with unzCloseCurrentFile before call unzClose. return UNZ_OK if there is no problem. */ -extern int ZEXPORT unzGetGlobalInfo OF((unzFile file, - unz_global_info *pglobal_info)); +extern int ZEXPORT unzGetGlobalInfo(unzFile file, + unz_global_info *pglobal_info); -extern int ZEXPORT unzGetGlobalInfo64 OF((unzFile file, - unz_global_info64 *pglobal_info)); +extern int ZEXPORT unzGetGlobalInfo64(unzFile file, + unz_global_info64 *pglobal_info); /* Write info about the ZipFile in the *pglobal_info structure. No preparation of the structure is needed return UNZ_OK if there is no problem. */ -extern int ZEXPORT unzGetGlobalComment OF((unzFile file, - char *szComment, - uLong uSizeBuf)); +extern int ZEXPORT unzGetGlobalComment(unzFile file, + char *szComment, + uLong uSizeBuf); /* Get the global comment string of the ZipFile, in the szComment buffer. uSizeBuf is the size of the szComment buffer. @@ -226,22 +226,22 @@ extern int ZEXPORT unzGetGlobalComment OF((unzFile file, /***************************************************************************/ /* Unzip package allow you browse the directory of the zipfile */ -extern int ZEXPORT unzGoToFirstFile OF((unzFile file)); +extern int ZEXPORT unzGoToFirstFile(unzFile file); /* Set the current file of the zipfile to the first file. return UNZ_OK if there is no problem */ -extern int ZEXPORT unzGoToNextFile OF((unzFile file)); +extern int ZEXPORT unzGoToNextFile(unzFile file); /* Set the current file of the zipfile to the next file. return UNZ_OK if there is no problem return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest. */ -extern int ZEXPORT unzLocateFile OF((unzFile file, - const char *szFileName, - int iCaseSensitivity)); +extern int ZEXPORT unzLocateFile(unzFile file, + const char *szFileName, + int iCaseSensitivity); /* Try locate the file szFileName in the zipfile. For the iCaseSensitivity signification, see unzStringFileNameCompare @@ -285,28 +285,28 @@ extern int ZEXPORT unzGoToFilePos64( /* ****************************************** */ -extern int ZEXPORT unzGetCurrentFileInfo64 OF((unzFile file, - unz_file_info64 *pfile_info, - char *szFileName, - uLong fileNameBufferSize, - void *extraField, - uLong extraFieldBufferSize, - char *szComment, - uLong commentBufferSize)); - -extern int ZEXPORT unzGetCurrentFileInfo OF((unzFile file, - unz_file_info *pfile_info, - char *szFileName, - uLong fileNameBufferSize, - void *extraField, - uLong extraFieldBufferSize, - char *szComment, - uLong commentBufferSize)); +extern int ZEXPORT unzGetCurrentFileInfo64(unzFile file, + unz_file_info64 *pfile_info, + char *szFileName, + uLong fileNameBufferSize, + void *extraField, + uLong extraFieldBufferSize, + char *szComment, + uLong commentBufferSize); + +extern int ZEXPORT unzGetCurrentFileInfo(unzFile file, + unz_file_info *pfile_info, + char *szFileName, + uLong fileNameBufferSize, + void *extraField, + uLong extraFieldBufferSize, + char *szComment, + uLong commentBufferSize); /* Get Info about the current file - if pfile_info!=NULL, the *pfile_info structure will contain somes info about + if pfile_info!=NULL, the *pfile_info structure will contain some info about the current file - if szFileName!=NULL, the filemane string will be copied in szFileName + if szFileName!=NULL, the filename string will be copied in szFileName (fileNameBufferSize is the size of the buffer) if extraField!=NULL, the extra field information will be copied in extraField (extraFieldBufferSize is the size of the buffer). @@ -318,7 +318,7 @@ extern int ZEXPORT unzGetCurrentFileInfo OF((unzFile file, /** Addition for GDAL : START */ -extern ZPOS64_T ZEXPORT unzGetCurrentFileZStreamPos64 OF((unzFile file)); +extern ZPOS64_T ZEXPORT unzGetCurrentFileZStreamPos64(unzFile file); /** Addition for GDAL : END */ @@ -328,24 +328,24 @@ extern ZPOS64_T ZEXPORT unzGetCurrentFileZStreamPos64 OF((unzFile file)); from it, and close it (you can close it before reading all the file) */ -extern int ZEXPORT unzOpenCurrentFile OF((unzFile file)); +extern int ZEXPORT unzOpenCurrentFile(unzFile file); /* Open for reading data the current file in the zipfile. If there is no error, the return value is UNZ_OK. */ -extern int ZEXPORT unzOpenCurrentFilePassword OF((unzFile file, - const char* password)); +extern int ZEXPORT unzOpenCurrentFilePassword(unzFile file, + const char* password); /* Open for reading data the current file in the zipfile. password is a crypting password If there is no error, the return value is UNZ_OK. */ -extern int ZEXPORT unzOpenCurrentFile2 OF((unzFile file, - int* method, - int* level, - int raw)); +extern int ZEXPORT unzOpenCurrentFile2(unzFile file, + int* method, + int* level, + int raw); /* Same than unzOpenCurrentFile, but open for read raw the file (not uncompress) if raw==1 @@ -355,11 +355,11 @@ extern int ZEXPORT unzOpenCurrentFile2 OF((unzFile file, but you CANNOT set method parameter as NULL */ -extern int ZEXPORT unzOpenCurrentFile3 OF((unzFile file, - int* method, - int* level, - int raw, - const char* password)); +extern int ZEXPORT unzOpenCurrentFile3(unzFile file, + int* method, + int* level, + int raw, + const char* password); /* Same than unzOpenCurrentFile, but open for read raw the file (not uncompress) if raw==1 @@ -370,41 +370,41 @@ extern int ZEXPORT unzOpenCurrentFile3 OF((unzFile file, */ -extern int ZEXPORT unzCloseCurrentFile OF((unzFile file)); +extern int ZEXPORT unzCloseCurrentFile(unzFile file); /* Close the file in zip opened with unzOpenCurrentFile Return UNZ_CRCERROR if all the file was read but the CRC is not good */ -extern int ZEXPORT unzReadCurrentFile OF((unzFile file, - voidp buf, - unsigned len)); +extern int ZEXPORT unzReadCurrentFile(unzFile file, + voidp buf, + unsigned len); /* Read bytes from the current file (opened by unzOpenCurrentFile) buf contain buffer where data must be copied len the size of buf. - return the number of byte copied if somes bytes are copied + return the number of byte copied if some bytes are copied return 0 if the end of file was reached return <0 with error code if there is an error (UNZ_ERRNO for IO error, or zLib error for uncompress error) */ -extern z_off_t ZEXPORT unztell OF((unzFile file)); +extern z_off_t ZEXPORT unztell(unzFile file); -extern ZPOS64_T ZEXPORT unztell64 OF((unzFile file)); +extern ZPOS64_T ZEXPORT unztell64(unzFile file); /* Give the current position in uncompressed data */ -extern int ZEXPORT unzeof OF((unzFile file)); +extern int ZEXPORT unzeof(unzFile file); /* return 1 if the end of file was reached, 0 elsewhere */ -extern int ZEXPORT unzGetLocalExtrafield OF((unzFile file, - voidp buf, - unsigned len)); +extern int ZEXPORT unzGetLocalExtrafield(unzFile file, + voidp buf, + unsigned len); /* Read extra field from the current file (opened by unzOpenCurrentFile) This is the local-header version of the extra field (sometimes, there is diff --git a/src/PureLib/pure/zlib/contrib/minizip/zip.c b/src/PureLib/pure/zlib/contrib/minizip/zip.c index 66d693f85a..60bdffac34 100644 --- a/src/PureLib/pure/zlib/contrib/minizip/zip.c +++ b/src/PureLib/pure/zlib/contrib/minizip/zip.c @@ -14,7 +14,7 @@ Oct-2009 - Mathias Svensson - Added Zip64 Support when creating new file archives Oct-2009 - Mathias Svensson - Did some code cleanup and refactoring to get better overview of some functions. Oct-2009 - Mathias Svensson - Added zipRemoveExtraInfoBlock to strip extra field data from its ZIP64 data - It is used when recreting zip archive with RAW when deleting items from a zip. + It is used when recreating zip archive with RAW when deleting items from a zip. ZIP64 data is automatically added to items that needs it, and existing ZIP64 data need to be removed. Oct-2009 - Mathias Svensson - Added support for BZIP2 as compression mode (bzip2 lib is required) Jan-2010 - back to unzip and minizip 1.0 name scheme, with compatibility layer @@ -25,14 +25,13 @@ #include #include #include +#include #include #include "zlib.h" #include "zip.h" #ifdef STDC # include -# include -# include #endif #ifdef NO_ERRNO_H extern int errno; @@ -47,7 +46,7 @@ /* compile with -Dlocal if your debugger can't find static symbols */ #ifndef VERSIONMADEBY -# define VERSIONMADEBY (0x0) /* platform depedent */ +# define VERSIONMADEBY (0x0) /* platform dependent */ #endif #ifndef Z_BUFSIZE @@ -61,9 +60,6 @@ #ifndef ALLOC # define ALLOC(size) (malloc(size)) #endif -#ifndef TRYFREE -# define TRYFREE(p) {if (p) free(p);} -#endif /* #define SIZECENTRALDIRITEM (0x2e) @@ -138,20 +134,20 @@ typedef struct uInt pos_in_buffered_data; /* last written byte in buffered_data */ ZPOS64_T pos_local_header; /* offset of the local header of the file - currenty writing */ + currently writing */ char* central_header; /* central header data for the current file */ uLong size_centralExtra; uLong size_centralheader; /* size of the central header for cur file */ uLong size_centralExtraFree; /* Extra bytes allocated to the centralheader but that are not used */ uLong flag; /* flag of the file currently writing */ - int method; /* compression method of file currenty wr.*/ + int method; /* compression method of file currently wr.*/ int raw; /* 1 for directly writing raw data */ Byte buffered_data[Z_BUFSIZE];/* buffer contain compressed data to be writ*/ uLong dosDate; uLong crc32; int encrypt; - int zip64; /* Add ZIP64 extened information in the extra field */ + int zip64; /* Add ZIP64 extended information in the extra field */ ZPOS64_T pos_zip64extrainfo; ZPOS64_T totalCompressedData; ZPOS64_T totalUncompressedData; @@ -165,10 +161,10 @@ typedef struct typedef struct { zlib_filefunc64_32_def z_filefunc; - voidpf filestream; /* io structore of the zipfile */ + voidpf filestream; /* io structure of the zipfile */ linkedlist_data central_dir;/* datablock with central dir in construction*/ int in_opened_file_inzip; /* 1 if a file in the zip is currently writ.*/ - curfile64_info ci; /* info on the file curretly writing */ + curfile64_info ci; /* info on the file currently writing */ ZPOS64_T begin_pos; /* position of the beginning of the zipfile */ ZPOS64_T add_position_when_writing_offset; @@ -186,8 +182,7 @@ typedef struct #include "crypt.h" #endif -local linkedlist_datablock_internal* allocate_new_datablock() -{ +local linkedlist_datablock_internal* allocate_new_datablock(void) { linkedlist_datablock_internal* ldi; ldi = (linkedlist_datablock_internal*) ALLOC(sizeof(linkedlist_datablock_internal)); @@ -200,30 +195,26 @@ local linkedlist_datablock_internal* allocate_new_datablock() return ldi; } -local void free_datablock(linkedlist_datablock_internal* ldi) -{ +local void free_datablock(linkedlist_datablock_internal* ldi) { while (ldi!=NULL) { linkedlist_datablock_internal* ldinext = ldi->next_datablock; - TRYFREE(ldi); + free(ldi); ldi = ldinext; } } -local void init_linkedlist(linkedlist_data* ll) -{ +local void init_linkedlist(linkedlist_data* ll) { ll->first_block = ll->last_block = NULL; } -local void free_linkedlist(linkedlist_data* ll) -{ +local void free_linkedlist(linkedlist_data* ll) { free_datablock(ll->first_block); ll->first_block = ll->last_block = NULL; } -local int add_data_in_datablock(linkedlist_data* ll, const void* buf, uLong len) -{ +local int add_data_in_datablock(linkedlist_data* ll, const void* buf, uLong len) { linkedlist_datablock_internal* ldi; const unsigned char* from_copy; @@ -238,7 +229,7 @@ local int add_data_in_datablock(linkedlist_data* ll, const void* buf, uLong len) } ldi = ll->last_block; - from_copy = (unsigned char*)buf; + from_copy = (const unsigned char*)buf; while (len>0) { @@ -283,9 +274,7 @@ local int add_data_in_datablock(linkedlist_data* ll, const void* buf, uLong len) nbByte == 1, 2 ,4 or 8 (byte, short or long, ZPOS64_T) */ -local int zip64local_putValue OF((const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream, ZPOS64_T x, int nbByte)); -local int zip64local_putValue (const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream, ZPOS64_T x, int nbByte) -{ +local int zip64local_putValue(const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream, ZPOS64_T x, int nbByte) { unsigned char buf[8]; int n; for (n = 0; n < nbByte; n++) @@ -307,9 +296,7 @@ local int zip64local_putValue (const zlib_filefunc64_32_def* pzlib_filefunc_def, return ZIP_OK; } -local void zip64local_putValue_inmemory OF((void* dest, ZPOS64_T x, int nbByte)); -local void zip64local_putValue_inmemory (void* dest, ZPOS64_T x, int nbByte) -{ +local void zip64local_putValue_inmemory (void* dest, ZPOS64_T x, int nbByte) { unsigned char* buf=(unsigned char*)dest; int n; for (n = 0; n < nbByte; n++) { @@ -329,8 +316,7 @@ local void zip64local_putValue_inmemory (void* dest, ZPOS64_T x, int nbByte) /****************************************************************************/ -local uLong zip64local_TmzDateToDosDate(const tm_zip* ptm) -{ +local uLong zip64local_TmzDateToDosDate(const tm_zip* ptm) { uLong year = (uLong)ptm->tm_year; if (year>=1980) year-=1980; @@ -344,10 +330,7 @@ local uLong zip64local_TmzDateToDosDate(const tm_zip* ptm) /****************************************************************************/ -local int zip64local_getByte OF((const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream, int *pi)); - -local int zip64local_getByte(const zlib_filefunc64_32_def* pzlib_filefunc_def,voidpf filestream,int* pi) -{ +local int zip64local_getByte(const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream, int* pi) { unsigned char c; int err = (int)ZREAD64(*pzlib_filefunc_def,filestream,&c,1); if (err==1) @@ -368,10 +351,7 @@ local int zip64local_getByte(const zlib_filefunc64_32_def* pzlib_filefunc_def,vo /* =========================================================================== Reads a long in LSB order from the given gz_stream. Sets */ -local int zip64local_getShort OF((const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream, uLong *pX)); - -local int zip64local_getShort (const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream, uLong* pX) -{ +local int zip64local_getShort(const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream, uLong* pX) { uLong x ; int i = 0; int err; @@ -390,10 +370,7 @@ local int zip64local_getShort (const zlib_filefunc64_32_def* pzlib_filefunc_def, return err; } -local int zip64local_getLong OF((const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream, uLong *pX)); - -local int zip64local_getLong (const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream, uLong* pX) -{ +local int zip64local_getLong(const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream, uLong* pX) { uLong x ; int i = 0; int err; @@ -420,11 +397,8 @@ local int zip64local_getLong (const zlib_filefunc64_32_def* pzlib_filefunc_def, return err; } -local int zip64local_getLong64 OF((const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream, ZPOS64_T *pX)); - -local int zip64local_getLong64 (const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream, ZPOS64_T *pX) -{ +local int zip64local_getLong64(const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream, ZPOS64_T *pX) { ZPOS64_T x; int i = 0; int err; @@ -475,10 +449,7 @@ local int zip64local_getLong64 (const zlib_filefunc64_32_def* pzlib_filefunc_def Locate the Central directory of a zipfile (at the end, just before the global comment) */ -local ZPOS64_T zip64local_SearchCentralDir OF((const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream)); - -local ZPOS64_T zip64local_SearchCentralDir(const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream) -{ +local ZPOS64_T zip64local_SearchCentralDir(const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream) { unsigned char* buf; ZPOS64_T uSizeFile; ZPOS64_T uBackRead; @@ -529,7 +500,7 @@ local ZPOS64_T zip64local_SearchCentralDir(const zlib_filefunc64_32_def* pzlib_f if (uPosFound!=0) break; } - TRYFREE(buf); + free(buf); return uPosFound; } @@ -537,10 +508,7 @@ local ZPOS64_T zip64local_SearchCentralDir(const zlib_filefunc64_32_def* pzlib_f Locate the End of Zip64 Central directory locator and from there find the CD of a zipfile (at the end, just before the global comment) */ -local ZPOS64_T zip64local_SearchCentralDir64 OF((const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream)); - -local ZPOS64_T zip64local_SearchCentralDir64(const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream) -{ +local ZPOS64_T zip64local_SearchCentralDir64(const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream) { unsigned char* buf; ZPOS64_T uSizeFile; ZPOS64_T uBackRead; @@ -595,7 +563,7 @@ local ZPOS64_T zip64local_SearchCentralDir64(const zlib_filefunc64_32_def* pzlib break; } - TRYFREE(buf); + free(buf); if (uPosFound == 0) return 0; @@ -607,7 +575,7 @@ local ZPOS64_T zip64local_SearchCentralDir64(const zlib_filefunc64_32_def* pzlib if (zip64local_getLong(pzlib_filefunc_def,filestream,&uL)!=ZIP_OK) return 0; - /* number of the disk with the start of the zip64 end of central directory */ + /* number of the disk with the start of the zip64 end of central directory */ if (zip64local_getLong(pzlib_filefunc_def,filestream,&uL)!=ZIP_OK) return 0; if (uL != 0) @@ -637,8 +605,7 @@ local ZPOS64_T zip64local_SearchCentralDir64(const zlib_filefunc64_32_def* pzlib return relativeOffset; } -local int LoadCentralDirectoryRecord(zip64_internal* pziinit) -{ +local int LoadCentralDirectoryRecord(zip64_internal* pziinit) { int err=ZIP_OK; ZPOS64_T byte_before_the_zipfile;/* byte before the zipfile, (>0 for sfx)*/ @@ -647,10 +614,10 @@ local int LoadCentralDirectoryRecord(zip64_internal* pziinit) ZPOS64_T central_pos; uLong uL; - uLong number_disk; /* number of the current dist, used for - spaning ZIP, unsupported, always 0*/ - uLong number_disk_with_CD; /* number the the disk with central dir, used - for spaning ZIP, unsupported, always 0*/ + uLong number_disk; /* number of the current disk, used for + spanning ZIP, unsupported, always 0*/ + uLong number_disk_with_CD; /* number of the disk with central dir, used + for spanning ZIP, unsupported, always 0*/ ZPOS64_T number_entry; ZPOS64_T number_entry_CD; /* total number of entries in the central dir @@ -830,7 +797,7 @@ local int LoadCentralDirectoryRecord(zip64_internal* pziinit) size_central_dir_to_read-=read_this; } - TRYFREE(buf_read); + free(buf_read); } pziinit->begin_pos = byte_before_the_zipfile; pziinit->number_entry = number_entry_CD; @@ -846,8 +813,7 @@ local int LoadCentralDirectoryRecord(zip64_internal* pziinit) /************************************************************/ -extern zipFile ZEXPORT zipOpen3 (const void *pathname, int append, zipcharpc* globalcomment, zlib_filefunc64_32_def* pzlib_filefunc64_32_def) -{ +extern zipFile ZEXPORT zipOpen3(const void *pathname, int append, zipcharpc* globalcomment, zlib_filefunc64_32_def* pzlib_filefunc64_32_def) { zip64_internal ziinit; zip64_internal* zi; int err=ZIP_OK; @@ -905,9 +871,9 @@ extern zipFile ZEXPORT zipOpen3 (const void *pathname, int append, zipcharpc* gl if (err != ZIP_OK) { # ifndef NO_ADDFILEINEXISTINGZIP - TRYFREE(ziinit.globalcomment); + free(ziinit.globalcomment); # endif /* !NO_ADDFILEINEXISTINGZIP*/ - TRYFREE(zi); + free(zi); return NULL; } else @@ -917,8 +883,7 @@ extern zipFile ZEXPORT zipOpen3 (const void *pathname, int append, zipcharpc* gl } } -extern zipFile ZEXPORT zipOpen2 (const char *pathname, int append, zipcharpc* globalcomment, zlib_filefunc_def* pzlib_filefunc32_def) -{ +extern zipFile ZEXPORT zipOpen2(const char *pathname, int append, zipcharpc* globalcomment, zlib_filefunc_def* pzlib_filefunc32_def) { if (pzlib_filefunc32_def != NULL) { zlib_filefunc64_32_def zlib_filefunc64_32_def_fill; @@ -929,8 +894,7 @@ extern zipFile ZEXPORT zipOpen2 (const char *pathname, int append, zipcharpc* gl return zipOpen3(pathname, append, globalcomment, NULL); } -extern zipFile ZEXPORT zipOpen2_64 (const void *pathname, int append, zipcharpc* globalcomment, zlib_filefunc64_def* pzlib_filefunc_def) -{ +extern zipFile ZEXPORT zipOpen2_64(const void *pathname, int append, zipcharpc* globalcomment, zlib_filefunc64_def* pzlib_filefunc_def) { if (pzlib_filefunc_def != NULL) { zlib_filefunc64_32_def zlib_filefunc64_32_def_fill; @@ -945,18 +909,15 @@ extern zipFile ZEXPORT zipOpen2_64 (const void *pathname, int append, zipcharpc* -extern zipFile ZEXPORT zipOpen (const char* pathname, int append) -{ +extern zipFile ZEXPORT zipOpen(const char* pathname, int append) { return zipOpen3((const void*)pathname,append,NULL,NULL); } -extern zipFile ZEXPORT zipOpen64 (const void* pathname, int append) -{ +extern zipFile ZEXPORT zipOpen64(const void* pathname, int append) { return zipOpen3(pathname,append,NULL,NULL); } -local int Write_LocalFileHeader(zip64_internal* zi, const char* filename, uInt size_extrafield_local, const void* extrafield_local) -{ +local int Write_LocalFileHeader(zip64_internal* zi, const char* filename, uInt size_extrafield_local, const void* extrafield_local) { /* write the local header */ int err; uInt size_filename = (uInt)strlen(filename); @@ -1052,14 +1013,13 @@ local int Write_LocalFileHeader(zip64_internal* zi, const char* filename, uInt s It is not done here because then we need to realloc a new buffer since parameters are 'const' and I want to minimize unnecessary allocations. */ -extern int ZEXPORT zipOpenNewFileInZip4_64 (zipFile file, const char* filename, const zip_fileinfo* zipfi, - const void* extrafield_local, uInt size_extrafield_local, - const void* extrafield_global, uInt size_extrafield_global, - const char* comment, int method, int level, int raw, - int windowBits,int memLevel, int strategy, - const char* password, uLong crcForCrypting, - uLong versionMadeBy, uLong flagBase, int zip64) -{ +extern int ZEXPORT zipOpenNewFileInZip4_64(zipFile file, const char* filename, const zip_fileinfo* zipfi, + const void* extrafield_local, uInt size_extrafield_local, + const void* extrafield_global, uInt size_extrafield_global, + const char* comment, int method, int level, int raw, + int windowBits,int memLevel, int strategy, + const char* password, uLong crcForCrypting, + uLong versionMadeBy, uLong flagBase, int zip64) { zip64_internal* zi; uInt size_filename; uInt size_comment; @@ -1083,6 +1043,17 @@ extern int ZEXPORT zipOpenNewFileInZip4_64 (zipFile file, const char* filename, return ZIP_PARAMERROR; #endif + // The filename and comment length must fit in 16 bits. + if ((filename!=NULL) && (strlen(filename)>0xffff)) + return ZIP_PARAMERROR; + if ((comment!=NULL) && (strlen(comment)>0xffff)) + return ZIP_PARAMERROR; + // The extra field length must fit in 16 bits. If the member also requires + // a Zip64 extra block, that will also need to fit within that 16-bit + // length, but that will be checked for later. + if ((size_extrafield_local>0xffff) || (size_extrafield_global>0xffff)) + return ZIP_PARAMERROR; + zi = (zip64_internal*)file; if (zi->in_opened_file_inzip == 1) @@ -1262,35 +1233,33 @@ extern int ZEXPORT zipOpenNewFileInZip4_64 (zipFile file, const char* filename, return err; } -extern int ZEXPORT zipOpenNewFileInZip4 (zipFile file, const char* filename, const zip_fileinfo* zipfi, - const void* extrafield_local, uInt size_extrafield_local, - const void* extrafield_global, uInt size_extrafield_global, - const char* comment, int method, int level, int raw, - int windowBits,int memLevel, int strategy, - const char* password, uLong crcForCrypting, - uLong versionMadeBy, uLong flagBase) -{ - return zipOpenNewFileInZip4_64 (file, filename, zipfi, - extrafield_local, size_extrafield_local, - extrafield_global, size_extrafield_global, - comment, method, level, raw, - windowBits, memLevel, strategy, - password, crcForCrypting, versionMadeBy, flagBase, 0); +extern int ZEXPORT zipOpenNewFileInZip4(zipFile file, const char* filename, const zip_fileinfo* zipfi, + const void* extrafield_local, uInt size_extrafield_local, + const void* extrafield_global, uInt size_extrafield_global, + const char* comment, int method, int level, int raw, + int windowBits,int memLevel, int strategy, + const char* password, uLong crcForCrypting, + uLong versionMadeBy, uLong flagBase) { + return zipOpenNewFileInZip4_64(file, filename, zipfi, + extrafield_local, size_extrafield_local, + extrafield_global, size_extrafield_global, + comment, method, level, raw, + windowBits, memLevel, strategy, + password, crcForCrypting, versionMadeBy, flagBase, 0); } -extern int ZEXPORT zipOpenNewFileInZip3 (zipFile file, const char* filename, const zip_fileinfo* zipfi, - const void* extrafield_local, uInt size_extrafield_local, - const void* extrafield_global, uInt size_extrafield_global, - const char* comment, int method, int level, int raw, - int windowBits,int memLevel, int strategy, - const char* password, uLong crcForCrypting) -{ - return zipOpenNewFileInZip4_64 (file, filename, zipfi, - extrafield_local, size_extrafield_local, - extrafield_global, size_extrafield_global, - comment, method, level, raw, - windowBits, memLevel, strategy, - password, crcForCrypting, VERSIONMADEBY, 0, 0); +extern int ZEXPORT zipOpenNewFileInZip3(zipFile file, const char* filename, const zip_fileinfo* zipfi, + const void* extrafield_local, uInt size_extrafield_local, + const void* extrafield_global, uInt size_extrafield_global, + const char* comment, int method, int level, int raw, + int windowBits,int memLevel, int strategy, + const char* password, uLong crcForCrypting) { + return zipOpenNewFileInZip4_64(file, filename, zipfi, + extrafield_local, size_extrafield_local, + extrafield_global, size_extrafield_global, + comment, method, level, raw, + windowBits, memLevel, strategy, + password, crcForCrypting, VERSIONMADEBY, 0, 0); } extern int ZEXPORT zipOpenNewFileInZip3_64(zipFile file, const char* filename, const zip_fileinfo* zipfi, @@ -1298,70 +1267,64 @@ extern int ZEXPORT zipOpenNewFileInZip3_64(zipFile file, const char* filename, c const void* extrafield_global, uInt size_extrafield_global, const char* comment, int method, int level, int raw, int windowBits,int memLevel, int strategy, - const char* password, uLong crcForCrypting, int zip64) -{ - return zipOpenNewFileInZip4_64 (file, filename, zipfi, - extrafield_local, size_extrafield_local, - extrafield_global, size_extrafield_global, - comment, method, level, raw, - windowBits, memLevel, strategy, - password, crcForCrypting, VERSIONMADEBY, 0, zip64); + const char* password, uLong crcForCrypting, int zip64) { + return zipOpenNewFileInZip4_64(file, filename, zipfi, + extrafield_local, size_extrafield_local, + extrafield_global, size_extrafield_global, + comment, method, level, raw, + windowBits, memLevel, strategy, + password, crcForCrypting, VERSIONMADEBY, 0, zip64); } extern int ZEXPORT zipOpenNewFileInZip2(zipFile file, const char* filename, const zip_fileinfo* zipfi, const void* extrafield_local, uInt size_extrafield_local, const void* extrafield_global, uInt size_extrafield_global, - const char* comment, int method, int level, int raw) -{ - return zipOpenNewFileInZip4_64 (file, filename, zipfi, - extrafield_local, size_extrafield_local, - extrafield_global, size_extrafield_global, - comment, method, level, raw, - -MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY, - NULL, 0, VERSIONMADEBY, 0, 0); + const char* comment, int method, int level, int raw) { + return zipOpenNewFileInZip4_64(file, filename, zipfi, + extrafield_local, size_extrafield_local, + extrafield_global, size_extrafield_global, + comment, method, level, raw, + -MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY, + NULL, 0, VERSIONMADEBY, 0, 0); } extern int ZEXPORT zipOpenNewFileInZip2_64(zipFile file, const char* filename, const zip_fileinfo* zipfi, - const void* extrafield_local, uInt size_extrafield_local, - const void* extrafield_global, uInt size_extrafield_global, - const char* comment, int method, int level, int raw, int zip64) -{ - return zipOpenNewFileInZip4_64 (file, filename, zipfi, - extrafield_local, size_extrafield_local, - extrafield_global, size_extrafield_global, - comment, method, level, raw, - -MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY, - NULL, 0, VERSIONMADEBY, 0, zip64); + const void* extrafield_local, uInt size_extrafield_local, + const void* extrafield_global, uInt size_extrafield_global, + const char* comment, int method, int level, int raw, int zip64) { + return zipOpenNewFileInZip4_64(file, filename, zipfi, + extrafield_local, size_extrafield_local, + extrafield_global, size_extrafield_global, + comment, method, level, raw, + -MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY, + NULL, 0, VERSIONMADEBY, 0, zip64); } -extern int ZEXPORT zipOpenNewFileInZip64 (zipFile file, const char* filename, const zip_fileinfo* zipfi, - const void* extrafield_local, uInt size_extrafield_local, - const void*extrafield_global, uInt size_extrafield_global, - const char* comment, int method, int level, int zip64) -{ - return zipOpenNewFileInZip4_64 (file, filename, zipfi, - extrafield_local, size_extrafield_local, - extrafield_global, size_extrafield_global, - comment, method, level, 0, - -MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY, - NULL, 0, VERSIONMADEBY, 0, zip64); +extern int ZEXPORT zipOpenNewFileInZip64(zipFile file, const char* filename, const zip_fileinfo* zipfi, + const void* extrafield_local, uInt size_extrafield_local, + const void*extrafield_global, uInt size_extrafield_global, + const char* comment, int method, int level, int zip64) { + return zipOpenNewFileInZip4_64(file, filename, zipfi, + extrafield_local, size_extrafield_local, + extrafield_global, size_extrafield_global, + comment, method, level, 0, + -MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY, + NULL, 0, VERSIONMADEBY, 0, zip64); } -extern int ZEXPORT zipOpenNewFileInZip (zipFile file, const char* filename, const zip_fileinfo* zipfi, - const void* extrafield_local, uInt size_extrafield_local, - const void*extrafield_global, uInt size_extrafield_global, - const char* comment, int method, int level) -{ - return zipOpenNewFileInZip4_64 (file, filename, zipfi, - extrafield_local, size_extrafield_local, - extrafield_global, size_extrafield_global, - comment, method, level, 0, - -MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY, - NULL, 0, VERSIONMADEBY, 0, 0); +extern int ZEXPORT zipOpenNewFileInZip(zipFile file, const char* filename, const zip_fileinfo* zipfi, + const void* extrafield_local, uInt size_extrafield_local, + const void*extrafield_global, uInt size_extrafield_global, + const char* comment, int method, int level) { + return zipOpenNewFileInZip4_64(file, filename, zipfi, + extrafield_local, size_extrafield_local, + extrafield_global, size_extrafield_global, + comment, method, level, 0, + -MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY, + NULL, 0, VERSIONMADEBY, 0, 0); } -local int zip64FlushWriteBuffer(zip64_internal* zi) -{ +local int zip64FlushWriteBuffer(zip64_internal* zi) { int err=ZIP_OK; if (zi->ci.encrypt != 0) @@ -1399,8 +1362,7 @@ local int zip64FlushWriteBuffer(zip64_internal* zi) return err; } -extern int ZEXPORT zipWriteInFileInZip (zipFile file,const void* buf,unsigned int len) -{ +extern int ZEXPORT zipWriteInFileInZip(zipFile file, const void* buf, unsigned int len) { zip64_internal* zi; int err=ZIP_OK; @@ -1450,7 +1412,7 @@ extern int ZEXPORT zipWriteInFileInZip (zipFile file,const void* buf,unsigned in else #endif { - zi->ci.stream.next_in = (Bytef*)buf; + zi->ci.stream.next_in = (Bytef*)(uintptr_t)buf; zi->ci.stream.avail_in = len; while ((err==ZIP_OK) && (zi->ci.stream.avail_in>0)) @@ -1501,13 +1463,11 @@ extern int ZEXPORT zipWriteInFileInZip (zipFile file,const void* buf,unsigned in return err; } -extern int ZEXPORT zipCloseFileInZipRaw (zipFile file, uLong uncompressed_size, uLong crc32) -{ +extern int ZEXPORT zipCloseFileInZipRaw(zipFile file, uLong uncompressed_size, uLong crc32) { return zipCloseFileInZipRaw64 (file, uncompressed_size, crc32); } -extern int ZEXPORT zipCloseFileInZipRaw64 (zipFile file, ZPOS64_T uncompressed_size, uLong crc32) -{ +extern int ZEXPORT zipCloseFileInZipRaw64(zipFile file, ZPOS64_T uncompressed_size, uLong crc32) { zip64_internal* zi; ZPOS64_T compressed_size; uLong invalidValue = 0xffffffff; @@ -1648,7 +1608,7 @@ extern int ZEXPORT zipCloseFileInZipRaw64 (zipFile file, ZPOS64_T uncompressed_s if((uLong)(datasize + 4) > zi->ci.size_centralExtraFree) { - // we can not write more data to the buffer that we have room for. + // we cannot write more data to the buffer that we have room for. return ZIP_BADZIPFILE; } @@ -1742,13 +1702,11 @@ extern int ZEXPORT zipCloseFileInZipRaw64 (zipFile file, ZPOS64_T uncompressed_s return err; } -extern int ZEXPORT zipCloseFileInZip (zipFile file) -{ +extern int ZEXPORT zipCloseFileInZip(zipFile file) { return zipCloseFileInZipRaw (file,0,0); } -local int Write_Zip64EndOfCentralDirectoryLocator(zip64_internal* zi, ZPOS64_T zip64eocd_pos_inzip) -{ +local int Write_Zip64EndOfCentralDirectoryLocator(zip64_internal* zi, ZPOS64_T zip64eocd_pos_inzip) { int err = ZIP_OK; ZPOS64_T pos = zip64eocd_pos_inzip - zi->add_position_when_writing_offset; @@ -1769,8 +1727,7 @@ local int Write_Zip64EndOfCentralDirectoryLocator(zip64_internal* zi, ZPOS64_T z return err; } -local int Write_Zip64EndOfCentralDirectoryRecord(zip64_internal* zi, uLong size_centraldir, ZPOS64_T centraldir_pos_inzip) -{ +local int Write_Zip64EndOfCentralDirectoryRecord(zip64_internal* zi, uLong size_centraldir, ZPOS64_T centraldir_pos_inzip) { int err = ZIP_OK; uLong Zip64DataSize = 44; @@ -1808,8 +1765,8 @@ local int Write_Zip64EndOfCentralDirectoryRecord(zip64_internal* zi, uLong size_ } return err; } -local int Write_EndOfCentralDirectoryRecord(zip64_internal* zi, uLong size_centraldir, ZPOS64_T centraldir_pos_inzip) -{ + +local int Write_EndOfCentralDirectoryRecord(zip64_internal* zi, uLong size_centraldir, ZPOS64_T centraldir_pos_inzip) { int err = ZIP_OK; /*signature*/ @@ -1856,8 +1813,7 @@ local int Write_EndOfCentralDirectoryRecord(zip64_internal* zi, uLong size_centr return err; } -local int Write_GlobalComment(zip64_internal* zi, const char* global_comment) -{ +local int Write_GlobalComment(zip64_internal* zi, const char* global_comment) { int err = ZIP_OK; uInt size_global_comment = 0; @@ -1874,8 +1830,7 @@ local int Write_GlobalComment(zip64_internal* zi, const char* global_comment) return err; } -extern int ZEXPORT zipClose (zipFile file, const char* global_comment) -{ +extern int ZEXPORT zipClose(zipFile file, const char* global_comment) { zip64_internal* zi; int err = 0; uLong size_centraldir = 0; @@ -1917,7 +1872,7 @@ extern int ZEXPORT zipClose (zipFile file, const char* global_comment) free_linkedlist(&(zi->central_dir)); pos = centraldir_pos_inzip - zi->add_position_when_writing_offset; - if(pos >= 0xffffffff || zi->number_entry > 0xFFFF) + if(pos >= 0xffffffff || zi->number_entry >= 0xFFFF) { ZPOS64_T Zip64EOCDpos = ZTELL64(zi->z_filefunc,zi->filestream); Write_Zip64EndOfCentralDirectoryRecord(zi, size_centraldir, centraldir_pos_inzip); @@ -1936,15 +1891,14 @@ extern int ZEXPORT zipClose (zipFile file, const char* global_comment) err = ZIP_ERRNO; #ifndef NO_ADDFILEINEXISTINGZIP - TRYFREE(zi->globalcomment); + free(zi->globalcomment); #endif - TRYFREE(zi); + free(zi); return err; } -extern int ZEXPORT zipRemoveExtraInfoBlock (char* pData, int* dataLen, short sHeader) -{ +extern int ZEXPORT zipRemoveExtraInfoBlock(char* pData, int* dataLen, short sHeader) { char* p = pData; int size = 0; char* pNewHeader; @@ -1996,7 +1950,7 @@ extern int ZEXPORT zipRemoveExtraInfoBlock (char* pData, int* dataLen, short sHe else retVal = ZIP_ERRNO; - TRYFREE(pNewHeader); + free(pNewHeader); return retVal; } diff --git a/src/PureLib/pure/zlib/contrib/minizip/zip.h b/src/PureLib/pure/zlib/contrib/minizip/zip.h index 7e4509d77b..3e230d3405 100644 --- a/src/PureLib/pure/zlib/contrib/minizip/zip.h +++ b/src/PureLib/pure/zlib/contrib/minizip/zip.h @@ -113,8 +113,8 @@ typedef const char* zipcharpc; #define APPEND_STATUS_CREATEAFTER (1) #define APPEND_STATUS_ADDINZIP (2) -extern zipFile ZEXPORT zipOpen OF((const char *pathname, int append)); -extern zipFile ZEXPORT zipOpen64 OF((const void *pathname, int append)); +extern zipFile ZEXPORT zipOpen(const char *pathname, int append); +extern zipFile ZEXPORT zipOpen64(const void *pathname, int append); /* Create a zipfile. pathname contain on Windows XP a filename like "c:\\zlib\\zlib113.zip" or on @@ -131,55 +131,55 @@ extern zipFile ZEXPORT zipOpen64 OF((const void *pathname, int append)); /* Note : there is no delete function into a zipfile. If you want delete file into a zipfile, you must open a zipfile, and create another - Of couse, you can use RAW reading and writing to copy the file you did not want delte + Of course, you can use RAW reading and writing to copy the file you did not want delete */ -extern zipFile ZEXPORT zipOpen2 OF((const char *pathname, - int append, - zipcharpc* globalcomment, - zlib_filefunc_def* pzlib_filefunc_def)); +extern zipFile ZEXPORT zipOpen2(const char *pathname, + int append, + zipcharpc* globalcomment, + zlib_filefunc_def* pzlib_filefunc_def); -extern zipFile ZEXPORT zipOpen2_64 OF((const void *pathname, +extern zipFile ZEXPORT zipOpen2_64(const void *pathname, int append, zipcharpc* globalcomment, - zlib_filefunc64_def* pzlib_filefunc_def)); - -extern zipFile ZEXPORT zipOpen3 OF((const void *pathname, - int append, - zipcharpc* globalcomment, - zlib_filefunc64_32_def* pzlib_filefunc64_32_def)); - -extern int ZEXPORT zipOpenNewFileInZip OF((zipFile file, - const char* filename, - const zip_fileinfo* zipfi, - const void* extrafield_local, - uInt size_extrafield_local, - const void* extrafield_global, - uInt size_extrafield_global, - const char* comment, - int method, - int level)); - -extern int ZEXPORT zipOpenNewFileInZip64 OF((zipFile file, - const char* filename, - const zip_fileinfo* zipfi, - const void* extrafield_local, - uInt size_extrafield_local, - const void* extrafield_global, - uInt size_extrafield_global, - const char* comment, - int method, - int level, - int zip64)); + zlib_filefunc64_def* pzlib_filefunc_def); + +extern zipFile ZEXPORT zipOpen3(const void *pathname, + int append, + zipcharpc* globalcomment, + zlib_filefunc64_32_def* pzlib_filefunc64_32_def); + +extern int ZEXPORT zipOpenNewFileInZip(zipFile file, + const char* filename, + const zip_fileinfo* zipfi, + const void* extrafield_local, + uInt size_extrafield_local, + const void* extrafield_global, + uInt size_extrafield_global, + const char* comment, + int method, + int level); + +extern int ZEXPORT zipOpenNewFileInZip64(zipFile file, + const char* filename, + const zip_fileinfo* zipfi, + const void* extrafield_local, + uInt size_extrafield_local, + const void* extrafield_global, + uInt size_extrafield_global, + const char* comment, + int method, + int level, + int zip64); /* Open a file in the ZIP for writing. filename : the filename in zip (if NULL, '-' without quote will be used *zipfi contain supplemental information if extrafield_local!=NULL and size_extrafield_local>0, extrafield_local - contains the extrafield data the the local header + contains the extrafield data for the local header if extrafield_global!=NULL and size_extrafield_global>0, extrafield_global - contains the extrafield data the the local header + contains the extrafield data for the global header if comment != NULL, comment contain the comment string method contain the compression method (0 for store, Z_DEFLATED for deflate) level contain the level of compression (can be Z_DEFAULT_COMPRESSION) @@ -189,70 +189,69 @@ extern int ZEXPORT zipOpenNewFileInZip64 OF((zipFile file, */ -extern int ZEXPORT zipOpenNewFileInZip2 OF((zipFile file, - const char* filename, - const zip_fileinfo* zipfi, - const void* extrafield_local, - uInt size_extrafield_local, - const void* extrafield_global, - uInt size_extrafield_global, - const char* comment, - int method, - int level, - int raw)); - - -extern int ZEXPORT zipOpenNewFileInZip2_64 OF((zipFile file, - const char* filename, - const zip_fileinfo* zipfi, - const void* extrafield_local, - uInt size_extrafield_local, - const void* extrafield_global, - uInt size_extrafield_global, - const char* comment, - int method, - int level, - int raw, - int zip64)); +extern int ZEXPORT zipOpenNewFileInZip2(zipFile file, + const char* filename, + const zip_fileinfo* zipfi, + const void* extrafield_local, + uInt size_extrafield_local, + const void* extrafield_global, + uInt size_extrafield_global, + const char* comment, + int method, + int level, + int raw); + + +extern int ZEXPORT zipOpenNewFileInZip2_64(zipFile file, + const char* filename, + const zip_fileinfo* zipfi, + const void* extrafield_local, + uInt size_extrafield_local, + const void* extrafield_global, + uInt size_extrafield_global, + const char* comment, + int method, + int level, + int raw, + int zip64); /* Same than zipOpenNewFileInZip, except if raw=1, we write raw file */ -extern int ZEXPORT zipOpenNewFileInZip3 OF((zipFile file, - const char* filename, - const zip_fileinfo* zipfi, - const void* extrafield_local, - uInt size_extrafield_local, - const void* extrafield_global, - uInt size_extrafield_global, - const char* comment, - int method, - int level, - int raw, - int windowBits, - int memLevel, - int strategy, - const char* password, - uLong crcForCrypting)); - -extern int ZEXPORT zipOpenNewFileInZip3_64 OF((zipFile file, - const char* filename, - const zip_fileinfo* zipfi, - const void* extrafield_local, - uInt size_extrafield_local, - const void* extrafield_global, - uInt size_extrafield_global, - const char* comment, - int method, - int level, - int raw, - int windowBits, - int memLevel, - int strategy, - const char* password, - uLong crcForCrypting, - int zip64 - )); +extern int ZEXPORT zipOpenNewFileInZip3(zipFile file, + const char* filename, + const zip_fileinfo* zipfi, + const void* extrafield_local, + uInt size_extrafield_local, + const void* extrafield_global, + uInt size_extrafield_global, + const char* comment, + int method, + int level, + int raw, + int windowBits, + int memLevel, + int strategy, + const char* password, + uLong crcForCrypting); + +extern int ZEXPORT zipOpenNewFileInZip3_64(zipFile file, + const char* filename, + const zip_fileinfo* zipfi, + const void* extrafield_local, + uInt size_extrafield_local, + const void* extrafield_global, + uInt size_extrafield_global, + const char* comment, + int method, + int level, + int raw, + int windowBits, + int memLevel, + int strategy, + const char* password, + uLong crcForCrypting, + int zip64); /* Same than zipOpenNewFileInZip2, except @@ -261,47 +260,45 @@ extern int ZEXPORT zipOpenNewFileInZip3_64 OF((zipFile file, crcForCrypting : crc of file to compress (needed for crypting) */ -extern int ZEXPORT zipOpenNewFileInZip4 OF((zipFile file, - const char* filename, - const zip_fileinfo* zipfi, - const void* extrafield_local, - uInt size_extrafield_local, - const void* extrafield_global, - uInt size_extrafield_global, - const char* comment, - int method, - int level, - int raw, - int windowBits, - int memLevel, - int strategy, - const char* password, - uLong crcForCrypting, - uLong versionMadeBy, - uLong flagBase - )); - - -extern int ZEXPORT zipOpenNewFileInZip4_64 OF((zipFile file, - const char* filename, - const zip_fileinfo* zipfi, - const void* extrafield_local, - uInt size_extrafield_local, - const void* extrafield_global, - uInt size_extrafield_global, - const char* comment, - int method, - int level, - int raw, - int windowBits, - int memLevel, - int strategy, - const char* password, - uLong crcForCrypting, - uLong versionMadeBy, - uLong flagBase, - int zip64 - )); +extern int ZEXPORT zipOpenNewFileInZip4(zipFile file, + const char* filename, + const zip_fileinfo* zipfi, + const void* extrafield_local, + uInt size_extrafield_local, + const void* extrafield_global, + uInt size_extrafield_global, + const char* comment, + int method, + int level, + int raw, + int windowBits, + int memLevel, + int strategy, + const char* password, + uLong crcForCrypting, + uLong versionMadeBy, + uLong flagBase); + + +extern int ZEXPORT zipOpenNewFileInZip4_64(zipFile file, + const char* filename, + const zip_fileinfo* zipfi, + const void* extrafield_local, + uInt size_extrafield_local, + const void* extrafield_global, + uInt size_extrafield_global, + const char* comment, + int method, + int level, + int raw, + int windowBits, + int memLevel, + int strategy, + const char* password, + uLong crcForCrypting, + uLong versionMadeBy, + uLong flagBase, + int zip64); /* Same than zipOpenNewFileInZip4, except versionMadeBy : value for Version made by field @@ -309,25 +306,25 @@ extern int ZEXPORT zipOpenNewFileInZip4_64 OF((zipFile file, */ -extern int ZEXPORT zipWriteInFileInZip OF((zipFile file, - const void* buf, - unsigned len)); +extern int ZEXPORT zipWriteInFileInZip(zipFile file, + const void* buf, + unsigned len); /* Write data in the zipfile */ -extern int ZEXPORT zipCloseFileInZip OF((zipFile file)); +extern int ZEXPORT zipCloseFileInZip(zipFile file); /* Close the current file in the zipfile */ -extern int ZEXPORT zipCloseFileInZipRaw OF((zipFile file, - uLong uncompressed_size, - uLong crc32)); +extern int ZEXPORT zipCloseFileInZipRaw(zipFile file, + uLong uncompressed_size, + uLong crc32); -extern int ZEXPORT zipCloseFileInZipRaw64 OF((zipFile file, - ZPOS64_T uncompressed_size, - uLong crc32)); +extern int ZEXPORT zipCloseFileInZipRaw64(zipFile file, + ZPOS64_T uncompressed_size, + uLong crc32); /* Close the current file in the zipfile, for file opened with @@ -335,14 +332,14 @@ extern int ZEXPORT zipCloseFileInZipRaw64 OF((zipFile file, uncompressed_size and crc32 are value for the uncompressed size */ -extern int ZEXPORT zipClose OF((zipFile file, - const char* global_comment)); +extern int ZEXPORT zipClose(zipFile file, + const char* global_comment); /* Close the zipfile */ -extern int ZEXPORT zipRemoveExtraInfoBlock OF((char* pData, int* dataLen, short sHeader)); +extern int ZEXPORT zipRemoveExtraInfoBlock(char* pData, int* dataLen, short sHeader); /* zipRemoveExtraInfoBlock - Added by Mathias Svensson diff --git a/src/PureLib/pure/zlib/contrib/nuget/nuget.csproj b/src/PureLib/pure/zlib/contrib/nuget/nuget.csproj new file mode 100644 index 0000000000..68627f034a --- /dev/null +++ b/src/PureLib/pure/zlib/contrib/nuget/nuget.csproj @@ -0,0 +1,43 @@ + + + + net6.0 + madler.zlib.redist + $(PackageId).win + $(PackageId).linux + $(PackageId).osx + (C) 1995-2024 Jean-loup Gailly and Mark Adler + 1.3.1 + NuGet Package for consuming native builds of zlib into .NET without complexity. + + NU5128 + $(MSBuildProjectDirectory) + Jean-loup Gailly and Mark Adler + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/PureLib/pure/zlib/contrib/nuget/nuget.sln b/src/PureLib/pure/zlib/contrib/nuget/nuget.sln new file mode 100644 index 0000000000..46ee8deab8 --- /dev/null +++ b/src/PureLib/pure/zlib/contrib/nuget/nuget.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.31903.59 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "nuget", "nuget.csproj", "{B1BD3984-EF8F-4E9D-9A94-EB784E5EB1E8}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B1BD3984-EF8F-4E9D-9A94-EB784E5EB1E8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B1BD3984-EF8F-4E9D-9A94-EB784E5EB1E8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B1BD3984-EF8F-4E9D-9A94-EB784E5EB1E8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B1BD3984-EF8F-4E9D-9A94-EB784E5EB1E8}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal diff --git a/src/PureLib/pure/zlib/contrib/pascal/zlibpas.pas b/src/PureLib/pure/zlib/contrib/pascal/zlibpas.pas index bf3fff6ff6..0cf0e7b82d 100644 --- a/src/PureLib/pure/zlib/contrib/pascal/zlibpas.pas +++ b/src/PureLib/pure/zlib/contrib/pascal/zlibpas.pas @@ -10,7 +10,7 @@ interface const - ZLIB_VERSION = '1.2.13'; + ZLIB_VERSION = '1.3.1'; ZLIB_VERNUM = $12a0; type diff --git a/src/PureLib/pure/zlib/contrib/puff/puff.c b/src/PureLib/pure/zlib/contrib/puff/puff.c index 6737ff6153..d759825ab1 100644 --- a/src/PureLib/pure/zlib/contrib/puff/puff.c +++ b/src/PureLib/pure/zlib/contrib/puff/puff.c @@ -593,10 +593,10 @@ local int fixed(struct state *s) * provided for each of the literal/length symbols, and for each of the * distance symbols. * - * - If a symbol is not used in the block, this is represented by a zero as - * as the code length. This does not mean a zero-length code, but rather - * that no code should be created for this symbol. There is no way in the - * deflate format to represent a zero-length code. + * - If a symbol is not used in the block, this is represented by a zero as the + * code length. This does not mean a zero-length code, but rather that no + * code should be created for this symbol. There is no way in the deflate + * format to represent a zero-length code. * * - The maximum number of bits in a code is 15, so the possible lengths for * any code are 1..15. diff --git a/src/PureLib/pure/zlib/contrib/testzlib/testzlib.c b/src/PureLib/pure/zlib/contrib/testzlib/testzlib.c index 5f659dea00..b3c0014f9b 100644 --- a/src/PureLib/pure/zlib/contrib/testzlib/testzlib.c +++ b/src/PureLib/pure/zlib/contrib/testzlib/testzlib.c @@ -169,7 +169,7 @@ int main(int argc, char *argv[]) printf("error reading %s\n",argv[1]); return 1; } - else printf("file %s read, %u bytes\n",argv[1],lFileSize); + else printf("file %s read, %ld bytes\n",argv[1],lFileSize); if (argc>=3) BlockSizeCompress=atol(argv[2]); diff --git a/src/PureLib/pure/zlib/contrib/untgz/untgz.c b/src/PureLib/pure/zlib/contrib/untgz/untgz.c index 2c391e5986..78579211fe 100644 --- a/src/PureLib/pure/zlib/contrib/untgz/untgz.c +++ b/src/PureLib/pure/zlib/contrib/untgz/untgz.c @@ -4,6 +4,22 @@ * written by Pedro A. Aranda Gutierrez * adaptation to Unix by Jean-loup Gailly * various fixes by Cosmin Truta + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. */ #include @@ -14,15 +30,10 @@ #include "zlib.h" -#ifdef unix -# include -#else +#ifdef _WIN32 # include # include -#endif - -#ifdef WIN32 -#include +# include # ifndef F_OK # define F_OK 0 # endif @@ -33,6 +44,8 @@ # define strdup(str) _strdup(str) # endif #else +# include +# include # include #endif @@ -102,28 +115,14 @@ struct attr_item enum { TGZ_EXTRACT, TGZ_LIST, TGZ_INVALID }; -char *TGZfname OF((const char *)); -void TGZnotfound OF((const char *)); - -int getoct OF((char *, int)); -char *strtime OF((time_t *)); -int setfiletime OF((char *, time_t)); -void push_attr OF((struct attr_item **, char *, int, time_t)); -void restore_attr OF((struct attr_item **)); - -int ExprMatch OF((char *, char *)); - -int makedir OF((char *)); -int matchname OF((int, int, char **, char *)); - -void error OF((const char *)); -int tar OF((gzFile, int, int, int, char **)); - -void help OF((int)); -int main OF((int, char **)); - char *prog; +void error(const char *msg) +{ + fprintf(stderr, "%s: %s\n", prog, msg); + exit(1); +} + const char *TGZsuffix[] = { "\0", ".tar", ".tar.gz", ".taz", ".tgz", NULL }; /* return the file name of the TGZ archive */ @@ -205,7 +204,7 @@ char *strtime (time_t *t) int setfiletime (char *fname,time_t ftime) { -#ifdef WIN32 +#ifdef _WIN32 static int isWinNT = -1; SYSTEMTIME st; FILETIME locft, modft; @@ -590,12 +589,6 @@ void help(int exitval) exit(exitval); } -void error(const char *msg) -{ - fprintf(stderr, "%s: %s\n", prog, msg); - exit(1); -} - /* ============================================================ */ @@ -608,7 +601,7 @@ int main(int argc,char **argv) int action = TGZ_EXTRACT; int arg = 1; char *TGZfile; - gzFile *f; + gzFile f; prog = strrchr(argv[0],'\\'); if (prog == NULL) diff --git a/src/PureLib/pure/zlib/contrib/vstudio/readme.txt b/src/PureLib/pure/zlib/contrib/vstudio/readme.txt index 17e693ffd5..061bbc0e2d 100644 --- a/src/PureLib/pure/zlib/contrib/vstudio/readme.txt +++ b/src/PureLib/pure/zlib/contrib/vstudio/readme.txt @@ -1,75 +1,81 @@ -Building instructions for the DLL versions of Zlib 1.2.13 -======================================================== - -This directory contains projects that build zlib and minizip using -Microsoft Visual C++ 9.0/10.0. - -You don't need to build these projects yourself. You can download the -binaries from: - http://www.winimage.com/zLibDll - -More information can be found at this site. - - - - - -Build instructions for Visual Studio 2008 (32 bits or 64 bits) --------------------------------------------------------------- -- Decompress current zlib, including all contrib/* files -- Open contrib\vstudio\vc9\zlibvc.sln with Microsoft Visual C++ 2008 -- Or run: vcbuild /rebuild contrib\vstudio\vc9\zlibvc.sln "Release|Win32" - -Build instructions for Visual Studio 2010 (32 bits or 64 bits) --------------------------------------------------------------- -- Decompress current zlib, including all contrib/* files -- Open contrib\vstudio\vc10\zlibvc.sln with Microsoft Visual C++ 2010 - -Build instructions for Visual Studio 2012 (32 bits or 64 bits) --------------------------------------------------------------- -- Decompress current zlib, including all contrib/* files -- Open contrib\vstudio\vc11\zlibvc.sln with Microsoft Visual C++ 2012 - -Build instructions for Visual Studio 2013 (32 bits or 64 bits) --------------------------------------------------------------- -- Decompress current zlib, including all contrib/* files -- Open contrib\vstudio\vc12\zlibvc.sln with Microsoft Visual C++ 2013 - -Build instructions for Visual Studio 2015 (32 bits or 64 bits) --------------------------------------------------------------- -- Decompress current zlib, including all contrib/* files -- Open contrib\vstudio\vc14\zlibvc.sln with Microsoft Visual C++ 2015 - - -Important ---------- -- To use zlibwapi.dll in your application, you must define the - macro ZLIB_WINAPI when compiling your application's source files. - - -Additional notes ----------------- -- This DLL, named zlibwapi.dll, is compatible to the old zlib.dll built - by Gilles Vollant from the zlib 1.1.x sources, and distributed at - http://www.winimage.com/zLibDll - It uses the WINAPI calling convention for the exported functions, and - includes the minizip functionality. If your application needs that - particular build of zlib.dll, you can rename zlibwapi.dll to zlib.dll. - -- The new DLL was renamed because there exist several incompatible - versions of zlib.dll on the Internet. - -- There is also an official DLL build of zlib, named zlib1.dll. This one - is exporting the functions using the CDECL convention. See the file - win32\DLL_FAQ.txt found in this zlib distribution. - -- There used to be a ZLIB_DLL macro in zlib 1.1.x, but now this symbol - has a slightly different effect. To avoid compatibility problems, do - not define it here. - - -Gilles Vollant -info@winimage.com - -Visual Studio 2013 and 2015 Projects from Sean Hunt -seandhunt_7@yahoo.com +Building instructions for the DLL versions of Zlib 1.3.1 +======================================================== + +This directory contains projects that build zlib and minizip using +Microsoft Visual C++ 9.0/10.0. + +You don't need to build these projects yourself. You can download the +binaries from: + http://www.winimage.com/zLibDll + +More information can be found at this site. + + + + + +Build instructions for Visual Studio 2008 (32 bits or 64 bits) +-------------------------------------------------------------- +- Decompress current zlib, including all contrib/* files +- Open contrib\vstudio\vc9\zlibvc.sln with Microsoft Visual C++ 2008 +- Or run: vcbuild /rebuild contrib\vstudio\vc9\zlibvc.sln "Release|Win32" + +Build instructions for Visual Studio 2010 (32 bits or 64 bits) +-------------------------------------------------------------- +- Decompress current zlib, including all contrib/* files +- Open contrib\vstudio\vc10\zlibvc.sln with Microsoft Visual C++ 2010 + +Build instructions for Visual Studio 2012 (32 bits or 64 bits) +-------------------------------------------------------------- +- Decompress current zlib, including all contrib/* files +- Open contrib\vstudio\vc11\zlibvc.sln with Microsoft Visual C++ 2012 + +Build instructions for Visual Studio 2013 (32 bits or 64 bits) +-------------------------------------------------------------- +- Decompress current zlib, including all contrib/* files +- Open contrib\vstudio\vc12\zlibvc.sln with Microsoft Visual C++ 2013 + +Build instructions for Visual Studio 2015 (32 bits or 64 bits) +-------------------------------------------------------------- +- Decompress current zlib, including all contrib/* files +- Open contrib\vstudio\vc14\zlibvc.sln with Microsoft Visual C++ 2015 + +Build instructions for Visual Studio 2022 (64 bits) +-------------------------------------------------------------- +- Decompress current zlib, including all contrib/* files +- Open contrib\vstudio\vc143\zlibvc.sln with Microsoft Visual C++ 2022 + + + +Important +--------- +- To use zlibwapi.dll in your application, you must define the + macro ZLIB_WINAPI when compiling your application's source files. + + +Additional notes +---------------- +- This DLL, named zlibwapi.dll, is compatible to the old zlib.dll built + by Gilles Vollant from the zlib 1.1.x sources, and distributed at + http://www.winimage.com/zLibDll + It uses the WINAPI calling convention for the exported functions, and + includes the minizip functionality. If your application needs that + particular build of zlib.dll, you can rename zlibwapi.dll to zlib.dll. + +- The new DLL was renamed because there exist several incompatible + versions of zlib.dll on the Internet. + +- There is also an official DLL build of zlib, named zlib1.dll. This one + is exporting the functions using the CDECL convention. See the file + win32\DLL_FAQ.txt found in this zlib distribution. + +- There used to be a ZLIB_DLL macro in zlib 1.1.x, but now this symbol + has a slightly different effect. To avoid compatibility problems, do + not define it here. + + +Gilles Vollant +info@winimage.com + +Visual Studio 2013, 2015, and 2022 Projects from Sean Hunt +seandhunt_7@yahoo.com diff --git a/src/PureLib/pure/zlib/contrib/vstudio/vc10/zlib.rc b/src/PureLib/pure/zlib/contrib/vstudio/vc10/zlib.rc index 876027498a..856bd11f08 100644 --- a/src/PureLib/pure/zlib/contrib/vstudio/vc10/zlib.rc +++ b/src/PureLib/pure/zlib/contrib/vstudio/vc10/zlib.rc @@ -2,8 +2,8 @@ #define IDR_VERSION1 1 IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE - FILEVERSION 1, 2, 13, 0 - PRODUCTVERSION 1, 2, 13, 0 + FILEVERSION 1, 3, 1, 0 + PRODUCTVERSION 1, 3, 1, 0 FILEFLAGSMASK VS_FFI_FILEFLAGSMASK FILEFLAGS 0 FILEOS VOS_DOS_WINDOWS32 @@ -17,12 +17,12 @@ BEGIN BEGIN VALUE "FileDescription", "zlib data compression and ZIP file I/O library\0" - VALUE "FileVersion", "1.2.13\0" + VALUE "FileVersion", "1.3.1\0" VALUE "InternalName", "zlib\0" VALUE "OriginalFilename", "zlibwapi.dll\0" VALUE "ProductName", "ZLib.DLL\0" VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0" - VALUE "LegalCopyright", "(C) 1995-2022 Jean-loup Gailly & Mark Adler\0" + VALUE "LegalCopyright", "(C) 1995-2024 Jean-loup Gailly & Mark Adler\0" END END BLOCK "VarFileInfo" diff --git a/src/PureLib/pure/zlib/contrib/vstudio/vc10/zlibvc.def b/src/PureLib/pure/zlib/contrib/vstudio/vc10/zlibvc.def index ba09bc1b98..3234a02d95 100644 --- a/src/PureLib/pure/zlib/contrib/vstudio/vc10/zlibvc.def +++ b/src/PureLib/pure/zlib/contrib/vstudio/vc10/zlibvc.def @@ -1,7 +1,7 @@ LIBRARY ; zlib data compression and ZIP file I/O library -VERSION 1.2 +VERSION 1.3.1 EXPORTS adler32 @1 diff --git a/src/PureLib/pure/zlib/contrib/vstudio/vc11/zlib.rc b/src/PureLib/pure/zlib/contrib/vstudio/vc11/zlib.rc index 876027498a..856bd11f08 100644 --- a/src/PureLib/pure/zlib/contrib/vstudio/vc11/zlib.rc +++ b/src/PureLib/pure/zlib/contrib/vstudio/vc11/zlib.rc @@ -2,8 +2,8 @@ #define IDR_VERSION1 1 IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE - FILEVERSION 1, 2, 13, 0 - PRODUCTVERSION 1, 2, 13, 0 + FILEVERSION 1, 3, 1, 0 + PRODUCTVERSION 1, 3, 1, 0 FILEFLAGSMASK VS_FFI_FILEFLAGSMASK FILEFLAGS 0 FILEOS VOS_DOS_WINDOWS32 @@ -17,12 +17,12 @@ BEGIN BEGIN VALUE "FileDescription", "zlib data compression and ZIP file I/O library\0" - VALUE "FileVersion", "1.2.13\0" + VALUE "FileVersion", "1.3.1\0" VALUE "InternalName", "zlib\0" VALUE "OriginalFilename", "zlibwapi.dll\0" VALUE "ProductName", "ZLib.DLL\0" VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0" - VALUE "LegalCopyright", "(C) 1995-2022 Jean-loup Gailly & Mark Adler\0" + VALUE "LegalCopyright", "(C) 1995-2024 Jean-loup Gailly & Mark Adler\0" END END BLOCK "VarFileInfo" diff --git a/src/PureLib/pure/zlib/contrib/vstudio/vc11/zlibvc.def b/src/PureLib/pure/zlib/contrib/vstudio/vc11/zlibvc.def index ba09bc1b98..3234a02d95 100644 --- a/src/PureLib/pure/zlib/contrib/vstudio/vc11/zlibvc.def +++ b/src/PureLib/pure/zlib/contrib/vstudio/vc11/zlibvc.def @@ -1,7 +1,7 @@ LIBRARY ; zlib data compression and ZIP file I/O library -VERSION 1.2 +VERSION 1.3.1 EXPORTS adler32 @1 diff --git a/src/PureLib/pure/zlib/contrib/vstudio/vc12/zlib.rc b/src/PureLib/pure/zlib/contrib/vstudio/vc12/zlib.rc index cdd7985d41..a55f341c74 100644 --- a/src/PureLib/pure/zlib/contrib/vstudio/vc12/zlib.rc +++ b/src/PureLib/pure/zlib/contrib/vstudio/vc12/zlib.rc @@ -2,8 +2,8 @@ #define IDR_VERSION1 1 IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE - FILEVERSION 1, 2, 13, 0 - PRODUCTVERSION 1, 2, 13, 0 + FILEVERSION 1, 3, 1, 0 + PRODUCTVERSION 1, 3, 1, 0 FILEFLAGSMASK VS_FFI_FILEFLAGSMASK FILEFLAGS 0 FILEOS VOS_DOS_WINDOWS32 @@ -17,12 +17,12 @@ BEGIN BEGIN VALUE "FileDescription", "zlib data compression and ZIP file I/O library\0" - VALUE "FileVersion", "1.2.13\0" + VALUE "FileVersion", "1.3.1\0" VALUE "InternalName", "zlib\0" VALUE "OriginalFilename", "zlibwapi.dll\0" VALUE "ProductName", "ZLib.DLL\0" VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0" - VALUE "LegalCopyright", "(C) 1995-2022 Jean-loup Gailly & Mark Adler\0" + VALUE "LegalCopyright", "(C) 1995-2024 Jean-loup Gailly & Mark Adler\0" END END BLOCK "VarFileInfo" diff --git a/src/PureLib/pure/zlib/contrib/vstudio/vc12/zlibvc.def b/src/PureLib/pure/zlib/contrib/vstudio/vc12/zlibvc.def index ba09bc1b98..3234a02d95 100644 --- a/src/PureLib/pure/zlib/contrib/vstudio/vc12/zlibvc.def +++ b/src/PureLib/pure/zlib/contrib/vstudio/vc12/zlibvc.def @@ -1,7 +1,7 @@ LIBRARY ; zlib data compression and ZIP file I/O library -VERSION 1.2 +VERSION 1.3.1 EXPORTS adler32 @1 diff --git a/src/PureLib/pure/zlib/contrib/vstudio/vc14/zlib.rc b/src/PureLib/pure/zlib/contrib/vstudio/vc14/zlib.rc index cdd7985d41..a55f341c74 100644 --- a/src/PureLib/pure/zlib/contrib/vstudio/vc14/zlib.rc +++ b/src/PureLib/pure/zlib/contrib/vstudio/vc14/zlib.rc @@ -2,8 +2,8 @@ #define IDR_VERSION1 1 IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE - FILEVERSION 1, 2, 13, 0 - PRODUCTVERSION 1, 2, 13, 0 + FILEVERSION 1, 3, 1, 0 + PRODUCTVERSION 1, 3, 1, 0 FILEFLAGSMASK VS_FFI_FILEFLAGSMASK FILEFLAGS 0 FILEOS VOS_DOS_WINDOWS32 @@ -17,12 +17,12 @@ BEGIN BEGIN VALUE "FileDescription", "zlib data compression and ZIP file I/O library\0" - VALUE "FileVersion", "1.2.13\0" + VALUE "FileVersion", "1.3.1\0" VALUE "InternalName", "zlib\0" VALUE "OriginalFilename", "zlibwapi.dll\0" VALUE "ProductName", "ZLib.DLL\0" VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0" - VALUE "LegalCopyright", "(C) 1995-2022 Jean-loup Gailly & Mark Adler\0" + VALUE "LegalCopyright", "(C) 1995-2024 Jean-loup Gailly & Mark Adler\0" END END BLOCK "VarFileInfo" diff --git a/src/PureLib/pure/zlib/contrib/vstudio/vc14/zlibvc.def b/src/PureLib/pure/zlib/contrib/vstudio/vc14/zlibvc.def index ba09bc1b98..3234a02d95 100644 --- a/src/PureLib/pure/zlib/contrib/vstudio/vc14/zlibvc.def +++ b/src/PureLib/pure/zlib/contrib/vstudio/vc14/zlibvc.def @@ -1,7 +1,7 @@ LIBRARY ; zlib data compression and ZIP file I/O library -VERSION 1.2 +VERSION 1.3.1 EXPORTS adler32 @1 diff --git a/src/PureLib/pure/zlib/contrib/vstudio/vc17/miniunz.vcxproj b/src/PureLib/pure/zlib/contrib/vstudio/vc17/miniunz.vcxproj new file mode 100644 index 0000000000..68ef16588b --- /dev/null +++ b/src/PureLib/pure/zlib/contrib/vstudio/vc17/miniunz.vcxproj @@ -0,0 +1,409 @@ + + + + + Debug + ARM + + + Debug + ARM64 + + + Debug + Win32 + + + Debug + x64 + + + Release + ARM + + + Release + ARM64 + + + Release + Win32 + + + Release + x64 + + + + {C52F9E7B-498A-42BE-8DB4-85A15694382A} + Win32Proj + 10.0 + + + + Application + MultiByte + v143 + + + Application + Unicode + v143 + + + Application + MultiByte + v143 + + + Application + MultiByte + v143 + + + Application + MultiByte + v143 + + + Application + MultiByte + v143 + + + Application + MultiByte + v143 + + + Application + MultiByte + v143 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30128.1 + x86\MiniUnzip$(Configuration)\ + x86\MiniUnzip$(Configuration)\Tmp\ + true + false + x86\MiniUnzip$(Configuration)\ + x86\MiniUnzip$(Configuration)\Tmp\ + false + false + x64\MiniUnzip$(Configuration)\ + x64\MiniUnzip$(Configuration)\Tmp\ + true + true + true + false + false + false + x64\MiniUnzip$(Configuration)\ + x64\MiniUnzip$(Configuration)\Tmp\ + false + false + false + false + false + false + AllRules.ruleset + + + AllRules.ruleset + AllRules.ruleset + AllRules.ruleset + + + + + + + AllRules.ruleset + + + AllRules.ruleset + AllRules.ruleset + AllRules.ruleset + + + + + + + + + arm64\MiniUnzip$(Configuration)\ + arm64\MiniUnzip$(Configuration)\Tmp\ + + + arm64\MiniUnzip$(Configuration)\ + arm64\MiniUnzip$(Configuration)\Tmp\ + + + arm\MiniUnzip$(Configuration)\ + arm\MiniUnzip$(Configuration)\Tmp\ + + + arm\MiniUnzip$(Configuration)\ + arm\MiniUnzip$(Configuration)\Tmp\ + + + + Disabled + ..\..\..;..\..\minizip;%(AdditionalIncludeDirectories) + WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + Default + MultiThreadedDebugDLL + false + + + $(IntDir) + Level3 + ProgramDatabase + + + x86\ZlibDllDebug\zlibwapi.lib;%(AdditionalDependencies) + $(OutDir)miniunz.exe + true + $(OutDir)miniunz.pdb + Console + false + + + MachineX86 + + + + + MaxSpeed + OnlyExplicitInline + true + ..\..\..;..\..\minizip;%(AdditionalIncludeDirectories) + WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + Default + MultiThreaded + false + true + + + $(IntDir) + Level3 + ProgramDatabase + + + x86\ZlibDllRelease\zlibwapi.lib;%(AdditionalDependencies) + $(OutDir)miniunz.exe + true + Console + true + true + false + + + MachineX86 + + + + + X64 + + + Disabled + ..\..\..;..\..\minizip;%(AdditionalIncludeDirectories) + _CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;_DEBUG;_CONSOLE;WIN64;%(PreprocessorDefinitions) + true + Default + MultiThreadedDebugDLL + false + + + $(IntDir) + Level3 + ProgramDatabase + + + x64\ZlibDllDebug\zlibwapi.lib;%(AdditionalDependencies) + $(OutDir)miniunz.exe + true + $(OutDir)miniunz.pdb + Console + MachineX64 + + + + + + Disabled + ..\..\..;..\..\minizip;%(AdditionalIncludeDirectories) + _CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;_DEBUG;_CONSOLE;WIN64;%(PreprocessorDefinitions) + true + Default + MultiThreadedDebugDLL + false + + + $(IntDir) + Level3 + ProgramDatabase + + + x64\ZlibDllDebug\zlibwapi.lib;%(AdditionalDependencies) + $(OutDir)miniunz.exe + true + $(OutDir)miniunz.pdb + Console + + + + + + Disabled + ..\..\..;..\..\minizip;%(AdditionalIncludeDirectories) + _CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;_DEBUG;_CONSOLE;WIN64;%(PreprocessorDefinitions) + true + Default + MultiThreadedDebugDLL + false + + + $(IntDir) + Level3 + ProgramDatabase + + + x64\ZlibDllDebug\zlibwapi.lib;%(AdditionalDependencies) + $(OutDir)miniunz.exe + true + $(OutDir)miniunz.pdb + Console + + + + + X64 + + + MaxSpeed + OnlyExplicitInline + true + ..\..\..;..\..\minizip;%(AdditionalIncludeDirectories) + _CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;NDEBUG;_CONSOLE;WIN64;%(PreprocessorDefinitions) + true + Default + MultiThreadedDLL + false + true + + + $(IntDir) + Level3 + ProgramDatabase + + + x64\ZlibDllRelease\zlibwapi.lib;%(AdditionalDependencies) + $(OutDir)miniunz.exe + true + Console + true + true + MachineX64 + + + + + + MaxSpeed + OnlyExplicitInline + true + ..\..\..;..\..\minizip;%(AdditionalIncludeDirectories) + _CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;NDEBUG;_CONSOLE;WIN64;%(PreprocessorDefinitions) + true + Default + MultiThreadedDLL + false + true + + + $(IntDir) + Level3 + ProgramDatabase + + + x64\ZlibDllRelease\zlibwapi.lib;%(AdditionalDependencies) + $(OutDir)miniunz.exe + true + Console + true + true + + + + + + MaxSpeed + OnlyExplicitInline + true + ..\..\..;..\..\minizip;%(AdditionalIncludeDirectories) + _CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;NDEBUG;_CONSOLE;WIN64;%(PreprocessorDefinitions) + true + Default + MultiThreadedDLL + false + true + + + $(IntDir) + Level3 + ProgramDatabase + + + x64\ZlibDllRelease\zlibwapi.lib;%(AdditionalDependencies) + $(OutDir)miniunz.exe + true + Console + true + true + + + + + + + + {8fd826f8-3739-44e6-8cc8-997122e53b8d} + + + + + + \ No newline at end of file diff --git a/src/PureLib/pure/zlib/contrib/vstudio/vc17/minizip.vcxproj b/src/PureLib/pure/zlib/contrib/vstudio/vc17/minizip.vcxproj new file mode 100644 index 0000000000..dd3c52e70c --- /dev/null +++ b/src/PureLib/pure/zlib/contrib/vstudio/vc17/minizip.vcxproj @@ -0,0 +1,405 @@ + + + + + Debug + ARM + + + Debug + ARM64 + + + Debug + Win32 + + + Debug + x64 + + + Release + ARM + + + Release + ARM64 + + + Release + Win32 + + + Release + x64 + + + + {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B} + Win32Proj + 10.0 + + + + Application + MultiByte + v143 + + + Application + Unicode + v143 + + + Application + MultiByte + v143 + + + Application + MultiByte + v143 + + + Application + MultiByte + v143 + + + Application + MultiByte + v143 + + + Application + MultiByte + v143 + + + Application + MultiByte + v143 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30128.1 + x86\MiniZip$(Configuration)\ + x86\MiniZip$(Configuration)\Tmp\ + true + false + x86\MiniZip$(Configuration)\ + x86\MiniZip$(Configuration)\Tmp\ + false + x64\$(Configuration)\ + x64\$(Configuration)\ + true + true + true + false + false + false + x64\$(Configuration)\ + x64\$(Configuration)\ + false + false + false + AllRules.ruleset + + + AllRules.ruleset + AllRules.ruleset + AllRules.ruleset + + + + + + + AllRules.ruleset + + + AllRules.ruleset + AllRules.ruleset + AllRules.ruleset + + + + + + + + + arm64\MiniZip$(Configuration)\ + arm64\MiniZip$(Configuration)\Tmp\ + + + arm64\MiniZip$(Configuration)\ + arm64\MiniZip$(Configuration)\Tmp\ + + + arm\MiniZip$(Configuration)\ + arm\MiniZip$(Configuration)\Tmp\ + + + arm\MiniZip$(Configuration)\ + arm\MiniZip$(Configuration)\Tmp\ + + + + Disabled + ..\..\..;..\..\minizip;%(AdditionalIncludeDirectories) + WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + Default + MultiThreadedDebugDLL + false + + + $(IntDir) + Level3 + ProgramDatabase + + + x86\ZlibDllDebug\zlibwapi.lib;%(AdditionalDependencies) + $(OutDir)minizip.exe + true + $(OutDir)minizip.pdb + Console + false + + + MachineX86 + + + + + MaxSpeed + OnlyExplicitInline + true + ..\..\..;..\..\minizip;%(AdditionalIncludeDirectories) + WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + Default + MultiThreaded + false + true + + + $(IntDir) + Level3 + ProgramDatabase + + + x86\ZlibDllRelease\zlibwapi.lib;%(AdditionalDependencies) + $(OutDir)minizip.exe + true + Console + true + true + false + + + MachineX86 + + + + + X64 + + + Disabled + ..\..\..;..\..\minizip;%(AdditionalIncludeDirectories) + _CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;_DEBUG;_CONSOLE;WIN64;%(PreprocessorDefinitions) + true + Default + MultiThreadedDebugDLL + false + + + $(IntDir) + Level3 + ProgramDatabase + + + x64\ZlibDllDebug\zlibwapi.lib;%(AdditionalDependencies) + $(OutDir)minizip.exe + true + $(OutDir)minizip.pdb + Console + MachineX64 + + + + + + Disabled + ..\..\..;..\..\minizip;%(AdditionalIncludeDirectories) + _CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;_DEBUG;_CONSOLE;WIN64;%(PreprocessorDefinitions) + true + Default + MultiThreadedDebugDLL + false + + + $(IntDir) + Level3 + ProgramDatabase + + + x64\ZlibDllDebug\zlibwapi.lib;%(AdditionalDependencies) + $(OutDir)minizip.exe + true + $(OutDir)minizip.pdb + Console + + + + + + Disabled + ..\..\..;..\..\minizip;%(AdditionalIncludeDirectories) + _CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;_DEBUG;_CONSOLE;WIN64;%(PreprocessorDefinitions) + true + Default + MultiThreadedDebugDLL + false + + + $(IntDir) + Level3 + ProgramDatabase + + + x64\ZlibDllDebug\zlibwapi.lib;%(AdditionalDependencies) + $(OutDir)minizip.exe + true + $(OutDir)minizip.pdb + Console + + + + + X64 + + + MaxSpeed + OnlyExplicitInline + true + ..\..\..;..\..\minizip;%(AdditionalIncludeDirectories) + _CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;NDEBUG;_CONSOLE;WIN64;%(PreprocessorDefinitions) + true + Default + MultiThreadedDLL + false + true + + + $(IntDir) + Level3 + ProgramDatabase + + + x64\ZlibDllRelease\zlibwapi.lib;%(AdditionalDependencies) + $(OutDir)minizip.exe + true + Console + true + true + MachineX64 + + + + + + MaxSpeed + OnlyExplicitInline + true + ..\..\..;..\..\minizip;%(AdditionalIncludeDirectories) + _CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;NDEBUG;_CONSOLE;WIN64;%(PreprocessorDefinitions) + true + Default + MultiThreadedDLL + false + true + + + $(IntDir) + Level3 + ProgramDatabase + + + x64\ZlibDllRelease\zlibwapi.lib;%(AdditionalDependencies) + $(OutDir)minizip.exe + true + Console + true + true + + + + + + MaxSpeed + OnlyExplicitInline + true + ..\..\..;..\..\minizip;%(AdditionalIncludeDirectories) + _CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;NDEBUG;_CONSOLE;WIN64;%(PreprocessorDefinitions) + true + Default + MultiThreadedDLL + false + true + + + $(IntDir) + Level3 + ProgramDatabase + + + x64\ZlibDllRelease\zlibwapi.lib;%(AdditionalDependencies) + $(OutDir)minizip.exe + true + Console + true + true + + + + + + + + {8fd826f8-3739-44e6-8cc8-997122e53b8d} + + + + + + \ No newline at end of file diff --git a/src/PureLib/pure/zlib/contrib/vstudio/vc17/testzlib.vcxproj b/src/PureLib/pure/zlib/contrib/vstudio/vc17/testzlib.vcxproj new file mode 100644 index 0000000000..4cc99b3ffe --- /dev/null +++ b/src/PureLib/pure/zlib/contrib/vstudio/vc17/testzlib.vcxproj @@ -0,0 +1,473 @@ + + + + + Debug + ARM + + + Debug + ARM64 + + + Debug + Win32 + + + Debug + x64 + + + ReleaseWithoutAsm + ARM + + + ReleaseWithoutAsm + ARM64 + + + ReleaseWithoutAsm + Win32 + + + ReleaseWithoutAsm + x64 + + + Release + ARM + + + Release + ARM64 + + + Release + Win32 + + + Release + x64 + + + + {AA6666AA-E09F-4135-9C0C-4FE50C3C654B} + testzlib + Win32Proj + 10.0 + + + + Application + MultiByte + true + v143 + + + Application + MultiByte + true + v143 + + + Application + Unicode + v143 + + + Application + true + v143 + + + Application + true + v143 + + + Application + true + v143 + + + Application + true + v143 + + + Application + true + v143 + + + Application + true + v143 + + + Application + v143 + + + Application + v143 + + + Application + v143 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30128.1 + x86\TestZlib$(Configuration)\ + x86\TestZlib$(Configuration)\Tmp\ + true + false + x86\TestZlib$(Configuration)\ + x86\TestZlib$(Configuration)\Tmp\ + false + false + x86\TestZlib$(Configuration)\ + x86\TestZlib$(Configuration)\Tmp\ + false + false + x64\TestZlib$(Configuration)\ + x64\TestZlib$(Configuration)\Tmp\ + false + false + false + x64\TestZlib$(Configuration)\ + x64\TestZlib$(Configuration)\Tmp\ + false + false + false + x64\TestZlib$(Configuration)\ + x64\TestZlib$(Configuration)\Tmp\ + false + false + false + AllRules.ruleset + + + AllRules.ruleset + AllRules.ruleset + AllRules.ruleset + + + + + + + AllRules.ruleset + + + AllRules.ruleset + AllRules.ruleset + AllRules.ruleset + + + + + + + AllRules.ruleset + + + AllRules.ruleset + AllRules.ruleset + AllRules.ruleset + + + + + + + + + arm64\TestZlib$(Configuration)\ + arm64\TestZlib$(Configuration)\Tmp\ + + + arm64\TestZlib$(Configuration)\ + arm64\TestZlib$(Configuration)\Tmp\ + + + arm64\TestZlib$(Configuration)\ + arm64\TestZlib$(Configuration)\Tmp\ + + + arm\TestZlib$(Configuration)\ + arm\TestZlib$(Configuration)\Tmp\ + + + arm\TestZlib$(Configuration)\ + arm\TestZlib$(Configuration)\Tmp\ + + + arm\TestZlib$(Configuration)\ + arm\TestZlib$(Configuration)\Tmp\ + + + + Disabled + ..\..\..;%(AdditionalIncludeDirectories) + WIN32;ZLIB_WINAPI;_DEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions) + true + Default + MultiThreadedDebugDLL + false + + + AssemblyAndSourceCode + $(IntDir) + Level3 + ProgramDatabase + + + %(AdditionalDependencies) + $(OutDir)testzlib.exe + true + $(OutDir)testzlib.pdb + Console + false + + + MachineX86 + + + + + MaxSpeed + OnlyExplicitInline + true + ..\..\..;%(AdditionalIncludeDirectories) + WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions) + true + Default + MultiThreaded + false + true + + + $(IntDir) + Level3 + ProgramDatabase + + + $(OutDir)testzlib.exe + true + Console + true + true + false + + + MachineX86 + + + + + MaxSpeed + OnlyExplicitInline + true + ..\..\..;%(AdditionalIncludeDirectories) + WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions) + true + Default + MultiThreaded + false + true + + + $(IntDir) + Level3 + ProgramDatabase + + + %(AdditionalDependencies) + $(OutDir)testzlib.exe + true + Console + true + true + false + + + MachineX86 + false + + + + + ..\..\..;%(AdditionalIncludeDirectories) + WIN32;ZLIB_WINAPI;_DEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions) + Default + MultiThreadedDebugDLL + false + $(IntDir) + + + %(AdditionalDependencies) + + + + + ..\..\..;%(AdditionalIncludeDirectories) + WIN32;ZLIB_WINAPI;_DEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions) + Default + MultiThreadedDebugDLL + false + $(IntDir) + + + %(AdditionalDependencies) + + + + + ..\..\..;%(AdditionalIncludeDirectories) + WIN32;ZLIB_WINAPI;_DEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions) + Default + MultiThreadedDebugDLL + false + $(IntDir) + + + %(AdditionalDependencies) + + + + + ..\..\..;%(AdditionalIncludeDirectories) + WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions) + Default + MultiThreadedDLL + false + $(IntDir) + + + %(AdditionalDependencies) + + + + + ..\..\..;%(AdditionalIncludeDirectories) + WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions) + Default + MultiThreadedDLL + false + $(IntDir) + + + %(AdditionalDependencies) + + + + + ..\..\..;%(AdditionalIncludeDirectories) + WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions) + Default + MultiThreadedDLL + false + $(IntDir) + + + %(AdditionalDependencies) + + + + + ..\..\..;%(AdditionalIncludeDirectories) + WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions) + Default + MultiThreadedDLL + false + $(IntDir) + + + %(AdditionalDependencies) + + + + + ..\..\..;%(AdditionalIncludeDirectories) + WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions) + Default + MultiThreadedDLL + false + $(IntDir) + + + %(AdditionalDependencies) + + + + + ..\..\..;%(AdditionalIncludeDirectories) + WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions) + Default + MultiThreadedDLL + false + $(IntDir) + + + %(AdditionalDependencies) + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/PureLib/pure/zlib/contrib/vstudio/vc17/testzlibdll.vcxproj b/src/PureLib/pure/zlib/contrib/vstudio/vc17/testzlibdll.vcxproj new file mode 100644 index 0000000000..73bba55da8 --- /dev/null +++ b/src/PureLib/pure/zlib/contrib/vstudio/vc17/testzlibdll.vcxproj @@ -0,0 +1,409 @@ + + + + + Debug + ARM + + + Debug + ARM64 + + + Debug + Win32 + + + Debug + x64 + + + Release + ARM + + + Release + ARM64 + + + Release + Win32 + + + Release + x64 + + + + {C52F9E7B-498A-42BE-8DB4-85A15694366A} + Win32Proj + 10.0 + + + + Application + MultiByte + v143 + + + Application + Unicode + v143 + + + Application + MultiByte + v143 + + + Application + MultiByte + v143 + + + Application + MultiByte + v143 + + + Application + MultiByte + v143 + + + Application + MultiByte + v143 + + + Application + MultiByte + v143 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30128.1 + x86\TestZlibDll$(Configuration)\ + x86\TestZlibDll$(Configuration)\Tmp\ + true + false + x86\TestZlibDll$(Configuration)\ + x86\TestZlibDll$(Configuration)\Tmp\ + false + false + x64\TestZlibDll$(Configuration)\ + x64\TestZlibDll$(Configuration)\Tmp\ + true + true + true + false + false + false + x64\TestZlibDll$(Configuration)\ + x64\TestZlibDll$(Configuration)\Tmp\ + false + false + false + false + false + false + AllRules.ruleset + + + AllRules.ruleset + AllRules.ruleset + AllRules.ruleset + + + + + + + AllRules.ruleset + + + AllRules.ruleset + AllRules.ruleset + AllRules.ruleset + + + + + + + + + arm64\TestZlibDll$(Configuration)\ + arm64\TestZlibDll$(Configuration)\Tmp\ + + + arm64\TestZlibDll$(Configuration)\ + arm64\TestZlibDll$(Configuration)\Tmp\ + + + arm\TestZlibDll$(Configuration)\ + arm\TestZlibDll$(Configuration)\Tmp\ + + + arm\TestZlibDll$(Configuration)\ + arm\TestZlibDll$(Configuration)\Tmp\ + + + + Disabled + ..\..\..;..\..\minizip;%(AdditionalIncludeDirectories) + WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + Default + MultiThreadedDebugDLL + false + + + $(IntDir) + Level3 + ProgramDatabase + + + x86\ZlibDllDebug\zlibwapi.lib;%(AdditionalDependencies) + $(OutDir)testzlibdll.exe + true + $(OutDir)testzlib.pdb + Console + false + + + MachineX86 + + + + + MaxSpeed + OnlyExplicitInline + true + ..\..\..;..\..\minizip;%(AdditionalIncludeDirectories) + WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + Default + MultiThreaded + false + true + + + $(IntDir) + Level3 + ProgramDatabase + + + x86\ZlibDllRelease\zlibwapi.lib;%(AdditionalDependencies) + $(OutDir)testzlibdll.exe + true + Console + true + true + false + + + MachineX86 + + + + + X64 + + + Disabled + ..\..\..;..\..\minizip;%(AdditionalIncludeDirectories) + _CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;_DEBUG;_CONSOLE;WIN64;%(PreprocessorDefinitions) + true + Default + MultiThreadedDebugDLL + false + + + $(IntDir) + Level3 + ProgramDatabase + + + x64\ZlibDllDebug\zlibwapi.lib;%(AdditionalDependencies) + $(OutDir)testzlibdll.exe + true + $(OutDir)testzlib.pdb + Console + MachineX64 + + + + + + Disabled + ..\..\..;..\..\minizip;%(AdditionalIncludeDirectories) + _CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;_DEBUG;_CONSOLE;WIN64;%(PreprocessorDefinitions) + true + Default + MultiThreadedDebugDLL + false + + + $(IntDir) + Level3 + ProgramDatabase + + + x64\ZlibDllDebug\zlibwapi.lib;%(AdditionalDependencies) + $(OutDir)testzlibdll.exe + true + $(OutDir)testzlib.pdb + Console + + + + + + Disabled + ..\..\..;..\..\minizip;%(AdditionalIncludeDirectories) + _CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;_DEBUG;_CONSOLE;WIN64;%(PreprocessorDefinitions) + true + Default + MultiThreadedDebugDLL + false + + + $(IntDir) + Level3 + ProgramDatabase + + + x64\ZlibDllDebug\zlibwapi.lib;%(AdditionalDependencies) + $(OutDir)testzlibdll.exe + true + $(OutDir)testzlib.pdb + Console + + + + + X64 + + + MaxSpeed + OnlyExplicitInline + true + ..\..\..;..\..\minizip;%(AdditionalIncludeDirectories) + _CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;NDEBUG;_CONSOLE;WIN64;%(PreprocessorDefinitions) + true + Default + MultiThreadedDLL + false + true + + + $(IntDir) + Level3 + ProgramDatabase + + + x64\ZlibDllRelease\zlibwapi.lib;%(AdditionalDependencies) + $(OutDir)testzlibdll.exe + true + Console + true + true + MachineX64 + + + + + + MaxSpeed + OnlyExplicitInline + true + ..\..\..;..\..\minizip;%(AdditionalIncludeDirectories) + _CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;NDEBUG;_CONSOLE;WIN64;%(PreprocessorDefinitions) + true + Default + MultiThreadedDLL + false + true + + + $(IntDir) + Level3 + ProgramDatabase + + + x64\ZlibDllRelease\zlibwapi.lib;%(AdditionalDependencies) + $(OutDir)testzlibdll.exe + true + Console + true + true + + + + + + MaxSpeed + OnlyExplicitInline + true + ..\..\..;..\..\minizip;%(AdditionalIncludeDirectories) + _CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;NDEBUG;_CONSOLE;WIN64;%(PreprocessorDefinitions) + true + Default + MultiThreadedDLL + false + true + + + $(IntDir) + Level3 + ProgramDatabase + + + x64\ZlibDllRelease\zlibwapi.lib;%(AdditionalDependencies) + $(OutDir)testzlibdll.exe + true + Console + true + true + + + + + + + + {8fd826f8-3739-44e6-8cc8-997122e53b8d} + + + + + + \ No newline at end of file diff --git a/src/PureLib/pure/zlib/contrib/vstudio/vc17/zlib.rc b/src/PureLib/pure/zlib/contrib/vstudio/vc17/zlib.rc new file mode 100644 index 0000000000..a55f341c74 --- /dev/null +++ b/src/PureLib/pure/zlib/contrib/vstudio/vc17/zlib.rc @@ -0,0 +1,32 @@ +#include + +#define IDR_VERSION1 1 +IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE + FILEVERSION 1, 3, 1, 0 + PRODUCTVERSION 1, 3, 1, 0 + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK + FILEFLAGS 0 + FILEOS VOS_DOS_WINDOWS32 + FILETYPE VFT_DLL + FILESUBTYPE 0 // not used +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904E4" + //language ID = U.S. English, char set = Windows, Multilingual + + BEGIN + VALUE "FileDescription", "zlib data compression and ZIP file I/O library\0" + VALUE "FileVersion", "1.3.1\0" + VALUE "InternalName", "zlib\0" + VALUE "OriginalFilename", "zlibwapi.dll\0" + VALUE "ProductName", "ZLib.DLL\0" + VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0" + VALUE "LegalCopyright", "(C) 1995-2024 Jean-loup Gailly & Mark Adler\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x0409, 1252 + END +END diff --git a/src/PureLib/pure/zlib/contrib/vstudio/vc17/zlibstat.vcxproj b/src/PureLib/pure/zlib/contrib/vstudio/vc17/zlibstat.vcxproj new file mode 100644 index 0000000000..b946ac2a90 --- /dev/null +++ b/src/PureLib/pure/zlib/contrib/vstudio/vc17/zlibstat.vcxproj @@ -0,0 +1,602 @@ + + + + + Debug + ARM + + + Debug + ARM64 + + + Debug + Win32 + + + Debug + x64 + + + ReleaseWithoutAsm + ARM + + + ReleaseWithoutAsm + ARM64 + + + ReleaseWithoutAsm + Win32 + + + ReleaseWithoutAsm + x64 + + + Release + ARM + + + Release + ARM64 + + + Release + Win32 + + + Release + x64 + + + + {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8} + 10.0 + + + + StaticLibrary + false + v143 + + + StaticLibrary + false + v143 + + + StaticLibrary + false + v143 + Unicode + + + StaticLibrary + false + v143 + + + StaticLibrary + false + v143 + + + StaticLibrary + false + v143 + + + StaticLibrary + false + v143 + + + StaticLibrary + false + v143 + + + StaticLibrary + false + v143 + + + StaticLibrary + false + v143 + + + StaticLibrary + false + v143 + + + StaticLibrary + false + v143 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30128.1 + x86\ZlibStat$(Configuration)\ + x86\ZlibStat$(Configuration)\Tmp\ + x86\ZlibStat$(Configuration)\ + x86\ZlibStat$(Configuration)\Tmp\ + x86\ZlibStat$(Configuration)\ + x86\ZlibStat$(Configuration)\Tmp\ + x64\ZlibStat$(Configuration)\ + x64\ZlibStat$(Configuration)\Tmp\ + x64\ZlibStat$(Configuration)\ + x64\ZlibStat$(Configuration)\Tmp\ + x64\ZlibStat$(Configuration)\ + x64\ZlibStat$(Configuration)\Tmp\ + AllRules.ruleset + + + AllRules.ruleset + AllRules.ruleset + AllRules.ruleset + + + + + + + AllRules.ruleset + + + AllRules.ruleset + AllRules.ruleset + AllRules.ruleset + + + + + + + AllRules.ruleset + + + AllRules.ruleset + AllRules.ruleset + AllRules.ruleset + + + + + + + + + arm64\ZlibStat$(Configuration)\ + arm64\ZlibStat$(Configuration)\Tmp\ + + + arm64\ZlibStat$(Configuration)\ + arm64\ZlibStat$(Configuration)\Tmp\ + + + arm64\ZlibStat$(Configuration)\ + arm64\ZlibStat$(Configuration)\Tmp\ + + + arm\ZlibStat$(Configuration)\ + arm\ZlibStat$(Configuration)\Tmp\ + + + arm\ZlibStat$(Configuration)\ + arm\ZlibStat$(Configuration)\Tmp\ + + + arm\ZlibStat$(Configuration)\ + arm\ZlibStat$(Configuration)\Tmp\ + + + + Disabled + ..\..\..;%(AdditionalIncludeDirectories) + WIN32;ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions) + + + MultiThreadedDebugDLL + false + $(IntDir)zlibstat.pch + $(IntDir) + $(IntDir) + $(OutDir) + Level3 + true + OldStyle + + + 0x040c + + + /MACHINE:X86 /NODEFAULTLIB %(AdditionalOptions) + $(OutDir)zlibstat.lib + true + + + + + OnlyExplicitInline + ..\..\..;%(AdditionalIncludeDirectories) + WIN32;ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions) + true + + + MultiThreaded + false + true + $(IntDir)zlibstat.pch + $(IntDir) + $(IntDir) + $(OutDir) + Level3 + true + + + 0x040c + + + /MACHINE:X86 /NODEFAULTLIB %(AdditionalOptions) + %(AdditionalDependencies) + $(OutDir)zlibstat.lib + true + + + + + OnlyExplicitInline + ..\..\..;%(AdditionalIncludeDirectories) + WIN32;ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions) + true + + + MultiThreaded + false + true + $(IntDir)zlibstat.pch + $(IntDir) + $(IntDir) + $(OutDir) + Level3 + true + + + 0x040c + + + /MACHINE:X86 /NODEFAULTLIB %(AdditionalOptions) + $(OutDir)zlibstat.lib + true + + + + + X64 + + + Disabled + ..\..\..;%(AdditionalIncludeDirectories) + ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions) + + + MultiThreadedDebugDLL + false + $(IntDir)zlibstat.pch + $(IntDir) + $(IntDir) + $(OutDir) + Level3 + true + OldStyle + + + 0x040c + + + /MACHINE:AMD64 /NODEFAULTLIB %(AdditionalOptions) + $(OutDir)zlibstat.lib + true + + + + + + Disabled + ..\..\..;%(AdditionalIncludeDirectories) + ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions) + + + MultiThreadedDebugDLL + false + $(IntDir)zlibstat.pch + $(IntDir) + $(IntDir) + $(OutDir) + Level3 + true + OldStyle + + + 0x040c + + + /MACHINE:ARM64 /NODEFAULTLIB %(AdditionalOptions) + $(OutDir)zlibstat.lib + true + + + + + + Disabled + ..\..\..;%(AdditionalIncludeDirectories) + ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions) + + + MultiThreadedDebugDLL + false + $(IntDir)zlibstat.pch + $(IntDir) + $(IntDir) + $(OutDir) + Level3 + true + OldStyle + + + 0x040c + + + /MACHINE:ARM /NODEFAULTLIB %(AdditionalOptions) + $(OutDir)zlibstat.lib + true + + + + + X64 + + + OnlyExplicitInline + ..\..\..;%(AdditionalIncludeDirectories) + ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions) + true + + + MultiThreadedDLL + false + true + $(IntDir)zlibstat.pch + $(IntDir) + $(IntDir) + $(OutDir) + Level3 + true + + + 0x040c + + + /MACHINE:AMD64 /NODEFAULTLIB %(AdditionalOptions) + %(AdditionalDependencies) + $(OutDir)zlibstat.lib + true + + + + + + OnlyExplicitInline + ..\..\..;%(AdditionalIncludeDirectories) + ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions) + true + + + MultiThreadedDLL + false + true + $(IntDir)zlibstat.pch + $(IntDir) + $(IntDir) + $(OutDir) + Level3 + true + + + 0x040c + + + /MACHINE:ARM64 /NODEFAULTLIB %(AdditionalOptions) + %(AdditionalDependencies) + $(OutDir)zlibstat.lib + true + + + + + + OnlyExplicitInline + ..\..\..;%(AdditionalIncludeDirectories) + ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions) + true + + + MultiThreadedDLL + false + true + $(IntDir)zlibstat.pch + $(IntDir) + $(IntDir) + $(OutDir) + Level3 + true + + + 0x040c + + + /MACHINE:ARM /NODEFAULTLIB %(AdditionalOptions) + %(AdditionalDependencies) + $(OutDir)zlibstat.lib + true + + + + + X64 + + + OnlyExplicitInline + ..\..\..;%(AdditionalIncludeDirectories) + ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions) + true + + + MultiThreadedDLL + false + true + $(IntDir)zlibstat.pch + $(IntDir) + $(IntDir) + $(OutDir) + Level3 + true + + + 0x040c + + + /MACHINE:AMD64 /NODEFAULTLIB %(AdditionalOptions) + $(OutDir)zlibstat.lib + true + + + + + + OnlyExplicitInline + ..\..\..;%(AdditionalIncludeDirectories) + ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions) + true + + + MultiThreadedDLL + false + true + $(IntDir)zlibstat.pch + $(IntDir) + $(IntDir) + $(OutDir) + Level3 + true + + + 0x040c + + + /MACHINE:ARM64 /NODEFAULTLIB %(AdditionalOptions) + $(OutDir)zlibstat.lib + true + + + + + + OnlyExplicitInline + ..\..\..;%(AdditionalIncludeDirectories) + ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions) + true + + + MultiThreadedDLL + false + true + $(IntDir)zlibstat.pch + $(IntDir) + $(IntDir) + $(OutDir) + Level3 + true + + + 0x040c + + + /MACHINE:ARM /NODEFAULTLIB %(AdditionalOptions) + $(OutDir)zlibstat.lib + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/PureLib/pure/zlib/contrib/vstudio/vc17/zlibvc.def b/src/PureLib/pure/zlib/contrib/vstudio/vc17/zlibvc.def new file mode 100644 index 0000000000..53947cc31b --- /dev/null +++ b/src/PureLib/pure/zlib/contrib/vstudio/vc17/zlibvc.def @@ -0,0 +1,158 @@ +LIBRARY +; zlib data compression and ZIP file I/O library + +VERSION 1.3.1 + +EXPORTS + adler32 @1 + compress @2 + crc32 @3 + deflate @4 + deflateCopy @5 + deflateEnd @6 + deflateInit2_ @7 + deflateInit_ @8 + deflateParams @9 + deflateReset @10 + deflateSetDictionary @11 + gzclose @12 + gzdopen @13 + gzerror @14 + gzflush @15 + gzopen @16 + gzread @17 + gzwrite @18 + inflate @19 + inflateEnd @20 + inflateInit2_ @21 + inflateInit_ @22 + inflateReset @23 + inflateSetDictionary @24 + inflateSync @25 + uncompress @26 + zlibVersion @27 + gzprintf @28 + gzputc @29 + gzgetc @30 + gzseek @31 + gzrewind @32 + gztell @33 + gzeof @34 + gzsetparams @35 + zError @36 + inflateSyncPoint @37 + get_crc_table @38 + compress2 @39 + gzputs @40 + gzgets @41 + inflateCopy @42 + inflateBackInit_ @43 + inflateBack @44 + inflateBackEnd @45 + compressBound @46 + deflateBound @47 + gzclearerr @48 + gzungetc @49 + zlibCompileFlags @50 + deflatePrime @51 + deflatePending @52 + + unzOpen @61 + unzClose @62 + unzGetGlobalInfo @63 + unzGetCurrentFileInfo @64 + unzGoToFirstFile @65 + unzGoToNextFile @66 + unzOpenCurrentFile @67 + unzReadCurrentFile @68 + unzOpenCurrentFile3 @69 + unztell @70 + unzeof @71 + unzCloseCurrentFile @72 + unzGetGlobalComment @73 + unzStringFileNameCompare @74 + unzLocateFile @75 + unzGetLocalExtrafield @76 + unzOpen2 @77 + unzOpenCurrentFile2 @78 + unzOpenCurrentFilePassword @79 + + zipOpen @80 + zipOpenNewFileInZip @81 + zipWriteInFileInZip @82 + zipCloseFileInZip @83 + zipClose @84 + zipOpenNewFileInZip2 @86 + zipCloseFileInZipRaw @87 + zipOpen2 @88 + zipOpenNewFileInZip3 @89 + + unzGetFilePos @100 + unzGoToFilePos @101 + + fill_win32_filefunc @110 + +; zlibwapi v1.2.4 added: + fill_win32_filefunc64 @111 + fill_win32_filefunc64A @112 + fill_win32_filefunc64W @113 + + unzOpen64 @120 + unzOpen2_64 @121 + unzGetGlobalInfo64 @122 + unzGetCurrentFileInfo64 @124 + unzGetCurrentFileZStreamPos64 @125 + unztell64 @126 + unzGetFilePos64 @127 + unzGoToFilePos64 @128 + + zipOpen64 @130 + zipOpen2_64 @131 + zipOpenNewFileInZip64 @132 + zipOpenNewFileInZip2_64 @133 + zipOpenNewFileInZip3_64 @134 + zipOpenNewFileInZip4_64 @135 + zipCloseFileInZipRaw64 @136 + +; zlib1 v1.2.4 added: + adler32_combine @140 + crc32_combine @142 + deflateSetHeader @144 + deflateTune @145 + gzbuffer @146 + gzclose_r @147 + gzclose_w @148 + gzdirect @149 + gzoffset @150 + inflateGetHeader @156 + inflateMark @157 + inflatePrime @158 + inflateReset2 @159 + inflateUndermine @160 + +; zlib1 v1.2.6 added: + gzgetc_ @161 + inflateResetKeep @163 + deflateResetKeep @164 + +; zlib1 v1.2.7 added: + gzopen_w @165 + +; zlib1 v1.2.8 added: + inflateGetDictionary @166 + gzvprintf @167 + +; zlib1 v1.2.9 added: + inflateCodesUsed @168 + inflateValidate @169 + uncompress2 @170 + gzfread @171 + gzfwrite @172 + deflateGetDictionary @173 + adler32_z @174 + crc32_z @175 + +; zlib1 v1.2.12 added: + crc32_combine_gen @176 + crc32_combine_gen64 @177 + crc32_combine_op @178 diff --git a/src/PureLib/pure/zlib/contrib/vstudio/vc17/zlibvc.sln b/src/PureLib/pure/zlib/contrib/vstudio/vc17/zlibvc.sln new file mode 100644 index 0000000000..67896b7470 --- /dev/null +++ b/src/PureLib/pure/zlib/contrib/vstudio/vc17/zlibvc.sln @@ -0,0 +1,179 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.4.33015.44 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlibvc", "zlibvc.vcxproj", "{8FD826F8-3739-44E6-8CC8-997122E53B8D}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlibstat", "zlibstat.vcxproj", "{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testzlib", "testzlib.vcxproj", "{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testzlibdll", "testzlibdll.vcxproj", "{C52F9E7B-498A-42BE-8DB4-85A15694366A}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "minizip", "minizip.vcxproj", "{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "miniunz", "miniunz.vcxproj", "{C52F9E7B-498A-42BE-8DB4-85A15694382A}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|ARM = Debug|ARM + Debug|ARM64 = Debug|ARM64 + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release|ARM = Release|ARM + Release|ARM64 = Release|ARM64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + ReleaseWithoutAsm|ARM = ReleaseWithoutAsm|ARM + ReleaseWithoutAsm|ARM64 = ReleaseWithoutAsm|ARM64 + ReleaseWithoutAsm|Win32 = ReleaseWithoutAsm|Win32 + ReleaseWithoutAsm|x64 = ReleaseWithoutAsm|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Debug|ARM.ActiveCfg = Debug|ARM + {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Debug|ARM.Build.0 = Debug|ARM + {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Debug|ARM64.Build.0 = Debug|ARM64 + {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Debug|Win32.ActiveCfg = Debug|Win32 + {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Debug|Win32.Build.0 = Debug|Win32 + {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Debug|x64.ActiveCfg = Debug|x64 + {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Debug|x64.Build.0 = Debug|x64 + {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|ARM.ActiveCfg = Release|ARM + {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|ARM.Build.0 = Release|ARM + {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|ARM64.ActiveCfg = Release|ARM64 + {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|ARM64.Build.0 = Release|ARM64 + {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|Win32.ActiveCfg = Release|Win32 + {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|Win32.Build.0 = Release|Win32 + {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|x64.ActiveCfg = Release|x64 + {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|x64.Build.0 = Release|x64 + {8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|ARM.ActiveCfg = ReleaseWithoutAsm|ARM + {8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|ARM.Build.0 = ReleaseWithoutAsm|ARM + {8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|ARM64.ActiveCfg = ReleaseWithoutAsm|ARM64 + {8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|ARM64.Build.0 = ReleaseWithoutAsm|ARM64 + {8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|Win32.ActiveCfg = ReleaseWithoutAsm|Win32 + {8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|Win32.Build.0 = ReleaseWithoutAsm|Win32 + {8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|x64.ActiveCfg = ReleaseWithoutAsm|x64 + {8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|x64.Build.0 = ReleaseWithoutAsm|x64 + {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|ARM.ActiveCfg = Debug|ARM + {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|ARM.Build.0 = Debug|ARM + {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|ARM64.Build.0 = Debug|ARM64 + {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|Win32.ActiveCfg = Debug|Win32 + {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|Win32.Build.0 = Debug|Win32 + {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|x64.ActiveCfg = Debug|x64 + {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|x64.Build.0 = Debug|x64 + {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|ARM.ActiveCfg = Release|ARM + {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|ARM.Build.0 = Release|ARM + {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|ARM64.ActiveCfg = Release|ARM64 + {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|ARM64.Build.0 = Release|ARM64 + {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|Win32.ActiveCfg = Release|Win32 + {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|Win32.Build.0 = Release|Win32 + {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|x64.ActiveCfg = Release|x64 + {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|x64.Build.0 = Release|x64 + {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|ARM.ActiveCfg = ReleaseWithoutAsm|ARM + {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|ARM.Build.0 = ReleaseWithoutAsm|ARM + {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|ARM64.ActiveCfg = ReleaseWithoutAsm|ARM64 + {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|ARM64.Build.0 = ReleaseWithoutAsm|ARM64 + {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|Win32.ActiveCfg = ReleaseWithoutAsm|Win32 + {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|Win32.Build.0 = ReleaseWithoutAsm|Win32 + {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|x64.ActiveCfg = ReleaseWithoutAsm|x64 + {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|x64.Build.0 = ReleaseWithoutAsm|x64 + {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Debug|ARM.ActiveCfg = Debug|ARM + {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Debug|ARM.Build.0 = Debug|ARM + {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Debug|ARM64.Build.0 = Debug|ARM64 + {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Debug|Win32.ActiveCfg = Debug|Win32 + {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Debug|Win32.Build.0 = Debug|Win32 + {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Debug|x64.ActiveCfg = Debug|x64 + {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Debug|x64.Build.0 = Debug|x64 + {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Release|ARM.ActiveCfg = Release|ARM + {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Release|ARM.Build.0 = Release|ARM + {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Release|ARM64.ActiveCfg = Release|ARM64 + {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Release|ARM64.Build.0 = Release|ARM64 + {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Release|Win32.ActiveCfg = Release|Win32 + {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Release|Win32.Build.0 = Release|Win32 + {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Release|x64.ActiveCfg = Release|x64 + {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Release|x64.Build.0 = Release|x64 + {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|ARM.ActiveCfg = ReleaseWithoutAsm|ARM + {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|ARM.Build.0 = ReleaseWithoutAsm|ARM + {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|ARM64.ActiveCfg = ReleaseWithoutAsm|ARM64 + {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|ARM64.Build.0 = ReleaseWithoutAsm|ARM64 + {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|Win32.ActiveCfg = ReleaseWithoutAsm|Win32 + {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|Win32.Build.0 = ReleaseWithoutAsm|Win32 + {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|x64.ActiveCfg = ReleaseWithoutAsm|x64 + {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|x64.Build.0 = ReleaseWithoutAsm|x64 + {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Debug|ARM.ActiveCfg = Debug|ARM + {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Debug|ARM.Build.0 = Debug|ARM + {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Debug|ARM64.Build.0 = Debug|ARM64 + {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Debug|Win32.ActiveCfg = Debug|Win32 + {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Debug|Win32.Build.0 = Debug|Win32 + {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Debug|x64.ActiveCfg = Debug|x64 + {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Debug|x64.Build.0 = Debug|x64 + {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Release|ARM.ActiveCfg = Release|ARM + {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Release|ARM.Build.0 = Release|ARM + {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Release|ARM64.ActiveCfg = Release|ARM64 + {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Release|ARM64.Build.0 = Release|ARM64 + {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Release|Win32.ActiveCfg = Release|Win32 + {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Release|Win32.Build.0 = Release|Win32 + {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Release|x64.ActiveCfg = Release|x64 + {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Release|x64.Build.0 = Release|x64 + {C52F9E7B-498A-42BE-8DB4-85A15694366A}.ReleaseWithoutAsm|ARM.ActiveCfg = Release|ARM + {C52F9E7B-498A-42BE-8DB4-85A15694366A}.ReleaseWithoutAsm|ARM.Build.0 = Release|ARM + {C52F9E7B-498A-42BE-8DB4-85A15694366A}.ReleaseWithoutAsm|ARM64.ActiveCfg = Release|ARM64 + {C52F9E7B-498A-42BE-8DB4-85A15694366A}.ReleaseWithoutAsm|ARM64.Build.0 = Release|ARM64 + {C52F9E7B-498A-42BE-8DB4-85A15694366A}.ReleaseWithoutAsm|Win32.ActiveCfg = Release|Win32 + {C52F9E7B-498A-42BE-8DB4-85A15694366A}.ReleaseWithoutAsm|x64.ActiveCfg = Release|x64 + {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Debug|ARM.ActiveCfg = Debug|ARM + {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Debug|ARM.Build.0 = Debug|ARM + {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Debug|ARM64.Build.0 = Debug|ARM64 + {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Debug|Win32.ActiveCfg = Debug|Win32 + {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Debug|Win32.Build.0 = Debug|Win32 + {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Debug|x64.ActiveCfg = Debug|x64 + {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Debug|x64.Build.0 = Debug|x64 + {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Release|ARM.ActiveCfg = Release|ARM + {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Release|ARM.Build.0 = Release|ARM + {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Release|ARM64.ActiveCfg = Release|ARM64 + {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Release|ARM64.Build.0 = Release|ARM64 + {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Release|Win32.ActiveCfg = Release|Win32 + {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Release|Win32.Build.0 = Release|Win32 + {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Release|x64.ActiveCfg = Release|x64 + {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Release|x64.Build.0 = Release|x64 + {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|ARM.ActiveCfg = Release|ARM + {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|ARM.Build.0 = Release|ARM + {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|ARM64.ActiveCfg = Release|ARM64 + {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|ARM64.Build.0 = Release|ARM64 + {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|Win32.ActiveCfg = Release|Win32 + {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|x64.ActiveCfg = Release|x64 + {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Debug|ARM.ActiveCfg = Debug|ARM + {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Debug|ARM.Build.0 = Debug|ARM + {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Debug|ARM64.Build.0 = Debug|ARM64 + {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Debug|Win32.ActiveCfg = Debug|Win32 + {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Debug|Win32.Build.0 = Debug|Win32 + {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Debug|x64.ActiveCfg = Debug|x64 + {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Debug|x64.Build.0 = Debug|x64 + {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Release|ARM.ActiveCfg = Release|ARM + {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Release|ARM.Build.0 = Release|ARM + {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Release|ARM64.ActiveCfg = Release|ARM64 + {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Release|ARM64.Build.0 = Release|ARM64 + {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Release|Win32.ActiveCfg = Release|Win32 + {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Release|Win32.Build.0 = Release|Win32 + {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Release|x64.ActiveCfg = Release|x64 + {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Release|x64.Build.0 = Release|x64 + {C52F9E7B-498A-42BE-8DB4-85A15694382A}.ReleaseWithoutAsm|ARM.ActiveCfg = Release|ARM + {C52F9E7B-498A-42BE-8DB4-85A15694382A}.ReleaseWithoutAsm|ARM.Build.0 = Release|ARM + {C52F9E7B-498A-42BE-8DB4-85A15694382A}.ReleaseWithoutAsm|ARM64.ActiveCfg = Release|ARM64 + {C52F9E7B-498A-42BE-8DB4-85A15694382A}.ReleaseWithoutAsm|ARM64.Build.0 = Release|ARM64 + {C52F9E7B-498A-42BE-8DB4-85A15694382A}.ReleaseWithoutAsm|Win32.ActiveCfg = Release|Win32 + {C52F9E7B-498A-42BE-8DB4-85A15694382A}.ReleaseWithoutAsm|x64.ActiveCfg = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {EAA58685-56D9-43F2-8703-FD2CB020745E} + EndGlobalSection +EndGlobal diff --git a/src/PureLib/pure/zlib/contrib/vstudio/vc17/zlibvc.vcxproj b/src/PureLib/pure/zlib/contrib/vstudio/vc17/zlibvc.vcxproj new file mode 100644 index 0000000000..10a7a901ef --- /dev/null +++ b/src/PureLib/pure/zlib/contrib/vstudio/vc17/zlibvc.vcxproj @@ -0,0 +1,875 @@ + + + + + Debug + ARM + + + Debug + ARM64 + + + Debug + Win32 + + + Debug + x64 + + + ReleaseWithoutAsm + ARM + + + ReleaseWithoutAsm + ARM64 + + + ReleaseWithoutAsm + Win32 + + + ReleaseWithoutAsm + x64 + + + Release + ARM + + + Release + ARM64 + + + Release + Win32 + + + Release + x64 + + + + {8FD826F8-3739-44E6-8CC8-997122E53B8D} + 10.0 + + + + DynamicLibrary + false + true + v143 + + + DynamicLibrary + false + true + v143 + + + DynamicLibrary + false + v143 + Unicode + + + DynamicLibrary + false + true + v143 + + + DynamicLibrary + false + true + v143 + + + DynamicLibrary + false + true + v143 + + + DynamicLibrary + false + true + v143 + + + DynamicLibrary + false + true + v143 + + + DynamicLibrary + false + true + v143 + + + DynamicLibrary + false + v143 + + + DynamicLibrary + false + v143 + + + DynamicLibrary + false + v143 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30128.1 + x86\ZlibDll$(Configuration)\ + x86\ZlibDll$(Configuration)\Tmp\ + true + false + x86\ZlibDll$(Configuration)\ + x86\ZlibDll$(Configuration)\Tmp\ + false + false + x86\ZlibDll$(Configuration)\ + x86\ZlibDll$(Configuration)\Tmp\ + false + false + x64\ZlibDll$(Configuration)\ + x64\ZlibDll$(Configuration)\Tmp\ + true + true + true + false + false + false + x64\ZlibDll$(Configuration)\ + x64\ZlibDll$(Configuration)\Tmp\ + false + false + false + false + false + false + x64\ZlibDll$(Configuration)\ + x64\ZlibDll$(Configuration)\Tmp\ + false + false + false + false + false + false + AllRules.ruleset + + + AllRules.ruleset + AllRules.ruleset + AllRules.ruleset + + + + + + + AllRules.ruleset + + + AllRules.ruleset + AllRules.ruleset + AllRules.ruleset + + + + + + + AllRules.ruleset + + + AllRules.ruleset + AllRules.ruleset + AllRules.ruleset + + + + + + + zlibwapi + zlibwapi + zlibwapi + zlibwapi + zlibwapi + zlibwapi + zlibwapi + zlibwapi + zlibwapi + zlibwapi + zlibwapi + zlibwapi + + + arm64\ZlibDll$(Configuration)\ + arm64\ZlibDll$(Configuration)\Tmp\ + + + arm\ZlibDll$(Configuration)\ + arm\ZlibDll$(Configuration)\Tmp\ + + + arm64\ZlibDll$(Configuration)\ + arm64\ZlibDll$(Configuration)\Tmp\ + + + arm64\ZlibDll$(Configuration)\ + arm64\ZlibDll$(Configuration)\Tmp\ + + + arm\ZlibDll$(Configuration)\ + arm\ZlibDll$(Configuration)\Tmp\ + + + arm\ZlibDll$(Configuration)\ + arm\ZlibDll$(Configuration)\Tmp\ + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + $(OutDir)zlibvc.tlb + + + Disabled + ..\..\..;%(AdditionalIncludeDirectories) + WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;%(PreprocessorDefinitions) + + + MultiThreadedDebugDLL + false + $(IntDir)zlibvc.pch + $(IntDir) + $(IntDir) + $(OutDir) + + + Level3 + true + ProgramDatabase + + + _DEBUG;%(PreprocessorDefinitions) + 0x040c + + + /MACHINE:I386 %(AdditionalOptions) + %(AdditionalDependencies) + $(OutDir)zlibwapi.dll + true + .\zlibvc.def + true + $(OutDir)zlibwapi.pdb + true + $(OutDir)zlibwapi.map + Windows + false + + + $(OutDir)zlibwapi.lib + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + $(OutDir)zlibvc.tlb + + + OnlyExplicitInline + ..\..\..;%(AdditionalIncludeDirectories) + WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;%(PreprocessorDefinitions) + true + + + MultiThreadedDLL + false + true + $(IntDir)zlibvc.pch + All + $(IntDir) + $(IntDir) + $(OutDir) + + + Level3 + true + + + NDEBUG;%(PreprocessorDefinitions) + 0x040c + + + /MACHINE:I386 %(AdditionalOptions) + $(OutDir)zlibwapi.dll + true + false + .\zlibvc.def + $(OutDir)zlibwapi.pdb + true + $(OutDir)zlibwapi.map + Windows + false + + + $(OutDir)zlibwapi.lib + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + $(OutDir)zlibvc.tlb + + + OnlyExplicitInline + ..\..\..;%(AdditionalIncludeDirectories) + WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;%(PreprocessorDefinitions) + true + + + MultiThreaded + false + true + $(IntDir)zlibvc.pch + All + $(IntDir) + $(IntDir) + $(OutDir) + + + Level3 + true + + + NDEBUG;%(PreprocessorDefinitions) + 0x040c + + + /MACHINE:I386 %(AdditionalOptions) + %(AdditionalDependencies) + $(OutDir)zlibwapi.dll + true + false + .\zlibvc.def + $(OutDir)zlibwapi.pdb + true + $(OutDir)zlibwapi.map + Windows + false + + + $(OutDir)zlibwapi.lib + false + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + X64 + $(OutDir)zlibvc.tlb + + + Disabled + ..\..\..;%(AdditionalIncludeDirectories) + WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64;%(PreprocessorDefinitions) + + + MultiThreadedDebugDLL + false + $(IntDir)zlibvc.pch + $(IntDir) + $(IntDir) + $(OutDir) + + + Level3 + true + ProgramDatabase + + + _DEBUG;%(PreprocessorDefinitions) + 0x040c + + + %(AdditionalDependencies) + $(OutDir)zlibwapi.dll + true + .\zlibvc.def + true + $(OutDir)zlibwapi.pdb + true + $(OutDir)zlibwapi.map + Windows + $(OutDir)zlibwapi.lib + MachineX64 + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + $(OutDir)zlibvc.tlb + + + Disabled + ..\..\..;%(AdditionalIncludeDirectories) + WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64;%(PreprocessorDefinitions) + + + MultiThreadedDebugDLL + false + $(IntDir)zlibvc.pch + $(IntDir) + $(IntDir) + $(OutDir) + + + Level3 + true + ProgramDatabase + + + _DEBUG;%(PreprocessorDefinitions) + 0x040c + + + %(AdditionalDependencies) + $(OutDir)zlibwapi.dll + true + .\zlibvc.def + true + $(OutDir)zlibwapi.pdb + true + $(OutDir)zlibwapi.map + Windows + $(OutDir)zlibwapi.lib + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + $(OutDir)zlibvc.tlb + + + Disabled + ..\..\..;%(AdditionalIncludeDirectories) + WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64;%(PreprocessorDefinitions) + + + MultiThreadedDebugDLL + false + $(IntDir)zlibvc.pch + $(IntDir) + $(IntDir) + $(OutDir) + + + Level3 + true + ProgramDatabase + + + _DEBUG;%(PreprocessorDefinitions) + 0x040c + + + %(AdditionalDependencies) + $(OutDir)zlibwapi.dll + true + .\zlibvc.def + true + $(OutDir)zlibwapi.pdb + true + $(OutDir)zlibwapi.map + Windows + $(OutDir)zlibwapi.lib + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + X64 + $(OutDir)zlibvc.tlb + + + OnlyExplicitInline + ..\..\..;%(AdditionalIncludeDirectories) + WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64;%(PreprocessorDefinitions) + true + + + MultiThreadedDLL + false + true + $(IntDir)zlibvc.pch + All + $(IntDir) + $(IntDir) + $(OutDir) + + + Level3 + true + + + NDEBUG;%(PreprocessorDefinitions) + 0x040c + + + $(OutDir)zlibwapi.dll + true + false + .\zlibvc.def + $(OutDir)zlibwapi.pdb + true + $(OutDir)zlibwapi.map + Windows + $(OutDir)zlibwapi.lib + MachineX64 + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + $(OutDir)zlibvc.tlb + + + OnlyExplicitInline + ..\..\..;%(AdditionalIncludeDirectories) + WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64;%(PreprocessorDefinitions) + true + + + MultiThreadedDLL + false + true + $(IntDir)zlibvc.pch + All + $(IntDir) + $(IntDir) + $(OutDir) + + + Level3 + true + + + NDEBUG;%(PreprocessorDefinitions) + 0x040c + + + $(OutDir)zlibwapi.dll + true + false + .\zlibvc.def + $(OutDir)zlibwapi.pdb + true + $(OutDir)zlibwapi.map + Windows + $(OutDir)zlibwapi.lib + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + $(OutDir)zlibvc.tlb + + + OnlyExplicitInline + ..\..\..;%(AdditionalIncludeDirectories) + WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64;%(PreprocessorDefinitions) + true + + + MultiThreadedDLL + false + true + $(IntDir)zlibvc.pch + All + $(IntDir) + $(IntDir) + $(OutDir) + + + Level3 + true + + + NDEBUG;%(PreprocessorDefinitions) + 0x040c + + + $(OutDir)zlibwapi.dll + true + false + .\zlibvc.def + $(OutDir)zlibwapi.pdb + true + $(OutDir)zlibwapi.map + Windows + $(OutDir)zlibwapi.lib + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + X64 + $(OutDir)zlibvc.tlb + + + OnlyExplicitInline + ..\..\..;%(AdditionalIncludeDirectories) + _CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64;%(PreprocessorDefinitions) + true + + + MultiThreadedDLL + false + true + $(IntDir)zlibvc.pch + All + $(IntDir) + $(IntDir) + $(OutDir) + + + Level3 + true + + + NDEBUG;%(PreprocessorDefinitions) + 0x040c + + + %(AdditionalDependencies) + $(OutDir)zlibwapi.dll + true + false + .\zlibvc.def + $(OutDir)zlibwapi.pdb + true + $(OutDir)zlibwapi.map + Windows + $(OutDir)zlibwapi.lib + MachineX64 + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + $(OutDir)zlibvc.tlb + + + OnlyExplicitInline + ..\..\..;%(AdditionalIncludeDirectories) + _CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64;%(PreprocessorDefinitions) + true + + + MultiThreadedDLL + false + true + $(IntDir)zlibvc.pch + All + $(IntDir) + $(IntDir) + $(OutDir) + + + Level3 + true + + + NDEBUG;%(PreprocessorDefinitions) + 0x040c + + + %(AdditionalDependencies) + $(OutDir)zlibwapi.dll + true + false + .\zlibvc.def + $(OutDir)zlibwapi.pdb + true + $(OutDir)zlibwapi.map + Windows + $(OutDir)zlibwapi.lib + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + $(OutDir)zlibvc.tlb + + + OnlyExplicitInline + ..\..\..;%(AdditionalIncludeDirectories) + _CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN32;%(PreprocessorDefinitions) + true + + + MultiThreadedDLL + false + true + $(IntDir)zlibvc.pch + All + $(IntDir) + $(IntDir) + $(OutDir) + + + Level3 + true + + + NDEBUG;%(PreprocessorDefinitions) + 0x040c + + + %(AdditionalDependencies) + $(OutDir)zlibwapi.dll + true + false + .\zlibvc.def + $(OutDir)zlibwapi.pdb + true + $(OutDir)zlibwapi.map + Windows + $(OutDir)zlibwapi.lib + + + + + + + + + + + + + + + + + + + + + %(AdditionalIncludeDirectories) + ZLIB_INTERNAL;%(PreprocessorDefinitions) + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + ZLIB_INTERNAL;%(PreprocessorDefinitions) + ZLIB_INTERNAL;%(PreprocessorDefinitions) + ZLIB_INTERNAL;%(PreprocessorDefinitions) + + + %(AdditionalIncludeDirectories) + ZLIB_INTERNAL;%(PreprocessorDefinitions) + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + ZLIB_INTERNAL;%(PreprocessorDefinitions) + ZLIB_INTERNAL;%(PreprocessorDefinitions) + ZLIB_INTERNAL;%(PreprocessorDefinitions) + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/PureLib/pure/zlib/contrib/vstudio/vc9/zlib.rc b/src/PureLib/pure/zlib/contrib/vstudio/vc9/zlib.rc index 876027498a..856bd11f08 100644 --- a/src/PureLib/pure/zlib/contrib/vstudio/vc9/zlib.rc +++ b/src/PureLib/pure/zlib/contrib/vstudio/vc9/zlib.rc @@ -2,8 +2,8 @@ #define IDR_VERSION1 1 IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE - FILEVERSION 1, 2, 13, 0 - PRODUCTVERSION 1, 2, 13, 0 + FILEVERSION 1, 3, 1, 0 + PRODUCTVERSION 1, 3, 1, 0 FILEFLAGSMASK VS_FFI_FILEFLAGSMASK FILEFLAGS 0 FILEOS VOS_DOS_WINDOWS32 @@ -17,12 +17,12 @@ BEGIN BEGIN VALUE "FileDescription", "zlib data compression and ZIP file I/O library\0" - VALUE "FileVersion", "1.2.13\0" + VALUE "FileVersion", "1.3.1\0" VALUE "InternalName", "zlib\0" VALUE "OriginalFilename", "zlibwapi.dll\0" VALUE "ProductName", "ZLib.DLL\0" VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0" - VALUE "LegalCopyright", "(C) 1995-2022 Jean-loup Gailly & Mark Adler\0" + VALUE "LegalCopyright", "(C) 1995-2024 Jean-loup Gailly & Mark Adler\0" END END BLOCK "VarFileInfo" diff --git a/src/PureLib/pure/zlib/contrib/vstudio/vc9/zlibvc.def b/src/PureLib/pure/zlib/contrib/vstudio/vc9/zlibvc.def index ba09bc1b98..3234a02d95 100644 --- a/src/PureLib/pure/zlib/contrib/vstudio/vc9/zlibvc.def +++ b/src/PureLib/pure/zlib/contrib/vstudio/vc9/zlibvc.def @@ -1,7 +1,7 @@ LIBRARY ; zlib data compression and ZIP file I/O library -VERSION 1.2 +VERSION 1.3.1 EXPORTS adler32 @1 diff --git a/src/PureLib/pure/zlib/crc32.c b/src/PureLib/pure/zlib/crc32.c index f8357b083f..6c38f5c04c 100644 --- a/src/PureLib/pure/zlib/crc32.c +++ b/src/PureLib/pure/zlib/crc32.c @@ -103,19 +103,6 @@ # define ARMCRC32 #endif -/* Local functions. */ -local z_crc_t multmodp OF((z_crc_t a, z_crc_t b)); -local z_crc_t x2nmodp OF((z_off64_t n, unsigned k)); - -#if defined(W) && (!defined(ARMCRC32) || defined(DYNAMIC_CRC_TABLE)) - local z_word_t byte_swap OF((z_word_t word)); -#endif - -#if defined(W) && !defined(ARMCRC32) - local z_crc_t crc_word OF((z_word_t data)); - local z_word_t crc_word_big OF((z_word_t data)); -#endif - #if defined(W) && (!defined(ARMCRC32) || defined(DYNAMIC_CRC_TABLE)) /* Swap the bytes in a z_word_t to convert between little and big endian. Any @@ -123,9 +110,7 @@ local z_crc_t x2nmodp OF((z_off64_t n, unsigned k)); instruction, if one is available. This assumes that word_t is either 32 bits or 64 bits. */ -local z_word_t byte_swap(word) - z_word_t word; -{ +local z_word_t byte_swap(z_word_t word) { # if W == 8 return (word & 0xff00000000000000) >> 56 | @@ -146,24 +131,77 @@ local z_word_t byte_swap(word) } #endif +#ifdef DYNAMIC_CRC_TABLE +/* ========================================================================= + * Table of powers of x for combining CRC-32s, filled in by make_crc_table() + * below. + */ + local z_crc_t FAR x2n_table[32]; +#else +/* ========================================================================= + * Tables for byte-wise and braided CRC-32 calculations, and a table of powers + * of x for combining CRC-32s, all made by make_crc_table(). + */ +# include "crc32.h" +#endif + /* CRC polynomial. */ #define POLY 0xedb88320 /* p(x) reflected, with x^32 implied */ -#ifdef DYNAMIC_CRC_TABLE +/* + Return a(x) multiplied by b(x) modulo p(x), where p(x) is the CRC polynomial, + reflected. For speed, this requires that a not be zero. + */ +local z_crc_t multmodp(z_crc_t a, z_crc_t b) { + z_crc_t m, p; + + m = (z_crc_t)1 << 31; + p = 0; + for (;;) { + if (a & m) { + p ^= b; + if ((a & (m - 1)) == 0) + break; + } + m >>= 1; + b = b & 1 ? (b >> 1) ^ POLY : b >> 1; + } + return p; +} +/* + Return x^(n * 2^k) modulo p(x). Requires that x2n_table[] has been + initialized. + */ +local z_crc_t x2nmodp(z_off64_t n, unsigned k) { + z_crc_t p; + + p = (z_crc_t)1 << 31; /* x^0 == 1 */ + while (n) { + if (n & 1) + p = multmodp(x2n_table[k & 31], p); + n >>= 1; + k++; + } + return p; +} + +#ifdef DYNAMIC_CRC_TABLE +/* ========================================================================= + * Build the tables for byte-wise and braided CRC-32 calculations, and a table + * of powers of x for combining CRC-32s. + */ local z_crc_t FAR crc_table[256]; -local z_crc_t FAR x2n_table[32]; -local void make_crc_table OF((void)); #ifdef W local z_word_t FAR crc_big_table[256]; local z_crc_t FAR crc_braid_table[W][256]; local z_word_t FAR crc_braid_big_table[W][256]; - local void braid OF((z_crc_t [][256], z_word_t [][256], int, int)); + local void braid(z_crc_t [][256], z_word_t [][256], int, int); #endif #ifdef MAKECRCH - local void write_table OF((FILE *, const z_crc_t FAR *, int)); - local void write_table32hi OF((FILE *, const z_word_t FAR *, int)); - local void write_table64 OF((FILE *, const z_word_t FAR *, int)); + local void write_table(FILE *, const z_crc_t FAR *, int); + local void write_table32hi(FILE *, const z_word_t FAR *, int); + local void write_table64(FILE *, const z_word_t FAR *, int); #endif /* MAKECRCH */ /* @@ -176,7 +214,6 @@ local void make_crc_table OF((void)); /* Definition of once functionality. */ typedef struct once_s once_t; -local void once OF((once_t *, void (*)(void))); /* Check for the availability of atomics. */ #if defined(__STDC__) && __STDC_VERSION__ >= 201112L && \ @@ -196,10 +233,7 @@ struct once_s { invoke once() at the same time. The state must be a once_t initialized with ONCE_INIT. */ -local void once(state, init) - once_t *state; - void (*init)(void); -{ +local void once(once_t *state, void (*init)(void)) { if (!atomic_load(&state->done)) { if (atomic_flag_test_and_set(&state->begun)) while (!atomic_load(&state->done)) @@ -222,10 +256,7 @@ struct once_s { /* Test and set. Alas, not atomic, but tries to minimize the period of vulnerability. */ -local int test_and_set OF((int volatile *)); -local int test_and_set(flag) - int volatile *flag; -{ +local int test_and_set(int volatile *flag) { int was; was = *flag; @@ -234,10 +265,7 @@ local int test_and_set(flag) } /* Run the provided init() function once. This is not thread-safe. */ -local void once(state, init) - once_t *state; - void (*init)(void); -{ +local void once(once_t *state, void (*init)(void)) { if (!state->done) { if (test_and_set(&state->begun)) while (!state->done) @@ -279,8 +307,7 @@ local once_t made = ONCE_INIT; combinations of CRC register values and incoming bytes. */ -local void make_crc_table() -{ +local void make_crc_table(void) { unsigned i, j, n; z_crc_t p; @@ -447,11 +474,7 @@ local void make_crc_table() Write the 32-bit values in table[0..k-1] to out, five per line in hexadecimal separated by commas. */ -local void write_table(out, table, k) - FILE *out; - const z_crc_t FAR *table; - int k; -{ +local void write_table(FILE *out, const z_crc_t FAR *table, int k) { int n; for (n = 0; n < k; n++) @@ -464,11 +487,7 @@ local void write_table(out, table, k) Write the high 32-bits of each value in table[0..k-1] to out, five per line in hexadecimal separated by commas. */ -local void write_table32hi(out, table, k) -FILE *out; -const z_word_t FAR *table; -int k; -{ +local void write_table32hi(FILE *out, const z_word_t FAR *table, int k) { int n; for (n = 0; n < k; n++) @@ -484,11 +503,7 @@ int k; bits. If not, then the type cast and format string can be adjusted accordingly. */ -local void write_table64(out, table, k) - FILE *out; - const z_word_t FAR *table; - int k; -{ +local void write_table64(FILE *out, const z_word_t FAR *table, int k) { int n; for (n = 0; n < k; n++) @@ -498,8 +513,7 @@ local void write_table64(out, table, k) } /* Actually do the deed. */ -int main() -{ +int main(void) { make_crc_table(); return 0; } @@ -511,12 +525,7 @@ int main() Generate the little and big-endian braid tables for the given n and z_word_t size w. Each array must have room for w blocks of 256 elements. */ -local void braid(ltl, big, n, w) - z_crc_t ltl[][256]; - z_word_t big[][256]; - int n; - int w; -{ +local void braid(z_crc_t ltl[][256], z_word_t big[][256], int n, int w) { int k; z_crc_t i, p, q; for (k = 0; k < w; k++) { @@ -531,69 +540,13 @@ local void braid(ltl, big, n, w) } #endif -#else /* !DYNAMIC_CRC_TABLE */ -/* ======================================================================== - * Tables for byte-wise and braided CRC-32 calculations, and a table of powers - * of x for combining CRC-32s, all made by make_crc_table(). - */ -#include "crc32.h" #endif /* DYNAMIC_CRC_TABLE */ -/* ======================================================================== - * Routines used for CRC calculation. Some are also required for the table - * generation above. - */ - -/* - Return a(x) multiplied by b(x) modulo p(x), where p(x) is the CRC polynomial, - reflected. For speed, this requires that a not be zero. - */ -local z_crc_t multmodp(a, b) - z_crc_t a; - z_crc_t b; -{ - z_crc_t m, p; - - m = (z_crc_t)1 << 31; - p = 0; - for (;;) { - if (a & m) { - p ^= b; - if ((a & (m - 1)) == 0) - break; - } - m >>= 1; - b = b & 1 ? (b >> 1) ^ POLY : b >> 1; - } - return p; -} - -/* - Return x^(n * 2^k) modulo p(x). Requires that x2n_table[] has been - initialized. - */ -local z_crc_t x2nmodp(n, k) - z_off64_t n; - unsigned k; -{ - z_crc_t p; - - p = (z_crc_t)1 << 31; /* x^0 == 1 */ - while (n) { - if (n & 1) - p = multmodp(x2n_table[k & 31], p); - n >>= 1; - k++; - } - return p; -} - /* ========================================================================= * This function can be used by asm versions of crc32(), and to force the * generation of the CRC tables in a threaded application. */ -const z_crc_t FAR * ZEXPORT get_crc_table() -{ +const z_crc_t FAR * ZEXPORT get_crc_table(void) { #ifdef DYNAMIC_CRC_TABLE once(&made, make_crc_table); #endif /* DYNAMIC_CRC_TABLE */ @@ -619,11 +572,8 @@ const z_crc_t FAR * ZEXPORT get_crc_table() #define Z_BATCH_ZEROS 0xa10d3d0c /* computed from Z_BATCH = 3990 */ #define Z_BATCH_MIN 800 /* fewest words in a final batch */ -unsigned long ZEXPORT crc32_z(crc, buf, len) - unsigned long crc; - const unsigned char FAR *buf; - z_size_t len; -{ +unsigned long ZEXPORT crc32_z(unsigned long crc, const unsigned char FAR *buf, + z_size_t len) { z_crc_t val; z_word_t crc1, crc2; const z_word_t *word; @@ -723,18 +673,14 @@ unsigned long ZEXPORT crc32_z(crc, buf, len) least-significant byte of the word as the first byte of data, without any pre or post conditioning. This is used to combine the CRCs of each braid. */ -local z_crc_t crc_word(data) - z_word_t data; -{ +local z_crc_t crc_word(z_word_t data) { int k; for (k = 0; k < W; k++) data = (data >> 8) ^ crc_table[data & 0xff]; return (z_crc_t)data; } -local z_word_t crc_word_big(data) - z_word_t data; -{ +local z_word_t crc_word_big(z_word_t data) { int k; for (k = 0; k < W; k++) data = (data << 8) ^ @@ -745,11 +691,8 @@ local z_word_t crc_word_big(data) #endif /* ========================================================================= */ -unsigned long ZEXPORT crc32_z(crc, buf, len) - unsigned long crc; - const unsigned char FAR *buf; - z_size_t len; -{ +unsigned long ZEXPORT crc32_z(unsigned long crc, const unsigned char FAR *buf, + z_size_t len) { /* Return initial CRC, if requested. */ if (buf == Z_NULL) return 0; @@ -781,8 +724,8 @@ unsigned long ZEXPORT crc32_z(crc, buf, len) words = (z_word_t const *)buf; /* Do endian check at execution time instead of compile time, since ARM - processors can change the endianess at execution time. If the - compiler knows what the endianess will be, it can optimize out the + processors can change the endianness at execution time. If the + compiler knows what the endianness will be, it can optimize out the check and the unused branch. */ endian = 1; if (*(unsigned char *)&endian) { @@ -1069,20 +1012,13 @@ unsigned long ZEXPORT crc32_z(crc, buf, len) #endif /* ========================================================================= */ -unsigned long ZEXPORT crc32(crc, buf, len) - unsigned long crc; - const unsigned char FAR *buf; - uInt len; -{ +unsigned long ZEXPORT crc32(unsigned long crc, const unsigned char FAR *buf, + uInt len) { return crc32_z(crc, buf, len); } /* ========================================================================= */ -uLong ZEXPORT crc32_combine64(crc1, crc2, len2) - uLong crc1; - uLong crc2; - z_off64_t len2; -{ +uLong ZEXPORT crc32_combine64(uLong crc1, uLong crc2, z_off64_t len2) { #ifdef DYNAMIC_CRC_TABLE once(&made, make_crc_table); #endif /* DYNAMIC_CRC_TABLE */ @@ -1090,18 +1026,12 @@ uLong ZEXPORT crc32_combine64(crc1, crc2, len2) } /* ========================================================================= */ -uLong ZEXPORT crc32_combine(crc1, crc2, len2) - uLong crc1; - uLong crc2; - z_off_t len2; -{ +uLong ZEXPORT crc32_combine(uLong crc1, uLong crc2, z_off_t len2) { return crc32_combine64(crc1, crc2, (z_off64_t)len2); } /* ========================================================================= */ -uLong ZEXPORT crc32_combine_gen64(len2) - z_off64_t len2; -{ +uLong ZEXPORT crc32_combine_gen64(z_off64_t len2) { #ifdef DYNAMIC_CRC_TABLE once(&made, make_crc_table); #endif /* DYNAMIC_CRC_TABLE */ @@ -1109,17 +1039,11 @@ uLong ZEXPORT crc32_combine_gen64(len2) } /* ========================================================================= */ -uLong ZEXPORT crc32_combine_gen(len2) - z_off_t len2; -{ +uLong ZEXPORT crc32_combine_gen(z_off_t len2) { return crc32_combine_gen64((z_off64_t)len2); } /* ========================================================================= */ -uLong ZEXPORT crc32_combine_op(crc1, crc2, op) - uLong crc1; - uLong crc2; - uLong op; -{ +uLong ZEXPORT crc32_combine_op(uLong crc1, uLong crc2, uLong op) { return multmodp(op, crc1) ^ (crc2 & 0xffffffff); } diff --git a/src/PureLib/pure/zlib/deflate.c b/src/PureLib/pure/zlib/deflate.c index 4a689db359..012ea8148e 100644 --- a/src/PureLib/pure/zlib/deflate.c +++ b/src/PureLib/pure/zlib/deflate.c @@ -1,5 +1,5 @@ /* deflate.c -- compress data using the deflation algorithm - * Copyright (C) 1995-2022 Jean-loup Gailly and Mark Adler + * Copyright (C) 1995-2024 Jean-loup Gailly and Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -52,7 +52,7 @@ #include "deflate.h" const char deflate_copyright[] = - " deflate 1.2.13 Copyright 1995-2022 Jean-loup Gailly and Mark Adler "; + " deflate 1.3.1 Copyright 1995-2024 Jean-loup Gailly and Mark Adler "; /* If you use the zlib library in a product, an acknowledgment is welcome in the documentation of your product. If for some reason you cannot @@ -60,9 +60,6 @@ const char deflate_copyright[] = copyright string in the executable of your product. */ -/* =========================================================================== - * Function prototypes. - */ typedef enum { need_more, /* block not completed, need more input or more output */ block_done, /* block flush performed */ @@ -70,29 +67,16 @@ typedef enum { finish_done /* finish done, accept no more input or output */ } block_state; -typedef block_state (*compress_func) OF((deflate_state *s, int flush)); +typedef block_state (*compress_func)(deflate_state *s, int flush); /* Compression function. Returns the block state after the call. */ -local int deflateStateCheck OF((z_streamp strm)); -local void slide_hash OF((deflate_state *s)); -local void fill_window OF((deflate_state *s)); -local block_state deflate_stored OF((deflate_state *s, int flush)); -local block_state deflate_fast OF((deflate_state *s, int flush)); +local block_state deflate_stored(deflate_state *s, int flush); +local block_state deflate_fast(deflate_state *s, int flush); #ifndef FASTEST -local block_state deflate_slow OF((deflate_state *s, int flush)); -#endif -local block_state deflate_rle OF((deflate_state *s, int flush)); -local block_state deflate_huff OF((deflate_state *s, int flush)); -local void lm_init OF((deflate_state *s)); -local void putShortMSB OF((deflate_state *s, uInt b)); -local void flush_pending OF((z_streamp strm)); -local unsigned read_buf OF((z_streamp strm, Bytef *buf, unsigned size)); -local uInt longest_match OF((deflate_state *s, IPos cur_match)); - -#ifdef ZLIB_DEBUG -local void check_match OF((deflate_state *s, IPos start, IPos match, - int length)); +local block_state deflate_slow(deflate_state *s, int flush); #endif +local block_state deflate_rle(deflate_state *s, int flush); +local block_state deflate_huff(deflate_state *s, int flush); /* =========================================================================== * Local data @@ -195,9 +179,12 @@ local const config configuration_table[10] = { * bit values at the expense of memory usage). We slide even when level == 0 to * keep the hash table consistent if we switch back to level > 0 later. */ -local void slide_hash(s) - deflate_state *s; -{ +#if defined(__has_feature) +# if __has_feature(memory_sanitizer) + __attribute__((no_sanitize("memory"))) +# endif +#endif +local void slide_hash(deflate_state *s) { unsigned n, m; Posf *p; uInt wsize = s->w_size; @@ -221,30 +208,177 @@ local void slide_hash(s) #endif } +/* =========================================================================== + * Read a new buffer from the current input stream, update the adler32 + * and total number of bytes read. All deflate() input goes through + * this function so some applications may wish to modify it to avoid + * allocating a large strm->next_in buffer and copying from it. + * (See also flush_pending()). + */ +local unsigned read_buf(z_streamp strm, Bytef *buf, unsigned size) { + unsigned len = strm->avail_in; + + if (len > size) len = size; + if (len == 0) return 0; + + strm->avail_in -= len; + + zmemcpy(buf, strm->next_in, len); + if (strm->state->wrap == 1) { + strm->adler = adler32(strm->adler, buf, len); + } +#ifdef GZIP + else if (strm->state->wrap == 2) { + strm->adler = crc32(strm->adler, buf, len); + } +#endif + strm->next_in += len; + strm->total_in += len; + + return len; +} + +/* =========================================================================== + * Fill the window when the lookahead becomes insufficient. + * Updates strstart and lookahead. + * + * IN assertion: lookahead < MIN_LOOKAHEAD + * OUT assertions: strstart <= window_size-MIN_LOOKAHEAD + * At least one byte has been read, or avail_in == 0; reads are + * performed for at least two bytes (required for the zip translate_eol + * option -- not supported here). + */ +local void fill_window(deflate_state *s) { + unsigned n; + unsigned more; /* Amount of free space at the end of the window. */ + uInt wsize = s->w_size; + + Assert(s->lookahead < MIN_LOOKAHEAD, "already enough lookahead"); + + do { + more = (unsigned)(s->window_size -(ulg)s->lookahead -(ulg)s->strstart); + + /* Deal with !@#$% 64K limit: */ + if (sizeof(int) <= 2) { + if (more == 0 && s->strstart == 0 && s->lookahead == 0) { + more = wsize; + + } else if (more == (unsigned)(-1)) { + /* Very unlikely, but possible on 16 bit machine if + * strstart == 0 && lookahead == 1 (input done a byte at time) + */ + more--; + } + } + + /* If the window is almost full and there is insufficient lookahead, + * move the upper half to the lower one to make room in the upper half. + */ + if (s->strstart >= wsize + MAX_DIST(s)) { + + zmemcpy(s->window, s->window + wsize, (unsigned)wsize - more); + s->match_start -= wsize; + s->strstart -= wsize; /* we now have strstart >= MAX_DIST */ + s->block_start -= (long) wsize; + if (s->insert > s->strstart) + s->insert = s->strstart; + slide_hash(s); + more += wsize; + } + if (s->strm->avail_in == 0) break; + + /* If there was no sliding: + * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 && + * more == window_size - lookahead - strstart + * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1) + * => more >= window_size - 2*WSIZE + 2 + * In the BIG_MEM or MMAP case (not yet supported), + * window_size == input_size + MIN_LOOKAHEAD && + * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD. + * Otherwise, window_size == 2*WSIZE so more >= 2. + * If there was sliding, more >= WSIZE. So in all cases, more >= 2. + */ + Assert(more >= 2, "more < 2"); + + n = read_buf(s->strm, s->window + s->strstart + s->lookahead, more); + s->lookahead += n; + + /* Initialize the hash value now that we have some input: */ + if (s->lookahead + s->insert >= MIN_MATCH) { + uInt str = s->strstart - s->insert; + s->ins_h = s->window[str]; + UPDATE_HASH(s, s->ins_h, s->window[str + 1]); +#if MIN_MATCH != 3 + Call UPDATE_HASH() MIN_MATCH-3 more times +#endif + while (s->insert) { + UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); +#ifndef FASTEST + s->prev[str & s->w_mask] = s->head[s->ins_h]; +#endif + s->head[s->ins_h] = (Pos)str; + str++; + s->insert--; + if (s->lookahead + s->insert < MIN_MATCH) + break; + } + } + /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage, + * but this is not important since only literal bytes will be emitted. + */ + + } while (s->lookahead < MIN_LOOKAHEAD && s->strm->avail_in != 0); + + /* If the WIN_INIT bytes after the end of the current data have never been + * written, then zero those bytes in order to avoid memory check reports of + * the use of uninitialized (or uninitialised as Julian writes) bytes by + * the longest match routines. Update the high water mark for the next + * time through here. WIN_INIT is set to MAX_MATCH since the longest match + * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead. + */ + if (s->high_water < s->window_size) { + ulg curr = s->strstart + (ulg)(s->lookahead); + ulg init; + + if (s->high_water < curr) { + /* Previous high water mark below current data -- zero WIN_INIT + * bytes or up to end of window, whichever is less. + */ + init = s->window_size - curr; + if (init > WIN_INIT) + init = WIN_INIT; + zmemzero(s->window + curr, (unsigned)init); + s->high_water = curr + init; + } + else if (s->high_water < (ulg)curr + WIN_INIT) { + /* High water mark at or above current data, but below current data + * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up + * to end of window, whichever is less. + */ + init = (ulg)curr + WIN_INIT - s->high_water; + if (init > s->window_size - s->high_water) + init = s->window_size - s->high_water; + zmemzero(s->window + s->high_water, (unsigned)init); + s->high_water += init; + } + } + + Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD, + "not enough room for search"); +} + /* ========================================================================= */ -int ZEXPORT deflateInit_(strm, level, version, stream_size) - z_streamp strm; - int level; - const char *version; - int stream_size; -{ +int ZEXPORT deflateInit_(z_streamp strm, int level, const char *version, + int stream_size) { return deflateInit2_(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY, version, stream_size); /* To do: ignore strm->next_in if we use it as window */ } /* ========================================================================= */ -int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy, - version, stream_size) - z_streamp strm; - int level; - int method; - int windowBits; - int memLevel; - int strategy; - const char *version; - int stream_size; -{ +int ZEXPORT deflateInit2_(z_streamp strm, int level, int method, + int windowBits, int memLevel, int strategy, + const char *version, int stream_size) { deflate_state *s; int wrap = 1; static const char my_version[] = ZLIB_VERSION; @@ -359,7 +493,7 @@ int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy, * symbols from which it is being constructed. */ - s->pending_buf = (uchf *) ZALLOC(strm, s->lit_bufsize, 4); + s->pending_buf = (uchf *) ZALLOC(strm, s->lit_bufsize, LIT_BUFS); s->pending_buf_size = (ulg)s->lit_bufsize * 4; if (s->window == Z_NULL || s->prev == Z_NULL || s->head == Z_NULL || @@ -369,8 +503,14 @@ int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy, deflateEnd (strm); return Z_MEM_ERROR; } +#ifdef LIT_MEM + s->d_buf = (ushf *)(s->pending_buf + (s->lit_bufsize << 1)); + s->l_buf = s->pending_buf + (s->lit_bufsize << 2); + s->sym_end = s->lit_bufsize - 1; +#else s->sym_buf = s->pending_buf + s->lit_bufsize; s->sym_end = (s->lit_bufsize - 1) * 3; +#endif /* We avoid equality with lit_bufsize*3 because of wraparound at 64K * on 16 bit machines and because stored blocks are restricted to * 64K-1 bytes. @@ -386,9 +526,7 @@ int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy, /* ========================================================================= * Check for a valid deflate stream state. Return 0 if ok, 1 if not. */ -local int deflateStateCheck(strm) - z_streamp strm; -{ +local int deflateStateCheck(z_streamp strm) { deflate_state *s; if (strm == Z_NULL || strm->zalloc == (alloc_func)0 || strm->zfree == (free_func)0) @@ -409,11 +547,8 @@ local int deflateStateCheck(strm) } /* ========================================================================= */ -int ZEXPORT deflateSetDictionary(strm, dictionary, dictLength) - z_streamp strm; - const Bytef *dictionary; - uInt dictLength; -{ +int ZEXPORT deflateSetDictionary(z_streamp strm, const Bytef *dictionary, + uInt dictLength) { deflate_state *s; uInt str, n; int wrap; @@ -478,11 +613,8 @@ int ZEXPORT deflateSetDictionary(strm, dictionary, dictLength) } /* ========================================================================= */ -int ZEXPORT deflateGetDictionary(strm, dictionary, dictLength) - z_streamp strm; - Bytef *dictionary; - uInt *dictLength; -{ +int ZEXPORT deflateGetDictionary(z_streamp strm, Bytef *dictionary, + uInt *dictLength) { deflate_state *s; uInt len; @@ -500,9 +632,7 @@ int ZEXPORT deflateGetDictionary(strm, dictionary, dictLength) } /* ========================================================================= */ -int ZEXPORT deflateResetKeep(strm) - z_streamp strm; -{ +int ZEXPORT deflateResetKeep(z_streamp strm) { deflate_state *s; if (deflateStateCheck(strm)) { @@ -537,10 +667,32 @@ int ZEXPORT deflateResetKeep(strm) return Z_OK; } +/* =========================================================================== + * Initialize the "longest match" routines for a new zlib stream + */ +local void lm_init(deflate_state *s) { + s->window_size = (ulg)2L*s->w_size; + + CLEAR_HASH(s); + + /* Set the default configuration parameters: + */ + s->max_lazy_match = configuration_table[s->level].max_lazy; + s->good_match = configuration_table[s->level].good_length; + s->nice_match = configuration_table[s->level].nice_length; + s->max_chain_length = configuration_table[s->level].max_chain; + + s->strstart = 0; + s->block_start = 0L; + s->lookahead = 0; + s->insert = 0; + s->match_length = s->prev_length = MIN_MATCH-1; + s->match_available = 0; + s->ins_h = 0; +} + /* ========================================================================= */ -int ZEXPORT deflateReset(strm) - z_streamp strm; -{ +int ZEXPORT deflateReset(z_streamp strm) { int ret; ret = deflateResetKeep(strm); @@ -550,10 +702,7 @@ int ZEXPORT deflateReset(strm) } /* ========================================================================= */ -int ZEXPORT deflateSetHeader(strm, head) - z_streamp strm; - gz_headerp head; -{ +int ZEXPORT deflateSetHeader(z_streamp strm, gz_headerp head) { if (deflateStateCheck(strm) || strm->state->wrap != 2) return Z_STREAM_ERROR; strm->state->gzhead = head; @@ -561,11 +710,7 @@ int ZEXPORT deflateSetHeader(strm, head) } /* ========================================================================= */ -int ZEXPORT deflatePending(strm, pending, bits) - unsigned *pending; - int *bits; - z_streamp strm; -{ +int ZEXPORT deflatePending(z_streamp strm, unsigned *pending, int *bits) { if (deflateStateCheck(strm)) return Z_STREAM_ERROR; if (pending != Z_NULL) *pending = strm->state->pending; @@ -575,19 +720,21 @@ int ZEXPORT deflatePending(strm, pending, bits) } /* ========================================================================= */ -int ZEXPORT deflatePrime(strm, bits, value) - z_streamp strm; - int bits; - int value; -{ +int ZEXPORT deflatePrime(z_streamp strm, int bits, int value) { deflate_state *s; int put; if (deflateStateCheck(strm)) return Z_STREAM_ERROR; s = strm->state; +#ifdef LIT_MEM + if (bits < 0 || bits > 16 || + (uchf *)s->d_buf < s->pending_out + ((Buf_size + 7) >> 3)) + return Z_BUF_ERROR; +#else if (bits < 0 || bits > 16 || s->sym_buf < s->pending_out + ((Buf_size + 7) >> 3)) return Z_BUF_ERROR; +#endif do { put = Buf_size - s->bi_valid; if (put > bits) @@ -602,11 +749,7 @@ int ZEXPORT deflatePrime(strm, bits, value) } /* ========================================================================= */ -int ZEXPORT deflateParams(strm, level, strategy) - z_streamp strm; - int level; - int strategy; -{ +int ZEXPORT deflateParams(z_streamp strm, int level, int strategy) { deflate_state *s; compress_func func; @@ -651,13 +794,8 @@ int ZEXPORT deflateParams(strm, level, strategy) } /* ========================================================================= */ -int ZEXPORT deflateTune(strm, good_length, max_lazy, nice_length, max_chain) - z_streamp strm; - int good_length; - int max_lazy; - int nice_length; - int max_chain; -{ +int ZEXPORT deflateTune(z_streamp strm, int good_length, int max_lazy, + int nice_length, int max_chain) { deflate_state *s; if (deflateStateCheck(strm)) return Z_STREAM_ERROR; @@ -693,10 +831,7 @@ int ZEXPORT deflateTune(strm, good_length, max_lazy, nice_length, max_chain) * * Shifts are used to approximate divisions, for speed. */ -uLong ZEXPORT deflateBound(strm, sourceLen) - z_streamp strm; - uLong sourceLen; -{ +uLong ZEXPORT deflateBound(z_streamp strm, uLong sourceLen) { deflate_state *s; uLong fixedlen, storelen, wraplen; @@ -752,7 +887,8 @@ uLong ZEXPORT deflateBound(strm, sourceLen) /* if not default parameters, return one of the conservative bounds */ if (s->w_bits != 15 || s->hash_bits != 8 + 7) - return (s->w_bits <= s->hash_bits ? fixedlen : storelen) + wraplen; + return (s->w_bits <= s->hash_bits && s->level ? fixedlen : storelen) + + wraplen; /* default settings: return tight bound for that case -- ~0.03% overhead plus a small constant */ @@ -765,10 +901,7 @@ uLong ZEXPORT deflateBound(strm, sourceLen) * IN assertion: the stream state is correct and there is enough room in * pending_buf. */ -local void putShortMSB(s, b) - deflate_state *s; - uInt b; -{ +local void putShortMSB(deflate_state *s, uInt b) { put_byte(s, (Byte)(b >> 8)); put_byte(s, (Byte)(b & 0xff)); } @@ -779,9 +912,7 @@ local void putShortMSB(s, b) * applications may wish to modify it to avoid allocating a large * strm->next_out buffer and copying into it. (See also read_buf()). */ -local void flush_pending(strm) - z_streamp strm; -{ +local void flush_pending(z_streamp strm) { unsigned len; deflate_state *s = strm->state; @@ -812,10 +943,7 @@ local void flush_pending(strm) } while (0) /* ========================================================================= */ -int ZEXPORT deflate(strm, flush) - z_streamp strm; - int flush; -{ +int ZEXPORT deflate(z_streamp strm, int flush) { int old_flush; /* value of flush param for previous deflate call */ deflate_state *s; @@ -1127,9 +1255,7 @@ int ZEXPORT deflate(strm, flush) } /* ========================================================================= */ -int ZEXPORT deflateEnd(strm) - z_streamp strm; -{ +int ZEXPORT deflateEnd(z_streamp strm) { int status; if (deflateStateCheck(strm)) return Z_STREAM_ERROR; @@ -1153,11 +1279,10 @@ int ZEXPORT deflateEnd(strm) * To simplify the source, this is not supported for 16-bit MSDOS (which * doesn't have enough memory anyway to duplicate compression states). */ -int ZEXPORT deflateCopy(dest, source) - z_streamp dest; - z_streamp source; -{ +int ZEXPORT deflateCopy(z_streamp dest, z_streamp source) { #ifdef MAXSEG_64K + (void)dest; + (void)source; return Z_STREAM_ERROR; #else deflate_state *ds; @@ -1181,7 +1306,7 @@ int ZEXPORT deflateCopy(dest, source) ds->window = (Bytef *) ZALLOC(dest, ds->w_size, 2*sizeof(Byte)); ds->prev = (Posf *) ZALLOC(dest, ds->w_size, sizeof(Pos)); ds->head = (Posf *) ZALLOC(dest, ds->hash_size, sizeof(Pos)); - ds->pending_buf = (uchf *) ZALLOC(dest, ds->lit_bufsize, 4); + ds->pending_buf = (uchf *) ZALLOC(dest, ds->lit_bufsize, LIT_BUFS); if (ds->window == Z_NULL || ds->prev == Z_NULL || ds->head == Z_NULL || ds->pending_buf == Z_NULL) { @@ -1192,10 +1317,15 @@ int ZEXPORT deflateCopy(dest, source) zmemcpy(ds->window, ss->window, ds->w_size * 2 * sizeof(Byte)); zmemcpy((voidpf)ds->prev, (voidpf)ss->prev, ds->w_size * sizeof(Pos)); zmemcpy((voidpf)ds->head, (voidpf)ss->head, ds->hash_size * sizeof(Pos)); - zmemcpy(ds->pending_buf, ss->pending_buf, (uInt)ds->pending_buf_size); + zmemcpy(ds->pending_buf, ss->pending_buf, ds->lit_bufsize * LIT_BUFS); ds->pending_out = ds->pending_buf + (ss->pending_out - ss->pending_buf); +#ifdef LIT_MEM + ds->d_buf = (ushf *)(ds->pending_buf + (ds->lit_bufsize << 1)); + ds->l_buf = ds->pending_buf + (ds->lit_bufsize << 2); +#else ds->sym_buf = ds->pending_buf + ds->lit_bufsize; +#endif ds->l_desc.dyn_tree = ds->dyn_ltree; ds->d_desc.dyn_tree = ds->dyn_dtree; @@ -1205,66 +1335,6 @@ int ZEXPORT deflateCopy(dest, source) #endif /* MAXSEG_64K */ } -/* =========================================================================== - * Read a new buffer from the current input stream, update the adler32 - * and total number of bytes read. All deflate() input goes through - * this function so some applications may wish to modify it to avoid - * allocating a large strm->next_in buffer and copying from it. - * (See also flush_pending()). - */ -local unsigned read_buf(strm, buf, size) - z_streamp strm; - Bytef *buf; - unsigned size; -{ - unsigned len = strm->avail_in; - - if (len > size) len = size; - if (len == 0) return 0; - - strm->avail_in -= len; - - zmemcpy(buf, strm->next_in, len); - if (strm->state->wrap == 1) { - strm->adler = adler32(strm->adler, buf, len); - } -#ifdef GZIP - else if (strm->state->wrap == 2) { - strm->adler = crc32(strm->adler, buf, len); - } -#endif - strm->next_in += len; - strm->total_in += len; - - return len; -} - -/* =========================================================================== - * Initialize the "longest match" routines for a new zlib stream - */ -local void lm_init(s) - deflate_state *s; -{ - s->window_size = (ulg)2L*s->w_size; - - CLEAR_HASH(s); - - /* Set the default configuration parameters: - */ - s->max_lazy_match = configuration_table[s->level].max_lazy; - s->good_match = configuration_table[s->level].good_length; - s->nice_match = configuration_table[s->level].nice_length; - s->max_chain_length = configuration_table[s->level].max_chain; - - s->strstart = 0; - s->block_start = 0L; - s->lookahead = 0; - s->insert = 0; - s->match_length = s->prev_length = MIN_MATCH-1; - s->match_available = 0; - s->ins_h = 0; -} - #ifndef FASTEST /* =========================================================================== * Set match_start to the longest match starting at the given string and @@ -1275,10 +1345,7 @@ local void lm_init(s) * string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1 * OUT assertion: the match length is not greater than s->lookahead. */ -local uInt longest_match(s, cur_match) - deflate_state *s; - IPos cur_match; /* current match */ -{ +local uInt longest_match(deflate_state *s, IPos cur_match) { unsigned chain_length = s->max_chain_length;/* max hash chain length */ register Bytef *scan = s->window + s->strstart; /* current string */ register Bytef *match; /* matched string */ @@ -1426,10 +1493,7 @@ local uInt longest_match(s, cur_match) /* --------------------------------------------------------------------------- * Optimized version for FASTEST only */ -local uInt longest_match(s, cur_match) - deflate_state *s; - IPos cur_match; /* current match */ -{ +local uInt longest_match(deflate_state *s, IPos cur_match) { register Bytef *scan = s->window + s->strstart; /* current string */ register Bytef *match; /* matched string */ register int len; /* length of current match */ @@ -1490,19 +1554,23 @@ local uInt longest_match(s, cur_match) /* =========================================================================== * Check that the match at match_start is indeed a match. */ -local void check_match(s, start, match, length) - deflate_state *s; - IPos start, match; - int length; -{ +local void check_match(deflate_state *s, IPos start, IPos match, int length) { /* check that the match is indeed a match */ - if (zmemcmp(s->window + match, - s->window + start, length) != EQUAL) { - fprintf(stderr, " start %u, match %u, length %d\n", - start, match, length); + Bytef *back = s->window + (int)match, *here = s->window + start; + IPos len = length; + if (match == (IPos)-1) { + /* match starts one byte before the current window -- just compare the + subsequent length-1 bytes */ + back++; + here++; + len--; + } + if (zmemcmp(back, here, len) != EQUAL) { + fprintf(stderr, " start %u, match %d, length %d\n", + start, (int)match, length); do { - fprintf(stderr, "%c%c", s->window[match++], s->window[start++]); - } while (--length != 0); + fprintf(stderr, "(%02x %02x)", *back++, *here++); + } while (--len != 0); z_error("invalid match"); } if (z_verbose > 1) { @@ -1514,137 +1582,6 @@ local void check_match(s, start, match, length) # define check_match(s, start, match, length) #endif /* ZLIB_DEBUG */ -/* =========================================================================== - * Fill the window when the lookahead becomes insufficient. - * Updates strstart and lookahead. - * - * IN assertion: lookahead < MIN_LOOKAHEAD - * OUT assertions: strstart <= window_size-MIN_LOOKAHEAD - * At least one byte has been read, or avail_in == 0; reads are - * performed for at least two bytes (required for the zip translate_eol - * option -- not supported here). - */ -local void fill_window(s) - deflate_state *s; -{ - unsigned n; - unsigned more; /* Amount of free space at the end of the window. */ - uInt wsize = s->w_size; - - Assert(s->lookahead < MIN_LOOKAHEAD, "already enough lookahead"); - - do { - more = (unsigned)(s->window_size -(ulg)s->lookahead -(ulg)s->strstart); - - /* Deal with !@#$% 64K limit: */ - if (sizeof(int) <= 2) { - if (more == 0 && s->strstart == 0 && s->lookahead == 0) { - more = wsize; - - } else if (more == (unsigned)(-1)) { - /* Very unlikely, but possible on 16 bit machine if - * strstart == 0 && lookahead == 1 (input done a byte at time) - */ - more--; - } - } - - /* If the window is almost full and there is insufficient lookahead, - * move the upper half to the lower one to make room in the upper half. - */ - if (s->strstart >= wsize + MAX_DIST(s)) { - - zmemcpy(s->window, s->window + wsize, (unsigned)wsize - more); - s->match_start -= wsize; - s->strstart -= wsize; /* we now have strstart >= MAX_DIST */ - s->block_start -= (long) wsize; - if (s->insert > s->strstart) - s->insert = s->strstart; - slide_hash(s); - more += wsize; - } - if (s->strm->avail_in == 0) break; - - /* If there was no sliding: - * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 && - * more == window_size - lookahead - strstart - * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1) - * => more >= window_size - 2*WSIZE + 2 - * In the BIG_MEM or MMAP case (not yet supported), - * window_size == input_size + MIN_LOOKAHEAD && - * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD. - * Otherwise, window_size == 2*WSIZE so more >= 2. - * If there was sliding, more >= WSIZE. So in all cases, more >= 2. - */ - Assert(more >= 2, "more < 2"); - - n = read_buf(s->strm, s->window + s->strstart + s->lookahead, more); - s->lookahead += n; - - /* Initialize the hash value now that we have some input: */ - if (s->lookahead + s->insert >= MIN_MATCH) { - uInt str = s->strstart - s->insert; - s->ins_h = s->window[str]; - UPDATE_HASH(s, s->ins_h, s->window[str + 1]); -#if MIN_MATCH != 3 - Call UPDATE_HASH() MIN_MATCH-3 more times -#endif - while (s->insert) { - UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); -#ifndef FASTEST - s->prev[str & s->w_mask] = s->head[s->ins_h]; -#endif - s->head[s->ins_h] = (Pos)str; - str++; - s->insert--; - if (s->lookahead + s->insert < MIN_MATCH) - break; - } - } - /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage, - * but this is not important since only literal bytes will be emitted. - */ - - } while (s->lookahead < MIN_LOOKAHEAD && s->strm->avail_in != 0); - - /* If the WIN_INIT bytes after the end of the current data have never been - * written, then zero those bytes in order to avoid memory check reports of - * the use of uninitialized (or uninitialised as Julian writes) bytes by - * the longest match routines. Update the high water mark for the next - * time through here. WIN_INIT is set to MAX_MATCH since the longest match - * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead. - */ - if (s->high_water < s->window_size) { - ulg curr = s->strstart + (ulg)(s->lookahead); - ulg init; - - if (s->high_water < curr) { - /* Previous high water mark below current data -- zero WIN_INIT - * bytes or up to end of window, whichever is less. - */ - init = s->window_size - curr; - if (init > WIN_INIT) - init = WIN_INIT; - zmemzero(s->window + curr, (unsigned)init); - s->high_water = curr + init; - } - else if (s->high_water < (ulg)curr + WIN_INIT) { - /* High water mark at or above current data, but below current data - * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up - * to end of window, whichever is less. - */ - init = (ulg)curr + WIN_INIT - s->high_water; - if (init > s->window_size - s->high_water) - init = s->window_size - s->high_water; - zmemzero(s->window + s->high_water, (unsigned)init); - s->high_water += init; - } - } - - Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD, - "not enough room for search"); -} - /* =========================================================================== * Flush the current block, with given end-of-file flag. * IN assertion: strstart is set to the end of the current match. @@ -1687,10 +1624,7 @@ local void fill_window(s) * copied. It is most efficient with large input and output buffers, which * maximizes the opportunities to have a single copy from next_in to next_out. */ -local block_state deflate_stored(s, flush) - deflate_state *s; - int flush; -{ +local block_state deflate_stored(deflate_state *s, int flush) { /* Smallest worthy block size when not flushing or finishing. By default * this is 32K. This can be as small as 507 bytes for memLevel == 1. For * large input and output buffers, the stored block size will be larger. @@ -1874,10 +1808,7 @@ local block_state deflate_stored(s, flush) * new strings in the dictionary only for unmatched strings or for short * matches. It is used only for the fast compression options. */ -local block_state deflate_fast(s, flush) - deflate_state *s; - int flush; -{ +local block_state deflate_fast(deflate_state *s, int flush) { IPos hash_head; /* head of the hash chain */ int bflush; /* set if current block must be flushed */ @@ -1976,10 +1907,7 @@ local block_state deflate_fast(s, flush) * evaluation for matches: a match is finally adopted only if there is * no better match at the next window position. */ -local block_state deflate_slow(s, flush) - deflate_state *s; - int flush; -{ +local block_state deflate_slow(deflate_state *s, int flush) { IPos hash_head; /* head of hash chain */ int bflush; /* set if current block must be flushed */ @@ -2107,10 +2035,7 @@ local block_state deflate_slow(s, flush) * one. Do not maintain a hash table. (It will be regenerated if this run of * deflate switches away from Z_RLE.) */ -local block_state deflate_rle(s, flush) - deflate_state *s; - int flush; -{ +local block_state deflate_rle(deflate_state *s, int flush) { int bflush; /* set if current block must be flushed */ uInt prev; /* byte at distance one to match */ Bytef *scan, *strend; /* scan goes up to strend for length of run */ @@ -2181,10 +2106,7 @@ local block_state deflate_rle(s, flush) * For Z_HUFFMAN_ONLY, do not look for matches. Do not maintain a hash table. * (It will be regenerated if this run of deflate switches away from Huffman.) */ -local block_state deflate_huff(s, flush) - deflate_state *s; - int flush; -{ +local block_state deflate_huff(deflate_state *s, int flush) { int bflush; /* set if current block must be flushed */ for (;;) { diff --git a/src/PureLib/pure/zlib/deflate.h b/src/PureLib/pure/zlib/deflate.h index 1a06cd5f25..300c6ada62 100644 --- a/src/PureLib/pure/zlib/deflate.h +++ b/src/PureLib/pure/zlib/deflate.h @@ -1,5 +1,5 @@ /* deflate.h -- internal compression state - * Copyright (C) 1995-2018 Jean-loup Gailly + * Copyright (C) 1995-2024 Jean-loup Gailly * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -23,6 +23,10 @@ # define GZIP #endif +/* define LIT_MEM to slightly increase the speed of deflate (order 1% to 2%) at + the cost of a larger memory footprint */ +/* #define LIT_MEM */ + /* =========================================================================== * Internal compression state. */ @@ -217,7 +221,14 @@ typedef struct internal_state { /* Depth of each subtree used as tie breaker for trees of equal frequency */ +#ifdef LIT_MEM +# define LIT_BUFS 5 + ushf *d_buf; /* buffer for distances */ + uchf *l_buf; /* buffer for literals/lengths */ +#else +# define LIT_BUFS 4 uchf *sym_buf; /* buffer for distances and literals/lengths */ +#endif uInt lit_bufsize; /* Size of match buffer for literals/lengths. There are 4 reasons for @@ -239,7 +250,7 @@ typedef struct internal_state { * - I can't count above 4 */ - uInt sym_next; /* running index in sym_buf */ + uInt sym_next; /* running index in symbol buffer */ uInt sym_end; /* symbol table full when sym_next reaches this */ ulg opt_len; /* bit length of current block with optimal trees */ @@ -291,14 +302,14 @@ typedef struct internal_state { memory checker errors from longest match routines */ /* in trees.c */ -void ZLIB_INTERNAL _tr_init OF((deflate_state *s)); -int ZLIB_INTERNAL _tr_tally OF((deflate_state *s, unsigned dist, unsigned lc)); -void ZLIB_INTERNAL _tr_flush_block OF((deflate_state *s, charf *buf, - ulg stored_len, int last)); -void ZLIB_INTERNAL _tr_flush_bits OF((deflate_state *s)); -void ZLIB_INTERNAL _tr_align OF((deflate_state *s)); -void ZLIB_INTERNAL _tr_stored_block OF((deflate_state *s, charf *buf, - ulg stored_len, int last)); +void ZLIB_INTERNAL _tr_init(deflate_state *s); +int ZLIB_INTERNAL _tr_tally(deflate_state *s, unsigned dist, unsigned lc); +void ZLIB_INTERNAL _tr_flush_block(deflate_state *s, charf *buf, + ulg stored_len, int last); +void ZLIB_INTERNAL _tr_flush_bits(deflate_state *s); +void ZLIB_INTERNAL _tr_align(deflate_state *s); +void ZLIB_INTERNAL _tr_stored_block(deflate_state *s, charf *buf, + ulg stored_len, int last); #define d_code(dist) \ ((dist) < 256 ? _dist_code[dist] : _dist_code[256+((dist)>>7)]) @@ -318,6 +329,25 @@ void ZLIB_INTERNAL _tr_stored_block OF((deflate_state *s, charf *buf, extern const uch ZLIB_INTERNAL _dist_code[]; #endif +#ifdef LIT_MEM +# define _tr_tally_lit(s, c, flush) \ + { uch cc = (c); \ + s->d_buf[s->sym_next] = 0; \ + s->l_buf[s->sym_next++] = cc; \ + s->dyn_ltree[cc].Freq++; \ + flush = (s->sym_next == s->sym_end); \ + } +# define _tr_tally_dist(s, distance, length, flush) \ + { uch len = (uch)(length); \ + ush dist = (ush)(distance); \ + s->d_buf[s->sym_next] = dist; \ + s->l_buf[s->sym_next++] = len; \ + dist--; \ + s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \ + s->dyn_dtree[d_code(dist)].Freq++; \ + flush = (s->sym_next == s->sym_end); \ + } +#else # define _tr_tally_lit(s, c, flush) \ { uch cc = (c); \ s->sym_buf[s->sym_next++] = 0; \ @@ -337,6 +367,7 @@ void ZLIB_INTERNAL _tr_stored_block OF((deflate_state *s, charf *buf, s->dyn_dtree[d_code(dist)].Freq++; \ flush = (s->sym_next == s->sym_end); \ } +#endif #else # define _tr_tally_lit(s, c, flush) flush = _tr_tally(s, 0, c) # define _tr_tally_dist(s, distance, length, flush) \ diff --git a/src/PureLib/pure/zlib/doc/algorithm.txt b/src/PureLib/pure/zlib/doc/algorithm.txt index c97f495020..029e5a3134 100644 --- a/src/PureLib/pure/zlib/doc/algorithm.txt +++ b/src/PureLib/pure/zlib/doc/algorithm.txt @@ -77,7 +77,7 @@ table took no time (and if you had infinite memory), then there would only be a first level table to cover all the way to the longest code. However, building the table ends up taking a lot longer for more bits since short codes are replicated many times in such a table. What inflate() does is -simply to make the number of bits in the first table a variable, and then +simply to make the number of bits in the first table a variable, and then to set that variable for the maximum speed. For inflate, which has 286 possible codes for the literal/length tree, the size diff --git a/src/PureLib/pure/zlib/examples/fitblk.c b/src/PureLib/pure/zlib/examples/fitblk.c index 68f56809d0..723dc00281 100644 --- a/src/PureLib/pure/zlib/examples/fitblk.c +++ b/src/PureLib/pure/zlib/examples/fitblk.c @@ -198,7 +198,7 @@ int main(int argc, char **argv) if (ret == Z_MEM_ERROR) quit("out of memory"); - /* set up for next reocmpression */ + /* set up for next recompression */ ret = inflateReset(&inf); assert(ret != Z_STREAM_ERROR); ret = deflateReset(&def); diff --git a/src/PureLib/pure/zlib/examples/gzlog.c b/src/PureLib/pure/zlib/examples/gzlog.c index b977802dd6..da1b02e733 100644 --- a/src/PureLib/pure/zlib/examples/gzlog.c +++ b/src/PureLib/pure/zlib/examples/gzlog.c @@ -212,8 +212,8 @@ to the appropriate recovery below. If there is no foo.add file, provide a zero data length to the recovery. In that case, the append recovery restores the foo.gz to the previous compressed + uncompressed data state. - For the the compress recovery, a missing foo.add file results in foo.gz - being restored to the previous compressed-only data state. + For the compress recovery, a missing foo.add file results in foo.gz being + restored to the previous compressed-only data state. - Append recovery: - Pick up append at + step above - Compress recovery: diff --git a/src/PureLib/pure/zlib/examples/zlib_how.html b/src/PureLib/pure/zlib/examples/zlib_how.html index 444ff1c9a3..43271b988a 100644 --- a/src/PureLib/pure/zlib/examples/zlib_how.html +++ b/src/PureLib/pure/zlib/examples/zlib_how.html @@ -1,10 +1,10 @@ - + zlib Usage Example - +

zlib Usage Example

@@ -17,7 +17,7 @@

zlib Usage Example

annotations are interspersed between lines of the code. So please read between the lines. We hope this helps explain some of the intricacies of zlib.

-Without further adieu, here is the program zpipe.c: +Without further ado, here is the program zpipe.c:


 /* zpipe.c: example of proper use of zlib's inflate() and deflate()
    Not copyrighted -- provided to the public domain
@@ -155,13 +155,11 @@ 

zlib Usage Example

We start off by reading data from the input file. The number of bytes read is put directly into avail_in, and a pointer to those bytes is put into next_in. We also -check to see if end-of-file on the input has been reached. If we are at the end of file, then flush is set to the +check to see if end-of-file on the input has been reached using feof(). +If we are at the end of file, then flush is set to the zlib constant Z_FINISH, which is later passed to deflate() to -indicate that this is the last chunk of input data to compress. We need to use feof() -to check for end-of-file as opposed to seeing if fewer than CHUNK bytes have been read. The -reason is that if the input file length is an exact multiple of CHUNK, we will miss -the fact that we got to the end-of-file, and not know to tell deflate() to finish -up the compressed stream. If we are not yet at the end of the input, then the zlib +indicate that this is the last chunk of input data to compress. +If we are not yet at the end of the input, then the zlib constant Z_NO_FLUSH will be passed to deflate to indicate that we are still in the middle of the uncompressed data.

@@ -540,6 +538,12 @@

zlib Usage Example

}
-Copyright (c) 2004, 2005 by Mark Adler
Last modified 11 December 2005
+Last modified 24 January 2023
+Copyright © 2004-2023 Mark Adler

+ +Creative Commons License + +Creative Commons Attribution-NoDerivatives 4.0 International License. diff --git a/src/PureLib/pure/zlib/examples/zran.c b/src/PureLib/pure/zlib/examples/zran.c index 879c47ccf7..d3135955b0 100644 --- a/src/PureLib/pure/zlib/examples/zran.c +++ b/src/PureLib/pure/zlib/examples/zran.c @@ -1,114 +1,102 @@ -/* zran.c -- example of zlib/gzip stream indexing and random access - * Copyright (C) 2005, 2012, 2018 Mark Adler +/* zran.c -- example of deflate stream indexing and random access + * Copyright (C) 2005, 2012, 2018, 2023 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h - * Version 1.2 14 Oct 2018 Mark Adler */ + * Version 1.4 13 Apr 2023 Mark Adler */ /* Version History: 1.0 29 May 2005 First version 1.1 29 Sep 2012 Fix memory reallocation error 1.2 14 Oct 2018 Handle gzip streams with multiple members Add a header file to facilitate usage in applications + 1.3 18 Feb 2023 Permit raw deflate streams as well as zlib and gzip + Permit crossing gzip member boundaries when extracting + Support a size_t size when extracting (was an int) + Do a binary search over the index for an access point + Expose the access point type to enable save and load + 1.4 13 Apr 2023 Add a NOPRIME define to not use inflatePrime() */ -/* Illustrate the use of Z_BLOCK, inflatePrime(), and inflateSetDictionary() - for random access of a compressed file. A file containing a zlib or gzip - stream is provided on the command line. The compressed stream is decoded in - its entirety, and an index built with access points about every SPAN bytes - in the uncompressed output. The compressed file is left open, and can then - be read randomly, having to decompress on the average SPAN/2 uncompressed - bytes before getting to the desired block of data. - - An access point can be created at the start of any deflate block, by saving - the starting file offset and bit of that block, and the 32K bytes of - uncompressed data that precede that block. Also the uncompressed offset of - that block is saved to provide a reference for locating a desired starting - point in the uncompressed stream. deflate_index_build() works by - decompressing the input zlib or gzip stream a block at a time, and at the - end of each block deciding if enough uncompressed data has gone by to - justify the creation of a new access point. If so, that point is saved in a - data structure that grows as needed to accommodate the points. - - To use the index, an offset in the uncompressed data is provided, for which - the latest access point at or preceding that offset is located in the index. - The input file is positioned to the specified location in the index, and if - necessary the first few bits of the compressed data is read from the file. - inflate is initialized with those bits and the 32K of uncompressed data, and - the decompression then proceeds until the desired offset in the file is - reached. Then the decompression continues to read the desired uncompressed - data from the file. - - Another approach would be to generate the index on demand. In that case, - requests for random access reads from the compressed data would try to use - the index, but if a read far enough past the end of the index is required, - then further index entries would be generated and added. - - There is some fair bit of overhead to starting inflation for the random - access, mainly copying the 32K byte dictionary. So if small pieces of the - file are being accessed, it would make sense to implement a cache to hold - some lookahead and avoid many calls to deflate_index_extract() for small - lengths. - - Another way to build an index would be to use inflateCopy(). That would - not be constrained to have access points at block boundaries, but requires - more memory per access point, and also cannot be saved to file due to the - use of pointers in the state. The approach here allows for storage of the - index in a file. - */ +// Illustrate the use of Z_BLOCK, inflatePrime(), and inflateSetDictionary() +// for random access of a compressed file. A file containing a raw deflate +// stream is provided on the command line. The compressed stream is decoded in +// its entirety, and an index built with access points about every SPAN bytes +// in the uncompressed output. The compressed file is left open, and can then +// be read randomly, having to decompress on the average SPAN/2 uncompressed +// bytes before getting to the desired block of data. +// +// An access point can be created at the start of any deflate block, by saving +// the starting file offset and bit of that block, and the 32K bytes of +// uncompressed data that precede that block. Also the uncompressed offset of +// that block is saved to provide a reference for locating a desired starting +// point in the uncompressed stream. deflate_index_build() decompresses the +// input raw deflate stream a block at a time, and at the end of each block +// decides if enough uncompressed data has gone by to justify the creation of a +// new access point. If so, that point is saved in a data structure that grows +// as needed to accommodate the points. +// +// To use the index, an offset in the uncompressed data is provided, for which +// the latest access point at or preceding that offset is located in the index. +// The input file is positioned to the specified location in the index, and if +// necessary the first few bits of the compressed data is read from the file. +// inflate is initialized with those bits and the 32K of uncompressed data, and +// decompression then proceeds until the desired offset in the file is reached. +// Then decompression continues to read the requested uncompressed data from +// the file. +// +// There is some fair bit of overhead to starting inflation for the random +// access, mainly copying the 32K byte dictionary. If small pieces of the file +// are being accessed, it would make sense to implement a cache to hold some +// lookahead to avoid many calls to deflate_index_extract() for small lengths. +// +// Another way to build an index would be to use inflateCopy(). That would not +// be constrained to have access points at block boundaries, but would require +// more memory per access point, and could not be saved to a file due to the +// use of pointers in the state. The approach here allows for storage of the +// index in a file. #include #include #include +#include #include "zlib.h" #include "zran.h" -#define WINSIZE 32768U /* sliding window size */ -#define CHUNK 16384 /* file input buffer size */ - -/* Access point entry. */ -struct point { - off_t out; /* corresponding offset in uncompressed data */ - off_t in; /* offset in input file of first full byte */ - int bits; /* number of bits (1-7) from byte at in-1, or 0 */ - unsigned char window[WINSIZE]; /* preceding 32K of uncompressed data */ -}; +#define WINSIZE 32768U // sliding window size +#define CHUNK 16384 // file input buffer size -/* See comments in zran.h. */ -void deflate_index_free(struct deflate_index *index) -{ +// See comments in zran.h. +void deflate_index_free(struct deflate_index *index) { if (index != NULL) { free(index->list); free(index); } } -/* Add an entry to the access point list. If out of memory, deallocate the - existing list and return NULL. index->gzip is the allocated size of the - index in point entries, until it is time for deflate_index_build() to - return, at which point gzip is set to indicate a gzip file or not. - */ -static struct deflate_index *addpoint(struct deflate_index *index, int bits, - off_t in, off_t out, unsigned left, - unsigned char *window) -{ - struct point *next; - - /* if list is empty, create it (start with eight points) */ +// Add an access point to the list. If out of memory, deallocate the existing +// list and return NULL. index->mode is temporarily the allocated number of +// access points, until it is time for deflate_index_build() to return. Then +// index->mode is set to the mode of inflation. +static struct deflate_index *add_point(struct deflate_index *index, int bits, + off_t in, off_t out, unsigned left, + unsigned char *window) { if (index == NULL) { + // The list is empty. Create it, starting with eight access points. index = malloc(sizeof(struct deflate_index)); - if (index == NULL) return NULL; - index->list = malloc(sizeof(struct point) << 3); + if (index == NULL) + return NULL; + index->have = 0; + index->mode = 8; + index->list = malloc(sizeof(point_t) * index->mode); if (index->list == NULL) { free(index); return NULL; } - index->gzip = 8; - index->have = 0; } - /* if list is full, make it bigger */ - else if (index->have == index->gzip) { - index->gzip <<= 1; - next = realloc(index->list, sizeof(struct point) * index->gzip); + else if (index->have == index->mode) { + // The list is full. Make it bigger. + index->mode <<= 1; + point_t *next = realloc(index->list, sizeof(point_t) * index->mode); if (next == NULL) { deflate_index_free(index); return NULL; @@ -116,318 +104,379 @@ static struct deflate_index *addpoint(struct deflate_index *index, int bits, index->list = next; } - /* fill in entry and increment how many we have */ - next = (struct point *)(index->list) + index->have; - next->bits = bits; - next->in = in; + // Fill in the access point and increment how many we have. + point_t *next = (point_t *)(index->list) + index->have++; + if (index->have < 0) { + // Overflowed the int! + deflate_index_free(index); + return NULL; + } next->out = out; + next->in = in; + next->bits = bits; if (left) memcpy(next->window, window + WINSIZE - left, left); if (left < WINSIZE) memcpy(next->window + left, window, WINSIZE - left); - index->have++; - /* return list, possibly reallocated */ + // Return the index, which may have been newly allocated or destroyed. return index; } -/* See comments in zran.h. */ -int deflate_index_build(FILE *in, off_t span, struct deflate_index **built) -{ - int ret; - int gzip = 0; /* true if reading a gzip file */ - off_t totin, totout; /* our own total counters to avoid 4GB limit */ - off_t last; /* totout value of last access point */ - struct deflate_index *index; /* access points being generated */ - z_stream strm; - unsigned char input[CHUNK]; - unsigned char window[WINSIZE]; - - /* initialize inflate */ - strm.zalloc = Z_NULL; - strm.zfree = Z_NULL; - strm.opaque = Z_NULL; - strm.avail_in = 0; - strm.next_in = Z_NULL; - ret = inflateInit2(&strm, 47); /* automatic zlib or gzip decoding */ - if (ret != Z_OK) - return ret; - - /* inflate the input, maintain a sliding window, and build an index -- this - also validates the integrity of the compressed data using the check - information in the gzip or zlib stream */ - totin = totout = last = 0; - index = NULL; /* will be allocated by first addpoint() */ - strm.avail_out = 0; +// Decompression modes. These are the inflateInit2() windowBits parameter. +#define RAW -15 +#define ZLIB 15 +#define GZIP 31 + +// See comments in zran.h. +int deflate_index_build(FILE *in, off_t span, struct deflate_index **built) { + // Set up inflation state. + z_stream strm = {0}; // inflate engine (gets fired up later) + unsigned char buf[CHUNK]; // input buffer + unsigned char win[WINSIZE] = {0}; // output sliding window + off_t totin = 0; // total bytes read from input + off_t totout = 0; // total bytes uncompressed + int mode = 0; // mode: RAW, ZLIB, or GZIP (0 => not set yet) + + // Decompress from in, generating access points along the way. + int ret; // the return value from zlib, or Z_ERRNO + off_t last; // last access point uncompressed offset + struct deflate_index *index = NULL; // list of access points do { - /* get some compressed data from input file */ - strm.avail_in = fread(input, 1, CHUNK, in); - if (ferror(in)) { - ret = Z_ERRNO; - goto deflate_index_build_error; - } + // Assure available input, at least until reaching EOF. if (strm.avail_in == 0) { - ret = Z_DATA_ERROR; - goto deflate_index_build_error; - } - strm.next_in = input; - - /* check for a gzip stream */ - if (totin == 0 && strm.avail_in >= 3 && - input[0] == 31 && input[1] == 139 && input[2] == 8) - gzip = 1; - - /* process all of that, or until end of stream */ - do { - /* reset sliding window if necessary */ - if (strm.avail_out == 0) { - strm.avail_out = WINSIZE; - strm.next_out = window; - } - - /* inflate until out of input, output, or at end of block -- - update the total input and output counters */ + strm.avail_in = fread(buf, 1, sizeof(buf), in); totin += strm.avail_in; - totout += strm.avail_out; - ret = inflate(&strm, Z_BLOCK); /* return at end of block */ - totin -= strm.avail_in; - totout -= strm.avail_out; - if (ret == Z_NEED_DICT) - ret = Z_DATA_ERROR; - if (ret == Z_MEM_ERROR || ret == Z_DATA_ERROR) - goto deflate_index_build_error; - if (ret == Z_STREAM_END) { - if (gzip && - (strm.avail_in || ungetc(getc(in), in) != EOF)) { - ret = inflateReset(&strm); - if (ret != Z_OK) - goto deflate_index_build_error; - continue; - } + strm.next_in = buf; + if (strm.avail_in < sizeof(buf) && ferror(in)) { + ret = Z_ERRNO; break; } - /* if at end of block, consider adding an index entry (note that if - data_type indicates an end-of-block, then all of the - uncompressed data from that block has been delivered, and none - of the compressed data after that block has been consumed, - except for up to seven bits) -- the totout == 0 provides an - entry point after the zlib or gzip header, and assures that the - index always has at least one access point; we avoid creating an - access point after the last block by checking bit 6 of data_type - */ - if ((strm.data_type & 128) && !(strm.data_type & 64) && - (totout == 0 || totout - last > span)) { - index = addpoint(index, strm.data_type & 7, totin, - totout, strm.avail_out, window); - if (index == NULL) { - ret = Z_MEM_ERROR; - goto deflate_index_build_error; - } - last = totout; + if (mode == 0) { + // At the start of the input -- determine the type. Assume raw + // if it is neither zlib nor gzip. This could in theory result + // in a false positive for zlib, but in practice the fill bits + // after a stored block are always zeros, so a raw stream won't + // start with an 8 in the low nybble. + mode = strm.avail_in == 0 ? RAW : // empty -- will fail + (strm.next_in[0] & 0xf) == 8 ? ZLIB : + strm.next_in[0] == 0x1f ? GZIP : + /* else */ RAW; + ret = inflateInit2(&strm, mode); + if (ret != Z_OK) + break; } - } while (strm.avail_in != 0); - } while (ret != Z_STREAM_END); + } + + // Assure available output. This rotates the output through, for use as + // a sliding window on the uncompressed data. + if (strm.avail_out == 0) { + strm.avail_out = sizeof(win); + strm.next_out = win; + } - /* clean up and return index (release unused entries in list) */ - (void)inflateEnd(&strm); - index->list = realloc(index->list, sizeof(struct point) * index->have); - index->gzip = gzip; + if (mode == RAW && index == NULL) + // We skip the inflate() call at the start of raw deflate data in + // order generate an access point there. Set data_type to imitate + // the end of a header. + strm.data_type = 0x80; + else { + // Inflate and update the number of uncompressed bytes. + unsigned before = strm.avail_out; + ret = inflate(&strm, Z_BLOCK); + totout += before - strm.avail_out; + } + + if ((strm.data_type & 0xc0) == 0x80 && + (index == NULL || totout - last >= span)) { + // We are at the end of a header or a non-last deflate block, so we + // can add an access point here. Furthermore, we are either at the + // very start for the first access point, or there has been span or + // more uncompressed bytes since the last access point, so we want + // to add an access point here. + index = add_point(index, strm.data_type & 7, totin - strm.avail_in, + totout, strm.avail_out, win); + if (index == NULL) { + ret = Z_MEM_ERROR; + break; + } + last = totout; + } + + if (ret == Z_STREAM_END && mode == GZIP && + (strm.avail_in || ungetc(getc(in), in) != EOF)) + // There is more input after the end of a gzip member. Reset the + // inflate state to read another gzip member. On success, this will + // set ret to Z_OK to continue decompressing. + ret = inflateReset2(&strm, GZIP); + + // Keep going until Z_STREAM_END or error. If the compressed data ends + // prematurely without a file read error, Z_BUF_ERROR is returned. + } while (ret == Z_OK); + inflateEnd(&strm); + + if (ret != Z_STREAM_END) { + // An error was encountered. Discard the index and return a negative + // error code. + deflate_index_free(index); + return ret == Z_NEED_DICT ? Z_DATA_ERROR : ret; + } + + // Shrink the index to only the occupied access points and return it. + index->mode = mode; index->length = totout; + point_t *list = realloc(index->list, sizeof(point_t) * index->have); + if (list == NULL) { + // Seems like a realloc() to make something smaller should always work, + // but just in case. + deflate_index_free(index); + return Z_MEM_ERROR; + } + index->list = list; *built = index; return index->have; +} - /* return error */ - deflate_index_build_error: - (void)inflateEnd(&strm); - deflate_index_free(index); - return ret; +#ifdef NOPRIME +// Support zlib versions before 1.2.3 (July 2005), or incomplete zlib clones +// that do not have inflatePrime(). + +# define INFLATEPRIME inflatePreface + +// Append the low bits bits of value to in[] at bit position *have, updating +// *have. value must be zero above its low bits bits. bits must be positive. +// This assumes that any bits above the *have bits in the last byte are zeros. +// That assumption is preserved on return, as any bits above *have + bits in +// the last byte written will be set to zeros. +static inline void append_bits(unsigned value, int bits, + unsigned char *in, int *have) { + in += *have >> 3; // where the first bits from value will go + int k = *have & 7; // the number of bits already there + *have += bits; + if (k) + *in |= value << k; // write value above the low k bits + else + *in = value; + k = 8 - k; // the number of bits just appended + while (bits > k) { + value >>= k; // drop the bits appended + bits -= k; + k = 8; // now at a byte boundary + *++in = value; + } } -/* See comments in zran.h. */ -int deflate_index_extract(FILE *in, struct deflate_index *index, off_t offset, - unsigned char *buf, int len) -{ - int ret, skip; - z_stream strm; - struct point *here; - unsigned char input[CHUNK]; - unsigned char discard[WINSIZE]; +// Insert enough bits in the form of empty deflate blocks in front of the +// low bits bits of value, in order to bring the sequence to a byte boundary. +// Then feed that to inflate(). This does what inflatePrime() does, except that +// a negative value of bits is not supported. bits must be in 0..16. If the +// arguments are invalid, Z_STREAM_ERROR is returned. Otherwise the return +// value from inflate() is returned. +static int inflatePreface(z_stream *strm, int bits, int value) { + // Check input. + if (strm == Z_NULL || bits < 0 || bits > 16) + return Z_STREAM_ERROR; + if (bits == 0) + return Z_OK; + value &= (2 << (bits - 1)) - 1; + + // An empty dynamic block with an odd number of bits (95). The high bit of + // the last byte is unused. + static const unsigned char dyn[] = { + 4, 0xe0, 0x81, 8, 0, 0, 0, 0, 0x20, 0xa8, 0xab, 0x1f + }; + const int dynlen = 95; // number of bits in the block + + // Build an input buffer for inflate that is a multiple of eight bits in + // length, and that ends with the low bits bits of value. + unsigned char in[(dynlen + 3 * 10 + 16 + 7) / 8]; + int have = 0; + if (bits & 1) { + // Insert an empty dynamic block to get to an odd number of bits, so + // when bits bits from value are appended, we are at an even number of + // bits. + memcpy(in, dyn, sizeof(dyn)); + have = dynlen; + } + while ((have + bits) & 7) + // Insert empty fixed blocks until appending bits bits would put us on + // a byte boundary. This will insert at most three fixed blocks. + append_bits(2, 10, in, &have); + + // Append the bits bits from value, which takes us to a byte boundary. + append_bits(value, bits, in, &have); + + // Deliver the input to inflate(). There is no output space provided, but + // inflate() can't get stuck waiting on output not ingesting all of the + // provided input. The reason is that there will be at most 16 bits of + // input from value after the empty deflate blocks (which themselves + // generate no output). At least ten bits are needed to generate the first + // output byte from a fixed block. The last two bytes of the buffer have to + // be ingested in order to get ten bits, which is the most that value can + // occupy. + strm->avail_in = have >> 3; + strm->next_in = in; + strm->avail_out = 0; + strm->next_out = in; // not used, but can't be NULL + return inflate(strm, Z_NO_FLUSH); +} + +#else +# define INFLATEPRIME inflatePrime +#endif + +// See comments in zran.h. +ptrdiff_t deflate_index_extract(FILE *in, struct deflate_index *index, + off_t offset, unsigned char *buf, size_t len) { + // Do a quick sanity check on the index. + if (index == NULL || index->have < 1 || index->list[0].out != 0) + return Z_STREAM_ERROR; - /* proceed only if something reasonable to do */ - if (len < 0) + // If nothing to extract, return zero bytes extracted. + if (len == 0 || offset < 0 || offset >= index->length) return 0; - /* find where in stream to start */ - here = index->list; - ret = index->have; - while (--ret && here[1].out <= offset) - here++; - - /* initialize file and inflate state to start there */ - strm.zalloc = Z_NULL; - strm.zfree = Z_NULL; - strm.opaque = Z_NULL; - strm.avail_in = 0; - strm.next_in = Z_NULL; - ret = inflateInit2(&strm, -15); /* raw inflate */ + // Find the access point closest to but not after offset. + int lo = -1, hi = index->have; + point_t *point = index->list; + while (hi - lo > 1) { + int mid = (lo + hi) >> 1; + if (offset < point[mid].out) + hi = mid; + else + lo = mid; + } + point += lo; + + // Initialize the input file and prime the inflate engine to start there. + int ret = fseeko(in, point->in - (point->bits ? 1 : 0), SEEK_SET); + if (ret == -1) + return Z_ERRNO; + int ch = 0; + if (point->bits && (ch = getc(in)) == EOF) + return ferror(in) ? Z_ERRNO : Z_BUF_ERROR; + z_stream strm = {0}; + ret = inflateInit2(&strm, RAW); if (ret != Z_OK) return ret; - ret = fseeko(in, here->in - (here->bits ? 1 : 0), SEEK_SET); - if (ret == -1) - goto deflate_index_extract_ret; - if (here->bits) { - ret = getc(in); - if (ret == -1) { - ret = ferror(in) ? Z_ERRNO : Z_DATA_ERROR; - goto deflate_index_extract_ret; - } - (void)inflatePrime(&strm, here->bits, ret >> (8 - here->bits)); - } - (void)inflateSetDictionary(&strm, here->window, WINSIZE); + if (point->bits) + INFLATEPRIME(&strm, point->bits, ch >> (8 - point->bits)); + inflateSetDictionary(&strm, point->window, WINSIZE); - /* skip uncompressed bytes until offset reached, then satisfy request */ - offset -= here->out; - strm.avail_in = 0; - skip = 1; /* while skipping to offset */ + // Skip uncompressed bytes until offset reached, then satisfy request. + unsigned char input[CHUNK]; + unsigned char discard[WINSIZE]; + offset -= point->out; // number of bytes to skip to get to offset + size_t left = len; // number of bytes left to read after offset do { - /* define where to put uncompressed data, and how much */ - if (offset > WINSIZE) { /* skip WINSIZE bytes */ - strm.avail_out = WINSIZE; - strm.next_out = discard; - offset -= WINSIZE; - } - else if (offset > 0) { /* last skip */ - strm.avail_out = (unsigned)offset; + if (offset) { + // Discard up to offset uncompressed bytes. + strm.avail_out = offset < WINSIZE ? (unsigned)offset : WINSIZE; strm.next_out = discard; - offset = 0; } - else if (skip) { /* at offset now */ - strm.avail_out = len; - strm.next_out = buf; - skip = 0; /* only do this once */ + else { + // Uncompress up to left bytes into buf. + strm.avail_out = left < UINT_MAX ? (unsigned)left : UINT_MAX; + strm.next_out = buf + len - left; } - /* uncompress until avail_out filled, or end of stream */ - do { - if (strm.avail_in == 0) { - strm.avail_in = fread(input, 1, CHUNK, in); - if (ferror(in)) { - ret = Z_ERRNO; - goto deflate_index_extract_ret; - } - if (strm.avail_in == 0) { - ret = Z_DATA_ERROR; - goto deflate_index_extract_ret; - } - strm.next_in = input; + // Uncompress, setting got to the number of bytes uncompressed. + if (strm.avail_in == 0) { + // Assure available input. + strm.avail_in = fread(input, 1, CHUNK, in); + if (strm.avail_in < CHUNK && ferror(in)) { + ret = Z_ERRNO; + break; + } + strm.next_in = input; + } + unsigned got = strm.avail_out; + ret = inflate(&strm, Z_NO_FLUSH); + got -= strm.avail_out; + + // Update the appropriate count. + if (offset) + offset -= got; + else + left -= got; + + // If we're at the end of a gzip member and there's more to read, + // continue to the next gzip member. + if (ret == Z_STREAM_END && index->mode == GZIP) { + // Discard the gzip trailer. + unsigned drop = 8; // length of gzip trailer + if (strm.avail_in >= drop) { + strm.avail_in -= drop; + strm.next_in += drop; + } + else { + // Read and discard the remainder of the gzip trailer. + drop -= strm.avail_in; + strm.avail_in = 0; + do { + if (getc(in) == EOF) + // The input does not have a complete trailer. + return ferror(in) ? Z_ERRNO : Z_BUF_ERROR; + } while (--drop); } - ret = inflate(&strm, Z_NO_FLUSH); /* normal inflate */ - if (ret == Z_NEED_DICT) - ret = Z_DATA_ERROR; - if (ret == Z_MEM_ERROR || ret == Z_DATA_ERROR) - goto deflate_index_extract_ret; - if (ret == Z_STREAM_END) { - /* the raw deflate stream has ended */ - if (index->gzip == 0) - /* this is a zlib stream that has ended -- done */ - break; - - /* near the end of a gzip member, which might be followed by - another gzip member -- skip the gzip trailer and see if - there is more input after it */ - if (strm.avail_in < 8) { - fseeko(in, 8 - strm.avail_in, SEEK_CUR); - strm.avail_in = 0; - } - else { - strm.avail_in -= 8; - strm.next_in += 8; - } - if (strm.avail_in == 0 && ungetc(getc(in), in) == EOF) - /* the input ended after the gzip trailer -- done */ - break; - /* there is more input, so another gzip member should follow -- - validate and skip the gzip header */ - ret = inflateReset2(&strm, 31); - if (ret != Z_OK) - goto deflate_index_extract_ret; + if (strm.avail_in || ungetc(getc(in), in) != EOF) { + // There's more after the gzip trailer. Use inflate to skip the + // gzip header and resume the raw inflate there. + inflateReset2(&strm, GZIP); do { if (strm.avail_in == 0) { strm.avail_in = fread(input, 1, CHUNK, in); - if (ferror(in)) { + if (strm.avail_in < CHUNK && ferror(in)) { ret = Z_ERRNO; - goto deflate_index_extract_ret; - } - if (strm.avail_in == 0) { - ret = Z_DATA_ERROR; - goto deflate_index_extract_ret; + break; } strm.next_in = input; } - ret = inflate(&strm, Z_BLOCK); - if (ret == Z_MEM_ERROR || ret == Z_DATA_ERROR) - goto deflate_index_extract_ret; - } while ((strm.data_type & 128) == 0); - - /* set up to continue decompression of the raw deflate stream - that follows the gzip header */ - ret = inflateReset2(&strm, -15); + strm.avail_out = WINSIZE; + strm.next_out = discard; + ret = inflate(&strm, Z_BLOCK); // stop at end of header + } while (ret == Z_OK && (strm.data_type & 0x80) == 0); if (ret != Z_OK) - goto deflate_index_extract_ret; + break; + inflateReset2(&strm, RAW); } + } - /* continue to process the available input before reading more */ - } while (strm.avail_out != 0); - - if (ret == Z_STREAM_END) - /* reached the end of the compressed data -- return the data that - was available, possibly less than requested */ - break; - - /* do until offset reached and requested data read */ - } while (skip); - - /* compute the number of uncompressed bytes read after the offset */ - ret = skip ? 0 : len - strm.avail_out; + // Continue until we have the requested data, the deflate data has + // ended, or an error is encountered. + } while (ret == Z_OK && left); + inflateEnd(&strm); - /* clean up and return the bytes read, or the negative error */ - deflate_index_extract_ret: - (void)inflateEnd(&strm); - return ret; + // Return the number of uncompressed bytes read into buf, or the error. + return ret == Z_OK || ret == Z_STREAM_END ? len - left : ret; } #ifdef TEST -#define SPAN 1048576L /* desired distance between access points */ -#define LEN 16384 /* number of bytes to extract */ - -/* Demonstrate the use of deflate_index_build() and deflate_index_extract() by - processing the file provided on the command line, and extracting LEN bytes - from 2/3rds of the way through the uncompressed output, writing that to - stdout. An offset can be provided as the second argument, in which case the - data is extracted from there instead. */ -int main(int argc, char **argv) -{ - int len; - off_t offset = -1; - FILE *in; - struct deflate_index *index = NULL; - unsigned char buf[LEN]; +#define SPAN 1048576L // desired distance between access points +#define LEN 16384 // number of bytes to extract - /* open input file */ +// Demonstrate the use of deflate_index_build() and deflate_index_extract() by +// processing the file provided on the command line, and extracting LEN bytes +// from 2/3rds of the way through the uncompressed output, writing that to +// stdout. An offset can be provided as the second argument, in which case the +// data is extracted from there instead. +int main(int argc, char **argv) { + // Open the input file. if (argc < 2 || argc > 3) { - fprintf(stderr, "usage: zran file.gz [offset]\n"); + fprintf(stderr, "usage: zran file.raw [offset]\n"); return 1; } - in = fopen(argv[1], "rb"); + FILE *in = fopen(argv[1], "rb"); if (in == NULL) { fprintf(stderr, "zran: could not open %s for reading\n", argv[1]); return 1; } - /* get optional offset */ + // Get optional offset. + off_t offset = -1; if (argc == 3) { char *end; offset = strtoll(argv[2], &end, 10); @@ -437,14 +486,18 @@ int main(int argc, char **argv) } } - /* build index */ - len = deflate_index_build(in, SPAN, &index); + // Build index. + struct deflate_index *index = NULL; + int len = deflate_index_build(in, SPAN, &index); if (len < 0) { fclose(in); switch (len) { case Z_MEM_ERROR: fprintf(stderr, "zran: out of memory\n"); break; + case Z_BUF_ERROR: + fprintf(stderr, "zran: %s ended prematurely\n", argv[1]); + break; case Z_DATA_ERROR: fprintf(stderr, "zran: compressed data error in %s\n", argv[1]); break; @@ -458,19 +511,20 @@ int main(int argc, char **argv) } fprintf(stderr, "zran: built index with %d access points\n", len); - /* use index by reading some bytes from an arbitrary offset */ + // Use index by reading some bytes from an arbitrary offset. + unsigned char buf[LEN]; if (offset == -1) - offset = (index->length << 1) / 3; - len = deflate_index_extract(in, index, offset, buf, LEN); - if (len < 0) + offset = ((index->length + 1) << 1) / 3; + ptrdiff_t got = deflate_index_extract(in, index, offset, buf, LEN); + if (got < 0) fprintf(stderr, "zran: extraction failed: %s error\n", - len == Z_MEM_ERROR ? "out of memory" : "input corrupted"); + got == Z_MEM_ERROR ? "out of memory" : "input corrupted"); else { - fwrite(buf, 1, len, stdout); - fprintf(stderr, "zran: extracted %d bytes at %llu\n", len, offset); + fwrite(buf, 1, got, stdout); + fprintf(stderr, "zran: extracted %ld bytes at %lld\n", got, offset); } - /* clean up and exit */ + // Clean up and exit. deflate_index_free(index); fclose(in); return 0; diff --git a/src/PureLib/pure/zlib/examples/zran.h b/src/PureLib/pure/zlib/examples/zran.h index 2314125d6e..ebf780d0c1 100644 --- a/src/PureLib/pure/zlib/examples/zran.h +++ b/src/PureLib/pure/zlib/examples/zran.h @@ -1,40 +1,51 @@ -/* zran.h -- example of zlib/gzip stream indexing and random access - * Copyright (C) 2005, 2012, 2018 Mark Adler +/* zran.h -- example of deflated stream indexing and random access + * Copyright (C) 2005, 2012, 2018, 2023 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h - * Version 1.2 14 Oct 2018 Mark Adler */ + * Version 1.3 18 Feb 2023 Mark Adler */ #include #include "zlib.h" -/* Access point list. */ +// Access point. +typedef struct point { + off_t out; // offset in uncompressed data + off_t in; // offset in compressed file of first full byte + int bits; // 0, or number of bits (1-7) from byte at in-1 + unsigned char window[32768]; // preceding 32K of uncompressed data +} point_t; + +// Access point list. struct deflate_index { - int have; /* number of list entries */ - int gzip; /* 1 if the index is of a gzip file, 0 if it is of a - zlib stream */ - off_t length; /* total length of uncompressed data */ - void *list; /* allocated list of entries */ + int have; // number of access points in list + int mode; // -15 for raw, 15 for zlib, or 31 for gzip + off_t length; // total length of uncompressed data + point_t *list; // allocated list of access points }; -/* Make one entire pass through a zlib or gzip compressed stream and build an - index, with access points about every span bytes of uncompressed output. - gzip files with multiple members are indexed in their entirety. span should - be chosen to balance the speed of random access against the memory - requirements of the list, about 32K bytes per access point. The return value - is the number of access points on success (>= 1), Z_MEM_ERROR for out of - memory, Z_DATA_ERROR for an error in the input file, or Z_ERRNO for a file - read error. On success, *built points to the resulting index. */ +// Make one pass through a zlib, gzip, or raw deflate compressed stream and +// build an index, with access points about every span bytes of uncompressed +// output. gzip files with multiple members are fully indexed. span should be +// chosen to balance the speed of random access against the memory requirements +// of the list, which is about 32K bytes per access point. The return value is +// the number of access points on success (>= 1), Z_MEM_ERROR for out of +// memory, Z_BUF_ERROR for a premature end of input, Z_DATA_ERROR for a format +// or verification error in the input file, or Z_ERRNO for a file read error. +// On success, *built points to the resulting index. int deflate_index_build(FILE *in, off_t span, struct deflate_index **built); -/* Deallocate an index built by deflate_index_build() */ -void deflate_index_free(struct deflate_index *index); +// Use the index to read len bytes from offset into buf. Return the number of +// bytes read or a negative error code. If data is requested past the end of +// the uncompressed data, then deflate_index_extract() will return a value less +// than len, indicating how much was actually read into buf. If given a valid +// index, this function should not return an error unless the file was modified +// somehow since the index was generated, given that deflate_index_build() had +// validated all of the input. If nevertheless there is a failure, Z_BUF_ERROR +// is returned if the compressed data ends prematurely, Z_DATA_ERROR if the +// deflate compressed data is not valid, Z_MEM_ERROR if out of memory, +// Z_STREAM_ERROR if the index is not valid, or Z_ERRNO if there is an error +// reading or seeking on the input file. +ptrdiff_t deflate_index_extract(FILE *in, struct deflate_index *index, + off_t offset, unsigned char *buf, size_t len); -/* Use the index to read len bytes from offset into buf. Return bytes read or - negative for error (Z_DATA_ERROR or Z_MEM_ERROR). If data is requested past - the end of the uncompressed data, then deflate_index_extract() will return a - value less than len, indicating how much was actually read into buf. This - function should not return a data error unless the file was modified since - the index was generated, since deflate_index_build() validated all of the - input. deflate_index_extract() will return Z_ERRNO if there is an error on - reading or seeking the input file. */ -int deflate_index_extract(FILE *in, struct deflate_index *index, off_t offset, - unsigned char *buf, int len); +// Deallocate an index built by deflate_index_build(). +void deflate_index_free(struct deflate_index *index); diff --git a/src/PureLib/pure/zlib/gzclose.c b/src/PureLib/pure/zlib/gzclose.c index caeb99a317..48d6a86f04 100644 --- a/src/PureLib/pure/zlib/gzclose.c +++ b/src/PureLib/pure/zlib/gzclose.c @@ -8,9 +8,7 @@ /* gzclose() is in a separate file so that it is linked in only if it is used. That way the other gzclose functions can be used instead to avoid linking in unneeded compression or decompression routines. */ -int ZEXPORT gzclose(file) - gzFile file; -{ +int ZEXPORT gzclose(gzFile file) { #ifndef NO_GZCOMPRESS gz_statep state; diff --git a/src/PureLib/pure/zlib/gzguts.h b/src/PureLib/pure/zlib/gzguts.h index 57faf37165..eba72085bb 100644 --- a/src/PureLib/pure/zlib/gzguts.h +++ b/src/PureLib/pure/zlib/gzguts.h @@ -1,5 +1,5 @@ /* gzguts.h -- zlib internal header definitions for gz* operations - * Copyright (C) 2004-2019 Mark Adler + * Copyright (C) 2004-2024 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -7,9 +7,8 @@ # ifndef _LARGEFILE_SOURCE # define _LARGEFILE_SOURCE 1 # endif -# ifdef _FILE_OFFSET_BITS -# undef _FILE_OFFSET_BITS -# endif +# undef _FILE_OFFSET_BITS +# undef _TIME_BITS #endif #ifdef HAVE_HIDDEN @@ -119,8 +118,8 @@ /* gz* functions always use library allocation functions */ #ifndef STDC - extern voidp malloc OF((uInt size)); - extern void free OF((voidpf ptr)); + extern voidp malloc(uInt size); + extern void free(voidpf ptr); #endif /* get errno and strerror definition */ @@ -138,10 +137,10 @@ /* provide prototypes for these when building zlib without LFS */ #if !defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0 - ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *)); - ZEXTERN z_off64_t ZEXPORT gzseek64 OF((gzFile, z_off64_t, int)); - ZEXTERN z_off64_t ZEXPORT gztell64 OF((gzFile)); - ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile)); + ZEXTERN gzFile ZEXPORT gzopen64(const char *, const char *); + ZEXTERN z_off64_t ZEXPORT gzseek64(gzFile, z_off64_t, int); + ZEXTERN z_off64_t ZEXPORT gztell64(gzFile); + ZEXTERN z_off64_t ZEXPORT gzoffset64(gzFile); #endif /* default memLevel */ @@ -203,17 +202,13 @@ typedef struct { typedef gz_state FAR *gz_statep; /* shared functions */ -void ZLIB_INTERNAL gz_error OF((gz_statep, int, const char *)); +void ZLIB_INTERNAL gz_error(gz_statep, int, const char *); #if defined UNDER_CE -char ZLIB_INTERNAL *gz_strwinerror OF((DWORD error)); +char ZLIB_INTERNAL *gz_strwinerror(DWORD error); #endif /* GT_OFF(x), where x is an unsigned value, is true if x > maximum z_off64_t value -- needed when comparing unsigned to z_off64_t, which is signed (possible z_off64_t types off_t, off64_t, and long are all signed) */ -#ifdef INT_MAX -# define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > INT_MAX) -#else -unsigned ZLIB_INTERNAL gz_intmax OF((void)); -# define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > gz_intmax()) -#endif +unsigned ZLIB_INTERNAL gz_intmax(void); +#define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > gz_intmax()) diff --git a/src/PureLib/pure/zlib/gzlib.c b/src/PureLib/pure/zlib/gzlib.c index 55da46a453..983153cc8e 100644 --- a/src/PureLib/pure/zlib/gzlib.c +++ b/src/PureLib/pure/zlib/gzlib.c @@ -1,5 +1,5 @@ /* gzlib.c -- zlib functions common to reading and writing gzip files - * Copyright (C) 2004-2019 Mark Adler + * Copyright (C) 2004-2024 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -15,10 +15,6 @@ #endif #endif -/* Local functions */ -local void gz_reset OF((gz_statep)); -local gzFile gz_open OF((const void *, int, const char *)); - #if defined UNDER_CE /* Map the Windows error number in ERROR to a locale-dependent error message @@ -30,9 +26,7 @@ local gzFile gz_open OF((const void *, int, const char *)); The gz_strwinerror function does not change the current setting of GetLastError. */ -char ZLIB_INTERNAL *gz_strwinerror(error) - DWORD error; -{ +char ZLIB_INTERNAL *gz_strwinerror(DWORD error) { static char buf[1024]; wchar_t *msgbuf; @@ -72,9 +66,7 @@ char ZLIB_INTERNAL *gz_strwinerror(error) #endif /* UNDER_CE */ /* Reset gzip file state */ -local void gz_reset(state) - gz_statep state; -{ +local void gz_reset(gz_statep state) { state->x.have = 0; /* no output data available */ if (state->mode == GZ_READ) { /* for reading ... */ state->eof = 0; /* not at end of file */ @@ -90,11 +82,7 @@ local void gz_reset(state) } /* Open a gzip file either by name or file descriptor. */ -local gzFile gz_open(path, fd, mode) - const void *path; - int fd; - const char *mode; -{ +local gzFile gz_open(const void *path, int fd, const char *mode) { gz_statep state; z_size_t len; int oflag; @@ -269,26 +257,17 @@ local gzFile gz_open(path, fd, mode) } /* -- see zlib.h -- */ -gzFile ZEXPORT gzopen(path, mode) - const char *path; - const char *mode; -{ +gzFile ZEXPORT gzopen(const char *path, const char *mode) { return gz_open(path, -1, mode); } /* -- see zlib.h -- */ -gzFile ZEXPORT gzopen64(path, mode) - const char *path; - const char *mode; -{ +gzFile ZEXPORT gzopen64(const char *path, const char *mode) { return gz_open(path, -1, mode); } /* -- see zlib.h -- */ -gzFile ZEXPORT gzdopen(fd, mode) - int fd; - const char *mode; -{ +gzFile ZEXPORT gzdopen(int fd, const char *mode) { char *path; /* identifier for error messages */ gzFile gz; @@ -306,19 +285,13 @@ gzFile ZEXPORT gzdopen(fd, mode) /* -- see zlib.h -- */ #ifdef WIDECHAR -gzFile ZEXPORT gzopen_w(path, mode) - const wchar_t *path; - const char *mode; -{ +gzFile ZEXPORT gzopen_w(const wchar_t *path, const char *mode) { return gz_open(path, -2, mode); } #endif /* -- see zlib.h -- */ -int ZEXPORT gzbuffer(file, size) - gzFile file; - unsigned size; -{ +int ZEXPORT gzbuffer(gzFile file, unsigned size) { gz_statep state; /* get internal structure and check integrity */ @@ -335,16 +308,14 @@ int ZEXPORT gzbuffer(file, size) /* check and set requested size */ if ((size << 1) < size) return -1; /* need to be able to double it */ - if (size < 2) - size = 2; /* need two bytes to check magic header */ + if (size < 8) + size = 8; /* needed to behave well with flushing */ state->want = size; return 0; } /* -- see zlib.h -- */ -int ZEXPORT gzrewind(file) - gzFile file; -{ +int ZEXPORT gzrewind(gzFile file) { gz_statep state; /* get internal structure */ @@ -365,11 +336,7 @@ int ZEXPORT gzrewind(file) } /* -- see zlib.h -- */ -z_off64_t ZEXPORT gzseek64(file, offset, whence) - gzFile file; - z_off64_t offset; - int whence; -{ +z_off64_t ZEXPORT gzseek64(gzFile file, z_off64_t offset, int whence) { unsigned n; z_off64_t ret; gz_statep state; @@ -442,11 +409,7 @@ z_off64_t ZEXPORT gzseek64(file, offset, whence) } /* -- see zlib.h -- */ -z_off_t ZEXPORT gzseek(file, offset, whence) - gzFile file; - z_off_t offset; - int whence; -{ +z_off_t ZEXPORT gzseek(gzFile file, z_off_t offset, int whence) { z_off64_t ret; ret = gzseek64(file, (z_off64_t)offset, whence); @@ -454,9 +417,7 @@ z_off_t ZEXPORT gzseek(file, offset, whence) } /* -- see zlib.h -- */ -z_off64_t ZEXPORT gztell64(file) - gzFile file; -{ +z_off64_t ZEXPORT gztell64(gzFile file) { gz_statep state; /* get internal structure and check integrity */ @@ -471,9 +432,7 @@ z_off64_t ZEXPORT gztell64(file) } /* -- see zlib.h -- */ -z_off_t ZEXPORT gztell(file) - gzFile file; -{ +z_off_t ZEXPORT gztell(gzFile file) { z_off64_t ret; ret = gztell64(file); @@ -481,9 +440,7 @@ z_off_t ZEXPORT gztell(file) } /* -- see zlib.h -- */ -z_off64_t ZEXPORT gzoffset64(file) - gzFile file; -{ +z_off64_t ZEXPORT gzoffset64(gzFile file) { z_off64_t offset; gz_statep state; @@ -504,9 +461,7 @@ z_off64_t ZEXPORT gzoffset64(file) } /* -- see zlib.h -- */ -z_off_t ZEXPORT gzoffset(file) - gzFile file; -{ +z_off_t ZEXPORT gzoffset(gzFile file) { z_off64_t ret; ret = gzoffset64(file); @@ -514,9 +469,7 @@ z_off_t ZEXPORT gzoffset(file) } /* -- see zlib.h -- */ -int ZEXPORT gzeof(file) - gzFile file; -{ +int ZEXPORT gzeof(gzFile file) { gz_statep state; /* get internal structure and check integrity */ @@ -531,10 +484,7 @@ int ZEXPORT gzeof(file) } /* -- see zlib.h -- */ -const char * ZEXPORT gzerror(file, errnum) - gzFile file; - int *errnum; -{ +const char * ZEXPORT gzerror(gzFile file, int *errnum) { gz_statep state; /* get internal structure and check integrity */ @@ -552,9 +502,7 @@ const char * ZEXPORT gzerror(file, errnum) } /* -- see zlib.h -- */ -void ZEXPORT gzclearerr(file) - gzFile file; -{ +void ZEXPORT gzclearerr(gzFile file) { gz_statep state; /* get internal structure and check integrity */ @@ -578,11 +526,7 @@ void ZEXPORT gzclearerr(file) memory). Simply save the error message as a static string. If there is an allocation failure constructing the error message, then convert the error to out of memory. */ -void ZLIB_INTERNAL gz_error(state, err, msg) - gz_statep state; - int err; - const char *msg; -{ +void ZLIB_INTERNAL gz_error(gz_statep state, int err, const char *msg) { /* free previously allocated message and clear */ if (state->msg != NULL) { if (state->err != Z_MEM_ERROR) @@ -619,21 +563,20 @@ void ZLIB_INTERNAL gz_error(state, err, msg) #endif } -#ifndef INT_MAX /* portably return maximum value for an int (when limits.h presumed not available) -- we need to do this to cover cases where 2's complement not used, since C standard permits 1's complement and sign-bit representations, otherwise we could just use ((unsigned)-1) >> 1 */ -unsigned ZLIB_INTERNAL gz_intmax() -{ - unsigned p, q; - - p = 1; +unsigned ZLIB_INTERNAL gz_intmax(void) { +#ifdef INT_MAX + return INT_MAX; +#else + unsigned p = 1, q; do { q = p; p <<= 1; p++; } while (p > q); return q >> 1; -} #endif +} diff --git a/src/PureLib/pure/zlib/gzread.c b/src/PureLib/pure/zlib/gzread.c index dd77381596..4168cbc887 100644 --- a/src/PureLib/pure/zlib/gzread.c +++ b/src/PureLib/pure/zlib/gzread.c @@ -5,25 +5,12 @@ #include "gzguts.h" -/* Local functions */ -local int gz_load OF((gz_statep, unsigned char *, unsigned, unsigned *)); -local int gz_avail OF((gz_statep)); -local int gz_look OF((gz_statep)); -local int gz_decomp OF((gz_statep)); -local int gz_fetch OF((gz_statep)); -local int gz_skip OF((gz_statep, z_off64_t)); -local z_size_t gz_read OF((gz_statep, voidp, z_size_t)); - /* Use read() to load a buffer -- return -1 on error, otherwise 0. Read from state->fd, and update state->eof, state->err, and state->msg as appropriate. This function needs to loop on read(), since read() is not guaranteed to read the number of bytes requested, depending on the type of descriptor. */ -local int gz_load(state, buf, len, have) - gz_statep state; - unsigned char *buf; - unsigned len; - unsigned *have; -{ +local int gz_load(gz_statep state, unsigned char *buf, unsigned len, + unsigned *have) { int ret; unsigned get, max = ((unsigned)-1 >> 2) + 1; @@ -53,9 +40,7 @@ local int gz_load(state, buf, len, have) If strm->avail_in != 0, then the current data is moved to the beginning of the input buffer, and then the remainder of the buffer is loaded with the available data from the input file. */ -local int gz_avail(state) - gz_statep state; -{ +local int gz_avail(gz_statep state) { unsigned got; z_streamp strm = &(state->strm); @@ -88,9 +73,7 @@ local int gz_avail(state) case, all further file reads will be directly to either the output buffer or a user buffer. If decompressing, the inflate state will be initialized. gz_look() will return 0 on success or -1 on failure. */ -local int gz_look(state) - gz_statep state; -{ +local int gz_look(gz_statep state) { z_streamp strm = &(state->strm); /* allocate read buffers and inflate memory */ @@ -170,9 +153,7 @@ local int gz_look(state) data. If the gzip stream completes, state->how is reset to LOOK to look for the next gzip stream or raw data, once state->x.have is depleted. Returns 0 on success, -1 on failure. */ -local int gz_decomp(state) - gz_statep state; -{ +local int gz_decomp(gz_statep state) { int ret = Z_OK; unsigned had; z_streamp strm = &(state->strm); @@ -224,9 +205,7 @@ local int gz_decomp(state) looked for to determine whether to copy or decompress. Returns -1 on error, otherwise 0. gz_fetch() will leave state->how as COPY or GZIP unless the end of the input file has been reached and all data has been processed. */ -local int gz_fetch(state) - gz_statep state; -{ +local int gz_fetch(gz_statep state) { z_streamp strm = &(state->strm); do { @@ -254,10 +233,7 @@ local int gz_fetch(state) } /* Skip len uncompressed bytes of output. Return -1 on error, 0 on success. */ -local int gz_skip(state, len) - gz_statep state; - z_off64_t len; -{ +local int gz_skip(gz_statep state, z_off64_t len) { unsigned n; /* skip over len bytes or reach end-of-file, whichever comes first */ @@ -289,11 +265,7 @@ local int gz_skip(state, len) input. Return the number of bytes read. If zero is returned, either the end of file was reached, or there was an error. state->err must be consulted in that case to determine which. */ -local z_size_t gz_read(state, buf, len) - gz_statep state; - voidp buf; - z_size_t len; -{ +local z_size_t gz_read(gz_statep state, voidp buf, z_size_t len) { z_size_t got; unsigned n; @@ -370,11 +342,7 @@ local z_size_t gz_read(state, buf, len) } /* -- see zlib.h -- */ -int ZEXPORT gzread(file, buf, len) - gzFile file; - voidp buf; - unsigned len; -{ +int ZEXPORT gzread(gzFile file, voidp buf, unsigned len) { gz_statep state; /* get internal structure */ @@ -406,12 +374,7 @@ int ZEXPORT gzread(file, buf, len) } /* -- see zlib.h -- */ -z_size_t ZEXPORT gzfread(buf, size, nitems, file) - voidp buf; - z_size_t size; - z_size_t nitems; - gzFile file; -{ +z_size_t ZEXPORT gzfread(voidp buf, z_size_t size, z_size_t nitems, gzFile file) { z_size_t len; gz_statep state; @@ -442,9 +405,7 @@ z_size_t ZEXPORT gzfread(buf, size, nitems, file) #else # undef gzgetc #endif -int ZEXPORT gzgetc(file) - gzFile file; -{ +int ZEXPORT gzgetc(gzFile file) { unsigned char buf[1]; gz_statep state; @@ -469,17 +430,12 @@ int ZEXPORT gzgetc(file) return gz_read(state, buf, 1) < 1 ? -1 : buf[0]; } -int ZEXPORT gzgetc_(file) -gzFile file; -{ +int ZEXPORT gzgetc_(gzFile file) { return gzgetc(file); } /* -- see zlib.h -- */ -int ZEXPORT gzungetc(c, file) - int c; - gzFile file; -{ +int ZEXPORT gzungetc(int c, gzFile file) { gz_statep state; /* get internal structure */ @@ -487,6 +443,10 @@ int ZEXPORT gzungetc(c, file) return -1; state = (gz_statep)file; + /* in case this was just opened, set up the input buffer */ + if (state->mode == GZ_READ && state->how == LOOK && state->x.have == 0) + (void)gz_look(state); + /* check that we're reading and that there's no (serious) error */ if (state->mode != GZ_READ || (state->err != Z_OK && state->err != Z_BUF_ERROR)) @@ -536,11 +496,7 @@ int ZEXPORT gzungetc(c, file) } /* -- see zlib.h -- */ -char * ZEXPORT gzgets(file, buf, len) - gzFile file; - char *buf; - int len; -{ +char * ZEXPORT gzgets(gzFile file, char *buf, int len) { unsigned left, n; char *str; unsigned char *eol; @@ -600,9 +556,7 @@ char * ZEXPORT gzgets(file, buf, len) } /* -- see zlib.h -- */ -int ZEXPORT gzdirect(file) - gzFile file; -{ +int ZEXPORT gzdirect(gzFile file) { gz_statep state; /* get internal structure */ @@ -620,9 +574,7 @@ int ZEXPORT gzdirect(file) } /* -- see zlib.h -- */ -int ZEXPORT gzclose_r(file) - gzFile file; -{ +int ZEXPORT gzclose_r(gzFile file) { int ret, err; gz_statep state; diff --git a/src/PureLib/pure/zlib/gzwrite.c b/src/PureLib/pure/zlib/gzwrite.c index eb8a0e5893..435b4621b5 100644 --- a/src/PureLib/pure/zlib/gzwrite.c +++ b/src/PureLib/pure/zlib/gzwrite.c @@ -5,18 +5,10 @@ #include "gzguts.h" -/* Local functions */ -local int gz_init OF((gz_statep)); -local int gz_comp OF((gz_statep, int)); -local int gz_zero OF((gz_statep, z_off64_t)); -local z_size_t gz_write OF((gz_statep, voidpc, z_size_t)); - /* Initialize state for writing a gzip file. Mark initialization by setting state->size to non-zero. Return -1 on a memory allocation failure, or 0 on success. */ -local int gz_init(state) - gz_statep state; -{ +local int gz_init(gz_statep state) { int ret; z_streamp strm = &(state->strm); @@ -70,10 +62,7 @@ local int gz_init(state) deflate() flush value. If flush is Z_FINISH, then the deflate() state is reset to start a new gzip stream. If gz->direct is true, then simply write to the output file without compressing, and ignore flush. */ -local int gz_comp(state, flush) - gz_statep state; - int flush; -{ +local int gz_comp(gz_statep state, int flush) { int ret, writ; unsigned have, put, max = ((unsigned)-1 >> 2) + 1; z_streamp strm = &(state->strm); @@ -151,10 +140,7 @@ local int gz_comp(state, flush) /* Compress len zeros to output. Return -1 on a write error or memory allocation failure by gz_comp(), or 0 on success. */ -local int gz_zero(state, len) - gz_statep state; - z_off64_t len; -{ +local int gz_zero(gz_statep state, z_off64_t len) { int first; unsigned n; z_streamp strm = &(state->strm); @@ -184,11 +170,7 @@ local int gz_zero(state, len) /* Write len bytes from buf to file. Return the number of bytes written. If the returned value is less than len, then there was an error. */ -local z_size_t gz_write(state, buf, len) - gz_statep state; - voidpc buf; - z_size_t len; -{ +local z_size_t gz_write(gz_statep state, voidpc buf, z_size_t len) { z_size_t put = len; /* if len is zero, avoid unnecessary operations */ @@ -252,11 +234,7 @@ local z_size_t gz_write(state, buf, len) } /* -- see zlib.h -- */ -int ZEXPORT gzwrite(file, buf, len) - gzFile file; - voidpc buf; - unsigned len; -{ +int ZEXPORT gzwrite(gzFile file, voidpc buf, unsigned len) { gz_statep state; /* get internal structure */ @@ -280,12 +258,8 @@ int ZEXPORT gzwrite(file, buf, len) } /* -- see zlib.h -- */ -z_size_t ZEXPORT gzfwrite(buf, size, nitems, file) - voidpc buf; - z_size_t size; - z_size_t nitems; - gzFile file; -{ +z_size_t ZEXPORT gzfwrite(voidpc buf, z_size_t size, z_size_t nitems, + gzFile file) { z_size_t len; gz_statep state; @@ -310,10 +284,7 @@ z_size_t ZEXPORT gzfwrite(buf, size, nitems, file) } /* -- see zlib.h -- */ -int ZEXPORT gzputc(file, c) - gzFile file; - int c; -{ +int ZEXPORT gzputc(gzFile file, int c) { unsigned have; unsigned char buf[1]; gz_statep state; @@ -358,10 +329,7 @@ int ZEXPORT gzputc(file, c) } /* -- see zlib.h -- */ -int ZEXPORT gzputs(file, s) - gzFile file; - const char *s; -{ +int ZEXPORT gzputs(gzFile file, const char *s) { z_size_t len, put; gz_statep state; @@ -388,8 +356,7 @@ int ZEXPORT gzputs(file, s) #include /* -- see zlib.h -- */ -int ZEXPORTVA gzvprintf(gzFile file, const char *format, va_list va) -{ +int ZEXPORTVA gzvprintf(gzFile file, const char *format, va_list va) { int len; unsigned left; char *next; @@ -460,8 +427,7 @@ int ZEXPORTVA gzvprintf(gzFile file, const char *format, va_list va) return len; } -int ZEXPORTVA gzprintf(gzFile file, const char *format, ...) -{ +int ZEXPORTVA gzprintf(gzFile file, const char *format, ...) { va_list va; int ret; @@ -474,13 +440,10 @@ int ZEXPORTVA gzprintf(gzFile file, const char *format, ...) #else /* !STDC && !Z_HAVE_STDARG_H */ /* -- see zlib.h -- */ -int ZEXPORTVA gzprintf(file, format, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, - a11, a12, a13, a14, a15, a16, a17, a18, a19, a20) - gzFile file; - const char *format; - int a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, - a11, a12, a13, a14, a15, a16, a17, a18, a19, a20; -{ +int ZEXPORTVA gzprintf(gzFile file, const char *format, int a1, int a2, int a3, + int a4, int a5, int a6, int a7, int a8, int a9, int a10, + int a11, int a12, int a13, int a14, int a15, int a16, + int a17, int a18, int a19, int a20) { unsigned len, left; char *next; gz_statep state; @@ -562,10 +525,7 @@ int ZEXPORTVA gzprintf(file, format, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, #endif /* -- see zlib.h -- */ -int ZEXPORT gzflush(file, flush) - gzFile file; - int flush; -{ +int ZEXPORT gzflush(gzFile file, int flush) { gz_statep state; /* get internal structure */ @@ -594,11 +554,7 @@ int ZEXPORT gzflush(file, flush) } /* -- see zlib.h -- */ -int ZEXPORT gzsetparams(file, level, strategy) - gzFile file; - int level; - int strategy; -{ +int ZEXPORT gzsetparams(gzFile file, int level, int strategy) { gz_statep state; z_streamp strm; @@ -609,7 +565,7 @@ int ZEXPORT gzsetparams(file, level, strategy) strm = &(state->strm); /* check that we're writing and that there's no error */ - if (state->mode != GZ_WRITE || state->err != Z_OK) + if (state->mode != GZ_WRITE || state->err != Z_OK || state->direct) return Z_STREAM_ERROR; /* if no change is requested, then do nothing */ @@ -636,9 +592,7 @@ int ZEXPORT gzsetparams(file, level, strategy) } /* -- see zlib.h -- */ -int ZEXPORT gzclose_w(file) - gzFile file; -{ +int ZEXPORT gzclose_w(gzFile file) { int ret = Z_OK; gz_statep state; diff --git a/src/PureLib/pure/zlib/infback.c b/src/PureLib/pure/zlib/infback.c index babeaf1806..e7b25b307a 100644 --- a/src/PureLib/pure/zlib/infback.c +++ b/src/PureLib/pure/zlib/infback.c @@ -15,9 +15,6 @@ #include "inflate.h" #include "inffast.h" -/* function prototypes */ -local void fixedtables OF((struct inflate_state FAR *state)); - /* strm provides memory allocation functions in zalloc and zfree, or Z_NULL to use the library memory allocation functions. @@ -25,13 +22,9 @@ local void fixedtables OF((struct inflate_state FAR *state)); windowBits is in the range 8..15, and window is a user-supplied window and output buffer that is 2**windowBits bytes. */ -int ZEXPORT inflateBackInit_(strm, windowBits, window, version, stream_size) -z_streamp strm; -int windowBits; -unsigned char FAR *window; -const char *version; -int stream_size; -{ +int ZEXPORT inflateBackInit_(z_streamp strm, int windowBits, + unsigned char FAR *window, const char *version, + int stream_size) { struct inflate_state FAR *state; if (version == Z_NULL || version[0] != ZLIB_VERSION[0] || @@ -80,9 +73,7 @@ int stream_size; used for threaded applications, since the rewriting of the tables and virgin may not be thread-safe. */ -local void fixedtables(state) -struct inflate_state FAR *state; -{ +local void fixedtables(struct inflate_state FAR *state) { #ifdef BUILDFIXED static int virgin = 1; static code *lenfix, *distfix; @@ -248,13 +239,8 @@ struct inflate_state FAR *state; inflateBack() can also return Z_STREAM_ERROR if the input parameters are not correct, i.e. strm is Z_NULL or the state was not initialized. */ -int ZEXPORT inflateBack(strm, in, in_desc, out, out_desc) -z_streamp strm; -in_func in; -void FAR *in_desc; -out_func out; -void FAR *out_desc; -{ +int ZEXPORT inflateBack(z_streamp strm, in_func in, void FAR *in_desc, + out_func out, void FAR *out_desc) { struct inflate_state FAR *state; z_const unsigned char FAR *next; /* next input */ unsigned char FAR *put; /* next output */ @@ -632,9 +618,7 @@ void FAR *out_desc; return ret; } -int ZEXPORT inflateBackEnd(strm) -z_streamp strm; -{ +int ZEXPORT inflateBackEnd(z_streamp strm) { if (strm == Z_NULL || strm->state == Z_NULL || strm->zfree == (free_func)0) return Z_STREAM_ERROR; ZFREE(strm, strm->state); diff --git a/src/PureLib/pure/zlib/inffast.c b/src/PureLib/pure/zlib/inffast.c index 1fec7f363f..9354676e78 100644 --- a/src/PureLib/pure/zlib/inffast.c +++ b/src/PureLib/pure/zlib/inffast.c @@ -47,10 +47,7 @@ requires strm->avail_out >= 258 for each loop to avoid checking for output space. */ -void ZLIB_INTERNAL inflate_fast(strm, start) -z_streamp strm; -unsigned start; /* inflate()'s starting value for strm->avail_out */ -{ +void ZLIB_INTERNAL inflate_fast(z_streamp strm, unsigned start) { struct inflate_state FAR *state; z_const unsigned char FAR *in; /* local strm->next_in */ z_const unsigned char FAR *last; /* have enough input while in < last */ diff --git a/src/PureLib/pure/zlib/inffast.h b/src/PureLib/pure/zlib/inffast.h index e5c1aa4ca8..49c6d156c5 100644 --- a/src/PureLib/pure/zlib/inffast.h +++ b/src/PureLib/pure/zlib/inffast.h @@ -8,4 +8,4 @@ subject to change. Applications should only use zlib.h. */ -void ZLIB_INTERNAL inflate_fast OF((z_streamp strm, unsigned start)); +void ZLIB_INTERNAL inflate_fast(z_streamp strm, unsigned start); diff --git a/src/PureLib/pure/zlib/inflate.c b/src/PureLib/pure/zlib/inflate.c index 8acbef44e9..94ecff015a 100644 --- a/src/PureLib/pure/zlib/inflate.c +++ b/src/PureLib/pure/zlib/inflate.c @@ -91,20 +91,7 @@ # endif #endif -/* function prototypes */ -local int inflateStateCheck OF((z_streamp strm)); -local void fixedtables OF((struct inflate_state FAR *state)); -local int updatewindow OF((z_streamp strm, const unsigned char FAR *end, - unsigned copy)); -#ifdef BUILDFIXED - void makefixed OF((void)); -#endif -local unsigned syncsearch OF((unsigned FAR *have, const unsigned char FAR *buf, - unsigned len)); - -local int inflateStateCheck(strm) -z_streamp strm; -{ +local int inflateStateCheck(z_streamp strm) { struct inflate_state FAR *state; if (strm == Z_NULL || strm->zalloc == (alloc_func)0 || strm->zfree == (free_func)0) @@ -116,9 +103,7 @@ z_streamp strm; return 0; } -int ZEXPORT inflateResetKeep(strm) -z_streamp strm; -{ +int ZEXPORT inflateResetKeep(z_streamp strm) { struct inflate_state FAR *state; if (inflateStateCheck(strm)) return Z_STREAM_ERROR; @@ -142,9 +127,7 @@ z_streamp strm; return Z_OK; } -int ZEXPORT inflateReset(strm) -z_streamp strm; -{ +int ZEXPORT inflateReset(z_streamp strm) { struct inflate_state FAR *state; if (inflateStateCheck(strm)) return Z_STREAM_ERROR; @@ -155,10 +138,7 @@ z_streamp strm; return inflateResetKeep(strm); } -int ZEXPORT inflateReset2(strm, windowBits) -z_streamp strm; -int windowBits; -{ +int ZEXPORT inflateReset2(z_streamp strm, int windowBits) { int wrap; struct inflate_state FAR *state; @@ -195,12 +175,8 @@ int windowBits; return inflateReset(strm); } -int ZEXPORT inflateInit2_(strm, windowBits, version, stream_size) -z_streamp strm; -int windowBits; -const char *version; -int stream_size; -{ +int ZEXPORT inflateInit2_(z_streamp strm, int windowBits, + const char *version, int stream_size) { int ret; struct inflate_state FAR *state; @@ -239,22 +215,17 @@ int stream_size; return ret; } -int ZEXPORT inflateInit_(strm, version, stream_size) -z_streamp strm; -const char *version; -int stream_size; -{ +int ZEXPORT inflateInit_(z_streamp strm, const char *version, + int stream_size) { return inflateInit2_(strm, DEF_WBITS, version, stream_size); } -int ZEXPORT inflatePrime(strm, bits, value) -z_streamp strm; -int bits; -int value; -{ +int ZEXPORT inflatePrime(z_streamp strm, int bits, int value) { struct inflate_state FAR *state; if (inflateStateCheck(strm)) return Z_STREAM_ERROR; + if (bits == 0) + return Z_OK; state = (struct inflate_state FAR *)strm->state; if (bits < 0) { state->hold = 0; @@ -278,9 +249,7 @@ int value; used for threaded applications, since the rewriting of the tables and virgin may not be thread-safe. */ -local void fixedtables(state) -struct inflate_state FAR *state; -{ +local void fixedtables(struct inflate_state FAR *state) { #ifdef BUILDFIXED static int virgin = 1; static code *lenfix, *distfix; @@ -342,7 +311,7 @@ struct inflate_state FAR *state; a.out > inffixed.h */ -void makefixed() +void makefixed(void) { unsigned low, size; struct inflate_state state; @@ -396,11 +365,7 @@ void makefixed() output will fall in the output data, making match copies simpler and faster. The advantage may be dependent on the size of the processor's data caches. */ -local int updatewindow(strm, end, copy) -z_streamp strm; -const Bytef *end; -unsigned copy; -{ +local int updatewindow(z_streamp strm, const Bytef *end, unsigned copy) { struct inflate_state FAR *state; unsigned dist; @@ -622,10 +587,7 @@ unsigned copy; will return Z_BUF_ERROR if it has not reached the end of the stream. */ -int ZEXPORT inflate(strm, flush) -z_streamp strm; -int flush; -{ +int ZEXPORT inflate(z_streamp strm, int flush) { struct inflate_state FAR *state; z_const unsigned char FAR *next; /* next input */ unsigned char FAR *put; /* next output */ @@ -1301,9 +1263,7 @@ int flush; return ret; } -int ZEXPORT inflateEnd(strm) -z_streamp strm; -{ +int ZEXPORT inflateEnd(z_streamp strm) { struct inflate_state FAR *state; if (inflateStateCheck(strm)) return Z_STREAM_ERROR; @@ -1315,11 +1275,8 @@ z_streamp strm; return Z_OK; } -int ZEXPORT inflateGetDictionary(strm, dictionary, dictLength) -z_streamp strm; -Bytef *dictionary; -uInt *dictLength; -{ +int ZEXPORT inflateGetDictionary(z_streamp strm, Bytef *dictionary, + uInt *dictLength) { struct inflate_state FAR *state; /* check state */ @@ -1338,11 +1295,8 @@ uInt *dictLength; return Z_OK; } -int ZEXPORT inflateSetDictionary(strm, dictionary, dictLength) -z_streamp strm; -const Bytef *dictionary; -uInt dictLength; -{ +int ZEXPORT inflateSetDictionary(z_streamp strm, const Bytef *dictionary, + uInt dictLength) { struct inflate_state FAR *state; unsigned long dictid; int ret; @@ -1373,10 +1327,7 @@ uInt dictLength; return Z_OK; } -int ZEXPORT inflateGetHeader(strm, head) -z_streamp strm; -gz_headerp head; -{ +int ZEXPORT inflateGetHeader(z_streamp strm, gz_headerp head) { struct inflate_state FAR *state; /* check state */ @@ -1401,11 +1352,8 @@ gz_headerp head; called again with more data and the *have state. *have is initialized to zero for the first call. */ -local unsigned syncsearch(have, buf, len) -unsigned FAR *have; -const unsigned char FAR *buf; -unsigned len; -{ +local unsigned syncsearch(unsigned FAR *have, const unsigned char FAR *buf, + unsigned len) { unsigned got; unsigned next; @@ -1424,9 +1372,7 @@ unsigned len; return next; } -int ZEXPORT inflateSync(strm) -z_streamp strm; -{ +int ZEXPORT inflateSync(z_streamp strm) { unsigned len; /* number of bytes to look at or looked at */ int flags; /* temporary to save header status */ unsigned long in, out; /* temporary to save total_in and total_out */ @@ -1441,7 +1387,7 @@ z_streamp strm; /* if first time, start search in bit buffer */ if (state->mode != SYNC) { state->mode = SYNC; - state->hold <<= state->bits & 7; + state->hold >>= state->bits & 7; state->bits -= state->bits & 7; len = 0; while (state->bits >= 8) { @@ -1482,9 +1428,7 @@ z_streamp strm; block. When decompressing, PPP checks that at the end of input packet, inflate is waiting for these length bytes. */ -int ZEXPORT inflateSyncPoint(strm) -z_streamp strm; -{ +int ZEXPORT inflateSyncPoint(z_streamp strm) { struct inflate_state FAR *state; if (inflateStateCheck(strm)) return Z_STREAM_ERROR; @@ -1492,10 +1436,7 @@ z_streamp strm; return state->mode == STORED && state->bits == 0; } -int ZEXPORT inflateCopy(dest, source) -z_streamp dest; -z_streamp source; -{ +int ZEXPORT inflateCopy(z_streamp dest, z_streamp source) { struct inflate_state FAR *state; struct inflate_state FAR *copy; unsigned char FAR *window; @@ -1539,10 +1480,7 @@ z_streamp source; return Z_OK; } -int ZEXPORT inflateUndermine(strm, subvert) -z_streamp strm; -int subvert; -{ +int ZEXPORT inflateUndermine(z_streamp strm, int subvert) { struct inflate_state FAR *state; if (inflateStateCheck(strm)) return Z_STREAM_ERROR; @@ -1557,10 +1495,7 @@ int subvert; #endif } -int ZEXPORT inflateValidate(strm, check) -z_streamp strm; -int check; -{ +int ZEXPORT inflateValidate(z_streamp strm, int check) { struct inflate_state FAR *state; if (inflateStateCheck(strm)) return Z_STREAM_ERROR; @@ -1572,9 +1507,7 @@ int check; return Z_OK; } -long ZEXPORT inflateMark(strm) -z_streamp strm; -{ +long ZEXPORT inflateMark(z_streamp strm) { struct inflate_state FAR *state; if (inflateStateCheck(strm)) @@ -1585,9 +1518,7 @@ z_streamp strm; (state->mode == MATCH ? state->was - state->length : 0)); } -unsigned long ZEXPORT inflateCodesUsed(strm) -z_streamp strm; -{ +unsigned long ZEXPORT inflateCodesUsed(z_streamp strm) { struct inflate_state FAR *state; if (inflateStateCheck(strm)) return (unsigned long)-1; state = (struct inflate_state FAR *)strm->state; diff --git a/src/PureLib/pure/zlib/inftrees.c b/src/PureLib/pure/zlib/inftrees.c index 57d2793bec..98cfe16445 100644 --- a/src/PureLib/pure/zlib/inftrees.c +++ b/src/PureLib/pure/zlib/inftrees.c @@ -1,5 +1,5 @@ /* inftrees.c -- generate Huffman trees for efficient decoding - * Copyright (C) 1995-2022 Mark Adler + * Copyright (C) 1995-2024 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -9,7 +9,7 @@ #define MAXBITS 15 const char inflate_copyright[] = - " inflate 1.2.13 Copyright 1995-2022 Mark Adler "; + " inflate 1.3.1 Copyright 1995-2024 Mark Adler "; /* If you use the zlib library in a product, an acknowledgment is welcome in the documentation of your product. If for some reason you cannot @@ -29,14 +29,9 @@ const char inflate_copyright[] = table index bits. It will differ if the request is greater than the longest code or if it is less than the shortest code. */ -int ZLIB_INTERNAL inflate_table(type, lens, codes, table, bits, work) -codetype type; -unsigned short FAR *lens; -unsigned codes; -code FAR * FAR *table; -unsigned FAR *bits; -unsigned short FAR *work; -{ +int ZLIB_INTERNAL inflate_table(codetype type, unsigned short FAR *lens, + unsigned codes, code FAR * FAR *table, + unsigned FAR *bits, unsigned short FAR *work) { unsigned len; /* a code's length in bits */ unsigned sym; /* index of code symbols */ unsigned min, max; /* minimum and maximum code lengths */ @@ -62,7 +57,7 @@ unsigned short FAR *work; 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0}; static const unsigned short lext[31] = { /* Length codes 257..285 extra */ 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, - 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 194, 65}; + 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 203, 77}; static const unsigned short dbase[32] = { /* Distance codes 0..29 base */ 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, diff --git a/src/PureLib/pure/zlib/inftrees.h b/src/PureLib/pure/zlib/inftrees.h index f53665311c..396f74b5da 100644 --- a/src/PureLib/pure/zlib/inftrees.h +++ b/src/PureLib/pure/zlib/inftrees.h @@ -41,8 +41,8 @@ typedef struct { examples/enough.c found in the zlib distribution. The arguments to that program are the number of symbols, the initial root table size, and the maximum bit length of a code. "enough 286 9 15" for literal/length codes - returns returns 852, and "enough 30 6 15" for distance codes returns 592. - The initial root table size (9 or 6) is found in the fifth argument of the + returns 852, and "enough 30 6 15" for distance codes returns 592. The + initial root table size (9 or 6) is found in the fifth argument of the inflate_table() calls in inflate.c and infback.c. If the root table size is changed, then these maximum sizes would be need to be recalculated and updated. */ @@ -57,6 +57,6 @@ typedef enum { DISTS } codetype; -int ZLIB_INTERNAL inflate_table OF((codetype type, unsigned short FAR *lens, - unsigned codes, code FAR * FAR *table, - unsigned FAR *bits, unsigned short FAR *work)); +int ZLIB_INTERNAL inflate_table(codetype type, unsigned short FAR *lens, + unsigned codes, code FAR * FAR *table, + unsigned FAR *bits, unsigned short FAR *work); diff --git a/src/PureLib/pure/zlib/old/visual-basic.txt b/src/PureLib/pure/zlib/old/visual-basic.txt index 57efe58124..3c8d2a42df 100644 --- a/src/PureLib/pure/zlib/old/visual-basic.txt +++ b/src/PureLib/pure/zlib/old/visual-basic.txt @@ -115,7 +115,7 @@ SUCCESS Then ReDim Preserve bytaryCpr(lngCprSiz - 1) Open strCprPth For Binary Access Write As #1 Put #1, , bytaryCpr() - Put #1, , lngOriSiz 'Add the the original size value to the end + Put #1, , lngOriSiz 'Add the original size value to the end (last 4 bytes) Close #1 Else diff --git a/src/PureLib/pure/zlib/os400/README400 b/src/PureLib/pure/zlib/os400/README400 index c06fa8459a..30ed5a12c6 100644 --- a/src/PureLib/pure/zlib/os400/README400 +++ b/src/PureLib/pure/zlib/os400/README400 @@ -1,4 +1,4 @@ - ZLIB version 1.2.13 for OS/400 installation instructions + ZLIB version 1.3.1 for OS/400 installation instructions 1) Download and unpack the zlib tarball to some IFS directory. (i.e.: /path/to/the/zlib/ifs/source/directory) diff --git a/src/PureLib/pure/zlib/os400/zlib.inc b/src/PureLib/pure/zlib/os400/zlib.inc index c273c863c6..744729ab9d 100644 --- a/src/PureLib/pure/zlib/os400/zlib.inc +++ b/src/PureLib/pure/zlib/os400/zlib.inc @@ -1,7 +1,7 @@ * ZLIB.INC - Interface to the general purpose compression library * * ILE RPG400 version by Patrick Monnerat, DATASPHERE. - * Version 1.2.13 + * Version 1.3.1 * * * WARNING: @@ -22,12 +22,12 @@ * * Versioning information. * - D ZLIB_VERSION C '1.2.13' + D ZLIB_VERSION C '1.3.1' D ZLIB_VERNUM C X'12a0' D ZLIB_VER_MAJOR C 1 - D ZLIB_VER_MINOR C 2 + D ZLIB_VER_MINOR C 3 D ZLIB_VER_REVISION... - D C 13 + D C 1 D ZLIB_VER_SUBREVISION... D C 0 * diff --git a/src/PureLib/pure/zlib/qnx/package.qpg b/src/PureLib/pure/zlib/qnx/package.qpg index ba2f1a2d6c..4877e0ef01 100644 --- a/src/PureLib/pure/zlib/qnx/package.qpg +++ b/src/PureLib/pure/zlib/qnx/package.qpg @@ -25,10 +25,10 @@ - - - - + + + + @@ -63,7 +63,7 @@ - 1.2.13 + 1.3.1 Medium Stable diff --git a/src/PureLib/pure/zlib/test/example.c b/src/PureLib/pure/zlib/test/example.c index 1470bc842e..c3521dd593 100644 --- a/src/PureLib/pure/zlib/test/example.c +++ b/src/PureLib/pure/zlib/test/example.c @@ -34,37 +34,14 @@ static z_const char hello[] = "hello, hello!"; static const char dictionary[] = "hello"; static uLong dictId; /* Adler32 value of the dictionary */ -void test_deflate OF((Byte *compr, uLong comprLen)); -void test_inflate OF((Byte *compr, uLong comprLen, - Byte *uncompr, uLong uncomprLen)); -void test_large_deflate OF((Byte *compr, uLong comprLen, - Byte *uncompr, uLong uncomprLen)); -void test_large_inflate OF((Byte *compr, uLong comprLen, - Byte *uncompr, uLong uncomprLen)); -void test_flush OF((Byte *compr, uLong *comprLen)); -void test_sync OF((Byte *compr, uLong comprLen, - Byte *uncompr, uLong uncomprLen)); -void test_dict_deflate OF((Byte *compr, uLong comprLen)); -void test_dict_inflate OF((Byte *compr, uLong comprLen, - Byte *uncompr, uLong uncomprLen)); -int main OF((int argc, char *argv[])); - - #ifdef Z_SOLO -void *myalloc OF((void *, unsigned, unsigned)); -void myfree OF((void *, void *)); - -void *myalloc(q, n, m) - void *q; - unsigned n, m; -{ +static void *myalloc(void *q, unsigned n, unsigned m) { (void)q; return calloc(n, m); } -void myfree(void *q, void *p) -{ +static void myfree(void *q, void *p) { (void)q; free(p); } @@ -77,18 +54,11 @@ static free_func zfree = myfree; static alloc_func zalloc = (alloc_func)0; static free_func zfree = (free_func)0; -void test_compress OF((Byte *compr, uLong comprLen, - Byte *uncompr, uLong uncomprLen)); -void test_gzio OF((const char *fname, - Byte *uncompr, uLong uncomprLen)); - /* =========================================================================== * Test compress() and uncompress() */ -void test_compress(compr, comprLen, uncompr, uncomprLen) - Byte *compr, *uncompr; - uLong comprLen, uncomprLen; -{ +static void test_compress(Byte *compr, uLong comprLen, Byte *uncompr, + uLong uncomprLen) { int err; uLong len = (uLong)strlen(hello)+1; @@ -111,11 +81,7 @@ void test_compress(compr, comprLen, uncompr, uncomprLen) /* =========================================================================== * Test read/write of .gz files */ -void test_gzio(fname, uncompr, uncomprLen) - const char *fname; /* compressed file name */ - Byte *uncompr; - uLong uncomprLen; -{ +static void test_gzio(const char *fname, Byte *uncompr, uLong uncomprLen) { #ifdef NO_GZCOMPRESS fprintf(stderr, "NO_GZCOMPRESS -- gz* functions cannot compress\n"); #else @@ -197,10 +163,7 @@ void test_gzio(fname, uncompr, uncomprLen) /* =========================================================================== * Test deflate() with small buffers */ -void test_deflate(compr, comprLen) - Byte *compr; - uLong comprLen; -{ +static void test_deflate(Byte *compr, uLong comprLen) { z_stream c_stream; /* compression stream */ int err; uLong len = (uLong)strlen(hello)+1; @@ -235,10 +198,8 @@ void test_deflate(compr, comprLen) /* =========================================================================== * Test inflate() with small buffers */ -void test_inflate(compr, comprLen, uncompr, uncomprLen) - Byte *compr, *uncompr; - uLong comprLen, uncomprLen; -{ +static void test_inflate(Byte *compr, uLong comprLen, Byte *uncompr, + uLong uncomprLen) { int err; z_stream d_stream; /* decompression stream */ @@ -276,10 +237,8 @@ void test_inflate(compr, comprLen, uncompr, uncomprLen) /* =========================================================================== * Test deflate() with large buffers and dynamic change of compression level */ -void test_large_deflate(compr, comprLen, uncompr, uncomprLen) - Byte *compr, *uncompr; - uLong comprLen, uncomprLen; -{ +static void test_large_deflate(Byte *compr, uLong comprLen, Byte *uncompr, + uLong uncomprLen) { z_stream c_stream; /* compression stream */ int err; @@ -308,7 +267,7 @@ void test_large_deflate(compr, comprLen, uncompr, uncomprLen) /* Feed in already compressed data and switch to no compression: */ deflateParams(&c_stream, Z_NO_COMPRESSION, Z_DEFAULT_STRATEGY); c_stream.next_in = compr; - c_stream.avail_in = (uInt)comprLen/2; + c_stream.avail_in = (uInt)uncomprLen/2; err = deflate(&c_stream, Z_NO_FLUSH); CHECK_ERR(err, "deflate"); @@ -331,10 +290,8 @@ void test_large_deflate(compr, comprLen, uncompr, uncomprLen) /* =========================================================================== * Test inflate() with large buffers */ -void test_large_inflate(compr, comprLen, uncompr, uncomprLen) - Byte *compr, *uncompr; - uLong comprLen, uncomprLen; -{ +static void test_large_inflate(Byte *compr, uLong comprLen, Byte *uncompr, + uLong uncomprLen) { int err; z_stream d_stream; /* decompression stream */ @@ -361,7 +318,7 @@ void test_large_inflate(compr, comprLen, uncompr, uncomprLen) err = inflateEnd(&d_stream); CHECK_ERR(err, "inflateEnd"); - if (d_stream.total_out != 2*uncomprLen + comprLen/2) { + if (d_stream.total_out != 2*uncomprLen + uncomprLen/2) { fprintf(stderr, "bad large inflate: %ld\n", d_stream.total_out); exit(1); } else { @@ -372,10 +329,7 @@ void test_large_inflate(compr, comprLen, uncompr, uncomprLen) /* =========================================================================== * Test deflate() with full flush */ -void test_flush(compr, comprLen) - Byte *compr; - uLong *comprLen; -{ +static void test_flush(Byte *compr, uLong *comprLen) { z_stream c_stream; /* compression stream */ int err; uInt len = (uInt)strlen(hello)+1; @@ -410,10 +364,8 @@ void test_flush(compr, comprLen) /* =========================================================================== * Test inflateSync() */ -void test_sync(compr, comprLen, uncompr, uncomprLen) - Byte *compr, *uncompr; - uLong comprLen, uncomprLen; -{ +static void test_sync(Byte *compr, uLong comprLen, Byte *uncompr, + uLong uncomprLen) { int err; z_stream d_stream; /* decompression stream */ @@ -453,10 +405,7 @@ void test_sync(compr, comprLen, uncompr, uncomprLen) /* =========================================================================== * Test deflate() with preset dictionary */ -void test_dict_deflate(compr, comprLen) - Byte *compr; - uLong comprLen; -{ +static void test_dict_deflate(Byte *compr, uLong comprLen) { z_stream c_stream; /* compression stream */ int err; @@ -490,10 +439,8 @@ void test_dict_deflate(compr, comprLen) /* =========================================================================== * Test inflate() with a preset dictionary */ -void test_dict_inflate(compr, comprLen, uncompr, uncomprLen) - Byte *compr, *uncompr; - uLong comprLen, uncomprLen; -{ +static void test_dict_inflate(Byte *compr, uLong comprLen, Byte *uncompr, + uLong uncomprLen) { int err; z_stream d_stream; /* decompression stream */ @@ -541,13 +488,10 @@ void test_dict_inflate(compr, comprLen, uncompr, uncomprLen) * Usage: example [output.gz [input.gz]] */ -int main(argc, argv) - int argc; - char *argv[]; -{ +int main(int argc, char *argv[]) { Byte *compr, *uncompr; - uLong comprLen = 10000*sizeof(int); /* don't overflow on MSDOS */ - uLong uncomprLen = comprLen; + uLong uncomprLen = 20000; + uLong comprLen = 3 * uncomprLen; static const char* myVersion = ZLIB_VERSION; if (zlibVersion()[0] != myVersion[0]) { @@ -590,7 +534,7 @@ int main(argc, argv) test_flush(compr, &comprLen); test_sync(compr, comprLen, uncompr, uncomprLen); - comprLen = uncomprLen; + comprLen = 3 * uncomprLen; test_dict_deflate(compr, comprLen); test_dict_inflate(compr, comprLen, uncompr, uncomprLen); diff --git a/src/PureLib/pure/zlib/test/infcover.c b/src/PureLib/pure/zlib/test/infcover.c index 2be01646ce..8912c403dd 100644 --- a/src/PureLib/pure/zlib/test/infcover.c +++ b/src/PureLib/pure/zlib/test/infcover.c @@ -373,7 +373,7 @@ local void cover_support(void) mem_setup(&strm); strm.avail_in = 0; strm.next_in = Z_NULL; - ret = inflateInit_(&strm, ZLIB_VERSION - 1, (int)sizeof(z_stream)); + ret = inflateInit_(&strm, "!", (int)sizeof(z_stream)); assert(ret == Z_VERSION_ERROR); mem_done(&strm, "wrong version"); @@ -462,7 +462,8 @@ local unsigned pull(void *desc, unsigned char **buf) local int push(void *desc, unsigned char *buf, unsigned len) { - buf += len; + (void)buf; + (void)len; return desc != Z_NULL; /* force error if desc not null */ } diff --git a/src/PureLib/pure/zlib/test/minigzip.c b/src/PureLib/pure/zlib/test/minigzip.c index a649d2b3d9..134e10e6c3 100644 --- a/src/PureLib/pure/zlib/test/minigzip.c +++ b/src/PureLib/pure/zlib/test/minigzip.c @@ -59,7 +59,7 @@ #if !defined(Z_HAVE_UNISTD_H) && !defined(_LARGEFILE64_SOURCE) #ifndef WIN32 /* unlink already in stdio.h for WIN32 */ - extern int unlink OF((const char *)); + extern int unlink(const char *); #endif #endif @@ -149,20 +149,12 @@ static void pwinerror (s) # include /* for unlink() */ #endif -void *myalloc OF((void *, unsigned, unsigned)); -void myfree OF((void *, void *)); - -void *myalloc(q, n, m) - void *q; - unsigned n, m; -{ +static void *myalloc(void *q, unsigned n, unsigned m) { (void)q; return calloc(n, m); } -void myfree(q, p) - void *q, *p; -{ +static void myfree(void *q, void *p) { (void)q; free(p); } @@ -175,29 +167,7 @@ typedef struct gzFile_s { z_stream strm; } *gzFile; -gzFile gzopen OF((const char *, const char *)); -gzFile gzdopen OF((int, const char *)); -gzFile gz_open OF((const char *, int, const char *)); - -gzFile gzopen(path, mode) -const char *path; -const char *mode; -{ - return gz_open(path, -1, mode); -} - -gzFile gzdopen(fd, mode) -int fd; -const char *mode; -{ - return gz_open(NULL, fd, mode); -} - -gzFile gz_open(path, fd, mode) - const char *path; - int fd; - const char *mode; -{ +static gzFile gz_open(const char *path, int fd, const char *mode) { gzFile gz; int ret; @@ -231,13 +201,15 @@ gzFile gz_open(path, fd, mode) return gz; } -int gzwrite OF((gzFile, const void *, unsigned)); +static gzFile gzopen(const char *path, const char *mode) { + return gz_open(path, -1, mode); +} -int gzwrite(gz, buf, len) - gzFile gz; - const void *buf; - unsigned len; -{ +static gzFile gzdopen(int fd, const char *mode) { + return gz_open(NULL, fd, mode); +} + +static int gzwrite(gzFile gz, const void *buf, unsigned len) { z_stream *strm; unsigned char out[BUFLEN]; @@ -255,13 +227,7 @@ int gzwrite(gz, buf, len) return len; } -int gzread OF((gzFile, void *, unsigned)); - -int gzread(gz, buf, len) - gzFile gz; - void *buf; - unsigned len; -{ +static int gzread(gzFile gz, void *buf, unsigned len) { int ret; unsigned got; unsigned char in[1]; @@ -292,11 +258,7 @@ int gzread(gz, buf, len) return len - strm->avail_out; } -int gzclose OF((gzFile)); - -int gzclose(gz) - gzFile gz; -{ +static int gzclose(gzFile gz) { z_stream *strm; unsigned char out[BUFLEN]; @@ -321,12 +283,7 @@ int gzclose(gz) return Z_OK; } -const char *gzerror OF((gzFile, int *)); - -const char *gzerror(gz, err) - gzFile gz; - int *err; -{ +static const char *gzerror(gzFile gz, int *err) { *err = gz->err; return gz->msg; } @@ -335,67 +292,20 @@ const char *gzerror(gz, err) static char *prog; -void error OF((const char *msg)); -void gz_compress OF((FILE *in, gzFile out)); -#ifdef USE_MMAP -int gz_compress_mmap OF((FILE *in, gzFile out)); -#endif -void gz_uncompress OF((gzFile in, FILE *out)); -void file_compress OF((char *file, char *mode)); -void file_uncompress OF((char *file)); -int main OF((int argc, char *argv[])); - /* =========================================================================== * Display error message and exit */ -void error(msg) - const char *msg; -{ +static void error(const char *msg) { fprintf(stderr, "%s: %s\n", prog, msg); exit(1); } -/* =========================================================================== - * Compress input to output then close both files. - */ - -void gz_compress(in, out) - FILE *in; - gzFile out; -{ - local char buf[BUFLEN]; - int len; - int err; - -#ifdef USE_MMAP - /* Try first compressing with mmap. If mmap fails (minigzip used in a - * pipe), use the normal fread loop. - */ - if (gz_compress_mmap(in, out) == Z_OK) return; -#endif - for (;;) { - len = (int)fread(buf, 1, sizeof(buf), in); - if (ferror(in)) { - perror("fread"); - exit(1); - } - if (len == 0) break; - - if (gzwrite(out, buf, (unsigned)len) != len) error(gzerror(out, &err)); - } - fclose(in); - if (gzclose(out) != Z_OK) error("failed gzclose"); -} - #ifdef USE_MMAP /* MMAP version, Miguel Albrecht */ /* Try compressing the input file at once using mmap. Return Z_OK if - * if success, Z_ERRNO otherwise. + * success, Z_ERRNO otherwise. */ -int gz_compress_mmap(in, out) - FILE *in; - gzFile out; -{ +static int gz_compress_mmap(FILE *in, gzFile out) { int len; int err; int ifd = fileno(in); @@ -424,13 +334,39 @@ int gz_compress_mmap(in, out) } #endif /* USE_MMAP */ +/* =========================================================================== + * Compress input to output then close both files. + */ + +static void gz_compress(FILE *in, gzFile out) { + local char buf[BUFLEN]; + int len; + int err; + +#ifdef USE_MMAP + /* Try first compressing with mmap. If mmap fails (minigzip used in a + * pipe), use the normal fread loop. + */ + if (gz_compress_mmap(in, out) == Z_OK) return; +#endif + for (;;) { + len = (int)fread(buf, 1, sizeof(buf), in); + if (ferror(in)) { + perror("fread"); + exit(1); + } + if (len == 0) break; + + if (gzwrite(out, buf, (unsigned)len) != len) error(gzerror(out, &err)); + } + fclose(in); + if (gzclose(out) != Z_OK) error("failed gzclose"); +} + /* =========================================================================== * Uncompress input to output then close both files. */ -void gz_uncompress(in, out) - gzFile in; - FILE *out; -{ +static void gz_uncompress(gzFile in, FILE *out) { local char buf[BUFLEN]; int len; int err; @@ -454,10 +390,7 @@ void gz_uncompress(in, out) * Compress the given file: create a corresponding .gz file and remove the * original. */ -void file_compress(file, mode) - char *file; - char *mode; -{ +static void file_compress(char *file, char *mode) { local char outfile[MAX_NAME_LEN]; FILE *in; gzFile out; @@ -493,9 +426,7 @@ void file_compress(file, mode) /* =========================================================================== * Uncompress the given file and remove the original. */ -void file_uncompress(file) - char *file; -{ +static void file_uncompress(char *file) { local char buf[MAX_NAME_LEN]; char *infile, *outfile; FILE *out; @@ -553,10 +484,7 @@ void file_uncompress(file) * -1 to -9 : compression level */ -int main(argc, argv) - int argc; - char *argv[]; -{ +int main(int argc, char *argv[]) { int copyout = 0; int uncompr = 0; gzFile file; diff --git a/src/PureLib/pure/zlib/treebuild.xml b/src/PureLib/pure/zlib/treebuild.xml index 0017a45d3c..930b00be4a 100644 --- a/src/PureLib/pure/zlib/treebuild.xml +++ b/src/PureLib/pure/zlib/treebuild.xml @@ -1,6 +1,6 @@ - - + + zip compression library diff --git a/src/PureLib/pure/zlib/trees.c b/src/PureLib/pure/zlib/trees.c index 5f305c4722..6a523ef34e 100644 --- a/src/PureLib/pure/zlib/trees.c +++ b/src/PureLib/pure/zlib/trees.c @@ -1,5 +1,5 @@ /* trees.c -- output deflated data using Huffman coding - * Copyright (C) 1995-2021 Jean-loup Gailly + * Copyright (C) 1995-2024 Jean-loup Gailly * detect_data_type() function provided freely by Cosmin Truta, 2006 * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -122,39 +122,116 @@ struct static_tree_desc_s { int max_length; /* max bit length for the codes */ }; -local const static_tree_desc static_l_desc = +#ifdef NO_INIT_GLOBAL_POINTERS +# define TCONST +#else +# define TCONST const +#endif + +local TCONST static_tree_desc static_l_desc = {static_ltree, extra_lbits, LITERALS+1, L_CODES, MAX_BITS}; -local const static_tree_desc static_d_desc = +local TCONST static_tree_desc static_d_desc = {static_dtree, extra_dbits, 0, D_CODES, MAX_BITS}; -local const static_tree_desc static_bl_desc = +local TCONST static_tree_desc static_bl_desc = {(const ct_data *)0, extra_blbits, 0, BL_CODES, MAX_BL_BITS}; /* =========================================================================== - * Local (static) routines in this file. + * Output a short LSB first on the stream. + * IN assertion: there is enough room in pendingBuf. + */ +#define put_short(s, w) { \ + put_byte(s, (uch)((w) & 0xff)); \ + put_byte(s, (uch)((ush)(w) >> 8)); \ +} + +/* =========================================================================== + * Reverse the first len bits of a code, using straightforward code (a faster + * method would use a table) + * IN assertion: 1 <= len <= 15 */ +local unsigned bi_reverse(unsigned code, int len) { + register unsigned res = 0; + do { + res |= code & 1; + code >>= 1, res <<= 1; + } while (--len > 0); + return res >> 1; +} -local void tr_static_init OF((void)); -local void init_block OF((deflate_state *s)); -local void pqdownheap OF((deflate_state *s, ct_data *tree, int k)); -local void gen_bitlen OF((deflate_state *s, tree_desc *desc)); -local void gen_codes OF((ct_data *tree, int max_code, ushf *bl_count)); -local void build_tree OF((deflate_state *s, tree_desc *desc)); -local void scan_tree OF((deflate_state *s, ct_data *tree, int max_code)); -local void send_tree OF((deflate_state *s, ct_data *tree, int max_code)); -local int build_bl_tree OF((deflate_state *s)); -local void send_all_trees OF((deflate_state *s, int lcodes, int dcodes, - int blcodes)); -local void compress_block OF((deflate_state *s, const ct_data *ltree, - const ct_data *dtree)); -local int detect_data_type OF((deflate_state *s)); -local unsigned bi_reverse OF((unsigned code, int len)); -local void bi_windup OF((deflate_state *s)); -local void bi_flush OF((deflate_state *s)); +/* =========================================================================== + * Flush the bit buffer, keeping at most 7 bits in it. + */ +local void bi_flush(deflate_state *s) { + if (s->bi_valid == 16) { + put_short(s, s->bi_buf); + s->bi_buf = 0; + s->bi_valid = 0; + } else if (s->bi_valid >= 8) { + put_byte(s, (Byte)s->bi_buf); + s->bi_buf >>= 8; + s->bi_valid -= 8; + } +} + +/* =========================================================================== + * Flush the bit buffer and align the output on a byte boundary + */ +local void bi_windup(deflate_state *s) { + if (s->bi_valid > 8) { + put_short(s, s->bi_buf); + } else if (s->bi_valid > 0) { + put_byte(s, (Byte)s->bi_buf); + } + s->bi_buf = 0; + s->bi_valid = 0; +#ifdef ZLIB_DEBUG + s->bits_sent = (s->bits_sent + 7) & ~7; +#endif +} + +/* =========================================================================== + * Generate the codes for a given tree and bit counts (which need not be + * optimal). + * IN assertion: the array bl_count contains the bit length statistics for + * the given tree and the field len is set for all tree elements. + * OUT assertion: the field code is set for all tree elements of non + * zero code length. + */ +local void gen_codes(ct_data *tree, int max_code, ushf *bl_count) { + ush next_code[MAX_BITS+1]; /* next code value for each bit length */ + unsigned code = 0; /* running code value */ + int bits; /* bit index */ + int n; /* code index */ + + /* The distribution counts are first used to generate the code values + * without bit reversal. + */ + for (bits = 1; bits <= MAX_BITS; bits++) { + code = (code + bl_count[bits - 1]) << 1; + next_code[bits] = (ush)code; + } + /* Check that the bit counts in bl_count are consistent. The last code + * must be all ones. + */ + Assert (code + bl_count[MAX_BITS] - 1 == (1 << MAX_BITS) - 1, + "inconsistent bit counts"); + Tracev((stderr,"\ngen_codes: max_code %d ", max_code)); + + for (n = 0; n <= max_code; n++) { + int len = tree[n].Len; + if (len == 0) continue; + /* Now reverse the bits */ + tree[n].Code = (ush)bi_reverse(next_code[len]++, len); + + Tracecv(tree != static_ltree, (stderr,"\nn %3d %c l %2d c %4x (%x) ", + n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len] - 1)); + } +} #ifdef GEN_TREES_H -local void gen_trees_header OF((void)); +local void gen_trees_header(void); #endif #ifndef ZLIB_DEBUG @@ -167,27 +244,12 @@ local void gen_trees_header OF((void)); send_bits(s, tree[c].Code, tree[c].Len); } #endif -/* =========================================================================== - * Output a short LSB first on the stream. - * IN assertion: there is enough room in pendingBuf. - */ -#define put_short(s, w) { \ - put_byte(s, (uch)((w) & 0xff)); \ - put_byte(s, (uch)((ush)(w) >> 8)); \ -} - /* =========================================================================== * Send a value on a given number of bits. * IN assertion: length <= 16 and value fits in length bits. */ #ifdef ZLIB_DEBUG -local void send_bits OF((deflate_state *s, int value, int length)); - -local void send_bits(s, value, length) - deflate_state *s; - int value; /* value to send */ - int length; /* number of bits */ -{ +local void send_bits(deflate_state *s, int value, int length) { Tracevv((stderr," l %2d v %4x ", length, value)); Assert(length > 0 && length <= 15, "invalid length"); s->bits_sent += (ulg)length; @@ -229,8 +291,7 @@ local void send_bits(s, value, length) /* =========================================================================== * Initialize the various 'constant' tables. */ -local void tr_static_init() -{ +local void tr_static_init(void) { #if defined(GEN_TREES_H) || !defined(STDC) static int static_init_done = 0; int n; /* iterates over tree elements */ @@ -323,8 +384,7 @@ local void tr_static_init() ((i) == (last)? "\n};\n\n" : \ ((i) % (width) == (width) - 1 ? ",\n" : ", ")) -void gen_trees_header() -{ +void gen_trees_header(void) { FILE *header = fopen("trees.h", "w"); int i; @@ -373,12 +433,26 @@ void gen_trees_header() } #endif /* GEN_TREES_H */ +/* =========================================================================== + * Initialize a new block. + */ +local void init_block(deflate_state *s) { + int n; /* iterates over tree elements */ + + /* Initialize the trees. */ + for (n = 0; n < L_CODES; n++) s->dyn_ltree[n].Freq = 0; + for (n = 0; n < D_CODES; n++) s->dyn_dtree[n].Freq = 0; + for (n = 0; n < BL_CODES; n++) s->bl_tree[n].Freq = 0; + + s->dyn_ltree[END_BLOCK].Freq = 1; + s->opt_len = s->static_len = 0L; + s->sym_next = s->matches = 0; +} + /* =========================================================================== * Initialize the tree data structures for a new zlib stream. */ -void ZLIB_INTERNAL _tr_init(s) - deflate_state *s; -{ +void ZLIB_INTERNAL _tr_init(deflate_state *s) { tr_static_init(); s->l_desc.dyn_tree = s->dyn_ltree; @@ -401,24 +475,6 @@ void ZLIB_INTERNAL _tr_init(s) init_block(s); } -/* =========================================================================== - * Initialize a new block. - */ -local void init_block(s) - deflate_state *s; -{ - int n; /* iterates over tree elements */ - - /* Initialize the trees. */ - for (n = 0; n < L_CODES; n++) s->dyn_ltree[n].Freq = 0; - for (n = 0; n < D_CODES; n++) s->dyn_dtree[n].Freq = 0; - for (n = 0; n < BL_CODES; n++) s->bl_tree[n].Freq = 0; - - s->dyn_ltree[END_BLOCK].Freq = 1; - s->opt_len = s->static_len = 0L; - s->sym_next = s->matches = 0; -} - #define SMALLEST 1 /* Index within the heap array of least frequent node in the Huffman tree */ @@ -448,11 +504,7 @@ local void init_block(s) * when the heap property is re-established (each father smaller than its * two sons). */ -local void pqdownheap(s, tree, k) - deflate_state *s; - ct_data *tree; /* the tree to restore */ - int k; /* node to move down */ -{ +local void pqdownheap(deflate_state *s, ct_data *tree, int k) { int v = s->heap[k]; int j = k << 1; /* left son of k */ while (j <= s->heap_len) { @@ -483,10 +535,7 @@ local void pqdownheap(s, tree, k) * The length opt_len is updated; static_len is also updated if stree is * not null. */ -local void gen_bitlen(s, desc) - deflate_state *s; - tree_desc *desc; /* the tree descriptor */ -{ +local void gen_bitlen(deflate_state *s, tree_desc *desc) { ct_data *tree = desc->dyn_tree; int max_code = desc->max_code; const ct_data *stree = desc->stat_desc->static_tree; @@ -561,48 +610,9 @@ local void gen_bitlen(s, desc) } } -/* =========================================================================== - * Generate the codes for a given tree and bit counts (which need not be - * optimal). - * IN assertion: the array bl_count contains the bit length statistics for - * the given tree and the field len is set for all tree elements. - * OUT assertion: the field code is set for all tree elements of non - * zero code length. - */ -local void gen_codes(tree, max_code, bl_count) - ct_data *tree; /* the tree to decorate */ - int max_code; /* largest code with non zero frequency */ - ushf *bl_count; /* number of codes at each bit length */ -{ - ush next_code[MAX_BITS+1]; /* next code value for each bit length */ - unsigned code = 0; /* running code value */ - int bits; /* bit index */ - int n; /* code index */ - - /* The distribution counts are first used to generate the code values - * without bit reversal. - */ - for (bits = 1; bits <= MAX_BITS; bits++) { - code = (code + bl_count[bits - 1]) << 1; - next_code[bits] = (ush)code; - } - /* Check that the bit counts in bl_count are consistent. The last code - * must be all ones. - */ - Assert (code + bl_count[MAX_BITS] - 1 == (1 << MAX_BITS) - 1, - "inconsistent bit counts"); - Tracev((stderr,"\ngen_codes: max_code %d ", max_code)); - - for (n = 0; n <= max_code; n++) { - int len = tree[n].Len; - if (len == 0) continue; - /* Now reverse the bits */ - tree[n].Code = (ush)bi_reverse(next_code[len]++, len); - - Tracecv(tree != static_ltree, (stderr,"\nn %3d %c l %2d c %4x (%x) ", - n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len] - 1)); - } -} +#ifdef DUMP_BL_TREE +# include +#endif /* =========================================================================== * Construct one Huffman tree and assigns the code bit strings and lengths. @@ -612,10 +622,7 @@ local void gen_codes(tree, max_code, bl_count) * and corresponding code. The length opt_len is updated; static_len is * also updated if stree is not null. The field max_code is set. */ -local void build_tree(s, desc) - deflate_state *s; - tree_desc *desc; /* the tree descriptor */ -{ +local void build_tree(deflate_state *s, tree_desc *desc) { ct_data *tree = desc->dyn_tree; const ct_data *stree = desc->stat_desc->static_tree; int elems = desc->stat_desc->elems; @@ -700,11 +707,7 @@ local void build_tree(s, desc) * Scan a literal or distance tree to determine the frequencies of the codes * in the bit length tree. */ -local void scan_tree(s, tree, max_code) - deflate_state *s; - ct_data *tree; /* the tree to be scanned */ - int max_code; /* and its largest code of non zero frequency */ -{ +local void scan_tree(deflate_state *s, ct_data *tree, int max_code) { int n; /* iterates over all tree elements */ int prevlen = -1; /* last emitted length */ int curlen; /* length of current code */ @@ -745,11 +748,7 @@ local void scan_tree(s, tree, max_code) * Send a literal or distance tree in compressed form, using the codes in * bl_tree. */ -local void send_tree(s, tree, max_code) - deflate_state *s; - ct_data *tree; /* the tree to be scanned */ - int max_code; /* and its largest code of non zero frequency */ -{ +local void send_tree(deflate_state *s, ct_data *tree, int max_code) { int n; /* iterates over all tree elements */ int prevlen = -1; /* last emitted length */ int curlen; /* length of current code */ @@ -796,9 +795,7 @@ local void send_tree(s, tree, max_code) * Construct the Huffman tree for the bit lengths and return the index in * bl_order of the last bit length code to send. */ -local int build_bl_tree(s) - deflate_state *s; -{ +local int build_bl_tree(deflate_state *s) { int max_blindex; /* index of last bit length code of non zero freq */ /* Determine the bit length frequencies for literal and distance trees */ @@ -831,10 +828,8 @@ local int build_bl_tree(s) * lengths of the bit length codes, the literal tree and the distance tree. * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4. */ -local void send_all_trees(s, lcodes, dcodes, blcodes) - deflate_state *s; - int lcodes, dcodes, blcodes; /* number of codes for each tree */ -{ +local void send_all_trees(deflate_state *s, int lcodes, int dcodes, + int blcodes) { int rank; /* index in bl_order */ Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, "not enough codes"); @@ -860,12 +855,8 @@ local void send_all_trees(s, lcodes, dcodes, blcodes) /* =========================================================================== * Send a stored block */ -void ZLIB_INTERNAL _tr_stored_block(s, buf, stored_len, last) - deflate_state *s; - charf *buf; /* input block */ - ulg stored_len; /* length of input block */ - int last; /* one if this is the last block for a file */ -{ +void ZLIB_INTERNAL _tr_stored_block(deflate_state *s, charf *buf, + ulg stored_len, int last) { send_bits(s, (STORED_BLOCK<<1) + last, 3); /* send block type */ bi_windup(s); /* align on byte boundary */ put_short(s, (ush)stored_len); @@ -884,9 +875,7 @@ void ZLIB_INTERNAL _tr_stored_block(s, buf, stored_len, last) /* =========================================================================== * Flush the bits in the bit buffer to pending output (leaves at most 7 bits) */ -void ZLIB_INTERNAL _tr_flush_bits(s) - deflate_state *s; -{ +void ZLIB_INTERNAL _tr_flush_bits(deflate_state *s) { bi_flush(s); } @@ -894,9 +883,7 @@ void ZLIB_INTERNAL _tr_flush_bits(s) * Send one empty static block to give enough lookahead for inflate. * This takes 10 bits, of which 7 may remain in the bit buffer. */ -void ZLIB_INTERNAL _tr_align(s) - deflate_state *s; -{ +void ZLIB_INTERNAL _tr_align(deflate_state *s) { send_bits(s, STATIC_TREES<<1, 3); send_code(s, END_BLOCK, static_ltree); #ifdef ZLIB_DEBUG @@ -905,16 +892,108 @@ void ZLIB_INTERNAL _tr_align(s) bi_flush(s); } +/* =========================================================================== + * Send the block data compressed using the given Huffman trees + */ +local void compress_block(deflate_state *s, const ct_data *ltree, + const ct_data *dtree) { + unsigned dist; /* distance of matched string */ + int lc; /* match length or unmatched char (if dist == 0) */ + unsigned sx = 0; /* running index in symbol buffers */ + unsigned code; /* the code to send */ + int extra; /* number of extra bits to send */ + + if (s->sym_next != 0) do { +#ifdef LIT_MEM + dist = s->d_buf[sx]; + lc = s->l_buf[sx++]; +#else + dist = s->sym_buf[sx++] & 0xff; + dist += (unsigned)(s->sym_buf[sx++] & 0xff) << 8; + lc = s->sym_buf[sx++]; +#endif + if (dist == 0) { + send_code(s, lc, ltree); /* send a literal byte */ + Tracecv(isgraph(lc), (stderr," '%c' ", lc)); + } else { + /* Here, lc is the match length - MIN_MATCH */ + code = _length_code[lc]; + send_code(s, code + LITERALS + 1, ltree); /* send length code */ + extra = extra_lbits[code]; + if (extra != 0) { + lc -= base_length[code]; + send_bits(s, lc, extra); /* send the extra length bits */ + } + dist--; /* dist is now the match distance - 1 */ + code = d_code(dist); + Assert (code < D_CODES, "bad d_code"); + + send_code(s, code, dtree); /* send the distance code */ + extra = extra_dbits[code]; + if (extra != 0) { + dist -= (unsigned)base_dist[code]; + send_bits(s, dist, extra); /* send the extra distance bits */ + } + } /* literal or match pair ? */ + + /* Check for no overlay of pending_buf on needed symbols */ +#ifdef LIT_MEM + Assert(s->pending < 2 * (s->lit_bufsize + sx), "pendingBuf overflow"); +#else + Assert(s->pending < s->lit_bufsize + sx, "pendingBuf overflow"); +#endif + + } while (sx < s->sym_next); + + send_code(s, END_BLOCK, ltree); +} + +/* =========================================================================== + * Check if the data type is TEXT or BINARY, using the following algorithm: + * - TEXT if the two conditions below are satisfied: + * a) There are no non-portable control characters belonging to the + * "block list" (0..6, 14..25, 28..31). + * b) There is at least one printable character belonging to the + * "allow list" (9 {TAB}, 10 {LF}, 13 {CR}, 32..255). + * - BINARY otherwise. + * - The following partially-portable control characters form a + * "gray list" that is ignored in this detection algorithm: + * (7 {BEL}, 8 {BS}, 11 {VT}, 12 {FF}, 26 {SUB}, 27 {ESC}). + * IN assertion: the fields Freq of dyn_ltree are set. + */ +local int detect_data_type(deflate_state *s) { + /* block_mask is the bit mask of block-listed bytes + * set bits 0..6, 14..25, and 28..31 + * 0xf3ffc07f = binary 11110011111111111100000001111111 + */ + unsigned long block_mask = 0xf3ffc07fUL; + int n; + + /* Check for non-textual ("block-listed") bytes. */ + for (n = 0; n <= 31; n++, block_mask >>= 1) + if ((block_mask & 1) && (s->dyn_ltree[n].Freq != 0)) + return Z_BINARY; + + /* Check for textual ("allow-listed") bytes. */ + if (s->dyn_ltree[9].Freq != 0 || s->dyn_ltree[10].Freq != 0 + || s->dyn_ltree[13].Freq != 0) + return Z_TEXT; + for (n = 32; n < LITERALS; n++) + if (s->dyn_ltree[n].Freq != 0) + return Z_TEXT; + + /* There are no "block-listed" or "allow-listed" bytes: + * this stream either is empty or has tolerated ("gray-listed") bytes only. + */ + return Z_BINARY; +} + /* =========================================================================== * Determine the best encoding for the current block: dynamic trees, static * trees or store, and write out the encoded block. */ -void ZLIB_INTERNAL _tr_flush_block(s, buf, stored_len, last) - deflate_state *s; - charf *buf; /* input block, or NULL if too old */ - ulg stored_len; /* length of input block */ - int last; /* one if this is the last block for a file */ -{ +void ZLIB_INTERNAL _tr_flush_block(deflate_state *s, charf *buf, + ulg stored_len, int last) { ulg opt_lenb, static_lenb; /* opt_len and static_len in bytes */ int max_blindex = 0; /* index of last bit length code of non zero freq */ @@ -1011,14 +1090,15 @@ void ZLIB_INTERNAL _tr_flush_block(s, buf, stored_len, last) * Save the match info and tally the frequency counts. Return true if * the current block must be flushed. */ -int ZLIB_INTERNAL _tr_tally(s, dist, lc) - deflate_state *s; - unsigned dist; /* distance of matched string */ - unsigned lc; /* match length - MIN_MATCH or unmatched char (dist==0) */ -{ +int ZLIB_INTERNAL _tr_tally(deflate_state *s, unsigned dist, unsigned lc) { +#ifdef LIT_MEM + s->d_buf[s->sym_next] = (ush)dist; + s->l_buf[s->sym_next++] = (uch)lc; +#else s->sym_buf[s->sym_next++] = (uch)dist; s->sym_buf[s->sym_next++] = (uch)(dist >> 8); s->sym_buf[s->sym_next++] = (uch)lc; +#endif if (dist == 0) { /* lc is the unmatched char */ s->dyn_ltree[lc].Freq++; @@ -1035,147 +1115,3 @@ int ZLIB_INTERNAL _tr_tally(s, dist, lc) } return (s->sym_next == s->sym_end); } - -/* =========================================================================== - * Send the block data compressed using the given Huffman trees - */ -local void compress_block(s, ltree, dtree) - deflate_state *s; - const ct_data *ltree; /* literal tree */ - const ct_data *dtree; /* distance tree */ -{ - unsigned dist; /* distance of matched string */ - int lc; /* match length or unmatched char (if dist == 0) */ - unsigned sx = 0; /* running index in sym_buf */ - unsigned code; /* the code to send */ - int extra; /* number of extra bits to send */ - - if (s->sym_next != 0) do { - dist = s->sym_buf[sx++] & 0xff; - dist += (unsigned)(s->sym_buf[sx++] & 0xff) << 8; - lc = s->sym_buf[sx++]; - if (dist == 0) { - send_code(s, lc, ltree); /* send a literal byte */ - Tracecv(isgraph(lc), (stderr," '%c' ", lc)); - } else { - /* Here, lc is the match length - MIN_MATCH */ - code = _length_code[lc]; - send_code(s, code + LITERALS + 1, ltree); /* send length code */ - extra = extra_lbits[code]; - if (extra != 0) { - lc -= base_length[code]; - send_bits(s, lc, extra); /* send the extra length bits */ - } - dist--; /* dist is now the match distance - 1 */ - code = d_code(dist); - Assert (code < D_CODES, "bad d_code"); - - send_code(s, code, dtree); /* send the distance code */ - extra = extra_dbits[code]; - if (extra != 0) { - dist -= (unsigned)base_dist[code]; - send_bits(s, dist, extra); /* send the extra distance bits */ - } - } /* literal or match pair ? */ - - /* Check that the overlay between pending_buf and sym_buf is ok: */ - Assert(s->pending < s->lit_bufsize + sx, "pendingBuf overflow"); - - } while (sx < s->sym_next); - - send_code(s, END_BLOCK, ltree); -} - -/* =========================================================================== - * Check if the data type is TEXT or BINARY, using the following algorithm: - * - TEXT if the two conditions below are satisfied: - * a) There are no non-portable control characters belonging to the - * "block list" (0..6, 14..25, 28..31). - * b) There is at least one printable character belonging to the - * "allow list" (9 {TAB}, 10 {LF}, 13 {CR}, 32..255). - * - BINARY otherwise. - * - The following partially-portable control characters form a - * "gray list" that is ignored in this detection algorithm: - * (7 {BEL}, 8 {BS}, 11 {VT}, 12 {FF}, 26 {SUB}, 27 {ESC}). - * IN assertion: the fields Freq of dyn_ltree are set. - */ -local int detect_data_type(s) - deflate_state *s; -{ - /* block_mask is the bit mask of block-listed bytes - * set bits 0..6, 14..25, and 28..31 - * 0xf3ffc07f = binary 11110011111111111100000001111111 - */ - unsigned long block_mask = 0xf3ffc07fUL; - int n; - - /* Check for non-textual ("block-listed") bytes. */ - for (n = 0; n <= 31; n++, block_mask >>= 1) - if ((block_mask & 1) && (s->dyn_ltree[n].Freq != 0)) - return Z_BINARY; - - /* Check for textual ("allow-listed") bytes. */ - if (s->dyn_ltree[9].Freq != 0 || s->dyn_ltree[10].Freq != 0 - || s->dyn_ltree[13].Freq != 0) - return Z_TEXT; - for (n = 32; n < LITERALS; n++) - if (s->dyn_ltree[n].Freq != 0) - return Z_TEXT; - - /* There are no "block-listed" or "allow-listed" bytes: - * this stream either is empty or has tolerated ("gray-listed") bytes only. - */ - return Z_BINARY; -} - -/* =========================================================================== - * Reverse the first len bits of a code, using straightforward code (a faster - * method would use a table) - * IN assertion: 1 <= len <= 15 - */ -local unsigned bi_reverse(code, len) - unsigned code; /* the value to invert */ - int len; /* its bit length */ -{ - register unsigned res = 0; - do { - res |= code & 1; - code >>= 1, res <<= 1; - } while (--len > 0); - return res >> 1; -} - -/* =========================================================================== - * Flush the bit buffer, keeping at most 7 bits in it. - */ -local void bi_flush(s) - deflate_state *s; -{ - if (s->bi_valid == 16) { - put_short(s, s->bi_buf); - s->bi_buf = 0; - s->bi_valid = 0; - } else if (s->bi_valid >= 8) { - put_byte(s, (Byte)s->bi_buf); - s->bi_buf >>= 8; - s->bi_valid -= 8; - } -} - -/* =========================================================================== - * Flush the bit buffer and align the output on a byte boundary - */ -local void bi_windup(s) - deflate_state *s; -{ - if (s->bi_valid > 8) { - put_short(s, s->bi_buf); - } else if (s->bi_valid > 0) { - put_byte(s, (Byte)s->bi_buf); - } - s->bi_buf = 0; - s->bi_valid = 0; -#ifdef ZLIB_DEBUG - s->bits_sent = (s->bits_sent + 7) & ~7; -#endif -} diff --git a/src/PureLib/pure/zlib/uncompr.c b/src/PureLib/pure/zlib/uncompr.c index f9532f46c1..5e256663b4 100644 --- a/src/PureLib/pure/zlib/uncompr.c +++ b/src/PureLib/pure/zlib/uncompr.c @@ -24,12 +24,8 @@ Z_DATA_ERROR if the input data was corrupted, including if the input data is an incomplete zlib stream. */ -int ZEXPORT uncompress2(dest, destLen, source, sourceLen) - Bytef *dest; - uLongf *destLen; - const Bytef *source; - uLong *sourceLen; -{ +int ZEXPORT uncompress2(Bytef *dest, uLongf *destLen, const Bytef *source, + uLong *sourceLen) { z_stream stream; int err; const uInt max = (uInt)-1; @@ -83,11 +79,7 @@ int ZEXPORT uncompress2(dest, destLen, source, sourceLen) err; } -int ZEXPORT uncompress(dest, destLen, source, sourceLen) - Bytef *dest; - uLongf *destLen; - const Bytef *source; - uLong sourceLen; -{ +int ZEXPORT uncompress(Bytef *dest, uLongf *destLen, const Bytef *source, + uLong sourceLen) { return uncompress2(dest, destLen, source, &sourceLen); } diff --git a/src/PureLib/pure/zlib/win32/DLL_FAQ.txt b/src/PureLib/pure/zlib/win32/DLL_FAQ.txt index 12c009018c..d8cf5f31e3 100644 --- a/src/PureLib/pure/zlib/win32/DLL_FAQ.txt +++ b/src/PureLib/pure/zlib/win32/DLL_FAQ.txt @@ -3,7 +3,7 @@ This document describes the design, the rationale, and the usage -of the official DLL build of zlib, named ZLIB1.DLL. If you have +of the common DLL build of zlib, named ZLIB1.DLL. If you have general questions about zlib, you should see the file "FAQ" found in the zlib distribution, or at the following location: http://www.gzip.org/zlib/zlib_faq.html @@ -11,13 +11,9 @@ in the zlib distribution, or at the following location: 1. What is ZLIB1.DLL, and how can I get it? - - ZLIB1.DLL is the official build of zlib as a DLL. + - ZLIB1.DLL is the common build of zlib as a DLL. (Please remark the character '1' in the name.) - Pointers to a precompiled ZLIB1.DLL can be found in the zlib - web site at: - http://www.zlib.net/ - Applications that link to ZLIB1.DLL can rely on the following specification: @@ -379,18 +375,6 @@ in the zlib distribution, or at the following location: code. But you can make your own private DLL build, under a different file name, as suggested in the previous answer. - -17. I made my own ZLIB1.DLL build. Can I test it for compliance? - - - We prefer that you download the official DLL from the zlib - web site. If you need something peculiar from this DLL, you - can send your suggestion to the zlib mailing list. - - However, in case you do rebuild the DLL yourself, you can run - it with the test programs found in the DLL distribution. - Running these test programs is not a guarantee of compliance, - but a failure can imply a detected problem. - ** This document is written and maintained by diff --git a/src/PureLib/pure/zlib/win32/README-WIN32.txt b/src/PureLib/pure/zlib/win32/README-WIN32.txt index 050197d80f..14e6398ef3 100644 --- a/src/PureLib/pure/zlib/win32/README-WIN32.txt +++ b/src/PureLib/pure/zlib/win32/README-WIN32.txt @@ -1,6 +1,6 @@ ZLIB DATA COMPRESSION LIBRARY -zlib 1.2.13 is a general purpose data compression library. All the code is +zlib 1.3.1 is a general purpose data compression library. All the code is thread safe. The data format used by the zlib library is described by RFCs (Request for Comments) 1950 to 1952 in the files http://www.ietf.org/rfc/rfc1950.txt (zlib format), rfc1951.txt (deflate format) @@ -16,13 +16,13 @@ is http://zlib.net/ . Before reporting a problem, please check this site to verify that you have the latest version of zlib; otherwise get the latest version and check whether the problem still exists or not. -PLEASE read DLL_FAQ.txt, and the the zlib FAQ http://zlib.net/zlib_faq.html -before asking for help. +PLEASE read DLL_FAQ.txt, and the zlib FAQ http://zlib.net/zlib_faq.html before +asking for help. Manifest: -The package zlib-1.2.13-win32-x86.zip will contain the following files: +The package zlib-1.3.1-win32-x86.zip will contain the following files: README-WIN32.txt This document ChangeLog Changes since previous zlib packages diff --git a/src/PureLib/pure/zlib/zconf.h b/src/PureLib/pure/zlib/zconf.h index bf977d3e70..62adc8d843 100644 --- a/src/PureLib/pure/zlib/zconf.h +++ b/src/PureLib/pure/zlib/zconf.h @@ -1,5 +1,5 @@ /* zconf.h -- configuration of the zlib compression library - * Copyright (C) 1995-2016 Jean-loup Gailly, Mark Adler + * Copyright (C) 1995-2024 Jean-loup Gailly, Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -241,7 +241,11 @@ #endif #ifdef Z_SOLO - typedef unsigned long z_size_t; +# ifdef _WIN64 + typedef unsigned long long z_size_t; +# else + typedef unsigned long z_size_t; +# endif #else # define z_longlong long long # if defined(NO_SIZE_T) @@ -296,14 +300,6 @@ # endif #endif -#ifndef Z_ARG /* function prototypes for stdarg */ -# if defined(STDC) || defined(Z_HAVE_STDARG_H) -# define Z_ARG(args) args -# else -# define Z_ARG(args) () -# endif -#endif - /* The following definitions for FAR are needed only for MSDOS mixed * model programming (small or medium model with some far allocations). * This was tested only with MSC; for other MSDOS compilers you may have @@ -520,7 +516,7 @@ typedef uLong FAR uLongf; #if !defined(_WIN32) && defined(Z_LARGE64) # define z_off64_t off64_t #else -# if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO) +# if defined(_WIN32) && !defined(__GNUC__) # define z_off64_t __int64 # else # define z_off64_t z_off_t diff --git a/src/PureLib/pure/zlib/zconf.h.cmakein b/src/PureLib/pure/zlib/zconf.h.cmakein index 247ba2461d..0abe3bc9d8 100644 --- a/src/PureLib/pure/zlib/zconf.h.cmakein +++ b/src/PureLib/pure/zlib/zconf.h.cmakein @@ -1,5 +1,5 @@ /* zconf.h -- configuration of the zlib compression library - * Copyright (C) 1995-2016 Jean-loup Gailly, Mark Adler + * Copyright (C) 1995-2024 Jean-loup Gailly, Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -243,7 +243,11 @@ #endif #ifdef Z_SOLO - typedef unsigned long z_size_t; +# ifdef _WIN64 + typedef unsigned long long z_size_t; +# else + typedef unsigned long z_size_t; +# endif #else # define z_longlong long long # if defined(NO_SIZE_T) @@ -298,14 +302,6 @@ # endif #endif -#ifndef Z_ARG /* function prototypes for stdarg */ -# if defined(STDC) || defined(Z_HAVE_STDARG_H) -# define Z_ARG(args) args -# else -# define Z_ARG(args) () -# endif -#endif - /* The following definitions for FAR are needed only for MSDOS mixed * model programming (small or medium model with some far allocations). * This was tested only with MSC; for other MSDOS compilers you may have @@ -522,7 +518,7 @@ typedef uLong FAR uLongf; #if !defined(_WIN32) && defined(Z_LARGE64) # define z_off64_t off64_t #else -# if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO) +# if defined(_WIN32) && !defined(__GNUC__) # define z_off64_t __int64 # else # define z_off64_t z_off_t diff --git a/src/PureLib/pure/zlib/zconf.h.in b/src/PureLib/pure/zlib/zconf.h.in index bf977d3e70..62adc8d843 100644 --- a/src/PureLib/pure/zlib/zconf.h.in +++ b/src/PureLib/pure/zlib/zconf.h.in @@ -1,5 +1,5 @@ /* zconf.h -- configuration of the zlib compression library - * Copyright (C) 1995-2016 Jean-loup Gailly, Mark Adler + * Copyright (C) 1995-2024 Jean-loup Gailly, Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -241,7 +241,11 @@ #endif #ifdef Z_SOLO - typedef unsigned long z_size_t; +# ifdef _WIN64 + typedef unsigned long long z_size_t; +# else + typedef unsigned long z_size_t; +# endif #else # define z_longlong long long # if defined(NO_SIZE_T) @@ -296,14 +300,6 @@ # endif #endif -#ifndef Z_ARG /* function prototypes for stdarg */ -# if defined(STDC) || defined(Z_HAVE_STDARG_H) -# define Z_ARG(args) args -# else -# define Z_ARG(args) () -# endif -#endif - /* The following definitions for FAR are needed only for MSDOS mixed * model programming (small or medium model with some far allocations). * This was tested only with MSC; for other MSDOS compilers you may have @@ -520,7 +516,7 @@ typedef uLong FAR uLongf; #if !defined(_WIN32) && defined(Z_LARGE64) # define z_off64_t off64_t #else -# if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO) +# if defined(_WIN32) && !defined(__GNUC__) # define z_off64_t __int64 # else # define z_off64_t z_off_t diff --git a/src/PureLib/pure/zlib/zlib.3 b/src/PureLib/pure/zlib/zlib.3 index 6f6e91404d..c716020ea9 100644 --- a/src/PureLib/pure/zlib/zlib.3 +++ b/src/PureLib/pure/zlib/zlib.3 @@ -1,4 +1,4 @@ -.TH ZLIB 3 "13 Oct 2022" +.TH ZLIB 3 "22 Jan 2024" .SH NAME zlib \- compression/decompression library .SH SYNOPSIS @@ -105,9 +105,9 @@ before asking for help. Send questions and/or comments to zlib@gzip.org, or (for the Windows DLL version) to Gilles Vollant (info@winimage.com). .SH AUTHORS AND LICENSE -Version 1.2.13 +Version 1.3.1 .LP -Copyright (C) 1995-2022 Jean-loup Gailly and Mark Adler +Copyright (C) 1995-2024 Jean-loup Gailly and Mark Adler .LP This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/PureLib/pure/zlib/zlib.3.pdf b/src/PureLib/pure/zlib/zlib.3.pdf index 8132d840c8..b224532bdd 100644 Binary files a/src/PureLib/pure/zlib/zlib.3.pdf and b/src/PureLib/pure/zlib/zlib.3.pdf differ diff --git a/src/PureLib/pure/zlib/zlib.h b/src/PureLib/pure/zlib/zlib.h index 953cb5012d..8d4b932eaf 100644 --- a/src/PureLib/pure/zlib/zlib.h +++ b/src/PureLib/pure/zlib/zlib.h @@ -1,7 +1,7 @@ /* zlib.h -- interface of the 'zlib' general purpose compression library - version 1.2.13, October 13th, 2022 + version 1.3.1, January 22nd, 2024 - Copyright (C) 1995-2022 Jean-loup Gailly and Mark Adler + Copyright (C) 1995-2024 Jean-loup Gailly and Mark Adler This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -37,11 +37,11 @@ extern "C" { #endif -#define ZLIB_VERSION "1.2.13" -#define ZLIB_VERNUM 0x12d0 +#define ZLIB_VERSION "1.3.1" +#define ZLIB_VERNUM 0x1310 #define ZLIB_VER_MAJOR 1 -#define ZLIB_VER_MINOR 2 -#define ZLIB_VER_REVISION 13 +#define ZLIB_VER_MINOR 3 +#define ZLIB_VER_REVISION 1 #define ZLIB_VER_SUBREVISION 0 /* @@ -78,8 +78,8 @@ extern "C" { even in the case of corrupted input. */ -typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size)); -typedef void (*free_func) OF((voidpf opaque, voidpf address)); +typedef voidpf (*alloc_func)(voidpf opaque, uInt items, uInt size); +typedef void (*free_func)(voidpf opaque, voidpf address); struct internal_state; @@ -217,7 +217,7 @@ typedef gz_header FAR *gz_headerp; /* basic functions */ -ZEXTERN const char * ZEXPORT zlibVersion OF((void)); +ZEXTERN const char * ZEXPORT zlibVersion(void); /* The application can compare zlibVersion and ZLIB_VERSION for consistency. If the first character differs, the library code actually used is not compatible with the zlib.h header file used by the application. This check @@ -225,12 +225,12 @@ ZEXTERN const char * ZEXPORT zlibVersion OF((void)); */ /* -ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level)); +ZEXTERN int ZEXPORT deflateInit(z_streamp strm, int level); Initializes the internal stream state for compression. The fields zalloc, zfree and opaque must be initialized before by the caller. If zalloc and zfree are set to Z_NULL, deflateInit updates them to use default - allocation functions. + allocation functions. total_in, total_out, adler, and msg are initialized. The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9: 1 gives best speed, 9 gives best compression, 0 gives no compression at all @@ -247,7 +247,7 @@ ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level)); */ -ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush)); +ZEXTERN int ZEXPORT deflate(z_streamp strm, int flush); /* deflate compresses as much data as possible, and stops when the input buffer becomes empty or the output buffer becomes full. It may introduce @@ -320,8 +320,8 @@ ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush)); with the same value of the flush parameter and more output space (updated avail_out), until the flush is complete (deflate returns with non-zero avail_out). In the case of a Z_FULL_FLUSH or Z_SYNC_FLUSH, make sure that - avail_out is greater than six to avoid repeated flush markers due to - avail_out == 0 on return. + avail_out is greater than six when the flush marker begins, in order to avoid + repeated flush markers upon calling deflate() again when avail_out == 0. If the parameter flush is set to Z_FINISH, pending input is processed, pending output is flushed and deflate returns with Z_STREAM_END if there was @@ -360,7 +360,7 @@ ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush)); */ -ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm)); +ZEXTERN int ZEXPORT deflateEnd(z_streamp strm); /* All dynamically allocated data structures for this stream are freed. This function discards any unprocessed input and does not flush any pending @@ -375,7 +375,7 @@ ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm)); /* -ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm)); +ZEXTERN int ZEXPORT inflateInit(z_streamp strm); Initializes the internal stream state for decompression. The fields next_in, avail_in, zalloc, zfree and opaque must be initialized before by @@ -383,7 +383,8 @@ ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm)); read or consumed. The allocation of a sliding window will be deferred to the first call of inflate (if the decompression does not complete on the first call). If zalloc and zfree are set to Z_NULL, inflateInit updates - them to use default allocation functions. + them to use default allocation functions. total_in, total_out, adler, and + msg are initialized. inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_VERSION_ERROR if the zlib library version is incompatible with the @@ -397,7 +398,7 @@ ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm)); */ -ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush)); +ZEXTERN int ZEXPORT inflate(z_streamp strm, int flush); /* inflate decompresses as much data as possible, and stops when the input buffer becomes empty or the output buffer becomes full. It may introduce @@ -517,7 +518,7 @@ ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush)); */ -ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm)); +ZEXTERN int ZEXPORT inflateEnd(z_streamp strm); /* All dynamically allocated data structures for this stream are freed. This function discards any unprocessed input and does not flush any pending @@ -535,12 +536,12 @@ ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm)); */ /* -ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm, - int level, - int method, - int windowBits, - int memLevel, - int strategy)); +ZEXTERN int ZEXPORT deflateInit2(z_streamp strm, + int level, + int method, + int windowBits, + int memLevel, + int strategy); This is another version of deflateInit with more compression options. The fields zalloc, zfree and opaque must be initialized before by the caller. @@ -607,9 +608,9 @@ ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm, compression: this will be done by deflate(). */ -ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm, - const Bytef *dictionary, - uInt dictLength)); +ZEXTERN int ZEXPORT deflateSetDictionary(z_streamp strm, + const Bytef *dictionary, + uInt dictLength); /* Initializes the compression dictionary from the given byte sequence without producing any compressed output. When using the zlib format, this @@ -651,9 +652,9 @@ ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm, not perform any compression: this will be done by deflate(). */ -ZEXTERN int ZEXPORT deflateGetDictionary OF((z_streamp strm, - Bytef *dictionary, - uInt *dictLength)); +ZEXTERN int ZEXPORT deflateGetDictionary(z_streamp strm, + Bytef *dictionary, + uInt *dictLength); /* Returns the sliding dictionary being maintained by deflate. dictLength is set to the number of bytes in the dictionary, and that many bytes are copied @@ -673,8 +674,8 @@ ZEXTERN int ZEXPORT deflateGetDictionary OF((z_streamp strm, stream state is inconsistent. */ -ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest, - z_streamp source)); +ZEXTERN int ZEXPORT deflateCopy(z_streamp dest, + z_streamp source); /* Sets the destination stream as a complete copy of the source stream. @@ -691,20 +692,20 @@ ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest, destination. */ -ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm)); +ZEXTERN int ZEXPORT deflateReset(z_streamp strm); /* This function is equivalent to deflateEnd followed by deflateInit, but does not free and reallocate the internal compression state. The stream will leave the compression level and any other attributes that may have been - set unchanged. + set unchanged. total_in, total_out, adler, and msg are initialized. deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source stream state was inconsistent (such as zalloc or state being Z_NULL). */ -ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm, - int level, - int strategy)); +ZEXTERN int ZEXPORT deflateParams(z_streamp strm, + int level, + int strategy); /* Dynamically update the compression level and compression strategy. The interpretation of level and strategy is as in deflateInit2(). This can be @@ -729,7 +730,7 @@ ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm, Then no more input data should be provided before the deflateParams() call. If this is done, the old level and strategy will be applied to the data compressed before deflateParams(), and the new level and strategy will be - applied to the the data compressed after deflateParams(). + applied to the data compressed after deflateParams(). deflateParams returns Z_OK on success, Z_STREAM_ERROR if the source stream state was inconsistent or if a parameter was invalid, or Z_BUF_ERROR if @@ -740,11 +741,11 @@ ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm, retried with more output space. */ -ZEXTERN int ZEXPORT deflateTune OF((z_streamp strm, - int good_length, - int max_lazy, - int nice_length, - int max_chain)); +ZEXTERN int ZEXPORT deflateTune(z_streamp strm, + int good_length, + int max_lazy, + int nice_length, + int max_chain); /* Fine tune deflate's internal compression parameters. This should only be used by someone who understands the algorithm used by zlib's deflate for @@ -757,8 +758,8 @@ ZEXTERN int ZEXPORT deflateTune OF((z_streamp strm, returns Z_OK on success, or Z_STREAM_ERROR for an invalid deflate stream. */ -ZEXTERN uLong ZEXPORT deflateBound OF((z_streamp strm, - uLong sourceLen)); +ZEXTERN uLong ZEXPORT deflateBound(z_streamp strm, + uLong sourceLen); /* deflateBound() returns an upper bound on the compressed size after deflation of sourceLen bytes. It must be called after deflateInit() or @@ -772,9 +773,9 @@ ZEXTERN uLong ZEXPORT deflateBound OF((z_streamp strm, than Z_FINISH or Z_NO_FLUSH are used. */ -ZEXTERN int ZEXPORT deflatePending OF((z_streamp strm, - unsigned *pending, - int *bits)); +ZEXTERN int ZEXPORT deflatePending(z_streamp strm, + unsigned *pending, + int *bits); /* deflatePending() returns the number of bytes and bits of output that have been generated, but not yet provided in the available output. The bytes not @@ -787,9 +788,9 @@ ZEXTERN int ZEXPORT deflatePending OF((z_streamp strm, stream state was inconsistent. */ -ZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm, - int bits, - int value)); +ZEXTERN int ZEXPORT deflatePrime(z_streamp strm, + int bits, + int value); /* deflatePrime() inserts bits in the deflate output stream. The intent is that this function is used to start off the deflate output with the bits @@ -804,8 +805,8 @@ ZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm, source stream state was inconsistent. */ -ZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm, - gz_headerp head)); +ZEXTERN int ZEXPORT deflateSetHeader(z_streamp strm, + gz_headerp head); /* deflateSetHeader() provides gzip header information for when a gzip stream is requested by deflateInit2(). deflateSetHeader() may be called @@ -821,16 +822,17 @@ ZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm, gzip file" and give up. If deflateSetHeader is not used, the default gzip header has text false, - the time set to zero, and os set to 255, with no extra, name, or comment - fields. The gzip header is returned to the default state by deflateReset(). + the time set to zero, and os set to the current operating system, with no + extra, name, or comment fields. The gzip header is returned to the default + state by deflateReset(). deflateSetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source stream state was inconsistent. */ /* -ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm, - int windowBits)); +ZEXTERN int ZEXPORT inflateInit2(z_streamp strm, + int windowBits); This is another version of inflateInit with an extra parameter. The fields next_in, avail_in, zalloc, zfree and opaque must be initialized @@ -883,9 +885,9 @@ ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm, deferred until inflate() is called. */ -ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm, - const Bytef *dictionary, - uInt dictLength)); +ZEXTERN int ZEXPORT inflateSetDictionary(z_streamp strm, + const Bytef *dictionary, + uInt dictLength); /* Initializes the decompression dictionary from the given uncompressed byte sequence. This function must be called immediately after a call of inflate, @@ -906,9 +908,9 @@ ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm, inflate(). */ -ZEXTERN int ZEXPORT inflateGetDictionary OF((z_streamp strm, - Bytef *dictionary, - uInt *dictLength)); +ZEXTERN int ZEXPORT inflateGetDictionary(z_streamp strm, + Bytef *dictionary, + uInt *dictLength); /* Returns the sliding dictionary being maintained by inflate. dictLength is set to the number of bytes in the dictionary, and that many bytes are copied @@ -921,7 +923,7 @@ ZEXTERN int ZEXPORT inflateGetDictionary OF((z_streamp strm, stream state is inconsistent. */ -ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm)); +ZEXTERN int ZEXPORT inflateSync(z_streamp strm); /* Skips invalid compressed data until a possible full flush point (see above for the description of deflate with Z_FULL_FLUSH) can be found, or until all @@ -934,14 +936,14 @@ ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm)); inflateSync returns Z_OK if a possible full flush point has been found, Z_BUF_ERROR if no more input was provided, Z_DATA_ERROR if no flush point has been found, or Z_STREAM_ERROR if the stream structure was inconsistent. - In the success case, the application may save the current current value of - total_in which indicates where valid compressed data was found. In the - error case, the application may repeatedly call inflateSync, providing more - input each time, until success or end of the input data. + In the success case, the application may save the current value of total_in + which indicates where valid compressed data was found. In the error case, + the application may repeatedly call inflateSync, providing more input each + time, until success or end of the input data. */ -ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest, - z_streamp source)); +ZEXTERN int ZEXPORT inflateCopy(z_streamp dest, + z_streamp source); /* Sets the destination stream as a complete copy of the source stream. @@ -956,18 +958,19 @@ ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest, destination. */ -ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm)); +ZEXTERN int ZEXPORT inflateReset(z_streamp strm); /* This function is equivalent to inflateEnd followed by inflateInit, but does not free and reallocate the internal decompression state. The stream will keep attributes that may have been set by inflateInit2. + total_in, total_out, adler, and msg are initialized. inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source stream state was inconsistent (such as zalloc or state being Z_NULL). */ -ZEXTERN int ZEXPORT inflateReset2 OF((z_streamp strm, - int windowBits)); +ZEXTERN int ZEXPORT inflateReset2(z_streamp strm, + int windowBits); /* This function is the same as inflateReset, but it also permits changing the wrap and window size requests. The windowBits parameter is interpreted @@ -980,9 +983,9 @@ ZEXTERN int ZEXPORT inflateReset2 OF((z_streamp strm, the windowBits parameter is invalid. */ -ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm, - int bits, - int value)); +ZEXTERN int ZEXPORT inflatePrime(z_streamp strm, + int bits, + int value); /* This function inserts bits in the inflate input stream. The intent is that this function is used to start inflating at a bit position in the @@ -1001,7 +1004,7 @@ ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm, stream state was inconsistent. */ -ZEXTERN long ZEXPORT inflateMark OF((z_streamp strm)); +ZEXTERN long ZEXPORT inflateMark(z_streamp strm); /* This function returns two values, one in the lower 16 bits of the return value, and the other in the remaining upper bits, obtained by shifting the @@ -1029,8 +1032,8 @@ ZEXTERN long ZEXPORT inflateMark OF((z_streamp strm)); source stream state was inconsistent. */ -ZEXTERN int ZEXPORT inflateGetHeader OF((z_streamp strm, - gz_headerp head)); +ZEXTERN int ZEXPORT inflateGetHeader(z_streamp strm, + gz_headerp head); /* inflateGetHeader() requests that gzip header information be stored in the provided gz_header structure. inflateGetHeader() may be called after @@ -1070,8 +1073,8 @@ ZEXTERN int ZEXPORT inflateGetHeader OF((z_streamp strm, */ /* -ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits, - unsigned char FAR *window)); +ZEXTERN int ZEXPORT inflateBackInit(z_streamp strm, int windowBits, + unsigned char FAR *window); Initialize the internal stream state for decompression using inflateBack() calls. The fields zalloc, zfree and opaque in strm must be initialized @@ -1091,13 +1094,13 @@ ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits, the version of the header file. */ -typedef unsigned (*in_func) OF((void FAR *, - z_const unsigned char FAR * FAR *)); -typedef int (*out_func) OF((void FAR *, unsigned char FAR *, unsigned)); +typedef unsigned (*in_func)(void FAR *, + z_const unsigned char FAR * FAR *); +typedef int (*out_func)(void FAR *, unsigned char FAR *, unsigned); -ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm, - in_func in, void FAR *in_desc, - out_func out, void FAR *out_desc)); +ZEXTERN int ZEXPORT inflateBack(z_streamp strm, + in_func in, void FAR *in_desc, + out_func out, void FAR *out_desc); /* inflateBack() does a raw inflate with a single call using a call-back interface for input and output. This is potentially more efficient than @@ -1165,7 +1168,7 @@ ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm, cannot return Z_OK. */ -ZEXTERN int ZEXPORT inflateBackEnd OF((z_streamp strm)); +ZEXTERN int ZEXPORT inflateBackEnd(z_streamp strm); /* All memory allocated by inflateBackInit() is freed. @@ -1173,7 +1176,7 @@ ZEXTERN int ZEXPORT inflateBackEnd OF((z_streamp strm)); state was inconsistent. */ -ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void)); +ZEXTERN uLong ZEXPORT zlibCompileFlags(void); /* Return flags indicating compile-time options. Type sizes, two bits each, 00 = 16 bits, 01 = 32, 10 = 64, 11 = other: @@ -1226,8 +1229,8 @@ ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void)); you need special options. */ -ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen, - const Bytef *source, uLong sourceLen)); +ZEXTERN int ZEXPORT compress(Bytef *dest, uLongf *destLen, + const Bytef *source, uLong sourceLen); /* Compresses the source buffer into the destination buffer. sourceLen is the byte length of the source buffer. Upon entry, destLen is the total size @@ -1241,9 +1244,9 @@ ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen, buffer. */ -ZEXTERN int ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen, - const Bytef *source, uLong sourceLen, - int level)); +ZEXTERN int ZEXPORT compress2(Bytef *dest, uLongf *destLen, + const Bytef *source, uLong sourceLen, + int level); /* Compresses the source buffer into the destination buffer. The level parameter has the same meaning as in deflateInit. sourceLen is the byte @@ -1257,15 +1260,15 @@ ZEXTERN int ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen, Z_STREAM_ERROR if the level parameter is invalid. */ -ZEXTERN uLong ZEXPORT compressBound OF((uLong sourceLen)); +ZEXTERN uLong ZEXPORT compressBound(uLong sourceLen); /* compressBound() returns an upper bound on the compressed size after compress() or compress2() on sourceLen bytes. It would be used before a compress() or compress2() call to allocate the destination buffer. */ -ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen, - const Bytef *source, uLong sourceLen)); +ZEXTERN int ZEXPORT uncompress(Bytef *dest, uLongf *destLen, + const Bytef *source, uLong sourceLen); /* Decompresses the source buffer into the destination buffer. sourceLen is the byte length of the source buffer. Upon entry, destLen is the total size @@ -1282,8 +1285,8 @@ ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen, buffer with the uncompressed data up to that point. */ -ZEXTERN int ZEXPORT uncompress2 OF((Bytef *dest, uLongf *destLen, - const Bytef *source, uLong *sourceLen)); +ZEXTERN int ZEXPORT uncompress2(Bytef *dest, uLongf *destLen, + const Bytef *source, uLong *sourceLen); /* Same as uncompress, except that sourceLen is a pointer, where the length of the source is *sourceLen. On return, *sourceLen is the number of @@ -1302,7 +1305,7 @@ ZEXTERN int ZEXPORT uncompress2 OF((Bytef *dest, uLongf *destLen, typedef struct gzFile_s *gzFile; /* semi-opaque gzip file descriptor */ /* -ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode)); +ZEXTERN gzFile ZEXPORT gzopen(const char *path, const char *mode); Open the gzip (.gz) file at path for reading and decompressing, or compressing and writing. The mode parameter is as in fopen ("rb" or "wb") @@ -1339,7 +1342,7 @@ ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode)); file could not be opened. */ -ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode)); +ZEXTERN gzFile ZEXPORT gzdopen(int fd, const char *mode); /* Associate a gzFile with the file descriptor fd. File descriptors are obtained from calls like open, dup, creat, pipe or fileno (if the file has @@ -1362,7 +1365,7 @@ ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode)); will not detect if fd is invalid (unless fd is -1). */ -ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size)); +ZEXTERN int ZEXPORT gzbuffer(gzFile file, unsigned size); /* Set the internal buffer size used by this library's functions for file to size. The default buffer size is 8192 bytes. This function must be called @@ -1378,7 +1381,7 @@ ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size)); too late. */ -ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy)); +ZEXTERN int ZEXPORT gzsetparams(gzFile file, int level, int strategy); /* Dynamically update the compression level and strategy for file. See the description of deflateInit2 for the meaning of these parameters. Previously @@ -1389,7 +1392,7 @@ ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy)); or Z_MEM_ERROR if there is a memory allocation error. */ -ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len)); +ZEXTERN int ZEXPORT gzread(gzFile file, voidp buf, unsigned len); /* Read and decompress up to len uncompressed bytes from file into buf. If the input file is not in gzip format, gzread copies the given number of @@ -1419,8 +1422,8 @@ ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len)); Z_STREAM_ERROR. */ -ZEXTERN z_size_t ZEXPORT gzfread OF((voidp buf, z_size_t size, z_size_t nitems, - gzFile file)); +ZEXTERN z_size_t ZEXPORT gzfread(voidp buf, z_size_t size, z_size_t nitems, + gzFile file); /* Read and decompress up to nitems items of size size from file into buf, otherwise operating as gzread() does. This duplicates the interface of @@ -1445,14 +1448,14 @@ ZEXTERN z_size_t ZEXPORT gzfread OF((voidp buf, z_size_t size, z_size_t nitems, file, resetting and retrying on end-of-file, when size is not 1. */ -ZEXTERN int ZEXPORT gzwrite OF((gzFile file, voidpc buf, unsigned len)); +ZEXTERN int ZEXPORT gzwrite(gzFile file, voidpc buf, unsigned len); /* Compress and write the len uncompressed bytes at buf to file. gzwrite returns the number of uncompressed bytes written or 0 in case of error. */ -ZEXTERN z_size_t ZEXPORT gzfwrite OF((voidpc buf, z_size_t size, - z_size_t nitems, gzFile file)); +ZEXTERN z_size_t ZEXPORT gzfwrite(voidpc buf, z_size_t size, + z_size_t nitems, gzFile file); /* Compress and write nitems items of size size from buf to file, duplicating the interface of stdio's fwrite(), with size_t request and return types. If @@ -1465,7 +1468,7 @@ ZEXTERN z_size_t ZEXPORT gzfwrite OF((voidpc buf, z_size_t size, is returned, and the error state is set to Z_STREAM_ERROR. */ -ZEXTERN int ZEXPORTVA gzprintf Z_ARG((gzFile file, const char *format, ...)); +ZEXTERN int ZEXPORTVA gzprintf(gzFile file, const char *format, ...); /* Convert, format, compress, and write the arguments (...) to file under control of the string format, as in fprintf. gzprintf returns the number of @@ -1480,7 +1483,7 @@ ZEXTERN int ZEXPORTVA gzprintf Z_ARG((gzFile file, const char *format, ...)); This can be determined using zlibCompileFlags(). */ -ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s)); +ZEXTERN int ZEXPORT gzputs(gzFile file, const char *s); /* Compress and write the given null-terminated string s to file, excluding the terminating null character. @@ -1488,7 +1491,7 @@ ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s)); gzputs returns the number of characters written, or -1 in case of error. */ -ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len)); +ZEXTERN char * ZEXPORT gzgets(gzFile file, char *buf, int len); /* Read and decompress bytes from file into buf, until len-1 characters are read, or until a newline character is read and transferred to buf, or an @@ -1502,13 +1505,13 @@ ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len)); buf are indeterminate. */ -ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c)); +ZEXTERN int ZEXPORT gzputc(gzFile file, int c); /* Compress and write c, converted to an unsigned char, into file. gzputc returns the value that was written, or -1 in case of error. */ -ZEXTERN int ZEXPORT gzgetc OF((gzFile file)); +ZEXTERN int ZEXPORT gzgetc(gzFile file); /* Read and decompress one byte from file. gzgetc returns this byte or -1 in case of end of file or error. This is implemented as a macro for speed. @@ -1517,7 +1520,7 @@ ZEXTERN int ZEXPORT gzgetc OF((gzFile file)); points to has been clobbered or not. */ -ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file)); +ZEXTERN int ZEXPORT gzungetc(int c, gzFile file); /* Push c back onto the stream for file to be read as the first character on the next read. At least one character of push-back is always allowed. @@ -1529,7 +1532,7 @@ ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file)); gzseek() or gzrewind(). */ -ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush)); +ZEXTERN int ZEXPORT gzflush(gzFile file, int flush); /* Flush all pending output to file. The parameter flush is as in the deflate() function. The return value is the zlib error number (see function @@ -1545,8 +1548,8 @@ ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush)); */ /* -ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file, - z_off_t offset, int whence)); +ZEXTERN z_off_t ZEXPORT gzseek(gzFile file, + z_off_t offset, int whence); Set the starting position to offset relative to whence for the next gzread or gzwrite on file. The offset represents a number of bytes in the @@ -1564,7 +1567,7 @@ ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file, would be before the current position. */ -ZEXTERN int ZEXPORT gzrewind OF((gzFile file)); +ZEXTERN int ZEXPORT gzrewind(gzFile file); /* Rewind file. This function is supported only for reading. @@ -1572,7 +1575,7 @@ ZEXTERN int ZEXPORT gzrewind OF((gzFile file)); */ /* -ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file)); +ZEXTERN z_off_t ZEXPORT gztell(gzFile file); Return the starting position for the next gzread or gzwrite on file. This position represents a number of bytes in the uncompressed data stream, @@ -1583,7 +1586,7 @@ ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file)); */ /* -ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile file)); +ZEXTERN z_off_t ZEXPORT gzoffset(gzFile file); Return the current compressed (actual) read or write offset of file. This offset includes the count of bytes that precede the gzip stream, for example @@ -1592,7 +1595,7 @@ ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile file)); be used for a progress indicator. On error, gzoffset() returns -1. */ -ZEXTERN int ZEXPORT gzeof OF((gzFile file)); +ZEXTERN int ZEXPORT gzeof(gzFile file); /* Return true (1) if the end-of-file indicator for file has been set while reading, false (0) otherwise. Note that the end-of-file indicator is set @@ -1607,7 +1610,7 @@ ZEXTERN int ZEXPORT gzeof OF((gzFile file)); has grown since the previous end of file was detected. */ -ZEXTERN int ZEXPORT gzdirect OF((gzFile file)); +ZEXTERN int ZEXPORT gzdirect(gzFile file); /* Return true (1) if file is being copied directly while reading, or false (0) if file is a gzip stream being decompressed. @@ -1628,7 +1631,7 @@ ZEXTERN int ZEXPORT gzdirect OF((gzFile file)); gzip file reading and decompression, which may not be desired.) */ -ZEXTERN int ZEXPORT gzclose OF((gzFile file)); +ZEXTERN int ZEXPORT gzclose(gzFile file); /* Flush all pending output for file, if necessary, close file and deallocate the (de)compression state. Note that once file is closed, you @@ -1641,8 +1644,8 @@ ZEXTERN int ZEXPORT gzclose OF((gzFile file)); last read ended in the middle of a gzip stream, or Z_OK on success. */ -ZEXTERN int ZEXPORT gzclose_r OF((gzFile file)); -ZEXTERN int ZEXPORT gzclose_w OF((gzFile file)); +ZEXTERN int ZEXPORT gzclose_r(gzFile file); +ZEXTERN int ZEXPORT gzclose_w(gzFile file); /* Same as gzclose(), but gzclose_r() is only for use when reading, and gzclose_w() is only for use when writing or appending. The advantage to @@ -1653,7 +1656,7 @@ ZEXTERN int ZEXPORT gzclose_w OF((gzFile file)); zlib library. */ -ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum)); +ZEXTERN const char * ZEXPORT gzerror(gzFile file, int *errnum); /* Return the error message for the last error which occurred on file. errnum is set to zlib error number. If an error occurred in the file system @@ -1669,7 +1672,7 @@ ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum)); functions above that do not distinguish those cases in their return values. */ -ZEXTERN void ZEXPORT gzclearerr OF((gzFile file)); +ZEXTERN void ZEXPORT gzclearerr(gzFile file); /* Clear the error and end-of-file flags for file. This is analogous to the clearerr() function in stdio. This is useful for continuing to read a gzip @@ -1686,7 +1689,7 @@ ZEXTERN void ZEXPORT gzclearerr OF((gzFile file)); library. */ -ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len)); +ZEXTERN uLong ZEXPORT adler32(uLong adler, const Bytef *buf, uInt len); /* Update a running Adler-32 checksum with the bytes buf[0..len-1] and return the updated checksum. An Adler-32 value is in the range of a 32-bit @@ -1706,15 +1709,15 @@ ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len)); if (adler != original_adler) error(); */ -ZEXTERN uLong ZEXPORT adler32_z OF((uLong adler, const Bytef *buf, - z_size_t len)); +ZEXTERN uLong ZEXPORT adler32_z(uLong adler, const Bytef *buf, + z_size_t len); /* Same as adler32(), but with a size_t length. */ /* -ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2, - z_off_t len2)); +ZEXTERN uLong ZEXPORT adler32_combine(uLong adler1, uLong adler2, + z_off_t len2); Combine two Adler-32 checksums into one. For two sequences of bytes, seq1 and seq2 with lengths len1 and len2, Adler-32 checksums were calculated for @@ -1724,7 +1727,7 @@ ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2, negative, the result has no meaning or utility. */ -ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len)); +ZEXTERN uLong ZEXPORT crc32(uLong crc, const Bytef *buf, uInt len); /* Update a running CRC-32 with the bytes buf[0..len-1] and return the updated CRC-32. A CRC-32 value is in the range of a 32-bit unsigned integer. @@ -1742,30 +1745,30 @@ ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len)); if (crc != original_crc) error(); */ -ZEXTERN uLong ZEXPORT crc32_z OF((uLong crc, const Bytef *buf, - z_size_t len)); +ZEXTERN uLong ZEXPORT crc32_z(uLong crc, const Bytef *buf, + z_size_t len); /* Same as crc32(), but with a size_t length. */ /* -ZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len2)); +ZEXTERN uLong ZEXPORT crc32_combine(uLong crc1, uLong crc2, z_off_t len2); Combine two CRC-32 check values into one. For two sequences of bytes, seq1 and seq2 with lengths len1 and len2, CRC-32 check values were calculated for each, crc1 and crc2. crc32_combine() returns the CRC-32 check value of seq1 and seq2 concatenated, requiring only crc1, crc2, and - len2. + len2. len2 must be non-negative. */ /* -ZEXTERN uLong ZEXPORT crc32_combine_gen OF((z_off_t len2)); +ZEXTERN uLong ZEXPORT crc32_combine_gen(z_off_t len2); Return the operator corresponding to length len2, to be used with - crc32_combine_op(). + crc32_combine_op(). len2 must be non-negative. */ -ZEXTERN uLong ZEXPORT crc32_combine_op OF((uLong crc1, uLong crc2, uLong op)); +ZEXTERN uLong ZEXPORT crc32_combine_op(uLong crc1, uLong crc2, uLong op); /* Give the same result as crc32_combine(), using op in place of len2. op is is generated from len2 by crc32_combine_gen(). This will be faster than @@ -1778,20 +1781,20 @@ ZEXTERN uLong ZEXPORT crc32_combine_op OF((uLong crc1, uLong crc2, uLong op)); /* deflateInit and inflateInit are macros to allow checking the zlib version * and the compiler's view of z_stream: */ -ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level, - const char *version, int stream_size)); -ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm, - const char *version, int stream_size)); -ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int level, int method, - int windowBits, int memLevel, - int strategy, const char *version, - int stream_size)); -ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits, - const char *version, int stream_size)); -ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits, - unsigned char FAR *window, - const char *version, - int stream_size)); +ZEXTERN int ZEXPORT deflateInit_(z_streamp strm, int level, + const char *version, int stream_size); +ZEXTERN int ZEXPORT inflateInit_(z_streamp strm, + const char *version, int stream_size); +ZEXTERN int ZEXPORT deflateInit2_(z_streamp strm, int level, int method, + int windowBits, int memLevel, + int strategy, const char *version, + int stream_size); +ZEXTERN int ZEXPORT inflateInit2_(z_streamp strm, int windowBits, + const char *version, int stream_size); +ZEXTERN int ZEXPORT inflateBackInit_(z_streamp strm, int windowBits, + unsigned char FAR *window, + const char *version, + int stream_size); #ifdef Z_PREFIX_SET # define z_deflateInit(strm, level) \ deflateInit_((strm), (level), ZLIB_VERSION, (int)sizeof(z_stream)) @@ -1836,7 +1839,7 @@ struct gzFile_s { unsigned char *next; z_off64_t pos; }; -ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */ +ZEXTERN int ZEXPORT gzgetc_(gzFile file); /* backward compatibility */ #ifdef Z_PREFIX_SET # undef z_gzgetc # define z_gzgetc(g) \ @@ -1853,13 +1856,13 @@ ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */ * without large file support, _LFS64_LARGEFILE must also be true */ #ifdef Z_LARGE64 - ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *)); - ZEXTERN z_off64_t ZEXPORT gzseek64 OF((gzFile, z_off64_t, int)); - ZEXTERN z_off64_t ZEXPORT gztell64 OF((gzFile)); - ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile)); - ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off64_t)); - ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off64_t)); - ZEXTERN uLong ZEXPORT crc32_combine_gen64 OF((z_off64_t)); + ZEXTERN gzFile ZEXPORT gzopen64(const char *, const char *); + ZEXTERN z_off64_t ZEXPORT gzseek64(gzFile, z_off64_t, int); + ZEXTERN z_off64_t ZEXPORT gztell64(gzFile); + ZEXTERN z_off64_t ZEXPORT gzoffset64(gzFile); + ZEXTERN uLong ZEXPORT adler32_combine64(uLong, uLong, z_off64_t); + ZEXTERN uLong ZEXPORT crc32_combine64(uLong, uLong, z_off64_t); + ZEXTERN uLong ZEXPORT crc32_combine_gen64(z_off64_t); #endif #if !defined(ZLIB_INTERNAL) && defined(Z_WANT64) @@ -1881,50 +1884,50 @@ ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */ # define crc32_combine_gen crc32_combine_gen64 # endif # ifndef Z_LARGE64 - ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *)); - ZEXTERN z_off_t ZEXPORT gzseek64 OF((gzFile, z_off_t, int)); - ZEXTERN z_off_t ZEXPORT gztell64 OF((gzFile)); - ZEXTERN z_off_t ZEXPORT gzoffset64 OF((gzFile)); - ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t)); - ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t)); - ZEXTERN uLong ZEXPORT crc32_combine_gen64 OF((z_off_t)); + ZEXTERN gzFile ZEXPORT gzopen64(const char *, const char *); + ZEXTERN z_off_t ZEXPORT gzseek64(gzFile, z_off_t, int); + ZEXTERN z_off_t ZEXPORT gztell64(gzFile); + ZEXTERN z_off_t ZEXPORT gzoffset64(gzFile); + ZEXTERN uLong ZEXPORT adler32_combine64(uLong, uLong, z_off_t); + ZEXTERN uLong ZEXPORT crc32_combine64(uLong, uLong, z_off_t); + ZEXTERN uLong ZEXPORT crc32_combine_gen64(z_off_t); # endif #else - ZEXTERN gzFile ZEXPORT gzopen OF((const char *, const char *)); - ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile, z_off_t, int)); - ZEXTERN z_off_t ZEXPORT gztell OF((gzFile)); - ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile)); - ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t)); - ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t)); - ZEXTERN uLong ZEXPORT crc32_combine_gen OF((z_off_t)); + ZEXTERN gzFile ZEXPORT gzopen(const char *, const char *); + ZEXTERN z_off_t ZEXPORT gzseek(gzFile, z_off_t, int); + ZEXTERN z_off_t ZEXPORT gztell(gzFile); + ZEXTERN z_off_t ZEXPORT gzoffset(gzFile); + ZEXTERN uLong ZEXPORT adler32_combine(uLong, uLong, z_off_t); + ZEXTERN uLong ZEXPORT crc32_combine(uLong, uLong, z_off_t); + ZEXTERN uLong ZEXPORT crc32_combine_gen(z_off_t); #endif #else /* Z_SOLO */ - ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t)); - ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t)); - ZEXTERN uLong ZEXPORT crc32_combine_gen OF((z_off_t)); + ZEXTERN uLong ZEXPORT adler32_combine(uLong, uLong, z_off_t); + ZEXTERN uLong ZEXPORT crc32_combine(uLong, uLong, z_off_t); + ZEXTERN uLong ZEXPORT crc32_combine_gen(z_off_t); #endif /* !Z_SOLO */ /* undocumented functions */ -ZEXTERN const char * ZEXPORT zError OF((int)); -ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp)); -ZEXTERN const z_crc_t FAR * ZEXPORT get_crc_table OF((void)); -ZEXTERN int ZEXPORT inflateUndermine OF((z_streamp, int)); -ZEXTERN int ZEXPORT inflateValidate OF((z_streamp, int)); -ZEXTERN unsigned long ZEXPORT inflateCodesUsed OF((z_streamp)); -ZEXTERN int ZEXPORT inflateResetKeep OF((z_streamp)); -ZEXTERN int ZEXPORT deflateResetKeep OF((z_streamp)); +ZEXTERN const char * ZEXPORT zError(int); +ZEXTERN int ZEXPORT inflateSyncPoint(z_streamp); +ZEXTERN const z_crc_t FAR * ZEXPORT get_crc_table(void); +ZEXTERN int ZEXPORT inflateUndermine(z_streamp, int); +ZEXTERN int ZEXPORT inflateValidate(z_streamp, int); +ZEXTERN unsigned long ZEXPORT inflateCodesUsed(z_streamp); +ZEXTERN int ZEXPORT inflateResetKeep(z_streamp); +ZEXTERN int ZEXPORT deflateResetKeep(z_streamp); #if defined(_WIN32) && !defined(Z_SOLO) -ZEXTERN gzFile ZEXPORT gzopen_w OF((const wchar_t *path, - const char *mode)); +ZEXTERN gzFile ZEXPORT gzopen_w(const wchar_t *path, + const char *mode); #endif #if defined(STDC) || defined(Z_HAVE_STDARG_H) # ifndef Z_SOLO -ZEXTERN int ZEXPORTVA gzvprintf Z_ARG((gzFile file, - const char *format, - va_list va)); +ZEXTERN int ZEXPORTVA gzvprintf(gzFile file, + const char *format, + va_list va); # endif #endif diff --git a/src/PureLib/pure/zlib/zlib.map b/src/PureLib/pure/zlib/zlib.map index b330b606fe..31544f2e93 100644 --- a/src/PureLib/pure/zlib/zlib.map +++ b/src/PureLib/pure/zlib/zlib.map @@ -1,100 +1,100 @@ -ZLIB_1.2.0 { - global: - compressBound; - deflateBound; - inflateBack; - inflateBackEnd; - inflateBackInit_; - inflateCopy; - local: - deflate_copyright; - inflate_copyright; - inflate_fast; - inflate_table; - zcalloc; - zcfree; - z_errmsg; - gz_error; - gz_intmax; - _*; -}; - -ZLIB_1.2.0.2 { - gzclearerr; - gzungetc; - zlibCompileFlags; -} ZLIB_1.2.0; - -ZLIB_1.2.0.8 { - deflatePrime; -} ZLIB_1.2.0.2; - -ZLIB_1.2.2 { - adler32_combine; - crc32_combine; - deflateSetHeader; - inflateGetHeader; -} ZLIB_1.2.0.8; - -ZLIB_1.2.2.3 { - deflateTune; - gzdirect; -} ZLIB_1.2.2; - -ZLIB_1.2.2.4 { - inflatePrime; -} ZLIB_1.2.2.3; - -ZLIB_1.2.3.3 { - adler32_combine64; - crc32_combine64; - gzopen64; - gzseek64; - gztell64; - inflateUndermine; -} ZLIB_1.2.2.4; - -ZLIB_1.2.3.4 { - inflateReset2; - inflateMark; -} ZLIB_1.2.3.3; - -ZLIB_1.2.3.5 { - gzbuffer; - gzoffset; - gzoffset64; - gzclose_r; - gzclose_w; -} ZLIB_1.2.3.4; - -ZLIB_1.2.5.1 { - deflatePending; -} ZLIB_1.2.3.5; - -ZLIB_1.2.5.2 { - deflateResetKeep; - gzgetc_; - inflateResetKeep; -} ZLIB_1.2.5.1; - -ZLIB_1.2.7.1 { - inflateGetDictionary; - gzvprintf; -} ZLIB_1.2.5.2; - -ZLIB_1.2.9 { - inflateCodesUsed; - inflateValidate; - uncompress2; - gzfread; - gzfwrite; - deflateGetDictionary; - adler32_z; - crc32_z; -} ZLIB_1.2.7.1; - -ZLIB_1.2.12 { - crc32_combine_gen; - crc32_combine_gen64; - crc32_combine_op; -} ZLIB_1.2.9; +ZLIB_1.2.0 { + global: + compressBound; + deflateBound; + inflateBack; + inflateBackEnd; + inflateBackInit_; + inflateCopy; + local: + deflate_copyright; + inflate_copyright; + inflate_fast; + inflate_table; + zcalloc; + zcfree; + z_errmsg; + gz_error; + gz_intmax; + _*; +}; + +ZLIB_1.2.0.2 { + gzclearerr; + gzungetc; + zlibCompileFlags; +} ZLIB_1.2.0; + +ZLIB_1.2.0.8 { + deflatePrime; +} ZLIB_1.2.0.2; + +ZLIB_1.2.2 { + adler32_combine; + crc32_combine; + deflateSetHeader; + inflateGetHeader; +} ZLIB_1.2.0.8; + +ZLIB_1.2.2.3 { + deflateTune; + gzdirect; +} ZLIB_1.2.2; + +ZLIB_1.2.2.4 { + inflatePrime; +} ZLIB_1.2.2.3; + +ZLIB_1.2.3.3 { + adler32_combine64; + crc32_combine64; + gzopen64; + gzseek64; + gztell64; + inflateUndermine; +} ZLIB_1.2.2.4; + +ZLIB_1.2.3.4 { + inflateReset2; + inflateMark; +} ZLIB_1.2.3.3; + +ZLIB_1.2.3.5 { + gzbuffer; + gzoffset; + gzoffset64; + gzclose_r; + gzclose_w; +} ZLIB_1.2.3.4; + +ZLIB_1.2.5.1 { + deflatePending; +} ZLIB_1.2.3.5; + +ZLIB_1.2.5.2 { + deflateResetKeep; + gzgetc_; + inflateResetKeep; +} ZLIB_1.2.5.1; + +ZLIB_1.2.7.1 { + inflateGetDictionary; + gzvprintf; +} ZLIB_1.2.5.2; + +ZLIB_1.2.9 { + inflateCodesUsed; + inflateValidate; + uncompress2; + gzfread; + gzfwrite; + deflateGetDictionary; + adler32_z; + crc32_z; +} ZLIB_1.2.7.1; + +ZLIB_1.2.12 { + crc32_combine_gen; + crc32_combine_gen64; + crc32_combine_op; +} ZLIB_1.2.9; diff --git a/src/PureLib/pure/zlib/zlib2ansi b/src/PureLib/pure/zlib/zlib2ansi deleted file mode 100755 index 23b2a1d5a3..0000000000 --- a/src/PureLib/pure/zlib/zlib2ansi +++ /dev/null @@ -1,152 +0,0 @@ -#!/usr/bin/perl - -# Transform K&R C function definitions into ANSI equivalent. -# -# Author: Paul Marquess -# Version: 1.0 -# Date: 3 October 2006 - -# TODO -# -# Assumes no function pointer parameters. unless they are typedefed. -# Assumes no literal strings that look like function definitions -# Assumes functions start at the beginning of a line - -use strict; -use warnings; - -local $/; -$_ = <>; - -my $sp = qr{ \s* (?: /\* .*? \*/ )? \s* }x; # assume no nested comments - -my $d1 = qr{ $sp (?: [\w\*\s]+ $sp)* $sp \w+ $sp [\[\]\s]* $sp }x ; -my $decl = qr{ $sp (?: \w+ $sp )+ $d1 }xo ; -my $dList = qr{ $sp $decl (?: $sp , $d1 )* $sp ; $sp }xo ; - - -while (s/^ - ( # Start $1 - ( # Start $2 - .*? # Minimal eat content - ( ^ \w [\w\s\*]+ ) # $3 -- function name - \s* # optional whitespace - ) # $2 - Matched up to before parameter list - - \( \s* # Literal "(" + optional whitespace - ( [^\)]+ ) # $4 - one or more anythings except ")" - \s* \) # optional whitespace surrounding a Literal ")" - - ( (?: $dList )+ ) # $5 - - $sp ^ { # literal "{" at start of line - ) # Remember to $1 - //xsom - ) -{ - my $all = $1 ; - my $prefix = $2; - my $param_list = $4 ; - my $params = $5; - - StripComments($params); - StripComments($param_list); - $param_list =~ s/^\s+//; - $param_list =~ s/\s+$//; - - my $i = 0 ; - my %pList = map { $_ => $i++ } - split /\s*,\s*/, $param_list; - my $pMatch = '(\b' . join('|', keys %pList) . '\b)\W*$' ; - - my @params = split /\s*;\s*/, $params; - my @outParams = (); - foreach my $p (@params) - { - if ($p =~ /,/) - { - my @bits = split /\s*,\s*/, $p; - my $first = shift @bits; - $first =~ s/^\s*//; - push @outParams, $first; - $first =~ /^(\w+\s*)/; - my $type = $1 ; - push @outParams, map { $type . $_ } @bits; - } - else - { - $p =~ s/^\s+//; - push @outParams, $p; - } - } - - - my %tmp = map { /$pMatch/; $_ => $pList{$1} } - @outParams ; - - @outParams = map { " $_" } - sort { $tmp{$a} <=> $tmp{$b} } - @outParams ; - - print $prefix ; - print "(\n" . join(",\n", @outParams) . ")\n"; - print "{" ; - -} - -# Output any trailing code. -print ; -exit 0; - - -sub StripComments -{ - - no warnings; - - # Strip C & C++ comments - # From the perlfaq - $_[0] =~ - - s{ - /\* ## Start of /* ... */ comment - [^*]*\*+ ## Non-* followed by 1-or-more *'s - ( - [^/*][^*]*\*+ - )* ## 0-or-more things which don't start with / - ## but do end with '*' - / ## End of /* ... */ comment - - | ## OR C++ Comment - // ## Start of C++ comment // - [^\n]* ## followed by 0-or-more non end of line characters - - | ## OR various things which aren't comments: - - ( - " ## Start of " ... " string - ( - \\. ## Escaped char - | ## OR - [^"\\] ## Non "\ - )* - " ## End of " ... " string - - | ## OR - - ' ## Start of ' ... ' string - ( - \\. ## Escaped char - | ## OR - [^'\\] ## Non '\ - )* - ' ## End of ' ... ' string - - | ## OR - - . ## Anything other char - [^/"'\\]* ## Chars which doesn't start a comment, string or escape - ) - }{$2}gxs; - -} diff --git a/src/PureLib/pure/zlib/zutil.c b/src/PureLib/pure/zlib/zutil.c index 9543ae825e..b1c5d2d3c6 100644 --- a/src/PureLib/pure/zlib/zutil.c +++ b/src/PureLib/pure/zlib/zutil.c @@ -24,13 +24,11 @@ z_const char * const z_errmsg[10] = { }; -const char * ZEXPORT zlibVersion() -{ +const char * ZEXPORT zlibVersion(void) { return ZLIB_VERSION; } -uLong ZEXPORT zlibCompileFlags() -{ +uLong ZEXPORT zlibCompileFlags(void) { uLong flags; flags = 0; @@ -121,9 +119,7 @@ uLong ZEXPORT zlibCompileFlags() # endif int ZLIB_INTERNAL z_verbose = verbose; -void ZLIB_INTERNAL z_error(m) - char *m; -{ +void ZLIB_INTERNAL z_error(char *m) { fprintf(stderr, "%s\n", m); exit(1); } @@ -132,9 +128,7 @@ void ZLIB_INTERNAL z_error(m) /* exported to allow conversion of error code to string for compress() and * uncompress() */ -const char * ZEXPORT zError(err) - int err; -{ +const char * ZEXPORT zError(int err) { return ERR_MSG(err); } @@ -148,22 +142,14 @@ const char * ZEXPORT zError(err) #ifndef HAVE_MEMCPY -void ZLIB_INTERNAL zmemcpy(dest, source, len) - Bytef* dest; - const Bytef* source; - uInt len; -{ +void ZLIB_INTERNAL zmemcpy(Bytef* dest, const Bytef* source, uInt len) { if (len == 0) return; do { *dest++ = *source++; /* ??? to be unrolled */ } while (--len != 0); } -int ZLIB_INTERNAL zmemcmp(s1, s2, len) - const Bytef* s1; - const Bytef* s2; - uInt len; -{ +int ZLIB_INTERNAL zmemcmp(const Bytef* s1, const Bytef* s2, uInt len) { uInt j; for (j = 0; j < len; j++) { @@ -172,10 +158,7 @@ int ZLIB_INTERNAL zmemcmp(s1, s2, len) return 0; } -void ZLIB_INTERNAL zmemzero(dest, len) - Bytef* dest; - uInt len; -{ +void ZLIB_INTERNAL zmemzero(Bytef* dest, uInt len) { if (len == 0) return; do { *dest++ = 0; /* ??? to be unrolled */ @@ -216,8 +199,7 @@ local ptr_table table[MAX_PTR]; * a protected system like OS/2. Use Microsoft C instead. */ -voidpf ZLIB_INTERNAL zcalloc(voidpf opaque, unsigned items, unsigned size) -{ +voidpf ZLIB_INTERNAL zcalloc(voidpf opaque, unsigned items, unsigned size) { voidpf buf; ulg bsize = (ulg)items*size; @@ -242,8 +224,7 @@ voidpf ZLIB_INTERNAL zcalloc(voidpf opaque, unsigned items, unsigned size) return buf; } -void ZLIB_INTERNAL zcfree(voidpf opaque, voidpf ptr) -{ +void ZLIB_INTERNAL zcfree(voidpf opaque, voidpf ptr) { int n; (void)opaque; @@ -279,14 +260,12 @@ void ZLIB_INTERNAL zcfree(voidpf opaque, voidpf ptr) # define _hfree hfree #endif -voidpf ZLIB_INTERNAL zcalloc(voidpf opaque, uInt items, uInt size) -{ +voidpf ZLIB_INTERNAL zcalloc(voidpf opaque, uInt items, uInt size) { (void)opaque; return _halloc((long)items, size); } -void ZLIB_INTERNAL zcfree(voidpf opaque, voidpf ptr) -{ +void ZLIB_INTERNAL zcfree(voidpf opaque, voidpf ptr) { (void)opaque; _hfree(ptr); } @@ -299,25 +278,18 @@ void ZLIB_INTERNAL zcfree(voidpf opaque, voidpf ptr) #ifndef MY_ZCALLOC /* Any system without a special alloc function */ #ifndef STDC -extern voidp malloc OF((uInt size)); -extern voidp calloc OF((uInt items, uInt size)); -extern void free OF((voidpf ptr)); +extern voidp malloc(uInt size); +extern voidp calloc(uInt items, uInt size); +extern void free(voidpf ptr); #endif -voidpf ZLIB_INTERNAL zcalloc(opaque, items, size) - voidpf opaque; - unsigned items; - unsigned size; -{ +voidpf ZLIB_INTERNAL zcalloc(voidpf opaque, unsigned items, unsigned size) { (void)opaque; return sizeof(uInt) > 2 ? (voidpf)malloc(items * size) : (voidpf)calloc(items, size); } -void ZLIB_INTERNAL zcfree(opaque, ptr) - voidpf opaque; - voidpf ptr; -{ +void ZLIB_INTERNAL zcfree(voidpf opaque, voidpf ptr) { (void)opaque; free(ptr); } diff --git a/src/PureLib/pure/zlib/zutil.h b/src/PureLib/pure/zlib/zutil.h index 0bc7f4ecd1..48dd7febae 100644 --- a/src/PureLib/pure/zlib/zutil.h +++ b/src/PureLib/pure/zlib/zutil.h @@ -1,5 +1,5 @@ /* zutil.h -- internal interface and configuration of the compression library - * Copyright (C) 1995-2022 Jean-loup Gailly, Mark Adler + * Copyright (C) 1995-2024 Jean-loup Gailly, Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -56,7 +56,7 @@ typedef unsigned long ulg; extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ /* (size given to avoid silly warnings with Visual C++) */ -#define ERR_MSG(err) z_errmsg[Z_NEED_DICT-(err)] +#define ERR_MSG(err) z_errmsg[(err) < -6 || (err) > 2 ? 9 : 2 - (err)] #define ERR_RETURN(strm,err) \ return (strm->msg = ERR_MSG(err), (err)) @@ -137,17 +137,8 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ # endif #endif -#if defined(MACOS) || defined(TARGET_OS_MAC) +#if defined(MACOS) # define OS_CODE 7 -# ifndef Z_SOLO -# if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os -# include /* for fdopen */ -# else -# ifndef fdopen -# define fdopen(fd,mode) NULL /* No fdopen() */ -# endif -# endif -# endif #endif #ifdef __acorn @@ -170,18 +161,6 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ # define OS_CODE 19 #endif -#if defined(_BEOS_) || defined(RISCOS) -# define fdopen(fd,mode) NULL /* No fdopen() */ -#endif - -#if (defined(_MSC_VER) && (_MSC_VER > 600)) && !defined __INTERIX -# if defined(_WIN32_WCE) -# define fdopen(fd,mode) NULL /* No fdopen() */ -# else -# define fdopen(fd,type) _fdopen(fd,type) -# endif -#endif - #if defined(__BORLANDC__) && !defined(MSDOS) #pragma warn -8004 #pragma warn -8008 @@ -191,9 +170,9 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ /* provide prototypes for these when building zlib without LFS */ #if !defined(_WIN32) && \ (!defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0) - ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t)); - ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t)); - ZEXTERN uLong ZEXPORT crc32_combine_gen64 OF((z_off_t)); + ZEXTERN uLong ZEXPORT adler32_combine64(uLong, uLong, z_off_t); + ZEXTERN uLong ZEXPORT crc32_combine64(uLong, uLong, z_off_t); + ZEXTERN uLong ZEXPORT crc32_combine_gen64(z_off_t); #endif /* common defaults */ @@ -232,16 +211,16 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ # define zmemzero(dest, len) memset(dest, 0, len) # endif #else - void ZLIB_INTERNAL zmemcpy OF((Bytef* dest, const Bytef* source, uInt len)); - int ZLIB_INTERNAL zmemcmp OF((const Bytef* s1, const Bytef* s2, uInt len)); - void ZLIB_INTERNAL zmemzero OF((Bytef* dest, uInt len)); + void ZLIB_INTERNAL zmemcpy(Bytef* dest, const Bytef* source, uInt len); + int ZLIB_INTERNAL zmemcmp(const Bytef* s1, const Bytef* s2, uInt len); + void ZLIB_INTERNAL zmemzero(Bytef* dest, uInt len); #endif /* Diagnostic functions */ #ifdef ZLIB_DEBUG # include extern int ZLIB_INTERNAL z_verbose; - extern void ZLIB_INTERNAL z_error OF((char *m)); + extern void ZLIB_INTERNAL z_error(char *m); # define Assert(cond,msg) {if(!(cond)) z_error(msg);} # define Trace(x) {if (z_verbose>=0) fprintf x ;} # define Tracev(x) {if (z_verbose>0) fprintf x ;} @@ -258,9 +237,9 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ #endif #ifndef Z_SOLO - voidpf ZLIB_INTERNAL zcalloc OF((voidpf opaque, unsigned items, - unsigned size)); - void ZLIB_INTERNAL zcfree OF((voidpf opaque, voidpf ptr)); + voidpf ZLIB_INTERNAL zcalloc(voidpf opaque, unsigned items, + unsigned size); + void ZLIB_INTERNAL zcfree(voidpf opaque, voidpf ptr); #endif #define ZALLOC(strm, items, size) \ diff --git a/src/PureLib/readme.md b/src/PureLib/readme.md index b3d8af7b45..286fcd1305 100644 --- a/src/PureLib/readme.md +++ b/src/PureLib/readme.md @@ -12,4 +12,15 @@ The PureLib.vcxproj and PureLib.vcxproj.filters are created to make pure code co 1. VS Create project from existing code wizard to point to PureLib directory. Use static library template. 2. Removed code not needed by WinGet project. Basically keeping only files under src and include. 3. Modify the created vcxproj file to follow settings from other project files in the WinGet solution. -4. Configure the additional include path to include the pure directory. \ No newline at end of file +4. Configure the additional include path to include the pure directory. + +## zlib +Original source: https://github.com/madler/zlib +Current commit: [Commit 51b7f2abdade71cd9bb0e7a373ef2610ec6f9daf](https://github.com/madler/zlib/commit/51b7f2abdade71cd9bb0e7a373ef2610ec6f9daf) + +Pure utilizes `zlib` for scanning zip files. To update this library, run the following command, then update the above commit for reference. 'develop' can be replaced with the appropriate commit spec as desired. + +``` + git subtree pull -P src/PureLib/pure/zlib https://github.com/madler/zlib develop --squash +``` +> **When committing the PR, DO NOT squash it. The two commits are needed as is to allow for future subtree pulls.**
\ No newline at end of file diff --git a/src/SfsClient/readme.md b/src/SfsClient/readme.md index caf768187a..382a316136 100644 --- a/src/SfsClient/readme.md +++ b/src/SfsClient/readme.md @@ -1,9 +1,9 @@ ## SfsClient -Do not change code under the sfs-client directory; it contains sfs-client source code from commit [ff315ec](https://github.com/microsoft/sfs-client/commits/ff315ec). +Do not change code under the sfs-client directory; it contains sfs-client source code from commit [be733af](https://github.com/microsoft/sfs-client/commits/be733af). It is created using git subtree command: ``` - git subtree add --prefix=src/SfsClient/sfs-client https://github.com/microsoft/sfs-client.git cf18b357f43aa9bbaba7d8b3b3774b39140aa00f --squash + git subtree add --prefix=src/SfsClient/sfs-client https://github.com/microsoft/sfs-client.git be733af9e5c8e9227f2018ff618800bf08a31180 --squash ``` ### Update diff --git a/src/SfsClient/sfs-client/.github/dependabot.yml b/src/SfsClient/sfs-client/.github/dependabot.yml index 8e742a7932..c64b5ab54b 100644 --- a/src/SfsClient/sfs-client/.github/dependabot.yml +++ b/src/SfsClient/sfs-client/.github/dependabot.yml @@ -17,3 +17,7 @@ updates: directory: "/" schedule: interval: "weekly" + ignore: + # Ignore patch updates for all pip dependencies + - dependency-name: "*" + update-types: ["version-update:semver-patch"] diff --git a/src/SfsClient/sfs-client/cgmanifest.json b/src/SfsClient/sfs-client/cgmanifest.json index 24cd480b66..e138025729 100644 --- a/src/SfsClient/sfs-client/cgmanifest.json +++ b/src/SfsClient/sfs-client/cgmanifest.json @@ -37,7 +37,7 @@ "type": "git", "git": { "repositoryUrl": "https://github.com/curl/curl", - "commitHash": "d755a5f7c009dd63a61b2c745180d8ba937cbfeb" + "commitHash": "83bedbd730d62b83744cc26fa0433d3f6e2e4cd6" } }, "developmentDependency": false @@ -56,7 +56,7 @@ "type": "git", "git": { "repositoryUrl": "https://github.com/curl/curl", - "commitHash": "d755a5f7c009dd63a61b2c745180d8ba937cbfeb" + "commitHash": "83bedbd730d62b83744cc26fa0433d3f6e2e4cd6" } } ] @@ -75,7 +75,7 @@ "type": "git", "git": { "repositoryUrl": "https://github.com/curl/curl", - "commitHash": "d755a5f7c009dd63a61b2c745180d8ba937cbfeb" + "commitHash": "83bedbd730d62b83744cc26fa0433d3f6e2e4cd6" } } ] diff --git a/src/SfsClient/sfs-client/client/tests/functional/details/CurlConnectionTests.cpp b/src/SfsClient/sfs-client/client/tests/functional/details/CurlConnectionTests.cpp index c835fc8b13..1d8a21ad68 100644 --- a/src/SfsClient/sfs-client/client/tests/functional/details/CurlConnectionTests.cpp +++ b/src/SfsClient/sfs-client/client/tests/functional/details/CurlConnectionTests.cpp @@ -45,15 +45,15 @@ class CurlConnectionTimeout : public CurlConnection std::string Get(const std::string& url) override { - // Timeout within 100ms - curl_easy_setopt(m_handle, CURLOPT_TIMEOUT_MS, 100L); + // Timeout within 1ms + curl_easy_setopt(m_handle, CURLOPT_TIMEOUT_MS, 1L); return CurlConnection::Get(url); } std::string Post(const std::string& url, const std::string& data) override { - // Timeout within 100ms - curl_easy_setopt(m_handle, CURLOPT_TIMEOUT_MS, 100L); + // Timeout within 1ms + curl_easy_setopt(m_handle, CURLOPT_TIMEOUT_MS, 1L); return CurlConnection::Post(url, data); } }; @@ -316,11 +316,11 @@ TEST("Testing a response over the limit fails the operation") json body = {{{"TargetingAttributes", {}}, {"Product", largeProductName}}}; REQUIRE_NOTHROW(connection->Post(url, body.dump())); - // Over limit fails + // Going over the limit fails with a message like "client returned ERROR on write of 16384 bytes" body[0]["Product"] = overLimitProductName; - REQUIRE_THROWS_CODE_MSG(connection->Post(url, body.dump()), - ConnectionUnexpectedError, - "Failure writing output to destination"); + REQUIRE_THROWS_CODE_MSG_MATCHES(connection->Post(url, body.dump()), + ConnectionUnexpectedError, + Catch::Matchers::ContainsSubstring("client returned ERROR on write of")); } TEST("Testing MS-CV is sent to server") diff --git a/src/SfsClient/sfs-client/client/tests/util/TestHelper.cpp b/src/SfsClient/sfs-client/client/tests/util/TestHelper.cpp index c676f6485e..d569796323 100644 --- a/src/SfsClient/sfs-client/client/tests/util/TestHelper.cpp +++ b/src/SfsClient/sfs-client/client/tests/util/TestHelper.cpp @@ -43,7 +43,7 @@ std::string TimestampToString(std::chrono::time_point void SFS::test::LogCallbackToTest(const SFS::LogData& logData) { std::lock_guard guard(s_logMutex); - UNSCOPED_INFO("Log: " << TimestampToString(logData.time) << " [" << ToString(logData.severity) << "]" << " " - << std::filesystem::path(logData.file).filename().string() << ":" << logData.line << " " - << logData.message); + UNSCOPED_INFO("Log: " << TimestampToString(logData.time) << " [" << ToString(logData.severity) << "]" + << " " << std::filesystem::path(logData.file).filename().string() << ":" << logData.line + << " " << logData.message); } diff --git a/src/SfsClient/sfs-client/samples/integration-do-client/IntegrationDOClient.cpp b/src/SfsClient/sfs-client/samples/integration-do-client/IntegrationDOClient.cpp index c22f954a82..7fb6ce66ac 100644 --- a/src/SfsClient/sfs-client/samples/integration-do-client/IntegrationDOClient.cpp +++ b/src/SfsClient/sfs-client/samples/integration-do-client/IntegrationDOClient.cpp @@ -171,7 +171,8 @@ std::string TimestampToString(std::chrono::time_point void LoggingCallback(const SFS::LogData& logData) { std::cout << c_darkGreyStart << "Log: " << TimestampToString(logData.time) << " [" << ToString(logData.severity) - << "]" << " " << std::filesystem::path(logData.file).filename().string() << ":" << logData.line << " " + << "]" + << " " << std::filesystem::path(logData.file).filename().string() << ":" << logData.line << " " << logData.message << c_colorEnd << std::endl; } diff --git a/src/SfsClient/sfs-client/samples/tool/SFSClientTool.cpp b/src/SfsClient/sfs-client/samples/tool/SFSClientTool.cpp index 876b4c3e28..b784c94611 100644 --- a/src/SfsClient/sfs-client/samples/tool/SFSClientTool.cpp +++ b/src/SfsClient/sfs-client/samples/tool/SFSClientTool.cpp @@ -5,6 +5,7 @@ #include #include +#include #include #include #include @@ -30,6 +31,7 @@ void DisplayUsage() << "Options:" << std::endl << " -h, --help\t\t\tDisplay this help message" << std::endl << " -v, --version\t\t\tDisplay the library version" << std::endl + << " -o, --outputFile \t\tWhen specified, the JSON output is saved to this file" << std::endl << " --isApp\t\t\tIndicates the specific product is an App" << std::endl << " --instanceId \t\tA custom SFS instance ID" << std::endl << " --namespace \t\tA custom SFS namespace" << std::endl @@ -87,6 +89,12 @@ struct Settings std::string instanceId; std::string nameSpace; std::string customUrl; + std::string outputFile; + + bool ShouldOutputToFile() const + { + return !outputFile.empty(); + } }; void ParseArguments(const std::vector& args, Settings& settings) @@ -126,6 +134,11 @@ void ParseArguments(const std::vector& args, Settings& setting { settings.displayVersion = true; } + else if (matchArg(args[i], "-o", "--outputFile")) + { + validateArg(i, "outputFile", settings.outputFile); + settings.outputFile = args[++i]; + } else if (matchLongArg(args[i], "--isApp")) { settings.isApp = true; @@ -197,16 +210,8 @@ constexpr std::string_view ToString(Architecture type) return ""; } -void DisplayResults(const std::vector& contents) +json ContentsToJson(const std::vector& contents) { - if (contents.empty()) - { - PrintError("No results found"); - return; - } - - PrintLog("Content found:"); - json out = json::array(); for (const auto& content : contents) { @@ -233,7 +238,7 @@ void DisplayResults(const std::vector& contents) out.push_back(j); } - PrintLog(out.dump(2 /*indent*/)); + return out; } json AppFileToJson(const AppFile& file) @@ -265,16 +270,8 @@ json AppFileToJson(const AppFile& file) return fileJson; } -void DisplayResults(const std::vector& contents) +json AppContentsToJson(const std::vector& contents) { - if (contents.empty()) - { - std::cout << "No results found." << std::endl; - return; - } - - PrintLog("Content found:"); - json out = json::array(); for (const auto& content : contents) { @@ -309,7 +306,50 @@ void DisplayResults(const std::vector& contents) out.push_back(j); } - PrintLog(out.dump(2 /*indent*/)); + return out; +} + +void DisplayResults(const json& results) +{ + if (results.empty()) + { + return; + } + + PrintLog("Content found:"); + PrintLog(results.dump(2 /*indent*/)); +} + +Result JSONToFile(const json& results, const std::string& filename) +{ + if (results.empty()) + { + return Result::Unexpected; + } + + const std::filesystem::path filepath = std::filesystem::absolute(filename); + try + { + std::filesystem::create_directories(filepath.parent_path()); + } + catch (const std::exception& e) + { + PrintError("Failed to create parent directories for filepath: " + filepath.string() + ". Error: " + e.what()); + return Result::Unexpected; + } + + std::ofstream file(filepath, std::ios::out | std::ios::trunc); + if (!file.is_open()) + { + PrintError("Failed to open file for writing: " + filename); + return Result::Unexpected; + } + + file << results.dump(2 /*indent*/); + + PrintLog("Content found. Saved to file " + filepath.string()); + + return Result::Success; } void LogResult(const SFS::Result& result) @@ -348,7 +388,8 @@ std::string TimestampToString(std::chrono::time_point void LoggingCallback(const SFS::LogData& logData) { std::cout << c_darkGreyStart << "Log: " << TimestampToString(logData.time) << " [" << ToString(logData.severity) - << "]" << " " << std::filesystem::path(logData.file).filename().string() << ":" << logData.line << " " + << "]" + << " " << std::filesystem::path(logData.file).filename().string() << ":" << logData.line << " " << logData.message << c_colorEnd << std::endl; } @@ -365,11 +406,12 @@ bool SetEnv(const std::string& varName, const std::string& value) #endif } -Result GetLatestDownloadInfo(const SFSClient& sfsClient, const Settings& settings) +Result GetLatestDownloadInfo(const SFSClient& sfsClient, const Settings& settings, json& out) { PrintLog("Getting latest download info for product: " + settings.product); RequestParams params; params.productRequests = {{settings.product, {}}}; + if (settings.isApp) { std::vector appContents; @@ -381,14 +423,12 @@ Result GetLatestDownloadInfo(const SFSClient& sfsClient, const Settings& setting return result.GetCode(); } - // Display results - DisplayResults(appContents); + out = AppContentsToJson(appContents); } else { std::vector contents; auto result = sfsClient.GetLatestDownloadInfo(params, contents); - if (!result) { PrintError("Failed to get latest download info."); @@ -396,8 +436,33 @@ Result GetLatestDownloadInfo(const SFSClient& sfsClient, const Settings& setting return result.GetCode(); } - // Display results + out = ContentsToJson(contents); + } + + if (out.empty()) + { + PrintError("No results found."); + return Result::Unexpected; + } + + return Result::Success; +} + +Result HandleJSONContents(const Settings& settings, const json& contents) +{ + if (settings.ShouldOutputToFile()) + { + auto result = JSONToFile(contents, settings.outputFile); + if (!result) + { + PrintError("Failed to save to file."); + return result.GetCode(); + } + } + else + { DisplayResults(contents); + return Result::Success; } return Result::Success; @@ -464,7 +529,15 @@ int main(int argc, char* argv[]) } // Perform operations using SFSClient - result = GetLatestDownloadInfo(*sfsClient, settings); + json contents; + result = GetLatestDownloadInfo(*sfsClient, settings, contents); + if (!result) + { + LogResult(result); + return result.GetCode(); + } + + result = HandleJSONContents(settings, contents); if (!result) { LogResult(result); diff --git a/src/SfsClient/sfs-client/scripts/pip.requirements.txt b/src/SfsClient/sfs-client/scripts/pip.requirements.txt index 24d7184bf9..377f1e824f 100644 --- a/src/SfsClient/sfs-client/scripts/pip.requirements.txt +++ b/src/SfsClient/sfs-client/scripts/pip.requirements.txt @@ -1,2 +1,2 @@ -clang-format==18.1.4 +clang-format==18.1.5 cmake-format==0.6.13 \ No newline at end of file diff --git a/src/SfsClient/sfs-client/vcpkg.json b/src/SfsClient/sfs-client/vcpkg.json index 40450b89e9..0d6c4d3fc1 100644 --- a/src/SfsClient/sfs-client/vcpkg.json +++ b/src/SfsClient/sfs-client/vcpkg.json @@ -44,7 +44,7 @@ }, { "name": "curl", - "version": "8.4.0" + "version": "8.9.1" }, { "name": "nlohmann-json", diff --git a/src/Valijson/valijson/Doxyfile b/src/Valijson/valijson/Doxyfile index 88996c5b1e..eef5e24989 100644 --- a/src/Valijson/valijson/Doxyfile +++ b/src/Valijson/valijson/Doxyfile @@ -194,7 +194,7 @@ QT_AUTOBRIEF = NO # tag to YES if you prefer the old behavior instead. # # Note that setting this tag to YES also means that rational rose comments are -# not recognized any more. +# not recognized anymore. # The default value is: NO. MULTILINE_CPP_IS_BRIEF = NO diff --git a/src/VcpkgCustomTriplets/arm-release-static.cmake b/src/VcpkgCustomTriplets/arm-release-static.cmake index e6ff71faa4..ae456fa291 100644 --- a/src/VcpkgCustomTriplets/arm-release-static.cmake +++ b/src/VcpkgCustomTriplets/arm-release-static.cmake @@ -1,6 +1,6 @@ set(VCPKG_TARGET_ARCHITECTURE arm) set(VCPKG_CRT_LINKAGE static) set(VCPKG_LIBRARY_LINKAGE static) -set(VCPKG_C_FLAGS "/Qspectre") -set(VCPKG_CXX_FLAGS "/Qspectre") +set(VCPKG_C_FLAGS "/Qspectre /W3") +set(VCPKG_CXX_FLAGS "/Qspectre /W3") set(VCPKG_BUILD_TYPE release) diff --git a/src/VcpkgCustomTriplets/arm-release.cmake b/src/VcpkgCustomTriplets/arm-release.cmake index 5e982fc84a..ebe8ba9b7f 100644 --- a/src/VcpkgCustomTriplets/arm-release.cmake +++ b/src/VcpkgCustomTriplets/arm-release.cmake @@ -1,6 +1,6 @@ set(VCPKG_TARGET_ARCHITECTURE arm) set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) -set(VCPKG_C_FLAGS "/Qspectre") -set(VCPKG_CXX_FLAGS "/Qspectre") +set(VCPKG_C_FLAGS "/Qspectre /W3") +set(VCPKG_CXX_FLAGS "/Qspectre /W3") set(VCPKG_BUILD_TYPE release) diff --git a/src/VcpkgCustomTriplets/arm64-release-static.cmake b/src/VcpkgCustomTriplets/arm64-release-static.cmake index 25249ffbd6..fecb1eacc6 100644 --- a/src/VcpkgCustomTriplets/arm64-release-static.cmake +++ b/src/VcpkgCustomTriplets/arm64-release-static.cmake @@ -1,6 +1,6 @@ set(VCPKG_TARGET_ARCHITECTURE arm64) set(VCPKG_CRT_LINKAGE static) set(VCPKG_LIBRARY_LINKAGE static) -set(VCPKG_C_FLAGS "/Qspectre") -set(VCPKG_CXX_FLAGS "/Qspectre") +set(VCPKG_C_FLAGS "/Qspectre /W3") +set(VCPKG_CXX_FLAGS "/Qspectre /W3") set(VCPKG_BUILD_TYPE release) diff --git a/src/VcpkgCustomTriplets/arm64-release.cmake b/src/VcpkgCustomTriplets/arm64-release.cmake index cfd004ac9b..486e091906 100644 --- a/src/VcpkgCustomTriplets/arm64-release.cmake +++ b/src/VcpkgCustomTriplets/arm64-release.cmake @@ -1,6 +1,6 @@ set(VCPKG_TARGET_ARCHITECTURE arm64) set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) -set(VCPKG_C_FLAGS "/Qspectre") -set(VCPKG_CXX_FLAGS "/Qspectre") +set(VCPKG_C_FLAGS "/Qspectre /W3") +set(VCPKG_CXX_FLAGS "/Qspectre /W3") set(VCPKG_BUILD_TYPE release) diff --git a/src/VcpkgCustomTriplets/x64-release-static.cmake b/src/VcpkgCustomTriplets/x64-release-static.cmake index cb08cc0c70..04020f3f5c 100644 --- a/src/VcpkgCustomTriplets/x64-release-static.cmake +++ b/src/VcpkgCustomTriplets/x64-release-static.cmake @@ -1,6 +1,6 @@ set(VCPKG_TARGET_ARCHITECTURE x64) set(VCPKG_CRT_LINKAGE static) set(VCPKG_LIBRARY_LINKAGE static) -set(VCPKG_C_FLAGS "/Qspectre") -set(VCPKG_CXX_FLAGS "/Qspectre") +set(VCPKG_C_FLAGS "/Qspectre /W3") +set(VCPKG_CXX_FLAGS "/Qspectre /W3") set(VCPKG_BUILD_TYPE release) diff --git a/src/VcpkgCustomTriplets/x64-release.cmake b/src/VcpkgCustomTriplets/x64-release.cmake index c667b50367..d06d53796e 100644 --- a/src/VcpkgCustomTriplets/x64-release.cmake +++ b/src/VcpkgCustomTriplets/x64-release.cmake @@ -1,6 +1,6 @@ set(VCPKG_TARGET_ARCHITECTURE x64) set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) -set(VCPKG_C_FLAGS "/Qspectre") -set(VCPKG_CXX_FLAGS "/Qspectre") +set(VCPKG_C_FLAGS "/Qspectre /W3") +set(VCPKG_CXX_FLAGS "/Qspectre /W3") set(VCPKG_BUILD_TYPE release) diff --git a/src/VcpkgCustomTriplets/x86-release-static.cmake b/src/VcpkgCustomTriplets/x86-release-static.cmake index bd58318abf..64a9f6c67a 100644 --- a/src/VcpkgCustomTriplets/x86-release-static.cmake +++ b/src/VcpkgCustomTriplets/x86-release-static.cmake @@ -1,6 +1,6 @@ set(VCPKG_TARGET_ARCHITECTURE x86) set(VCPKG_CRT_LINKAGE static) set(VCPKG_LIBRARY_LINKAGE static) -set(VCPKG_C_FLAGS "/Qspectre") -set(VCPKG_CXX_FLAGS "/Qspectre") +set(VCPKG_C_FLAGS "/Qspectre /W3") +set(VCPKG_CXX_FLAGS "/Qspectre /W3") set(VCPKG_BUILD_TYPE release) diff --git a/src/VcpkgCustomTriplets/x86-release.cmake b/src/VcpkgCustomTriplets/x86-release.cmake index 5853ba50ec..349dee16b9 100644 --- a/src/VcpkgCustomTriplets/x86-release.cmake +++ b/src/VcpkgCustomTriplets/x86-release.cmake @@ -1,6 +1,6 @@ set(VCPKG_TARGET_ARCHITECTURE x86) set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) -set(VCPKG_C_FLAGS "/Qspectre") -set(VCPKG_CXX_FLAGS "/Qspectre") +set(VCPKG_C_FLAGS "/Qspectre /W3") +set(VCPKG_CXX_FLAGS "/Qspectre /W3") set(VCPKG_BUILD_TYPE release) diff --git a/src/WinGetUtilInterop.UnitTests/TestCollateral/AllEquality.yaml b/src/WinGetUtilInterop.UnitTests/TestCollateral/AllEquality.yaml index 0b4a5cf68f..f7bb552f6b 100644 --- a/src/WinGetUtilInterop.UnitTests/TestCollateral/AllEquality.yaml +++ b/src/WinGetUtilInterop.UnitTests/TestCollateral/AllEquality.yaml @@ -21,7 +21,7 @@ Installers: Language: /en-US Custom: /s - Arch: x64 - Url: https://contosa.net/publiccontainer/contosainstaller64.exe + Url: https://contoso.com/publiccontainer/contosoinstaller64.exe Sha256: 69D84CA8899800A5575CE31798293CD4FEBAB1D734A07C2E51E56A28E0DF8C83 Language: en-US Scope: user \ No newline at end of file diff --git a/src/WinGetUtilInterop.UnitTests/TestCollateral/AllEqualityWithDescription.yaml b/src/WinGetUtilInterop.UnitTests/TestCollateral/AllEqualityWithDescription.yaml index a1dff89c6e..be070b9a0c 100644 --- a/src/WinGetUtilInterop.UnitTests/TestCollateral/AllEqualityWithDescription.yaml +++ b/src/WinGetUtilInterop.UnitTests/TestCollateral/AllEqualityWithDescription.yaml @@ -22,7 +22,7 @@ Installers: Language: /en-US Custom: /s - Arch: x64 - Url: https://contosa.net/publiccontainer/contosainstaller64.exe + Url: https://contoso.com/publiccontainer/contosoinstaller64.exe Sha256: 69D84CA8899800A5575CE31798293CD4FEBAB1D734A07C2E51E56A28E0DF8C83 Language: en-US Scope: user \ No newline at end of file diff --git a/src/WinGetUtilInterop.UnitTests/TestCollateral/DifferentId.yaml b/src/WinGetUtilInterop.UnitTests/TestCollateral/DifferentId.yaml index 72314bbc06..8194a6265c 100644 --- a/src/WinGetUtilInterop.UnitTests/TestCollateral/DifferentId.yaml +++ b/src/WinGetUtilInterop.UnitTests/TestCollateral/DifferentId.yaml @@ -21,7 +21,7 @@ Installers: Language: /en-US Custom: /s - Arch: x64 - Url: https://contosa.net/publiccontainer/contosainstaller64.exe + Url: https://contoso.com/publiccontainer/contosoinstaller64.exe Sha256: 69D84CA8899800A5575CE31798293CD4FEBAB1D734A07C2E51E56A28E0DF8C83 Language: en-US Scope: user \ No newline at end of file diff --git a/src/WinGetUtilInterop.UnitTests/TestCollateral/OneInstaller.yaml b/src/WinGetUtilInterop.UnitTests/TestCollateral/OneInstaller.yaml index ea7f57f581..d5244dad00 100644 --- a/src/WinGetUtilInterop.UnitTests/TestCollateral/OneInstaller.yaml +++ b/src/WinGetUtilInterop.UnitTests/TestCollateral/OneInstaller.yaml @@ -12,7 +12,7 @@ Switches: InstallLocation: /d= Installers: - Arch: x64 - Url: https://contosa.net/publiccontainer/contosainstaller64.exe + Url: https://contoso.com/publiccontainer/contosoinstaller64.exe Sha256: 69D84CA8899800A5575CE31798293CD4FEBAB1D734A07C2E51E56A28E0DF8C83 Language: en-US Scope: user \ No newline at end of file diff --git a/src/WinGetUtilInterop.UnitTests/TestCollateral/SomeEquality.yaml b/src/WinGetUtilInterop.UnitTests/TestCollateral/SomeEquality.yaml index b4bcd34ae0..752c54c756 100644 --- a/src/WinGetUtilInterop.UnitTests/TestCollateral/SomeEquality.yaml +++ b/src/WinGetUtilInterop.UnitTests/TestCollateral/SomeEquality.yaml @@ -8,5 +8,5 @@ Installers: Sha256: 69D84CA8899800A5575CE31798293CD4FEBAB1D734A07C2E51E56A28E0DF8C82 SignatureSha256: 69D84CA8899800A5575CE31798293CD4FEBAB1D734A07C2E51E56A28E0DF8C82 - Arch: x64 - Url: https://contosa.net/publiccontainer/contosainstaller64.exe + Url: https://contoso.com/publiccontainer/contosoinstaller64.exe Sha256: 69D84CA8899800A5575CE31798293CD4FEBAB1D734A07C2E51E56A28E0DF8C83 \ No newline at end of file diff --git a/src/WinGetUtilInterop.UnitTests/TestCollateral/SomeEqualityWithLocalization.yaml b/src/WinGetUtilInterop.UnitTests/TestCollateral/SomeEqualityWithLocalization.yaml index d7cd64cc15..c2a7ab6405 100644 --- a/src/WinGetUtilInterop.UnitTests/TestCollateral/SomeEqualityWithLocalization.yaml +++ b/src/WinGetUtilInterop.UnitTests/TestCollateral/SomeEqualityWithLocalization.yaml @@ -8,7 +8,7 @@ Installers: Sha256: 69D84CA8899800A5575CE31798293CD4FEBAB1D734A07C2E51E56A28E0DF8C82 SignatureSha256: 69D84CA8899800A5575CE31798293CD4FEBAB1D734A07C2E51E56A28E0DF8C82 - Arch: x64 - Url: https://contosa.net/publiccontainer/contosainstaller64.exe + Url: https://contoso.com/publiccontainer/contosoinstaller64.exe Sha256: 69D84CA8899800A5575CE31798293CD4FEBAB1D734A07C2E51E56A28E0DF8C83 Localization: - Language: es-MX diff --git a/src/WinGetUtilInterop.UnitTests/TestCollateral/SomeEqualityWithoutSwitches.yaml b/src/WinGetUtilInterop.UnitTests/TestCollateral/SomeEqualityWithoutSwitches.yaml index 883df59dd3..8dd9970705 100644 --- a/src/WinGetUtilInterop.UnitTests/TestCollateral/SomeEqualityWithoutSwitches.yaml +++ b/src/WinGetUtilInterop.UnitTests/TestCollateral/SomeEqualityWithoutSwitches.yaml @@ -5,5 +5,5 @@ Installers: Sha256: 69D84CA8899800A5575CE31798293CD4FEBAB1D734A07C2E51E56A28E0DF8C82 SignatureSha256: 69D84CA8899800A5575CE31798293CD4FEBAB1D734A07C2E51E56A28E0DF8C82 - Arch: x64 - Url: https://contosa.net/publiccontainer/contosainstaller64.exe + Url: https://contoso.com/publiccontainer/contosoinstaller64.exe Sha256: 69D84CA8899800A5575CE31798293CD4FEBAB1D734A07C2E51E56A28E0DF8C83 diff --git a/src/WinGetYamlFuzzing/OneFuzzConfig.json b/src/WinGetYamlFuzzing/OneFuzzConfig.json index 7394bafda8..23a0c10212 100644 --- a/src/WinGetYamlFuzzing/OneFuzzConfig.json +++ b/src/WinGetYamlFuzzing/OneFuzzConfig.json @@ -24,7 +24,7 @@ "Org": "microsoft", "Project": "OS", "AssignedTo": "ryfu@microsoft.com", - "AreaPath": "OS\\Windows Client and Services\\ADEPT\\E4D-Engineered for Developers\\InstaDev", + "AreaPath": "OS\\Windows Client and Services\\WinPD\\DEEP-Developer Experience, Ecosystem and Partnerships\\InstaDev", "IterationPath": "OS" }, "codeCoverage": { diff --git a/src/WinGetYamlFuzzing/README.md b/src/WinGetYamlFuzzing/README.md index c141809076..a6bcb515d9 100644 --- a/src/WinGetYamlFuzzing/README.md +++ b/src/WinGetYamlFuzzing/README.md @@ -9,7 +9,7 @@ The goal of this project is to create a [libFuzzer](http://llvm.org/docs/LibFuzz This project only supports the `Fuzzing` configuration in either the `x64` or `x86` platform. The build output directory will be located at `$(ProjectDirectory)\src\$(Platform)\Fuzzing\` -WinGetYamlFuzzer is compiled with `/fsanitize=fuzzer`. This injects the LibFuzzer main function which invokes `LLVMFuzzerTestOneInput`. The LibFuzzer engine code is staticly linked into the WinGetYamlFuzzer executable, which is how OneFuzz will interact with the fuzzer by providing the appropriate command-line arguments. +WinGetYamlFuzzer is compiled with `/fsanitize=fuzzer`. This injects the LibFuzzer main function which invokes `LLVMFuzzerTestOneInput`. The LibFuzzer engine code is statically linked into the WinGetYamlFuzzer executable, which is how OneFuzz will interact with the fuzzer by providing the appropriate command-line arguments. The fuzzer and all libraries that it references need to be compiled with ASan and SanCov (along with various SanCov compiler flags). In order to run the fuzzer, the ASan runtime DLL is required. This file is copied to the output directory as a post-build step from `$(VCToolsInstallDir)\bin\Hostx64\x64\clang_rt.asan_dynamic-x86_64.dll​`. diff --git a/src/Xlang/UndockedRegFreeWinRT/src/UndockedRegFreeWinRT/detours/detours.vcxproj b/src/Xlang/UndockedRegFreeWinRT/src/UndockedRegFreeWinRT/detours/detours.vcxproj index 849c84cab6..19ea162153 100644 --- a/src/Xlang/UndockedRegFreeWinRT/src/UndockedRegFreeWinRT/detours/detours.vcxproj +++ b/src/Xlang/UndockedRegFreeWinRT/src/UndockedRegFreeWinRT/detours/detours.vcxproj @@ -106,18 +106,15 @@ true $(Platform)\$(Configuration)\ - $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ false $(Platform)\$(Configuration)\ - $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ Spectre false $(Platform)\$(Configuration)\ - $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ Spectre diff --git a/src/binver/binver.vcxitems b/src/binver/binver.vcxitems index 6f57c2bd6c..db924d2228 100644 --- a/src/binver/binver.vcxitems +++ b/src/binver/binver.vcxitems @@ -18,7 +18,7 @@
- + diff --git a/src/binver/binver/version.h b/src/binver/binver/version.h index 1a6d98bd3c..2fa18934f6 100644 --- a/src/binver/binver/version.h +++ b/src/binver/binver/version.h @@ -16,7 +16,7 @@ #define VER_PRODUCTNAME_STR "WinGet CLI" #define VER_PRODUCT_VERSION VER_FILE_VERSION #define VER_PRODUCT_VERSION_STR VER_FILE_VERSION_STR -#define VER_ORIGINAL_FILENAME_STR "AppInstallerCLI.exe" +#define VER_ORIGINAL_FILENAME_STR "winget.exe" #define VER_INTERNAL_NAME_STR VER_ORIGINAL_FILENAME_STR #define VER_COPYRIGHT_STR "Copyright (c) Microsoft Corporation" diff --git a/src/vcpkg.json b/src/vcpkg.json index 7cd4fc2662..a2a3bd67a3 100644 --- a/src/vcpkg.json +++ b/src/vcpkg.json @@ -8,7 +8,8 @@ "c-ares" ] }, - "nlohmann-json" + "nlohmann-json", + "zlib" ], "overrides": [ { @@ -21,11 +22,15 @@ }, { "name": "curl", - "version": "8.4.0" + "version": "8.9.1" }, { "name": "nlohmann-json", "version": "3.11.3" + }, + { + "name": "zlib", + "version": "1.3.1" } ], "vcpkg-configuration": { @@ -33,5 +38,5 @@ "./VcpkgCustomTriplets" ] }, - "builtin-baseline": "f56238700757aa05975e41fa835739c632810f3f" -} + "builtin-baseline": "1de2026f28ead93ff1773e6e680387643e914ea1" +} diff --git a/templates/e2e-setup.yml b/templates/e2e-setup.yml index adb1f496aa..9537b6ff77 100644 --- a/templates/e2e-setup.yml +++ b/templates/e2e-setup.yml @@ -4,34 +4,55 @@ parameters: type: string - name: localhostWebServerArgs type: string +- name: signingCertOutDir + type: string + default: $(Agent.TempDirectory) steps: - - task: DownloadSecureFile@1 - name: AppInstallerTest - displayName: 'Download Source Package Certificate' - inputs: - secureFile: 'AppInstallerTest.pfx' + - pwsh: | + $newCertArguments = @{ + Type = "Custom" + Subject = "CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US" + KeyUsage = "DigitalSignature" + TextExtension = @("2.5.29.37={text}1.3.6.1.5.5.7.3.3", "2.5.29.19={text}") + CertStoreLocation = "Cert:\CurrentUser\My" + } + $cert = New-SelfSignedCertificate @newCertArguments - - task: DownloadSecureFile@1 - name: HTTPSDevCert - displayName: 'Download Kestrel Certificate' - inputs: - secureFile: 'HTTPSDevCertV2.pfx' + $certPfxPath = Join-Path $(Agent.TempDirectory) TestSigningCert.pfx + $certCerPath = Join-Path ${{ parameters.signingCertOutDir }} TestSigningCert.cer + $certPassword = (New-Guid).ToString() + $certSecurePassword = ConvertTo-SecureString $certPassword -AsPlainText - - task: PowerShell@2 - displayName: Install Root Certificate - inputs: - filePath: '${{ parameters.sourceDir }}\src\LocalhostWebServer\InstallDevCert.ps1' - arguments: '-pfxpath $(HTTPSDevCert.secureFilePath) -password microsoft' + Export-PfxCertificate -Cert $cert -FilePath $certPfxPath -Password $certSecurePassword + Export-Certificate -Cert $cert -FilePath $certCerPath - - task: PowerShell@2 + Write-Host "##vso[task.setvariable variable=TestSigningCert.PfxPath;]$certPfxPath" + Write-Host "##vso[task.setvariable variable=TestSigningCert.CerPath;]$certCerPath" + Write-Host "##vso[task.setvariable variable=TestSigningCert.Password;]$certPassword" + displayName: Create test codesigning cert + condition: succeededOrFailed() + + - pwsh: | + $httpsCertPath = Join-Path $(Agent.TempDirectory) HttpsCert.pfx + $httpsCertPassword = (New-Guid).ToString() + dotnet dev-certs https --export-path $httpsCertPath --password $httpsCertPassword + + $securePassword = ConvertTo-SecureString $httpsCertPassword -AsPlainText + Import-PfxCertificate -FilePath $httpsCertPath -Password $securePassword -CertStoreLocation Cert:\LocalMachine\Root + + Write-Host "##vso[task.setvariable variable=HttpsCert.Path;]$httpsCertPath" + Write-Host "##vso[task.setvariable variable=HttpsCert.Password;]$httpsCertPassword" + displayName: Create and install localhost HTTPS cert + condition: succeededOrFailed() + + - pwsh: ${{ parameters.sourceDir }}\src\LocalhostWebServer\Run-LocalhostWebServer.ps1 -CertPath $(HttpsCert.Path) -CertPassword $(HttpsCert.Password) -OutCertFile $(Agent.TempDirectory)\servercert.cer ${{ parameters.localhostWebServerArgs }} displayName: Launch LocalhostWebServer - inputs: - filePath: '${{ parameters.sourceDir }}\src\LocalhostWebServer\Run-LocalhostWebServer.ps1' - arguments: '-CertPath $(HTTPSDevCert.secureFilePath) -CertPassword microsoft -OutCertFile $(Agent.TempDirectory)\servercert.cer ${{ parameters.localhostWebServerArgs }}' + condition: succeededOrFailed() - task: PowerShell@2 displayName: Setup Local PS Repository + condition: succeededOrFailed() inputs: filePath: '${{ parameters.sourceDir }}\src\AppInstallerCLIE2ETests\TestData\Configuration\Init-TestRepository.ps1' arguments: '-Force' diff --git a/templates/e2e-test.template.yml b/templates/e2e-test.template.yml index a4f863593a..4e0d3d6fe5 100644 --- a/templates/e2e-test.template.yml +++ b/templates/e2e-test.template.yml @@ -1,49 +1,50 @@ -parameters: -- name: title - type: string -- name: isPackaged - type: boolean -- name: filter - type: string -- name: experimentalFeatures +parameters: +- name: title type: string - default: 'none' - -steps: - - task: CmdLine@2 - displayName: Start COM trace for ${{ parameters.title }} - condition: and(succeededOrFailed(), eq(variables['System.debug'], true)) - inputs: - script: 'wpr -start $(Build.SourcesDirectory)\tools\COMTrace\ComTrace.wprp -filemode' - - - task: VSTest@2 - displayName: Run ${{ parameters.title }} - inputs: - testRunTitle: ${{ parameters.title }} - testSelector: 'testAssemblies' - testAssemblyVer2: '$(buildOutDir)\AppInstallerCLIE2ETests\AppInstallerCLIE2ETests.dll' - testFiltercriteria: ${{ parameters.filter }} - ${{ if eq(parameters.isPackaged, true) }}: - overrideTestrunParameters: '-PackagedContext true - -AICLIPackagePath $(packageLayoutDir) - -AICLIPath wingetdev.exe - -LooseFileRegistration true - -StaticFileRootPath $(Agent.TempDirectory)\TestLocalIndex - -PowerShellModulePath $(buildOutDir)\PowerShell\Microsoft.WinGet.Client\Microsoft.WinGet.Client.psd1 - -LocalServerCertPath $(Agent.TempDirectory)\servercert.cer +- name: isPackaged + type: boolean +- name: filter + type: string +- name: experimentalFeatures + type: string + default: 'none' + +steps: + - task: CmdLine@2 + displayName: Start COM trace for ${{ parameters.title }} + condition: and(succeededOrFailed(), eq(variables['System.debug'], true)) + inputs: + script: 'wpr -start $(Build.SourcesDirectory)\tools\COMTrace\ComTrace.wprp -filemode' + + - task: VSTest@2 + displayName: Run ${{ parameters.title }} + condition: succeededOrFailed() + inputs: + testRunTitle: ${{ parameters.title }} + testSelector: 'testAssemblies' + testAssemblyVer2: '$(buildOutDir)\AppInstallerCLIE2ETests\AppInstallerCLIE2ETests.dll' + testFiltercriteria: ${{ parameters.filter }} + ${{ if eq(parameters.isPackaged, true) }}: + overrideTestrunParameters: '-PackagedContext true + -AICLIPackagePath $(packageLayoutDir) + -AICLIPath wingetdev.exe + -LooseFileRegistration true + -StaticFileRootPath $(buildOutDir)\E2ETests\TestLocalIndex + -PowerShellModulePath $(buildOutDir)\PowerShell\Microsoft.WinGet.Client\Microsoft.WinGet.Client.psd1 + -LocalServerCertPath $(Agent.TempDirectory)\servercert.cer -SkipTestSource true - -ForcedExperimentalFeatures ${{ parameters.experimentalFeatures }}' - ${{ else }}: - overrideTestrunParameters: '-PackagedContext false - -AICLIPath $(packageLayoutDir)\AppInstallerCLI\winget.exe - -StaticFileRootPath $(Agent.TempDirectory)\TestLocalIndex - -PowerShellModulePath $(buildOutDir)\PowerShell\Microsoft.WinGet.Client\Microsoft.WinGet.Client.psd1 - -LocalServerCertPath $(Agent.TempDirectory)\servercert.cer + -ForcedExperimentalFeatures ${{ parameters.experimentalFeatures }}' + ${{ else }}: + overrideTestrunParameters: '-PackagedContext false + -AICLIPath $(packageLayoutDir)\AppInstallerCLI\winget.exe + -StaticFileRootPath $(buildOutDir)\E2ETests\TestLocalIndex + -PowerShellModulePath $(buildOutDir)\PowerShell\Microsoft.WinGet.Client\Microsoft.WinGet.Client.psd1 + -LocalServerCertPath $(Agent.TempDirectory)\servercert.cer -SkipTestSource true - -ForcedExperimentalFeatures ${{ parameters.experimentalFeatures }}' - - - task: CmdLine@2 - displayName: Complete COM trace for ${{ parameters.title }} - condition: and(succeededOrFailed(), eq(variables['System.debug'], true)) - inputs: - script: 'wpr -stop "$(artifactsDir)\ComTrace - ${{ parameters.title }}.etl"' + -ForcedExperimentalFeatures ${{ parameters.experimentalFeatures }}' + + - task: CmdLine@2 + displayName: Complete COM trace for ${{ parameters.title }} + condition: and(succeededOrFailed(), eq(variables['System.debug'], true)) + inputs: + script: 'wpr -stop "$(artifactsDir)\ComTrace - ${{ parameters.title }}.etl"' diff --git a/tools/CorrelationTestbed/InstallAndCheckCorrelation/InstallAndCheckCorrelation/InstallAndCheckCorrelation.cpp b/tools/CorrelationTestbed/InstallAndCheckCorrelation/InstallAndCheckCorrelation/InstallAndCheckCorrelation.cpp index b274c83ebe..f55c962138 100644 --- a/tools/CorrelationTestbed/InstallAndCheckCorrelation/InstallAndCheckCorrelation/InstallAndCheckCorrelation.cpp +++ b/tools/CorrelationTestbed/InstallAndCheckCorrelation/InstallAndCheckCorrelation/InstallAndCheckCorrelation.cpp @@ -350,7 +350,7 @@ struct Main std::ofstream stream{ metadataInputPath }; stream << "{" << std::endl; - stream << JSONPair{ "supportedMetadataVersion", "1.1"}; + stream << JSONPair{ "supportedMetadataVersion", "1.2"}; // TODO: Could theoretically produce this if we could enumerate the data via COM // stream << JSONPair{ "currentMetadata", "" }; stream << JSONPair{ "submissionData", nullptr, false } << "\n{\n"; diff --git a/tools/CorrelationTestbed/Readme.md b/tools/CorrelationTestbed/Readme.md index 77fbbe3f9c..6da294b584 100644 --- a/tools/CorrelationTestbed/Readme.md +++ b/tools/CorrelationTestbed/Readme.md @@ -19,6 +19,8 @@ Test-CorrelationInSandbox.ps1 [-DevPackagePath ] :: Path to the local dev *Release* winget build; defaults to the normal location [-ResultsPath ] :: Path to output the results to; defaults to a temp directory [-RegFileDirectory ] :: Path to a directory containing .reg files to insert before the test, creating noise for correlation +[-MetadataCollection] :: Switch to enable collection of metadata +[-WingetUtilPath ] :: Path to the WinGetUtil.dll to use; defaults to Debug build location ``` Once testing is done, `Process-CorrelationResults.ps1` will take all of the results JSON files and put them into `results.csv` in the directory. If any tests failed to run, they will be in `failed.csv`. There are correlation columns in the CSV that can be averaged in Excel to get the correlation percentage. diff --git a/tools/CorrelationTestbed/Test-CorrelationInSandbox.ps1 b/tools/CorrelationTestbed/Test-CorrelationInSandbox.ps1 index 9aabbf7ecd..8ac148428b 100644 --- a/tools/CorrelationTestbed/Test-CorrelationInSandbox.ps1 +++ b/tools/CorrelationTestbed/Test-CorrelationInSandbox.ps1 @@ -18,7 +18,7 @@ Param( [String] $RegFileDirectory, [Parameter(HelpMessage = "Indicates that the metadata collection process should be run.")] [Switch] $MetadataCollection, - [Parameter(HelpMessage = "The path to WinGetUtil.dll; only the release build works.")] + [Parameter(HelpMessage = "The path to WinGetUtil.dll.")] [String] $WingetUtilPath, [Parameter(HelpMessage = "Wait for user input before tearing down each sandbox.")] [Switch] $Wait diff --git a/tools/PowerShell/Microsoft.WinGet.Client/src/Library/Find-WinGetPackage.ps1 b/tools/PowerShell/Microsoft.WinGet.Client/src/Library/Find-WinGetPackage.ps1 index 583fee866f..9588a566e1 100644 --- a/tools/PowerShell/Microsoft.WinGet.Client/src/Library/Find-WinGetPackage.ps1 +++ b/tools/PowerShell/Microsoft.WinGet.Client/src/Library/Find-WinGetPackage.ps1 @@ -26,7 +26,7 @@ Function Find-WinGetPackage{ Used to specify the Command of the package .PARAMETER Exact - Used to specify an exact match for any parameters provided. Many of the other parameters may be used for case insensitive substring matches if Exact is not specified. + Used to specify an exact match for any parameters provided. Many of the other parameters may be used for case-insensitive substring matches if Exact is not specified. .PARAMETER Source Name of the Windows Package Manager private source. Can be identified by running: "Get-WinGetSource" and using the source Name @@ -103,7 +103,7 @@ Function Find-WinGetPackage{ $WinGetArgs += "--Command", $Command.Replace("…", "") } if($Exact){ - ## Search using exact values specified (case sensitive) + ## Search using exact values specified (case-sensitive) $WinGetArgs += "--Exact" } if($PSBoundParameters.ContainsKey('Source')){ @@ -119,7 +119,7 @@ Function Find-WinGetPackage{ $WinGetArgs += "--header", $Header } if($PSBoundParameters.ContainsKey('VerboseLog')){ - ## Search using exact values specified (case sensitive) + ## Search using exact values specified (case-sensitive) $WinGetArgs += "--VerboseLog", $VerboseLog } if($AcceptSourceAgreement){ diff --git a/tools/PowerShell/Microsoft.WinGet.Client/src/Library/Get-WinGetPackage.ps1 b/tools/PowerShell/Microsoft.WinGet.Client/src/Library/Get-WinGetPackage.ps1 index 7a4e0e5af6..ec16318108 100644 --- a/tools/PowerShell/Microsoft.WinGet.Client/src/Library/Get-WinGetPackage.ps1 +++ b/tools/PowerShell/Microsoft.WinGet.Client/src/Library/Get-WinGetPackage.ps1 @@ -29,7 +29,7 @@ Function Get-WinGetPackage{ Used to specify the maximum number of packages to return .PARAMETER Exact - Used to specify an exact match for any parameters provided. Many of the other parameters may be used for case insensitive substring matches if Exact is not specified. + Used to specify an exact match for any parameters provided. Many of the other parameters may be used for case-insensitive substring matches if Exact is not specified. .PARAMETER Source Name of the Windows Package Manager private source. Can be identified by running: "Get-WinGetSource" and using the source Name @@ -104,7 +104,7 @@ Function Get-WinGetPackage{ $WinGetArgs += "--Count", $Count } if($Exact){ - ## Search using exact values specified (case sensitive) + ## Search using exact values specified (case-sensitive) $WinGetArgs += "--Exact" } if($PSBoundParameters.ContainsKey('Header')){ diff --git a/tools/PowerShell/Microsoft.WinGet.Client/src/Library/Install-WinGetPackage.ps1 b/tools/PowerShell/Microsoft.WinGet.Client/src/Library/Install-WinGetPackage.ps1 index 81efd9b80d..73dbfd53ee 100644 --- a/tools/PowerShell/Microsoft.WinGet.Client/src/Library/Install-WinGetPackage.ps1 +++ b/tools/PowerShell/Microsoft.WinGet.Client/src/Library/Install-WinGetPackage.ps1 @@ -30,7 +30,7 @@ Function Install-WinGetPackage Used to specify install scope (user or machine) .PARAMETER Exact - Used to specify an exact match for any parameters provided. Many of the other parameters may be used for case insensitive substring matches if Exact is not specified. + Used to specify an exact match for any parameters provided. Many of the other parameters may be used for case-insensitive substring matches if Exact is not specified. .PARAMETER Source Name of the Windows Package Manager private source. Can be identified by running: "Get-WinGetSource" and using the source Name diff --git a/tools/PowerShell/Microsoft.WinGet.Client/src/Library/Invoke-WinGetCommand.ps1 b/tools/PowerShell/Microsoft.WinGet.Client/src/Library/Invoke-WinGetCommand.ps1 index 43f45fecc1..d4b8933dec 100644 --- a/tools/PowerShell/Microsoft.WinGet.Client/src/Library/Invoke-WinGetCommand.ps1 +++ b/tools/PowerShell/Microsoft.WinGet.Client/src/Library/Invoke-WinGetCommand.ps1 @@ -154,9 +154,9 @@ Function Invoke-WinGetCommand } ## Gets the indexing of each title - $rgex = $IndexTitles -join "|" + $regex = $IndexTitles -join "|" for ($Offset=0; $Offset -lt $WinGetSourceListRaw.Length; $Offset++) { - if($WinGetSourceListRaw[$Offset].Split(" ")[0].Trim() -match $rgex) { + if($WinGetSourceListRaw[$Offset].Split(" ")[0].Trim() -match $regex) { $Found = $true break } diff --git a/tools/PowerShell/Microsoft.WinGet.Client/src/Library/Uninstall-WinGetPackage.ps1 b/tools/PowerShell/Microsoft.WinGet.Client/src/Library/Uninstall-WinGetPackage.ps1 index 0e1dcac608..6c368afdf8 100644 --- a/tools/PowerShell/Microsoft.WinGet.Client/src/Library/Uninstall-WinGetPackage.ps1 +++ b/tools/PowerShell/Microsoft.WinGet.Client/src/Library/Uninstall-WinGetPackage.ps1 @@ -23,7 +23,7 @@ Function Uninstall-WinGetPackage{ Used to specify the Version of the package .PARAMETER Exact - Used to specify an exact match for any parameters provided. Many of the other parameters may be used for case insensitive substring matches if Exact is not specified. + Used to specify an exact match for any parameters provided. Many of the other parameters may be used for case-insensitive substring matches if Exact is not specified. .PARAMETER Source Name of the Windows Package Manager private source. Can be identified by running: "Get-WinGetSource" and using the source Name diff --git a/tools/PowerShell/Microsoft.WinGet.Client/src/Library/Upgrade-WinGetPackage.ps1 b/tools/PowerShell/Microsoft.WinGet.Client/src/Library/Upgrade-WinGetPackage.ps1 index 3db80f4b91..736228998f 100644 --- a/tools/PowerShell/Microsoft.WinGet.Client/src/Library/Upgrade-WinGetPackage.ps1 +++ b/tools/PowerShell/Microsoft.WinGet.Client/src/Library/Upgrade-WinGetPackage.ps1 @@ -33,7 +33,7 @@ Function Upgrade-WinGetPackage Used to specify install scope (user or machine) .PARAMETER Exact - Used to specify an exact match for any parameters provided. Many of the other parameters may be used for case insensitive substring matches if Exact is not specified. + Used to specify an exact match for any parameters provided. Many of the other parameters may be used for case-insensitive substring matches if Exact is not specified. .PARAMETER Source Name of the Windows Package Manager private source. Can be identified by running: "Get-WinGetSource" and using the source Name diff --git a/tools/PowerShell/README.md b/tools/PowerShell/README.md index 228bef6c0b..6f2c4f80bf 100644 --- a/tools/PowerShell/README.md +++ b/tools/PowerShell/README.md @@ -163,7 +163,7 @@ This is not an exhaustive list, but is here as guide for work that needs to be p * Header is only valid in the context of a single source parameter. We may want to validate in the cmdlet * Validation needs to be built * The Modules should be moved to a new GitHub repository patterned after [Crescendo](https://www.powershellgallery.com/packages/PSPackageProject/0.1.18) -* Ultimately, the child modules will be moved to their respective GitHub repositories and the parent will stay in it's own repository. +* Ultimately, the child modules will be moved to their respective GitHub repositories and the parent will stay in its own repository. * Validation should be implemented * A CI Pipeline should be built to sign and publish the modules to the PowerShell gallery * Packaging with [PSPackageProject](https://www.powershellgallery.com/packages/PSPackageProject/0.1.18)