diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index 155eef78a7..0000000000 --- a/.editorconfig +++ /dev/null @@ -1,184 +0,0 @@ -; This file is for unifying the coding style for different editors and IDEs. -; More information at http://EditorConfig.org - -root = true - -[*] -end_of_line = crlf - -[*.ps1] -indent_style = space -indent_size = 4 - -[*.cs] -dotnet_diagnostic.RS0030.severity=error -dotnet_diagnostic.RS0031.severity=error -dotnet_diagnostic.RS0035.severity=error -csharp_using_directive_placement = outside_namespace:warning -csharp_prefer_simple_using_statement = true:suggestion -csharp_prefer_braces = true:error -csharp_style_namespace_declarations = block_scoped:error -csharp_style_prefer_method_group_conversion = true:silent -csharp_style_prefer_top_level_statements = false:error -csharp_style_expression_bodied_methods = false:warning -csharp_style_expression_bodied_constructors = false:warning -csharp_style_expression_bodied_operators = false:warning -csharp_style_expression_bodied_properties = false:warning -csharp_style_expression_bodied_indexers = false:warning -csharp_style_expression_bodied_accessors = false:warning -csharp_style_expression_bodied_lambdas = true:silent -csharp_style_expression_bodied_local_functions = false:error -csharp_indent_labels = no_change -csharp_space_around_binary_operators = before_and_after -csharp_style_throw_expression = true:silent -csharp_style_prefer_null_check_over_type_check = true:error -csharp_prefer_simple_default_expression = true:suggestion -csharp_style_prefer_local_over_anonymous_function = true:suggestion -csharp_style_prefer_index_operator = true:suggestion -csharp_style_implicit_object_creation_when_type_is_apparent = false:warning -csharp_style_prefer_range_operator = true:suggestion -csharp_style_prefer_tuple_swap = true:suggestion -csharp_style_prefer_utf8_string_literals = true:suggestion -csharp_style_deconstructed_variable_declaration = true:suggestion -csharp_style_inlined_variable_declaration = true:suggestion -csharp_style_unused_value_expression_statement_preference = discard_variable:silent -csharp_style_unused_value_assignment_preference = discard_variable:suggestion -csharp_prefer_static_local_function = true:suggestion -csharp_style_prefer_readonly_struct = true:suggestion -csharp_style_allow_embedded_statements_on_same_line_experimental = true:silent -csharp_style_allow_blank_lines_between_consecutive_braces_experimental = true:silent -csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = true:silent -csharp_style_conditional_delegate_call = true:suggestion -csharp_style_prefer_switch_expression = true:suggestion -csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion -csharp_style_prefer_pattern_matching = true:suggestion -csharp_style_prefer_not_pattern = true:suggestion -csharp_style_pattern_matching_over_as_with_null_check = true:suggestion -csharp_style_prefer_extended_property_pattern = true:suggestion -csharp_style_var_for_built_in_types = true:warning -csharp_style_var_when_type_is_apparent = true:warning -csharp_style_var_elsewhere = false:silent -csharp_style_prefer_primary_constructors = false:error -csharp_style_prefer_readonly_struct_member = true:suggestion -csharp_style_allow_blank_line_after_token_in_conditional_expression_experimental = true:silent -csharp_style_allow_blank_line_after_token_in_arrow_expression_clause_experimental = true:silent - -[*.{cs,vb}] -#### Naming styles #### - -# Naming rules - -dotnet_naming_rule.interface_should_be_begins_with_i.severity = error -dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface -dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i - -dotnet_naming_rule.types_should_be_pascal_case.severity = error -dotnet_naming_rule.types_should_be_pascal_case.symbols = types -dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case - -dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = error -dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members -dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case - -dotnet_naming_rule.private_fields_should_be_camel_case_underscore_prefix.severity = error -dotnet_naming_rule.private_fields_should_be_camel_case_underscore_prefix.symbols = private_fields -dotnet_naming_rule.private_fields_should_be_camel_case_underscore_prefix.style = camel_case_underscore_prefix - -dotnet_naming_rule.non_private_fields_should_be_pascal_case.severity = error -dotnet_naming_rule.non_private_fields_should_be_pascal_case.symbols = non_private_fields -dotnet_naming_rule.non_private_fields_should_be_pascal_case.style = pascal_case - -dotnet_naming_rule.local_variables_should_be_camel_case.severity = error -dotnet_naming_rule.local_variables_should_be_camel_case.symbols = local_variables -dotnet_naming_rule.local_variables_should_be_camel_case.style = camel_case - -dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = error -dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields -dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case - -# Symbol specifications - -dotnet_naming_symbols.interface.applicable_kinds = interface -dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected -dotnet_naming_symbols.interface.required_modifiers = - -dotnet_naming_symbols.non_private_fields.applicable_kinds = field -dotnet_naming_symbols.non_private_fields.applicable_accessibilities = public, internal, protected, protected_internal -dotnet_naming_symbols.non_private_fields.required_modifiers = - -dotnet_naming_symbols.private_fields.applicable_kinds = field -dotnet_naming_symbols.private_fields.applicable_accessibilities = private, private_protected -dotnet_naming_symbols.private_fields.required_modifiers = - -dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum -dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected -dotnet_naming_symbols.types.required_modifiers = - -dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method -dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected -dotnet_naming_symbols.non_field_members.required_modifiers = - -dotnet_naming_symbols.local_variables.applicable_kinds = parameter, local -dotnet_naming_symbols.local_variables.applicable_accessibilities = local -dotnet_naming_symbols.local_variables.required_modifiers = - -dotnet_naming_symbols.constant_fields.applicable_kinds = field -dotnet_naming_symbols.constant_fields.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected -dotnet_naming_symbols.constant_fields.required_modifiers = const - -# Naming styles - -dotnet_naming_style.pascal_case.required_prefix = -dotnet_naming_style.pascal_case.required_suffix = -dotnet_naming_style.pascal_case.word_separator = -dotnet_naming_style.pascal_case.capitalization = pascal_case - -dotnet_naming_style.camel_case.required_prefix = -dotnet_naming_style.camel_case.required_suffix = -dotnet_naming_style.camel_case.word_separator = -dotnet_naming_style.camel_case.capitalization = camel_case - -dotnet_naming_style.begins_with_i.required_prefix = I -dotnet_naming_style.begins_with_i.required_suffix = -dotnet_naming_style.begins_with_i.word_separator = -dotnet_naming_style.begins_with_i.capitalization = pascal_case - -dotnet_naming_style.camel_case_underscore_prefix.required_prefix = _ -dotnet_naming_style.camel_case_underscore_prefix.required_suffix = -dotnet_naming_style.camel_case_underscore_prefix.word_separator = -dotnet_naming_style.camel_case_underscore_prefix.capitalization = camel_case - -dotnet_style_operator_placement_when_wrapping = beginning_of_line -tab_width = 4 -indent_size = 4 -dotnet_style_coalesce_expression = true:suggestion -dotnet_style_null_propagation = true:suggestion -dotnet_style_prefer_is_null_check_over_reference_equality_method = true:warning -dotnet_style_prefer_auto_properties = true:warning -dotnet_style_object_initializer = true:warning -dotnet_style_collection_initializer = true:warning -dotnet_style_prefer_simplified_boolean_expressions = true:warning -dotnet_style_prefer_conditional_expression_over_assignment = true:silent -dotnet_style_prefer_conditional_expression_over_return = true:silent -dotnet_style_explicit_tuple_names = true:suggestion -dotnet_style_prefer_inferred_tuple_names = true:suggestion -dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion -dotnet_style_prefer_compound_assignment = true:suggestion -dotnet_style_prefer_simplified_interpolation = true:suggestion -dotnet_style_namespace_match_folder = true:error -dotnet_style_readonly_field = true:suggestion -dotnet_style_predefined_type_for_locals_parameters_members = true:warning -dotnet_style_predefined_type_for_member_access = true:warning -dotnet_style_require_accessibility_modifiers = for_non_interface_members:error -dotnet_style_allow_multiple_blank_lines_experimental = true:silent -dotnet_style_allow_statement_immediately_after_block_experimental = true:silent -dotnet_code_quality_unused_parameters = all:error -dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent -dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent -dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent -dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent -dotnet_style_qualification_for_property = false:error -dotnet_style_qualification_for_field = false:error -dotnet_style_qualification_for_method = false:error -dotnet_style_qualification_for_event = false:error -dotnet_style_prefer_collection_expression = true:suggestion diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 6e9bc471ff..901384dd65 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -12,7 +12,7 @@ jobs: stale: runs-on: ubuntu-latest steps: - - uses: actions/stale@v4.1.0 + - uses: actions/stale@v9 id: stale with: days-before-stale: 30 @@ -24,9 +24,10 @@ jobs: only-labels: '0 - Waiting on User' close-issue-label: "No Response / Stale" close-pr-label: "No Response / Stale" - exempt-issue-labels: 'Security / CVE' - exempt-pr-labels: 'Security / CVE' - labels-to-remove-when-unstale: '0 - Wating on User,Pending closure' + exempt-issue-labels: 'Security / CVE,2 - Working,3 - Review' + exempt-pr-labels: 'Security / CVE,2 - Working,3 - Review' + labels-to-remove-when-unstale: '0 - Waiting on User,Pending closure' + remove-stale-when-updated: true stale-issue-message: | Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward? This issue will be closed in 14 days if it continues to be inactive. diff --git a/.gitignore b/.gitignore index 4112787edb..58b7903074 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ code_drop obj src/packages /.vscode/** +!.vscode/extensions.json !/.vscode/settings.json .vs @@ -53,4 +54,7 @@ tools/** !tools/Modules/packages.config BuildArtifacts/ code_drop/ -src/chocolatey.install/assets/Install.ps1 \ No newline at end of file +src/chocolatey.install/assets/Install.ps1 + +# This project uses an editorconfig file maintained via a nuget package, so do not commit any of these to the repo +.editorconfig \ No newline at end of file diff --git a/.teamcity/settings.kts b/.teamcity/settings.kts index 4f79114751..8f52dbb633 100644 --- a/.teamcity/settings.kts +++ b/.teamcity/settings.kts @@ -22,6 +22,8 @@ object Chocolatey : BuildType({ id = AbsoluteId("Chocolatey") name = "Chocolatey CLI (Built with Unit Tests)" + templates(AbsoluteId("SlackNotificationTemplate")) + artifactRules = """ """.trimIndent() @@ -86,6 +88,7 @@ object Chocolatey : BuildType({ requirements { doesNotExist("docker.server.version") + doesNotContain("teamcity.agent.name", "Docker") } }) @@ -93,6 +96,8 @@ object ChocolateySchd : BuildType({ id = AbsoluteId("ChocolateySchd") name = "Chocolatey CLI (Scheduled Integration Testing)" + templates(AbsoluteId("SlackNotificationTemplate")) + artifactRules = """ """.trimIndent() @@ -150,6 +155,7 @@ object ChocolateySchd : BuildType({ requirements { doesNotExist("docker.server.version") + doesNotContain("teamcity.agent.name", "Docker") } }) @@ -157,6 +163,8 @@ object ChocolateyQA : BuildType({ id = AbsoluteId("ChocolateyQA") name = "Chocolatey CLI (SonarQube)" + templates(AbsoluteId("SlackNotificationTemplate")) + artifactRules = """ """.trimIndent() @@ -216,6 +224,7 @@ object ChocolateyQA : BuildType({ requirements { doesNotExist("docker.server.version") + doesNotContain("teamcity.agent.name", "Docker") } }) @@ -223,6 +232,8 @@ object ChocolateySign : BuildType({ id = AbsoluteId("ChocolateySign") name = "Chocolatey CLI (Script Signing)" + templates(AbsoluteId("SlackNotificationTemplate")) + artifactRules = """ """.trimIndent() @@ -286,6 +297,7 @@ object ChocolateySign : BuildType({ requirements { doesNotExist("docker.server.version") + doesNotContain("teamcity.agent.name", "Docker") } }) @@ -293,6 +305,8 @@ object ChocolateyDockerWin : BuildType({ id = AbsoluteId("ChocolateyDockerWin") name = "Docker (Windows)" + templates(AbsoluteId("SlackNotificationTemplate")) + params { // TeamCity has suggested "${Chocolatey.depParamRefs.buildNumber}" param("env.CHOCOLATEY_VERSION", "%dep.Chocolatey.build.number%") @@ -340,6 +354,7 @@ object ChocolateyDockerWin : BuildType({ requirements { contains("docker.server.osType", "windows") exists("docker.server.version") + contains("teamcity.agent.name", "Docker") } }) @@ -347,6 +362,8 @@ object ChocolateyPosix : BuildType({ id = AbsoluteId("ChocolateyPosix") name = "Docker (Linux)" + templates(AbsoluteId("SlackNotificationTemplate")) + params { param("env.CAKE_NUGET_SOURCE", "") // The Cake version we use has issues with authing to our private source on Linux param("env.PRIMARY_NUGET_SOURCE", "") // As above there are issues with authing to our private source on Linux @@ -452,5 +469,6 @@ object ChocolateyPosix : BuildType({ requirements { contains("docker.server.osType", "linux") exists("docker.server.version") + contains("teamcity.agent.name", "Docker") } }) diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000000..5c2b21c45f --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,5 @@ +{ + "recommendations": [ + "yzhang.markdown-all-in-one" + ] +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index 4dc317cc50..1d0b65848d 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,5 +1,6 @@ { "[powershell]": { "files.encoding": "utf8bom", - } + }, + "markdown.extension.toc.levels": "2..6" } \ No newline at end of file diff --git a/GenerateDocs.ps1 b/GenerateDocs.ps1 index 8bde26b1cc..7a2636699d 100644 --- a/GenerateDocs.ps1 +++ b/GenerateDocs.ps1 @@ -34,22 +34,20 @@ $sourceCommands = $sourceLocation + 'src/chocolatey/infrastructure.app/commands' $sourceFunctions = $sourceLocation + 'src/chocolatey.resources/helpers/functions' $global:powerShellReferenceTOC = @' --- -Order: 40 +order: 40 xref: powershell-reference -Title: PowerShell Reference -Description: PowerShell Functions aka Helpers Reference -RedirectFrom: - - docs/helpers-reference - - docs/HelpersReference +title: PowerShell Reference +description: PowerShell Functions aka Helpers Reference --- +import Xref from '@components/Xref.astro'; # PowerShell Functions aka Helpers Reference - +{/* This documentation file is automatically generated from the files at $sourceFunctions using $($sourceLocation)GenerateDocs.ps1. Contributions are welcome at the original location(s). */} ## Summary -In your Chocolatey packaging, you have the ability to use these functions (and others with Chocolatey's [PowerShell Extensions](xref:extensions)) to work with all aspects of software management. Keep in mind Chocolatey's automation scripts are just PowerShell, so you can do manage anything you want. +In your Chocolatey packaging, you have the ability to use these functions (and others with Chocolatey's ) to work with all aspects of software management. Keep in mind Chocolatey's automation scripts are just PowerShell, so you can do manage anything you want. > :choco-info: **NOTE** > @@ -57,12 +55,12 @@ In your Chocolatey packaging, you have the ability to use these functions (and o ## Main Functions -These functions call other functions and many times may be the only thing you need in your [chocolateyInstall.ps1 file](xref:chocolatey-install-ps1). +These functions call other functions and many times may be the only thing you need in your . -* [Install-ChocolateyPackage](xref:install-chocolateypackage) -* [Install-ChocolateyZipPackage](xref:install-chocolateyzippackage) -* [Install-ChocolateyPowershellCommand](xref:install-chocolateypowershellcommand) -* [Install-ChocolateyVsixPackage](xref:install-chocolateyvsixpackage) +* +* +* +* ## More Functions @@ -70,13 +68,13 @@ These functions call other functions and many times may be the only thing you ne When creating packages that need to run one of the following commands below, one should add the tag `admin` to the nuspec. -* [Install-ChocolateyPackage](xref:install-chocolateypackage) -* [Start-ChocolateyProcessAsAdmin](xref:start-chocolateyprocessasadmin) -* [Install-ChocolateyInstallPackage](xref:install-chocolateyinstallpackage) -* [Install-ChocolateyPath](xref:install-chocolateypath) - when specifying machine path -* [Install-ChocolateyEnvironmentVariable](xref:install-chocolateyenvironmentvariable) - when specifying machine path -* [Install-ChocolateyExplorerMenuItem](xref:install-chocolateyexplorermenuitem) -* [Install-ChocolateyFileAssociation](xref:install-chocolateyfileassociation) +* +* +* +* - when specifying machine path +* - when specifying machine path +* +* ### Non-Administrator Safe Functions @@ -84,17 +82,17 @@ When you have a need to run Chocolatey without Administrative access required (n These are the functions from above as one list. -* [Install-ChocolateyZipPackage](xref:install-chocolateyzippackage) -* [Install-ChocolateyPowershellCommand](xref:install-chocolateypowershellcommand) -* [Get-ChocolateyPath](xref:get-chocolateypath) -* [Get-ChocolateyWebFile](xref:get-chocolateywebfile) -* [Get-ChocolateyUnzip](xref:get-chocolateyunzip) -* [Install-ChocolateyPath](xref:install-chocolateypath) - when specifying user path -* [Install-ChocolateyEnvironmentVariable](xref:install-chocolateyenvironmentvariable) - when specifying user path -* [Install-ChocolateyPinnedTaskBarItem](xref:install-chocolateypinnedtaskbaritem) -* [Install-ChocolateyShortcut](xref:install-chocolateyshortcut) -* [Update-SessionEnvironment](xref:update-sessionenvironment) -* [Get-PackageParameters](xref:get-packageparameters) +* +* +* +* +* +* - when specifying user path +* - when specifying user path +* +* +* +* ## Complete List (alphabetical order) @@ -145,9 +143,9 @@ function Replace-CommonItems($text) { $text = $text -replace '(Pro[fessional]\s?/\s?Business)', '[$1](https://chocolatey.org/compare)' $text = $text -replace '([Ll]icensed editions)', '[$1](https://chocolatey.org/compare)' $text = $text -replace '([Ll]icensed versions)', '[$1](https://chocolatey.org/compare)' - $text = $text -replace '\(https://docs.chocolatey.org/en-us/create/automatic-packages\)', '(xref:automatic-packaging)' - $text = $text -replace 'Learn more about using this at https://docs.chocolatey.org/en-us/guides/create/parse-packageparameters-argument', '[Learn more](xref:parse-package-parameters)' - $text = $text -replace 'at https://docs.chocolatey.org/en-us/guides/create/parse-packageparameters-argument#step-3---use-core-community-extension', 'in [the docs](xref:parse-package-parameters#step-3-use-core-community-extension)' + $text = $text -replace '\[automatic packaging\]\(https://docs.chocolatey.org/en-us/create/automatic-packages\)', '' + $text = $text -replace 'Learn more about using this at https://docs.chocolatey.org/en-us/guides/create/parse-packageparameters-argument', '' + $text = $text -replace 'at https://docs.chocolatey.org/en-us/guides/create/parse-packageparameters-argument#step-3---use-core-community-extension', 'in ' $text = $text -replace 'https://docs.chocolatey.org/en-us/guides/create/parse-packageparameters-argument', 'https://docs.chocolatey.org/en-us/guides/create/parse-packageparameters-argument' $text = $text -replace '\[community feed\)\]\(https://community.chocolatey.org/packages\)', '[community feed](https://community.chocolatey.org/packages))' @@ -207,7 +205,7 @@ function Convert-Parameter($objItem, $commandName) { $aliases = [string]((Get-Command -Name $commandName).parameters."$($objItem.Name)".Aliases -join ', ') $required = [string]($objItem.required) $position = [string]($objItem.position) - $defValue = [string]($objItem.defaultValue) + $defValue = [string]($objItem.defaultValue -replace '@{Headers = @{}', '`@{Headers = @{}`' ) $acceptPipeline = [string]($objItem.pipelineInput) $padding = ($aliases.Length, $required.Length, $position.Length, $defValue.Length, $acceptPipeline.Length | Measure-Object -Maximum).Maximum @@ -245,11 +243,11 @@ function Convert-CommandText { $commandText = $commandText -replace '^(Windows Features|Ruby|Cygwin|Python)\s*$', '### $1' $commandText = $commandText -replace '(? :choco-info: **NOTE**' $commandText = $commandText -replace '(? :choco-warning: **WARNING**' - $commandText = $commandText -replace '\*> :choco-(info|warning): \*\*(INFO|WARNING)\*\*\*', '> :choco-$1: **$2**' - $commandText = $commandText -replace 'the command reference', '[how to pass arguments](xref:choco-commands#how-to-pass-options-switches)' + $commandText = $commandText -replace '\*> :choco-(info|warning): \*\*(INFO|WARNING|NOTE)\*\*\*', '> :choco-$1: **$2**' + $commandText = $commandText -replace 'the command reference', '' $commandText = $commandText -replace '(community feed[s]?|community repository)', '[$1](https://community.chocolatey.org/packages)' #$commandText = $commandText -replace '\`(apikey|install|upgrade|uninstall|list|search|info|outdated|pin)\`', '[[`$1`|Commands$1]]' - $commandText = $commandText -replace '\`([choco\s]*)(apikey|install|upgrade|uninstall|list|search|info|outdated|pin)\`', '[`$1$2`](xref:choco-command-$2)' + $commandText = $commandText -replace '\`([choco\s]*)(apikey|install|upgrade|uninstall|list|search|info|outdated|pin)\`', '' $commandText = $commandText -replace '^(.+):\s(.+.gif)$', '![$1]($2)' $commandText = $commandText -replace '^(\s+)\<\?xml', "~~~xml$lineFeed`$1', "`$1$lineFeed~~~" @@ -257,21 +255,21 @@ function Convert-CommandText { $commandText = $commandText -replace '(Pro[fessional]\s?/\s?Business)', '[$1](https://chocolatey.org/compare)' $commandText = $commandText -replace '([Ll]icensed editions)', '[$1](https://chocolatey.org/compare)' $commandText = $commandText -replace '([Ll]icensed versions)', '[$1](https://chocolatey.org/compare)' - $commandText = $commandText -replace 'https://raw.githubusercontent.com/wiki/chocolatey/choco/images', '/assets/images' + $commandText = $commandText -replace 'https://raw.githubusercontent.com/wiki/chocolatey/choco/images', '/images' $commandText = $commandText -replace 'https://chocolatey.org/docs/features-automatically-recompile-packages', 'https://docs.chocolatey.org/en-us/guides/create/recompile-packages' $commandText = $commandText -replace 'https://chocolatey.org/docs/features-private-cdn', 'https://docs.chocolatey.org/en-us/features/private-cdn' $commandText = $commandText -replace 'https://chocolatey.org/docs/features-virus-check', 'https://docs.chocolatey.org/en-us/features/virus-check' $commandText = $commandText -replace 'https://chocolatey.org/docs/features-synchronize', 'https://docs.chocolatey.org/en-us/features/package-synchronization' $commandText = $commandText -replace 'explicity', 'explicit' $commandText = $commandText -replace 'https://chocolatey.org/docs/features-create-packages-from-installers', 'https://docs.chocolatey.org/en-us/features/package-builder' - $commandText = $commandText -replace 'See https://chocolatey.org/docs/features-create-packages-from-installers', 'See more information about [Package Builder features](xref:package-builder)' - $commandText = $commandText -replace 'See https://docs.chocolatey.org/en-us/features/package-builder', 'See more information about [Package Builder features](xref:package-builder)' + $commandText = $commandText -replace 'See https://chocolatey.org/docs/features-create-packages-from-installers', 'See more information about ' + $commandText = $commandText -replace 'See https://docs.chocolatey.org/en-us/features/package-builder', 'See more information about ' $commandText = $commandText -replace 'https://chocolatey.org/docs/features-install-directory-override', 'https://docs.chocolatey.org/en-us/features/install-directory-override' $commandText = $commandText -replace 'y.org/docs/features-package-reducer', 'y.org/docs/en-us/features/package-reducer' $commandText = $commandText -replace 'https://chocolatey.org/docs/features-package-reducer', 'https://docs.chocolatey.org/en-us/features/package-reducer' $commandText = $commandText -replace 'https://chocolatey.org/docs/en-us/features/package-reducer', 'https://docs.chocolatey.org/en-us/features/package-reducer' $commandText = $commandText -replace '\[community feed\)\]\(https://community.chocolatey.org/packages\)', '[community feed](https://community.chocolatey.org/packages))' - $commandText = $commandText -replace '> :choco-(info|warning): \*\*(INFO|WARNING)\*\*\s', '> :choco-$1: **$2** + $commandText = $commandText -replace '> :choco-(info|warning): \*\*(INFO|WARNING|NOTE)\*\*\s', '> :choco-$1: **$2** > > ' @@ -286,7 +284,7 @@ function Convert-CommandText { try to install version 1.0.0 of every package passed. So please split out multiple package calls when wanting to pass specific options. -Includes [default options/switches](xref:choco-commands#default-options-and-switches) (included below for completeness). +Includes (included below for completeness). ~~~ '@ @@ -318,32 +316,30 @@ function Convert-CommandReferenceSpecific($commandText) { param($m) $commandName = $m.Groups[1].Value $commandNameUpper = $($commandName.Substring(0, 1).ToUpper() + $commandName.Substring(1)) - " * [$commandName](xref:choco-command-$($commandName)) -" + " * -" } ) #$commandText = $commandText -replace '\s?\s?\*\s(\w+)\s\-', ' * [[$1|Commands$1]] -' - $commandText = $commandText.Replace("## Default Options and Switches", "## See Help Menu In Action$lineFeed$lineFeed![choco help in action](/assets/images/gifs/choco_help.gif)$lineFeed$lineFeed## Default Options and Switches") + $commandText = $commandText.Replace("## Default Options and Switches", "## See Help Menu In Action$lineFeed$lineFeed![choco help in action](/images/gifs/choco_help.gif)$lineFeed$lineFeed## Default Options and Switches") Write-Output $commandText } function Generate-TopLevelCommandReference { Write-Host "Generating Top Level Command Reference" - $fileName = "$docsFolder\choco\commands\index.md" + $fileName = "$docsFolder\choco\commands\index.mdx" $commandOutput = @("---") - $commandOutput += @("Order: 40") + $commandOutput += @("order: 40") $commandOutput += @("xref: choco-commands") - $commandOutput += @("Title: Commands") - $commandOutput += @("Description: Full list of all available Chocolatey commands") - $commandOutput += @("RedirectFrom:") - $commandOutput += @(" - docs/commandsreference") - $commandOutput += @(" - docs/commands-reference") - $commandOutput += @("---$lineFeed") + $commandOutput += @("title: Commands") + $commandOutput += @("description: Full list of all available Chocolatey commands") + $commandOutput += @("---") + $commandOutput += @("import Xref from '@components/Xref.astro';$lineFeed") $commandOutput += @("# Command Reference$lineFeed") - $commandOutput += @(" $lineFeed") + $commandOutput += @("{/* This file is automatically generated based on output from the files at $sourceCommands using $($sourceLocation)GenerateDocs.ps1. Contributions are welcome at the original location(s). */} $lineFeed") $commandOutput += $(& $chocoExe -? -r) $commandOutput += @("$lineFeed~~~$lineFeed") - $commandOutput += @("$lineFeed$lineFeed*NOTE:* This documentation has been automatically generated from ``choco -h``. $lineFeed") + $commandOutput += @("$lineFeed$lineFeed> :choco-info: **NOTE**$lineFeed>$lineFeed> This documentation has been automatically generated from ``choco -h``. $lineFeed") $commandOutput | ForEach-Object { Convert-CommandText($_) } | @@ -356,51 +352,50 @@ function Move-GeneratedFiles { New-Item -ItemType Directory -Path "$docsFolder\create\commands" -ErrorAction Continue | Out-Null } - Move-Item -Path "$docsFolder\choco\commands\apikey.md" -Destination "$docsFolder\create\commands\api-key.md" - Move-Item -Path "$docsFolder\choco\commands\new.md" -Destination "$docsFolder\create\commands\new.md" - Move-Item -Path "$docsFolder\choco\commands\pack.md" -Destination "$docsFolder\create\commands\pack.md" - Move-Item -Path "$docsFolder\choco\commands\push.md" -Destination "$docsFolder\create\commands\push.md" - Move-Item -Path "$docsFolder\choco\commands\template.md" -Destination "$docsFolder\create\commands\template.md" - Move-Item -Path "$docsFolder\choco\commands\templates.md" -Destination "$docsFolder\create\commands\templates.md" - Move-Item -Path "$docsFolder\choco\commands\convert.md" -Destination "$docsFolder\create\commands\convert.md" + Move-Item -Path "$docsFolder\choco\commands\apikey.mdx" -Destination "$docsFolder\create\commands\api-key.mdx" + Move-Item -Path "$docsFolder\choco\commands\new.mdx" -Destination "$docsFolder\create\commands\new.mdx" + Move-Item -Path "$docsFolder\choco\commands\pack.mdx" -Destination "$docsFolder\create\commands\pack.mdx" + Move-Item -Path "$docsFolder\choco\commands\push.mdx" -Destination "$docsFolder\create\commands\push.mdx" + Move-Item -Path "$docsFolder\choco\commands\template.mdx" -Destination "$docsFolder\create\commands\template.mdx" + Move-Item -Path "$docsFolder\choco\commands\templates.mdx" -Destination "$docsFolder\create\commands\templates.mdx" + Move-Item -Path "$docsFolder\choco\commands\convert.mdx" -Destination "$docsFolder\create\commands\convert.mdx" } function Generate-CommandReference($commandName, $order) { if (-not(Test-Path "$docsFolder\choco\commands")) { New-Item -ItemType Directory -Path "$docsFolder\choco\commands" -ErrorAction Continue | Out-Null } - $fileName = Join-Path "$docsFolder\choco\commands" "$($commandName.ToLower()).md" + $fileName = Join-Path "$docsFolder\choco\commands" "$($commandName.ToLower()).mdx" $commandNameLower = $commandName.ToLower() Write-Host "Generating $fileName ..." $commandOutput += @("---") - $commandOutput += @("Order: $order") + $commandOutput += @("order: $order") $commandOutput += @("xref: choco-command-$commandNameLower") - $commandOutput += @("Title: $commandName") - $commandOutput += @("Description: $commandName Command (choco $commandNameLower)") - $commandOutput += @("RedirectFrom:") - $commandOutput += @(" - docs/commands$commandNameLower") - $commandOutput += @(" - docs/commands-$commandNameLower") + $commandOutput += @("title: $commandName") + $commandOutput += @("description: $commandName Command (choco $commandNameLower)") if ($commandName -eq 'Features') { - $commandOutput += @("ShowInNavbar: false") $commandOutput += @("ShowInSidebar: false") } if ($commandName -eq 'Templates') { - $commandOutput += @("ShowInNavbar: false") $commandOutput += @("ShowInSidebar: false") } - $commandOutput += @("---$lineFeed") - $commandOutput += @(" $lineFeed") + $commandOutput += @("---") + $commandOutput += @("import Xref from '@components/Xref.astro';$lineFeed") + $commandOutput += @("{/* This file is automatically generated based on output from $($sourceCommands)/Chocolatey$($commandName)Command.cs using $($sourceLocation)GenerateDocs.ps1. Contributions are welcome at the original location(s). If the file is not found, it is not part of the open source edition of Chocolatey or the name of the file is different. */} $lineFeed") $commandOutput += $(& $chocoExe $commandName.ToLower() -h -r) - $commandOutput += @("$lineFeed~~~$lineFeed$lineFeed[Command Reference](xref:choco-commands)") + $commandOutput += @("$lineFeed~~~$lineFeed$lineFeed") $commandOutput += @("$lineFeed$lineFeed*NOTE:* This documentation has been automatically generated from ``choco $($commandName.ToLower()) -h``. $lineFeed") - $commandOutput | + $fileContent = $commandOutput | ForEach-Object { Convert-CommandText $_ $commandName.ToLower() } | - Out-File $fileName -Encoding UTF8 -Force + Out-String + # Surround indented blocks with code blocks (intended for Usage and Examples sections), ignoring sections we are putting in code blocks in other ways + $fileContent = $fileContent -replace '(\r?\n( {4}[^ <-].+\r?\n?)+)',"`r`n~~~`$0~~~`r`n`r`n" + $fileContent | Out-File $fileName -Encoding UTF8 -Force } try { @@ -426,8 +421,8 @@ try { $helperOrder = 10; Get-Command -Module $psModuleName -CommandType Function | ForEach-Object -Process { Get-Help $_ -Full } | ForEach-Object -Process { ` $commandName = $_.Name - $fileName = Join-Path "$docsFolder\create\functions" "$($_.Name.ToLower()).md" - $global:powerShellReferenceTOC += "$lineFeed * [$commandName](xref:$([System.IO.Path]::GetFileNameWithoutExtension($fileName)))" + $fileName = Join-Path "$docsFolder\create\functions" "$($_.Name.ToLower()).mdx" + $global:powerShellReferenceTOC += "$lineFeed * " $hasCmdletBinding = (Get-Command -Name $commandName).CmdLetBinding Write-Host "Generating $fileName ..." @@ -446,18 +441,16 @@ try { @" --- -Order: $($helperOrder) +order: $($helperOrder) xref: $($_.Name.ToLower()) -Title: $($_.Name) -Description: Information on $($_.Name) function -RedirectFrom: - - docs/helpers-$($FormattedName) - - docs/helpers$($NameNoHyphen.ToLower()) +title: $($_.Name) +description: Information on $($_.Name) function --- +import Xref from '@components/Xref.astro'; # $($_.Name) - +{/* This documentation is automatically generated from $sourceFunctions/$($_.Name)`.ps1 using $($sourceLocation)GenerateDocs.ps1. Contributions are welcome at the original location(s). */} $(Replace-CommonItems $_.Synopsis) @@ -481,9 +474,9 @@ $( if ($_.ReturnValues -ne $null -and $_.ReturnValues.Length -gt 0 -and -not $_. ## Parameters $( if ($_.parameters.parameter.count -gt 0) { $_.parameters.parameter | ForEach-Object { Convert-Parameter $_ $commandName }}) $( if ($hasCmdletBinding) { "$lineFeed### <CommonParameters>$lineFeed$($lineFeed)This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see ``about_CommonParameters`` http://go.microsoft.com/fwlink/p/?LinkID=113216 ." } ) -$( if ($_.relatedLinks -ne $null) {Write-Output "$lineFeed## Links$lineFeed$lineFeed"; $_.relatedLinks.navigationLink | Where-Object { $_.linkText -ne $null} | ForEach-Object { Write-Output "* [$($_.LinkText)](xref:$($_.LinkText.ToLower()))$lineFeed" }}) +$( if ($_.relatedLinks -ne $null) {Write-Output "$lineFeed## Links$lineFeed$lineFeed"; $_.relatedLinks.navigationLink | Where-Object { $_.linkText -ne $null} | ForEach-Object { Write-Output "* $lineFeed" }}) -[Function Reference](xref:powershell-reference) + > :choco-info: **NOTE** > @@ -495,17 +488,17 @@ View the source for [$($_.Name)]($sourceFunctions/$($_.Name)`.ps1) } Write-Host "Generating Top Level PowerShell Reference" - $fileName = Join-Path "$docsFolder\create\functions" 'index.md' + $fileName = Join-Path "$docsFolder\create\functions" 'index.mdx' $global:powerShellReferenceTOC += @' ## Chocolatey for Business Functions - * [Install-ChocolateyWindowsService](xref:install-chocolateywindowsservice) - * [Start-ChocolateyWindowsService](xref:start-chocolateywindowsservice) - * [Stop-ChocolateyWindowsService](xref:stop-chocolateywindowsservice) - * [Uninstall-ChocolateyWindowsService](xref:uninstall-chocolateywindowsservice) +* +* +* +* ## Variables @@ -515,24 +508,24 @@ There are also a number of environment variables providing access to some values Chocolatey makes a number of environment variables available (You can access any of these with $env:TheVariableNameBelow): - * TEMP/TMP - Overridden to the CacheLocation, but may be the same as the original TEMP folder - * ChocolateyInstall - Top level folder where Chocolatey is installed - * ChocolateyPackageName - The name of the package, equivalent to the `` field in the nuspec - * ChocolateyPackageTitle - The title of the package, equivalent to the `` field in the nuspec - * ChocolateyPackageVersion - The version of the package, equivalent to the `<version />` field in the nuspec +* TEMP/TMP - Overridden to the CacheLocation, but may be the same as the original TEMP folder +* ChocolateyInstall - Top level folder where Chocolatey is installed +* ChocolateyPackageName - The name of the package, equivalent to the `<id />` field in the nuspec +* ChocolateyPackageTitle - The title of the package, equivalent to the `<title />` field in the nuspec +* ChocolateyPackageVersion - The version of the package, equivalent to the `<version />` field in the nuspec #### Advanced Environment Variables The following are more advanced settings: - * ChocolateyPackageParameters - Parameters to use with packaging, not the same as install arguments (which are passed directly to the native installer). Based on `--package-parameters`. - * CHOCOLATEY_VERSION - The version of Choco you normally see. Use if you are 'lighting' things up based on choco version, otherwise take a dependency on the specific version you need. - * ChocolateyForceX86 = If available and set to 'true', then user has requested 32bit version. Automatically handled in built in Choco functions. - * OS_PLATFORM - Like Windows, macOS, Linux. - * OS_VERSION - The version of OS, like 6.1 something something for Windows. - * OS_NAME - The reported name of the OS. - * IS_PROCESSELEVATED = Is the process elevated? - * ChocolateyPackageInstallLocation - Install location of the software that the package installs. Displayed at the end of the package install. +* ChocolateyPackageParameters - Parameters to use with packaging, not the same as install arguments (which are passed directly to the native installer). Based on `--package-parameters`. +* CHOCOLATEY_VERSION - The version of Choco you normally see. Use if you are 'lighting' things up based on choco version, otherwise take a dependency on the specific version you need. +* ChocolateyForceX86 = If available and set to 'true', then user has requested 32bit version. Automatically handled in built in Choco functions. +* OS_PLATFORM - Like Windows, macOS, Linux. +* OS_VERSION - The version of OS, like 6.1 something something for Windows. +* OS_NAME - The reported name of the OS. +* IS_PROCESSELEVATED = Is the process elevated? +* ChocolateyPackageInstallLocation - Install location of the software that the package installs. Displayed at the end of the package install. #### Set By Options and Configuration diff --git a/Invoke-Tests.ps1 b/Invoke-Tests.ps1 index d6ce96f030..6ff80f79bc 100644 --- a/Invoke-Tests.ps1 +++ b/Invoke-Tests.ps1 @@ -54,12 +54,53 @@ else { if (-not (Test-Path "$TestPath/packages") -or -not $SkipPackaging) { $null = New-Item -Path "$TestPath/packages" -ItemType Directory -Force # Get and pack packages - $nuspecs = Get-ChildItem -Path $PSScriptRoot/src/chocolatey.tests.integration, $PSScriptRoot/tests/packages -Recurse -Include *.nuspec | Where-Object FullName -notmatch 'bin' + $nuspecs = Get-ChildItem -Path $PSScriptRoot/src/chocolatey.tests.integration, $PSScriptRoot/tests/packages -Recurse -Include *.nuspec | Where-Object FullName -NotMatch 'bin' Get-ChildItem -Path $PSScriptRoot/tests/packages -Recurse -Include *.nupkg | Copy-Item -Destination "$TestPath/packages" - foreach ($file in $nuspecs) { - Write-Host "Packaging $file" - $null = choco pack $file.FullName --out "$TestPath/packages" + $packFailures = foreach ($file in $nuspecs) { + # Include allow-unofficial in case an unofficial Chocolatey has been installed globally for testing + $packOutput = choco pack $file.FullName --out "$TestPath/packages" --allow-unofficial + if ($LASTEXITCODE -ne 0) { + [pscustomobject]@{ + Package = $file.FullName + ExitCode = $LASTEXITCODE + Output = $packOutput + } + Write-Warning "Failed to pack $file" + } + else { + Write-Host "Packaged $file" + } + } + + if ($null -ne $packFailures) { + foreach ($failure in $packFailures) { + Write-Warning "$($failure.Package) failed to pack with exit code: $($failure.ExitCode)" + $failure.Output | Write-Warning + } + # If you want to stop things, change this to a throw. + # This is not currently throwing as there are two packages that are supposed to fail. + Write-Error "$($packFailures.Count) packages failed to pack." + } +} + +if (-not (Test-Path "$TestPath/all-packages") -or -not $SkipPackaging) { + $null = New-Item -Path "$TestPath/all-packages" -ItemType Directory -Force + + # These are the package ids that are loaded into the all packages test repository. + $AllPackagesRepository = @( + 'isdependency' + 'hasdependency' + 'hasnesteddependency' + 'downgradesdependency' + 'dependencyfailure' + 'hasfailingnesteddependency' + 'failingdependency' + 'isexactversiondependency' + ) + + foreach ($package in $AllPackagesRepository) { + $null = Copy-Item "$TestPath/packages/$package.*.nupkg" "$TestPath/all-packages/" } } @@ -97,6 +138,7 @@ try { Import-Module $PSScriptRoot\tests\helpers\common-helpers.psm1 -Force $null = Invoke-Choco source add --name hermes --source "$TestPath/packages" + $null = Invoke-Choco source add --name hermes-all --source "$TestPath/all-packages" Enable-ChocolateyFeature -Name allowGlobalConfirmation $PesterConfiguration = [PesterConfiguration]@{ Run = @{ diff --git a/README.md b/README.md index c0e3865bd7..f001a8aede 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,10 @@ You can just call me choco. - [Windows](#windows) - [Other Platforms](#other-platforms) - [Prerequisites:](#prerequisites) + - [Before building:](#before-building) - [Build Process:](#build-process) + - [Testing](#testing) + - [Installing on Other Platforms:](#installing-on-other-platforms) - [Credits](#credits) <!-- /TOC --> @@ -39,6 +42,7 @@ You can just call me choco. | [![GitHub Workflow Status (branch)](https://img.shields.io/github/workflow/status/chocolatey/choco/Chocolatey%20Builds/develop?logo=github)](https://github.com/chocolatey/choco/actions/workflows/build.yml) | ## Chat Room + Come join in the conversation about Chocolatey in our Community Chat Room. [![Discord](https://img.shields.io/discord/778552361454141460?logo=Discord)](https://ch0.co/community) @@ -46,9 +50,11 @@ Come join in the conversation about Chocolatey in our Community Chat Room. Please make sure you've read over and agree with the [etiquette regarding communication](#etiquette-regarding-communication). ## Support Chocolatey! + * Purchase [Chocolatey Pro / Chocolatey for Business](https://chocolatey.org/pricing#compare) ## See Chocolatey In Action + Chocolatey FOSS install showing tab completion and `refreshenv` (a way to update environment variables without restarting your shell): ![install](https://raw.githubusercontent.com/wiki/chocolatey/choco/images/gifs/choco_install.gif "Wat? Tab completion and updating environment variables!") @@ -58,11 +64,13 @@ Chocolatey FOSS install showing tab completion and `refreshenv` (a way to update ![install w/pro](https://raw.githubusercontent.com/wiki/chocolatey/choco/images/gifs/chocopro_install_stopped.gif "Chocolatey Pro availability now! A great option for individuals looking for that community PLUS option.") ## Etiquette Regarding Communication + If you are an open source user requesting support, please remember that most folks in the Chocolatey community are volunteers that have lives outside of open source and are not paid to ensure things work for you, so please be considerate of others' time when you are asking for things. Many of us have families that also need time as well and only have so much time to give on a daily basis. A little consideration and patience can go a long way. After all, you are using a pretty good tool without cost. It may not be perfect (yet), and we know that. If you are using a [commercial edition of Chocolatey](https://chocolatey.org/compare#compare), you have different terms! Please see [support](https://chocolatey.org/support). ## Information + * [Chocolatey Website and Community Package Repository](https://community.chocolatey.org) * [Mailing List](https://groups.google.com/group/chocolatey) / [Release Announcements Only Mailing List](https://groups.google.com/group/chocolatey-announce) / [Build Status Mailing List](http://groups.google.com/group/chocolatey-build-status) * [Twitter](https://twitter.com/chocolateynuget) / [Facebook](https://www.facebook.com/ChocolateySoftware) / [GitHub](https://github.com/chocolatey) @@ -70,6 +78,7 @@ If you are using a [commercial edition of Chocolatey](https://chocolatey.org/com * [Documentation](https://docs.chocolatey.org/en-us/) / [Support](https://chocolatey.org/support) ### Documentation + Please see the [docs](https://docs.chocolatey.org/en-us/) Give `choco.exe -?` a shot (or `choco.exe -h`). For specific commands, add the command and then the help switch e.g. `choco.exe install -h`. @@ -82,9 +91,11 @@ Give `choco.exe -?` a shot (or `choco.exe -h`). For specific commands, add the c - See our documentation on the [support lifecycle and supported operating systems](https://docs.chocolatey.org/en-us/information/support-lifecycle) for additional information ### License / Credits + Apache 2.0 - see [LICENSE](https://github.com/chocolatey/choco/blob/master/LICENSE) and [NOTICE](https://github.com/chocolatey/choco/blob/master/NOTICE) files. ## Submitting Issues + ![submitting issues](https://cloud.githubusercontent.com/assets/63502/12534554/6ea7cc04-c224-11e5-82ad-3805d0b5c724.png) * If you are having issue with a package, please see [Request Package Fixes or Updates / Become a maintainer of an existing package](https://docs.chocolatey.org/en-us/community-repository/users/package-triage-process). @@ -118,31 +129,45 @@ Submitting a ticket: * Include screenshots and/or animated gifs whenever possible, they help show us exactly what the problem is. ## Contributing + If you would like to contribute code or help squash a bug or two, that's awesome. Please familiarize yourself with [CONTRIBUTING](https://github.com/chocolatey/choco/blob/develop/CONTRIBUTING.md). This project uses an [.editorconfig](https://editorconfig.org) file in order to help maintain consistency of code. Errors and warnings produced by not following these defined conventions will in future be enforced at build time, so ensure your contributions adhere to the rules defined in it and produce no warnings or errors in Visual Studio. ## Committers + Committers, you should be very familiar with [COMMITTERS](https://github.com/chocolatey/choco/blob/develop/COMMITTERS.md). ### Compiling / Building Source + There is a `build.bat`/`build.sh` file that creates a necessary generated file named `SolutionVersion.cs`. It must be run at least once before Visual Studio will build. #### Windows + Prerequisites: - * .NET Framework 4.8+ - * Visual Studio 2019+ - * ReSharper is immensely helpful (and there is a `.sln.DotSettings` file to help with code conventions). +The following are a minimum set of requirements to successfully complete the build process: + + * .NET Framework 4.8 + * .NET Framework 4.8 Dev Pack + * Visual Studio 2019 or Visual Studio 2019 Build Tools + * .NET SDK (i.e. ability to install .NET Global tools using `dotnet tool install`) + +There is a `setup.ps1` file at the root of this repository, which can be used to install all of the above. Build Process: * Run `build.bat`. +> [!IMPORTANT] +> It is assumed that Chocolatey CLI is installed on the machine where you are running the build, as this is required to generate the final Chocolatey package. +> If required, you can skip the creation of the Chocolatey packages using the `--shouldRunChocolatey` option, i.e. `.\build.bat --shouldRunChocolatey=false` + Running the build on Windows should produce an artifact that is tested and ready to be used. #### Other Platforms + ##### Prerequisites: * Install and configure Mono. Mono 6.6 or newer should work, see `docker/Dockerfile.linux` for the currently recommended version of Mono. @@ -178,6 +203,15 @@ chmod +x *.sh Running the build on Mono produces an artifact similar to Windows but may have more rough edges. You may get a failure or two in the build script that can be safely ignored. +### Testing + +The Chocolatey CLI codebase contains a number of different tests, including unit, integration, and end-to-end tests. +These are all documented in the [TESTING.md](https://github.com/chocolatey/choco/blob/develop/TESTING.md) file. + +The unit and integration tests are NUnit tests, which can be executed directly within Visual Studio, or as part of the [build process](https://github.com/chocolatey/choco/blob/develop/TESTING.md#running-tests). + +The end-to-end tests use Pester as the test framework. Since these tests have the potential to actually make changes to your system, we recommend using the [provided Vagrant file to run these tests in a dedicated virtual machine](https://github.com/chocolatey/choco/blob/develop/TESTING.md#pester-tests). + ### Installing on Other Platforms: 1. Get a copy of the source code and build. @@ -186,4 +220,5 @@ Running the build on Mono produces an artifact similar to Windows but may have m 1. Copy `./docker/choco_wrapper` to a directory on the `$PATH`, rename to `choco`, and if the install directory is something else than `/opt/chocolatey`, then edit it to point to the correct path. ## Credits + Chocolatey is brought to you by quite a few people and frameworks. See [CREDITS](https://github.com/chocolatey/choco/blob/master/docs/legal/CREDITS.md) (just LEGAL/Credits.md in the zip folder). diff --git a/docs/legal/CREDITS.md b/docs/legal/CREDITS.md index 317b2ae0fa..7905b22ba6 100644 --- a/docs/legal/CREDITS.md +++ b/docs/legal/CREDITS.md @@ -6,22 +6,22 @@ - [Contributors](#contributors) - [Third Party Licenses - Development](#third-party-licenses---development) - [Third Party Licenses - Runtime](#third-party-licenses---runtime) - - [7-Zip @ 23.01](#7-zip--2301) + - [7-Zip @ 24.08](#7-zip--2408) - [AlphaFS @ 2.1.3](#alphafs--213) - - [Checksum @ 0.2.0](#checksum--020) + - [Checksum @ 0.3.1](#checksum--031) - [log4net @ 2.0.12](#log4net--2012) - [Microsoft.Bcl.HashCode @ 1.1.1](#microsoftbclhashcode--111) - - [Microsoft.Web.Xdt @ 2.1.1](#microsoftwebxdt--211) - - [Chocolatey.NuGet.Client @ 3.4.0](#chocolateynugetclient--340) + - [Microsoft.Web.Xdt @ 3.1.0](#microsoftwebxdt--310) + - [Newtonsoft.Json @ 13.0.1](#newtonsoftjson--1301) + - [Chocolatey.NuGet.Client @ 3.4.2](#chocolateynugetclient--342) - [Rhino.Licensing @ 1.4.1 (modified)](#rhinolicensing--141-modified) - - [Shim Generator (shimgen) @ 1.0.0](#shim-generator-shimgen--100) + - [Shim Generator (shimgen) @ 2.0.0](#shim-generator-shimgen--200) - [SimpleInjector @ 2.8.3](#simpleinjector--283) - [System.Reactive @ 5.0.0](#systemreactive--500) - [System.Runtime.CompilerServices.Unsafe @ 4.5.3](#systemruntimecompilerservicesunsafe--453) - [System.Threading.Tasks.Extensions @ 4.5.4](#systemthreadingtasksextensions--454) <!-- /TOC --> - ## Committers & Contributors Chocolatey has been the thoughts, ideas, and work of a large community. While [Rob](https://github.com/ferventcoder) heads up direction and plays a primary role in development, there are several people that have really been a part of making Chocolatey what it is today. @@ -73,7 +73,7 @@ We would like to credit other super sweet tools/frameworks that aid in the devel Chocolatey CLI (choco) uses a number of 3rd-party components. Their details are below. -### 7-Zip @ 23.01 +### 7-Zip @ 24.08 Chocolatey uses [7-Zip](http://www.7-zip.org/) for uncompressing archives. [License terms](http://www.7-zip.org/license.txt): @@ -198,7 +198,7 @@ Chocolatey uses [AlphaFS](https://github.com/alphaleonis/AlphaFS) for long file OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ``` -### Checksum @ 0.2.0 +### Checksum @ 0.3.1 Chocolatey uses [Checksum](https://github.com/chocolatey/checksum) to determine checksums. [License terms](https://github.com/chocolatey/checksum/blob/e6f5645610c7bc15084b48f69d4cdb056106f956/LICENSE): @@ -598,113 +598,205 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ``` -### Microsoft.Web.Xdt @ 2.1.1 +### Microsoft.Web.Xdt @ 3.1.0 Chocolatey uses [Microsoft.Web.Xdt](https://www.nuget.org/packages/Microsoft.Web.xdt) to perform Xml Document Transformation. -[License terms](https://www.microsoft.com/web/webpi/eula/microsoft_web_xmltransform.htm): +[License terms](https://github.com/dotnet/xdt/blob/01eb67319c7e9a852799734dfb7c29fa64b48c69/LICENSE.txt): ```txt - MICROSOFT SOFTWARE LICENSE TERMS - - MICROSOFT.WEB.XDT - - These license terms are an agreement between Microsoft Corporation (or based on where you live, one of its affiliates) and you. Please read them. They apply to the software named above, which includes the media on which you received it, if any. The terms also apply to any Microsoft - - · updates, - - · supplements, - - · Internet-based services, and - - · support services - - for this software, unless other terms accompany those items. If so, those terms apply. - - By using the software, you accept these terms. If you do not accept them, do not use the software. - - If you comply with these license terms, you have the perpetual rights below. - - 1. INSTALLATION AND USE RIGHTS. You may install and use any number of copies of the software on your devices. - - 2. ADDITIONAL LICENSING REQUIREMENTS AND/OR USE RIGHTS. - - a. Distributable Code. The software contains code that you are permitted to distribute in programs you develop if you comply with the terms below. - - i. Right to Use and Distribute. You may copy and distribute the object code form of Microsoft.Web.XmlTransform.dll file. - - · Third Party Distribution. You may permit distributors of your programs to copy and distribute the Distributable Code as part of those programs. - - ii.Distribution Requirements. For any Distributable Code you distribute, you must - - · add significant primary functionality to it in your programs; - - · require distributors and external end users to agree to terms that protect it at least as much as this agreement; + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ - · display your valid copyright notice on your programs; and + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - · indemnify, defend, and hold harmless Microsoft from any claims, including attorneys’ fees, related to the distribution or use of your programs. + 1. Definitions. - iii. Distribution Restrictions. You may not + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. - · alter any copyright, trademark or patent notice in the Distributable Code; + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. - · use Microsoft’s trademarks in your programs’ names or in a way that suggests your programs come from or are endorsed by Microsoft; + "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. - · distribute Distributable Code to run on a platform other than the Windows platform; + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. - · include Distributable Code in malicious, deceptive or unlawful programs; or + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. - · modify or distribute the source code of any Distributable Code so that any part of it becomes subject to an Excluded License. An Excluded License is one that requires, as a condition of use, modification or distribution, that + "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. - · the code be disclosed or distributed in source code form; or + "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). - · others have the right to modify it. + "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. - 3. SCOPE OF LICENSE. The software is licensed, not sold. This agreement only gives you some rights to use the software. Microsoft reserves all other rights. Unless applicable law gives you more rights despite this limitation, you may use the software only as expressly permitted in this agreement. In doing so, you must comply with any technical limitations in the software that only allow you to use it in certain ways. You may not + "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." - · work around any technical limitations in the software; + "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. - · reverse engineer, decompile or disassemble the software, except and only to the extent that applicable law expressly permits, despite this limitation; + 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. - · make more copies of the software than specified in this agreement or allowed by applicable law, despite this limitation; + 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. - · publish the software for others to copy; + 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: - · rent, lease or lend the software; or + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and - · transfer the software or this agreement to any third party. + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and - 4. BACKUP COPY. You may make one backup copy of the software. You may use it only to reinstall the software. + (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 - 5. DOCUMENTATION. Any person that has valid access to your computer or internal network may copy and use the documentation for your internal, reference purposes. + (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. - 6. EXPORT RESTRICTIONS. The software is subject to United States export laws and regulations. You must comply with all domestic and international export laws and regulations that apply to the software. These laws include restrictions on destinations, end users and end use. For additional information, see www.microsoft.com/exporting. + 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. - 7. SUPPORT SERVICES. Because this software is “as is,” we may not provide support services for it. + 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. - 8. ENTIRE AGREEMENT. This agreement, and the terms for supplements, updates, Internet-based services and support services that you use, are the entire agreement for the software and support services. + 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. - 9. APPLICABLE LAW. + 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. - a. United States. If you acquired the software in the United States, Washington state law governs the interpretation of this agreement and applies to claims for breach of it, regardless of conflict of laws principles. The laws of the state where you live govern all other claims, including claims under state consumer protection laws, unfair competition laws, and in tort. + 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. - b. Outside the United States. If you acquired the software in any other country, the laws of that country apply. + 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. - 10. LEGAL EFFECT. This agreement describes certain legal rights. You may have other rights under the laws of your country. You may also have rights with respect to the party from whom you acquired the software. This agreement does not change your rights under the laws of your country if the laws of your country do not permit it to do so. + END OF TERMS AND CONDITIONS +``` - 11. DISCLAIMER OF WARRANTY. The software is licensed “as-is.” You bear the risk of using it. Microsoft gives no express warranties, guarantees or conditions. You may have additional consumer rights or statutory guarantees under your local laws which this agreement cannot change. To the extent permitted under your local laws, Microsoft excludes the implied warranties of merchantability, fitness for a particular purpose and non-infringement. +### Newtonsoft.Json @ 13.0.1 - FOR AUSTRALIA – You have statutory guarantees under the Australian Consumer Law and nothing in these terms is intended to affect those rights. +Chocolatey uses [Newtonsoft.Json](https://www.nuget.org/packages/Newtonsoft.Json) to help serialize/deserialze JSON files. +[License terms](https://github.com/JamesNK/Newtonsoft.Json/blob/415b563806c218e9270331ea98c584fe84e58880/LICENSE.md): - 12. LIMITATION ON AND EXCLUSION OF REMEDIES AND DAMAGES. You can recover from Microsoft and its suppliers only direct damages up to U.S. $5.00. You cannot recover any other damages, including consequential, lost profits, special, indirect or incidental damages. +```txt +The MIT License (MIT) - This limitation applies to +Copyright (c) 2007 James Newton-King - · anything related to the software, services, content (including code) on third party Internet sites, or third party programs; and +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: - · claims for breach of contract, breach of warranty, guarantee or condition, strict liability, negligence, or other tort to the extent permitted by applicable law. +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - It also applies even if Microsoft knew or should have known about the possibility of the damages. The above limitation or exclusion may not apply to you because your country may not allow the exclusion or limitation of incidental, consequential or other damages. +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. ``` ### Chocolatey.NuGet.Client @ 3.4.2 @@ -763,7 +855,7 @@ Chocolatey uses [Rhino.Licensing](https://github.com/ayende/rhino-licensing) [(m THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ``` -### Shim Generator (shimgen) @ 1.0.0 +### Shim Generator (shimgen) @ 2.0.0 Chocolatey uses [shimgen](https://github.com/chocolatey/shimgen) to generate shim executables that call the original binaries. [License terms](https://github.com/chocolatey/choco/blob/96a796297641807094f1f56d130a7413e583d0ac/src/chocolatey.resources/tools/shimgen.license.txt): @@ -892,7 +984,7 @@ SOFTWARE. ### System.Runtime.CompilerServices.Unsafe @ 4.5.3 This is a dependency of System.Threading.Tasks.Extensions. -[Licensed terms](https://github.com/dotnet/runtime/blob/5bdc36e1d956fc39cd768b6cf59ac4b4bf5f56a5/LICENSE.TXT): +[License terms](https://github.com/dotnet/runtime/blob/5bdc36e1d956fc39cd768b6cf59ac4b4bf5f56a5/LICENSE.TXT): ```txt The MIT License (MIT) @@ -923,7 +1015,7 @@ SOFTWARE. ### System.Threading.Tasks.Extensions @ 4.5.4 This is a dependency of System.Reactive. -[Licensed terms](https://github.com/dotnet/runtime/blob/5bdc36e1d956fc39cd768b6cf59ac4b4bf5f56a5/LICENSE.TXT): +[License terms](https://github.com/dotnet/runtime/blob/5bdc36e1d956fc39cd768b6cf59ac4b4bf5f56a5/LICENSE.TXT): ```txt The MIT License (MIT) diff --git a/nuspec/chocolatey/chocolatey/tools/chocolateysetup.psm1 b/nuspec/chocolatey/chocolatey/tools/chocolateysetup.psm1 index 0034cbe82f..da4a61d93a 100644 --- a/nuspec/chocolatey/chocolatey/tools/chocolateysetup.psm1 +++ b/nuspec/chocolatey/chocolatey/tools/chocolateysetup.psm1 @@ -1,8 +1,7 @@ $thisScriptFolder = (Split-Path -Parent $MyInvocation.MyCommand.Definition) $chocoInstallVariableName = "ChocolateyInstall" -$sysDrive = $env:SystemDrive $tempDir = $env:TEMP -$defaultChocolateyPathOld = "$sysDrive\Chocolatey" +$insecureRootInstallPath = "$env:SystemDrive\Chocolatey" $originalForegroundColor = $host.ui.RawUI.ForegroundColor @@ -135,14 +134,15 @@ function Initialize-Chocolatey { } # variable to allow insecure directory: - $allowInsecureRootInstall = $false - if ($env:ChocolateyAllowInsecureRootDirectory -eq 'true') { - $allowInsecureRootInstall = $true - } + $allowInsecureRootInstall = $env:ChocolateyAllowInsecureRootDirectory -eq 'true' # if we have an already environment variable path, use it. $alreadyInitializedNugetPath = Get-ChocolateyInstallFolder - if ($alreadyInitializedNugetPath -and $alreadyInitializedNugetPath -ne $chocolateyPath -and ($allowInsecureRootInstall -or $alreadyInitializedNugetPath -ne $defaultChocolateyPathOld)) { + + $useCustomInstallPath = $alreadyInitializedNugetPath -and + $alreadyInitializedNugetPath -ne $chocolateyPath -and + ($allowInsecureRootInstall -or $alreadyInitializedNugetPath -ne $insecureRootInstallPath) + if ($useCustomInstallPath) { $chocolateyPath = $alreadyInitializedNugetPath } else { @@ -194,11 +194,6 @@ Creating Chocolatey CLI folders if they do not already exist. $realModule = Join-Path $chocolateyPath "helpers\chocolateyInstaller.psm1" Import-Module "$realModule" -Force - if (-not $allowInsecureRootInstall -and (Test-Path($defaultChocolateyPathOld))) { - Upgrade-OldChocolateyInstall $defaultChocolateyPathOld $chocolateyPath - Install-ChocolateyBinFiles $chocolateyPath $chocolateyExePath - } - Add-ChocolateyProfile Invoke-Chocolatey-Initial if ($env:ChocolateyExitCode -eq $null -or $env:ChocolateyExitCode -eq '') { @@ -220,10 +215,6 @@ You may need to shut down and restart powershell and/or consoles "@ | Write-Output } - if (-not $allowInsecureRootInstall) { - Remove-OldChocolateyInstall $defaultChocolateyPathOld - } - Remove-UnsupportedShimFiles -Paths $chocolateyExePath } @@ -368,87 +359,6 @@ function Ensure-Permissions { $ErrorActionPreference = $currentEA } -function Upgrade-OldChocolateyInstall { - param( - [string]$chocolateyPathOld = "$sysDrive\Chocolatey", - [string]$chocolateyPath = "$($env:ALLUSERSPROFILE)\chocolatey" - ) - - Write-Debug "Upgrade-OldChocolateyInstall" - - if (Test-Path $chocolateyPathOld) { - Write-Output "Attempting to upgrade `'$chocolateyPathOld`' to `'$chocolateyPath`'." - Write-ChocolateyWarning "Copying the contents of `'$chocolateyPathOld`' to `'$chocolateyPath`'. `n This step may fail if you have anything in this folder running or locked." - Write-Output 'If it fails, just manually copy the rest of the items out and then delete the folder.' - Write-ChocolateyWarning "!!!! ATTN: YOU WILL NEED TO CLOSE AND REOPEN YOUR SHELL !!!!" - #-ForegroundColor Magenta -BackgroundColor Black - - $chocolateyExePathOld = Join-Path $chocolateyPathOld 'bin' - 'Machine', 'User' | - ForEach-Object { - $path = Get-EnvironmentVariable -Name 'PATH' -Scope $_ - $updatedPath = [System.Text.RegularExpressions.Regex]::Replace($path, [System.Text.RegularExpressions.Regex]::Escape($chocolateyExePathOld) + '(?>;)?', '', [System.Text.RegularExpressions.RegexOptions]::IgnoreCase) - if ($updatedPath -ne $path) { - Write-Output "Updating `'$_`' PATH to reflect removal of '$chocolateyPathOld'." - try { - Set-EnvironmentVariable -Name 'Path' -Value $updatedPath -Scope $_ -ErrorAction Stop - } - catch { - Write-ChocolateyWarning "Was not able to remove the old environment variable from PATH. You will need to do this manually" - } - } - } - - Copy-Item "$chocolateyPathOld\lib\*" "$chocolateyPath\lib" -Force -Recurse - - $from = "$chocolateyPathOld\bin" - $to = "$chocolateyPath\bin" - # TODO: This exclusion list needs to be updated once shims are removed - $exclude = @("choco.exe", "RefreshEnv.cmd") - Get-ChildItem -Path $from -Recurse -Exclude $exclude | - ForEach-Object { - Write-Debug "Copying $_ `n to $to" - if ($_.PSIsContainer) { - Copy-Item $_ -Destination (Join-Path $to $_.Parent.FullName.Substring($from.length)) -Force -ErrorAction SilentlyContinue - } - else { - $fileToMove = (Join-Path $to $_.FullName.Substring($from.length)) - try { - Copy-Item $_ -Destination $fileToMove -Exclude $exclude -Force -ErrorAction Stop - } - catch { - Write-ChocolateyWarning "Was not able to move `'$fileToMove`'. You may need to reinstall the shim" - } - } - } - } -} - -function Remove-OldChocolateyInstall { - param( - [string]$chocolateyPathOld = "$sysDrive\Chocolatey" - ) - Write-Debug "Remove-OldChocolateyInstall" - - if (Test-Path $chocolateyPathOld) { - Write-ChocolateyWarning "This action will result in Log Errors, you can safely ignore those. `n You may need to finish removing '$chocolateyPathOld' manually." - try { - Get-ChildItem -Path "$chocolateyPathOld" | ForEach-Object { - if (Test-Path $_.FullName) { - Write-Debug "Removing $_ unless matches .log" - Remove-Item $_.FullName -Exclude *.log -Recurse -Force -ErrorAction SilentlyContinue - } - } - - Write-Output "Attempting to remove `'$chocolateyPathOld`'. This may fail if something in the folder is being used or locked." - Remove-Item "$($chocolateyPathOld)" -Force -Recurse -ErrorAction Stop - } - catch { - Write-ChocolateyWarning "Was not able to remove `'$chocolateyPathOld`'. You will need to manually remove it." - } - } -} - function Install-ChocolateyFiles { param( [string]$chocolateyPath @@ -874,10 +784,10 @@ function Invoke-Chocolatey-Initial { Export-ModuleMember -Function Initialize-Chocolatey # SIG # Begin signature block -# MIInKwYJKoZIhvcNAQcCoIInHDCCJxgCAQExDzANBglghkgBZQMEAgEFADB5Bgor +# MIInJQYJKoZIhvcNAQcCoIInFjCCJxICAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG -# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCArPR/MaAFOnPhm -# wTraOHhBiut3LMThkjxzi7DsT2up/qCCIK4wggWNMIIEdaADAgECAhAOmxiO+dAt +# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCAL5XDIHTSoe/0U +# 1fpADM55u4sth4hYys5hdS4zocysbqCCIKgwggWNMIIEdaADAgECAhAOmxiO+dAt # 5+/bUOIIQBhaMA0GCSqGSIb3DQEBDAUAMGUxCzAJBgNVBAYTAlVTMRUwEwYDVQQK # EwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xJDAiBgNV # BAMT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fFlENv +# a8ley6s/fMLtw0nZXC46kZfHBBRO2Um7wSQsf6k9TRDt+/vF+aNo1jpRDu0Jlw8o +# Q0h4udyE/8BTLl88Sv7cttVk7E//2vA2NjUy74n9UcOMx4DbwlSa7xCP2V/j7+uJ +# sDFbogq46ONf26yMs5V2PkHObaYovCfWp2qSm6ArwJOqQac0RbpndFCEwWAt4iss +# oSdMIYFkh0U4BPdavX84Tl9AjmZleEZ9Pw+lqd9JAxe4xVKDXHdG1po= # SIG # End signature block diff --git a/recipe.cake b/recipe.cake index 017d2baca6..feca7ac13c 100644 --- a/recipe.cake +++ b/recipe.cake @@ -1,4 +1,5 @@ #load nuget:?package=Chocolatey.Cake.Recipe&version=0.28.4 +#tool nuget:?package=WiX&version=3.11.2 /////////////////////////////////////////////////////////////////////////////// // TOOLS @@ -172,11 +173,21 @@ Task("Prepare-Chocolatey-Packages") { // Copy legal documents CopyFile(BuildParameters.RootDirectoryPath + "/docs/legal/CREDITS.md", BuildParameters.Paths.Directories.ChocolateyNuspecDirectory + "/tools/chocolateyInstall/CREDITS.txt"); + CopyFile(BuildParameters.Paths.Directories.PublishedApplications + "/choco/LICENSE.txt", BuildParameters.Paths.Directories.ChocolateyNuspecDirectory + "/tools/chocolateyInstall/LICENSE.txt"); - // Run Chocolatey Unpackself - CopyFile(BuildParameters.Paths.Directories.PublishedApplications + "/choco_merged/choco.exe", BuildParameters.Paths.Directories.ChocolateyNuspecDirectory + "/tools/chocolateyInstall/choco.exe"); + // Copy choco.exe.manifest + CopyFile(BuildParameters.Paths.Directories.PublishedApplications + "/choco/choco.exe.manifest", BuildParameters.Paths.Directories.ChocolateyNuspecDirectory + "/tools/chocolateyInstall/choco.exe.manifest"); + + // Copy external file resources + EnsureDirectoryExists(BuildParameters.Paths.Directories.ChocolateyNuspecDirectory + "/tools/chocolateyInstall/helpers"); + CopyFiles(GetFiles(BuildParameters.Paths.Directories.PublishedApplications + "/choco/helpers/**/*"), BuildParameters.Paths.Directories.ChocolateyNuspecDirectory + "/tools/chocolateyInstall/helpers", true); + EnsureDirectoryExists(BuildParameters.Paths.Directories.ChocolateyNuspecDirectory + "/tools/chocolateyInstall/redirects"); + CopyFiles(GetFiles(BuildParameters.Paths.Directories.PublishedApplications + "/choco/redirects/**/*"), BuildParameters.Paths.Directories.ChocolateyNuspecDirectory + "/tools/chocolateyInstall/redirects", true); + EnsureDirectoryExists(BuildParameters.Paths.Directories.ChocolateyNuspecDirectory + "/tools/chocolateyInstall/tools"); + CopyFiles(GetFiles(BuildParameters.Paths.Directories.PublishedApplications + "/choco/tools/**/*"), BuildParameters.Paths.Directories.ChocolateyNuspecDirectory + "/tools/chocolateyInstall/tools", true); - StartProcess(BuildParameters.Paths.Directories.ChocolateyNuspecDirectory + "/tools/chocolateyInstall/choco.exe", new ProcessSettings{ Arguments = "unpackself -f -y --allow-unofficial-build --run-actual" }); + // Copy merged choco.exe + CopyFile(BuildParameters.Paths.Directories.PublishedApplications + "/choco_merged/choco.exe", BuildParameters.Paths.Directories.ChocolateyNuspecDirectory + "/tools/chocolateyInstall/choco.exe"); // Copy Chocolatey.PowerShell.dll and its help.xml file CopyFile(BuildParameters.Paths.Directories.PublishedLibraries + "/Chocolatey.PowerShell/Chocolatey.PowerShell.dll", BuildParameters.Paths.Directories.ChocolateyNuspecDirectory + "/tools/chocolateyInstall/helpers/Chocolatey.PowerShell.dll"); @@ -264,11 +275,21 @@ Task("Prepare-ChocolateyNo7zip-Package") // Copy legal documents CopyFile(BuildParameters.RootDirectoryPath + "/docs/legal/CREDITS.md", nuspecDirectory + "/tools/chocolateyInstall/CREDITS.txt"); + CopyFile(BuildParameters.Paths.Directories.PublishedApplications + "/choco-no7zip/LICENSE.txt", nuspecDirectory + "/tools/chocolateyInstall/LICENSE.txt"); - // Run Chocolatey Unpackself - CopyFile(BuildParameters.Paths.Directories.PublishedApplications + "/choco-no7zip_merged/choco.exe", nuspecDirectory + "/tools/chocolateyInstall/choco.exe"); + // Copy choco.exe.manifest + CopyFile(BuildParameters.Paths.Directories.PublishedApplications + "/choco-no7zip/choco.exe.manifest", nuspecDirectory + "/tools/chocolateyInstall/choco.exe.manifest"); + + // Copy external file resources + EnsureDirectoryExists(nuspecDirectory + "/tools/chocolateyInstall/helpers"); + CopyFiles(GetFiles(BuildParameters.Paths.Directories.PublishedApplications + "/choco-no7zip/helpers/**/*"), nuspecDirectory + "/tools/chocolateyInstall/helpers", true); + EnsureDirectoryExists(nuspecDirectory + "/tools/chocolateyInstall/redirects"); + CopyFiles(GetFiles(BuildParameters.Paths.Directories.PublishedApplications + "/choco-no7zip/redirects/**/*"), nuspecDirectory + "/tools/chocolateyInstall/redirects", true); + EnsureDirectoryExists(nuspecDirectory + "/tools/chocolateyInstall/tools"); + CopyFiles(GetFiles(BuildParameters.Paths.Directories.PublishedApplications + "/choco-no7zip/tools/**/*"), nuspecDirectory + "/tools/chocolateyInstall/tools", true); - StartProcess(nuspecDirectory + "/tools/chocolateyInstall/choco.exe", new ProcessSettings{ Arguments = "unpackself -f -y --allow-unofficial-build" }); + // Copy merged choco.exe + CopyFile(BuildParameters.Paths.Directories.PublishedApplications + "/choco-no7zip_merged/choco.exe", nuspecDirectory + "/tools/chocolateyInstall/choco.exe"); // Copy Chocolatey.PowerShell.dll and help.xml file CopyFile(BuildParameters.Paths.Directories.PublishedLibraries + "/Chocolatey.PowerShell/Chocolatey.PowerShell.dll", nuspecDirectory + "/tools/chocolateyInstall/helpers/Chocolatey.PowerShell.dll"); diff --git a/setup.ps1 b/setup.ps1 index 187b242e30..e0bb159561 100644 --- a/setup.ps1 +++ b/setup.ps1 @@ -3,4 +3,7 @@ if (-not $env:ChocolateyInstall -or -not (Test-Path "$env:ChocolateyInstall")) { Invoke-Expression ((New-Object net.webclient).DownloadString("https://community.chocolatey.org/install.ps1")) } -choco install pester -version 2.0.2 +choco install dotnetfx -y +choco install visualstudio2019buildtools -y +choco install netfx-4.8-devpack -y +choco install dotnet-sdk -y diff --git a/src/Chocolatey.PowerShell/Chocolatey.PowerShell.dll-Help.xml b/src/Chocolatey.PowerShell/Chocolatey.PowerShell.dll-Help.xml index b6f74a03dd..a1d054d346 100644 --- a/src/Chocolatey.PowerShell/Chocolatey.PowerShell.dll-Help.xml +++ b/src/Chocolatey.PowerShell/Chocolatey.PowerShell.dll-Help.xml @@ -154,23 +154,23 @@ <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> - <maml:uri>https://docs.chocolatey.org/en-us/create/functions/get-environmentvariable</maml:uri> + <maml:uri>https://docs.chocolatey.org/en-us/create/cmdlets/get-environmentvariable</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-EnvironmentVariableNames</maml:linkText> - <maml:uri>xref:get-environmentvariablenames</maml:uri> + <maml:uri>xref:get-environmentvariablenames,mb-3 d-block</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Set-EnvironmentVariable</maml:linkText> - <maml:uri>xref:set-environmentvariable</maml:uri> + <maml:uri>xref:set-environmentvariable,mb-3 d-block</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Cmdlet Reference</maml:linkText> - <maml:uri>xref:powershell-cmdlet-reference</maml:uri> + <maml:uri>xref:powershell-cmdlet-reference,mb-3 d-block</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Function Reference</maml:linkText> - <maml:uri>xref:powershell-reference</maml:uri> + <maml:uri>xref:powershell-reference,d-block</maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> @@ -274,23 +274,23 @@ <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> - <maml:uri>https://docs.chocolatey.org/en-us/create/functions/get-environmentvariablenames</maml:uri> + <maml:uri>https://docs.chocolatey.org/en-us/create/cmdlets/get-environmentvariablenames</maml:uri> </maml:navigationLink> <maml:navigationLink> - <maml:linkText>Get-EnvironmentVariable</maml:linkText> - <maml:uri>xref:get-environmentvariable</maml:uri> + <maml:linkText>Get-EnvironmentVariableNames</maml:linkText> + <maml:uri>xref:get-environmentvariablenames,mb-3 d-block</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Set-EnvironmentVariable</maml:linkText> - <maml:uri>xref:set-environmentvariable</maml:uri> + <maml:uri>xref:set-environmentvariable,mb-3 d-block</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Cmdlet Reference</maml:linkText> - <maml:uri>xref:powershell-cmdlet-reference</maml:uri> + <maml:uri>xref:powershell-cmdlet-reference,mb-3 d-block</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Function Reference</maml:linkText> - <maml:uri>xref:powershell-reference</maml:uri> + <maml:uri>xref:powershell-reference,d-block</maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> @@ -300,8 +300,7 @@ <command:verb>Install</command:verb> <command:noun>ChocolateyPath</command:noun> <maml:description> - <maml:para>> :choco-info: NOTE > > Administrative Access Required when `-PathType 'Machine'.`</maml:para> - <maml:para>This puts a directory to the PATH environment variable.</maml:para> + <maml:para>> :choco-info: NOTE > > Administrative Access Required when `-PathType 'Machine'.` This puts a directory to the PATH environment variable.</maml:para> </maml:description> </command:details> <maml:description> @@ -351,6 +350,28 @@ </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> + <maml:name>Confirm</maml:name> + <maml:description> + <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> + </maml:description> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> + <maml:name>WhatIf</maml:name> + <maml:description> + <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> + </maml:description> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> @@ -390,6 +411,30 @@ </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> + <maml:name>Confirm</maml:name> + <maml:description> + <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> + </maml:description> + <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> + <maml:name>WhatIf</maml:name> + <maml:description> + <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> + </maml:description> + <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> </command:parameters> <command:inputTypes /> <command:returnValues /> @@ -401,7 +446,7 @@ </maml:alertSet> <command:examples> <command:example> - <maml:title>-------------------------- Example 1 --------------------------</maml:title> + <maml:title>-------------------------- Example 2 --------------------------</maml:title> <dev:code>PS C:\> Install-ChocolateyPath -PathToInstall "$($env:SystemDrive)\tools\gittfs"</dev:code> <dev:remarks> <maml:para>Adds the target path to the current user's PATH.</maml:para> @@ -418,35 +463,35 @@ <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> - <maml:uri>https://docs.chocolatey.org/en-us/create/functions/install-chocolateypath</maml:uri> + <maml:uri>https://docs.chocolatey.org/en-us/create/cmdlets/install-chocolateypath</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Uninstall-ChocolateyPath</maml:linkText> - <maml:uri>xref:uninstall-chocolateypath</maml:uri> + <maml:uri>xref:uninstall-chocolateypath,mb-3 d-block</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Install-ChocolateyEnvironmentVariable</maml:linkText> - <maml:uri>xref:install-chocolateyenvironmentvariable</maml:uri> + <maml:uri>xref:install-chocolateyenvironmentvariable,mb-3 d-block</maml:uri> </maml:navigationLink> <maml:navigationLink> - <maml:linkText>Get-EnvironmentVariable</maml:linkText> - <maml:uri>xref:get-environmentvariable</maml:uri> + <maml:linkText>Get-EnvironmentVariableNames</maml:linkText> + <maml:uri>xref:get-environmentvariablenames,mb-3 d-block</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Set-EnvironmentVariable</maml:linkText> - <maml:uri>xref:set-environmentvariable</maml:uri> + <maml:uri>xref:set-environmentvariable,mb-3 d-block</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-ToolsLocation</maml:linkText> - <maml:uri>xref:get-toolslocation</maml:uri> + <maml:uri>xref:get-toolslocation,mb-3 d-block</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Cmdlet Reference</maml:linkText> - <maml:uri>xref:powershell-cmdlet-reference</maml:uri> + <maml:uri>xref:powershell-cmdlet-reference,mb-3 d-block</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Function Reference</maml:linkText> - <maml:uri>xref:powershell-reference</maml:uri> + <maml:uri>xref:powershell-reference,d-block</maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> @@ -456,8 +501,7 @@ <command:verb>Set</command:verb> <command:noun>EnvironmentVariable</command:noun> <maml:description> - <maml:para>> :choco-info: NOTE > > Administrative Access Required when `-Scope 'Machine'.`</maml:para> - <maml:para>DO NOT USE. Not part of the public API. Use `Install-ChocolateyEnvironmentVariable` instead.</maml:para> + <maml:para>> :choco-info: NOTE > > Administrative Access Required when `-Scope 'Machine'.` DO NOT USE. Not part of the public API. Use `Install-ChocolateyEnvironmentVariable` instead.</maml:para> </maml:description> </command:details> <maml:description> @@ -519,6 +563,28 @@ </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> + <maml:name>Confirm</maml:name> + <maml:description> + <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> + </maml:description> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> + <maml:name>WhatIf</maml:name> + <maml:description> + <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> + </maml:description> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> @@ -570,6 +636,30 @@ </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> + <maml:name>Confirm</maml:name> + <maml:description> + <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> + </maml:description> + <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> + <maml:name>WhatIf</maml:name> + <maml:description> + <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> + </maml:description> + <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> </command:parameters> <command:inputTypes /> <command:returnValues /> @@ -590,31 +680,31 @@ <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> - <maml:uri>https://docs.chocolatey.org/en-us/create/functions/set-environmentvariable</maml:uri> + <maml:uri>https://docs.chocolatey.org/en-us/create/cmdlets/set-environmentvariable</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Install-ChocolateyEnvironmentVariable</maml:linkText> - <maml:uri>xref:install-chocolateyenvironmentvariable</maml:uri> + <maml:uri>xref:install-chocolateyenvironmentvariable,mb-3 d-block</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Uninstall-ChocolateyEnvironmentVariable</maml:linkText> - <maml:uri>xref:uninstall-chocolateyenvironmentvariable</maml:uri> + <maml:uri>xref:uninstall-chocolateyenvironmentvariable,mb-3 d-block</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Install-ChocolateyPath</maml:linkText> - <maml:uri>xref:install-chocolateypath</maml:uri> + <maml:uri>xref:install-chocolateypath,mb-3 d-block</maml:uri> </maml:navigationLink> <maml:navigationLink> - <maml:linkText>Get-EnvironmentVariable</maml:linkText> - <maml:uri>xref:get-environmentvariable</maml:uri> + <maml:linkText>Get-EnvironmentVariableNames</maml:linkText> + <maml:uri>xref:get-environmentvariablenames,mb-3 d-block</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Cmdlet Reference</maml:linkText> - <maml:uri>xref:powershell-cmdlet-reference</maml:uri> + <maml:uri>xref:powershell-cmdlet-reference,mb-3 d-block</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Function Reference</maml:linkText> - <maml:uri>xref:powershell-reference</maml:uri> + <maml:uri>xref:powershell-reference,d-block</maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> @@ -690,15 +780,15 @@ <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> - <maml:uri>https://docs.chocolatey.org/en-us/create/functions/test-processadminrights</maml:uri> + <maml:uri>https://docs.chocolatey.org/en-us/create/cmdlets/test-processadminrights</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Cmdlet Reference</maml:linkText> - <maml:uri>xref:powershell-cmdlet-reference</maml:uri> + <maml:uri>xref:powershell-cmdlet-reference,mb-3 d-block</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Function Reference</maml:linkText> - <maml:uri>xref:powershell-reference</maml:uri> + <maml:uri>xref:powershell-reference,d-block</maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> @@ -708,8 +798,7 @@ <command:verb>Uninstall</command:verb> <command:noun>ChocolateyPath</command:noun> <maml:description> - <maml:para>> :choco_info: NOTE > > Administrative Access Required when `-PathType 'Machine'.`</maml:para> - <maml:para>This puts a directory to the PATH environment variable.</maml:para> + <maml:para>> :choco-info: NOTE > > Administrative Access Required when `-PathType 'Machine'.` This puts a directory to the PATH environment variable.</maml:para> </maml:description> </command:details> <maml:description> @@ -759,6 +848,28 @@ </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> + <maml:name>Confirm</maml:name> + <maml:description> + <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> + </maml:description> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> + <maml:name>WhatIf</maml:name> + <maml:description> + <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> + </maml:description> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> @@ -798,6 +909,30 @@ </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> + <maml:name>Confirm</maml:name> + <maml:description> + <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> + </maml:description> + <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> + <maml:name>WhatIf</maml:name> + <maml:description> + <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> + </maml:description> + <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> </command:parameters> <command:inputTypes /> <command:returnValues /> @@ -825,35 +960,35 @@ <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> - <maml:uri>https://docs.chocolatey.org/en-us/create/functions/uninstall-chocolateypath</maml:uri> + <maml:uri>https://docs.chocolatey.org/en-us/create/cmdlets/uninstall-chocolateypath</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Install-ChocolateyPath</maml:linkText> - <maml:uri>xref:install-chocolateypath</maml:uri> + <maml:uri>xref:install-chocolateypath,mb-3 d-block</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Install-ChocolateyEnvironmentVariable</maml:linkText> - <maml:uri>xref:install-chocolateyenvironmentvariable</maml:uri> + <maml:uri>xref:install-chocolateyenvironmentvariable,mb-3 d-block</maml:uri> </maml:navigationLink> <maml:navigationLink> - <maml:linkText>Get-EnvironmentVariable</maml:linkText> - <maml:uri>xref:get-environmentvariable</maml:uri> + <maml:linkText>Get-EnvironmentVariableNames</maml:linkText> + <maml:uri>xref:get-environmentvariablenames,mb-3 d-block</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Set-EnvironmentVariable</maml:linkText> - <maml:uri>xref:set-environmentvariable</maml:uri> + <maml:uri>xref:set-environmentvariable,mb-3 d-block</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-ToolsLocation</maml:linkText> - <maml:uri>xref:get-toolslocation</maml:uri> + <maml:uri>xref:get-toolslocation,mb-3 d-block</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Cmdlet Reference</maml:linkText> - <maml:uri>xref:powershell-cmdlet-reference</maml:uri> + <maml:uri>xref:powershell-cmdlet-reference,mb-3 d-block</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Function Reference</maml:linkText> - <maml:uri>xref:powershell-reference</maml:uri> + <maml:uri>xref:powershell-reference,d-block</maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> @@ -885,6 +1020,28 @@ </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> + <maml:name>Confirm</maml:name> + <maml:description> + <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> + </maml:description> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> + <maml:name>WhatIf</maml:name> + <maml:description> + <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> + </maml:description> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> @@ -900,6 +1057,30 @@ </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> + <maml:name>Confirm</maml:name> + <maml:description> + <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> + </maml:description> + <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> + <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> + <maml:name>WhatIf</maml:name> + <maml:description> + <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> + </maml:description> + <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> + <dev:type> + <maml:name>SwitchParameter</maml:name> + <maml:uri /> + </dev:type> + <dev:defaultValue>False</dev:defaultValue> + </command:parameter> </command:parameters> <command:inputTypes /> <command:returnValues /> @@ -921,15 +1102,15 @@ <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> - <maml:uri>https://docs.chocolatey.org/en-us/create/functions/update-sessionenvironment</maml:uri> + <maml:uri>https://docs.chocolatey.org/en-us/create/cmdlets/update-sessionenvironment</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Cmdlet Reference</maml:linkText> - <maml:uri>xref:powershell-cmdlet-reference</maml:uri> + <maml:uri>xref:powershell-cmdlet-reference,mb-3 d-block</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Function Reference</maml:linkText> - <maml:uri>xref:powershell-reference</maml:uri> + <maml:uri>xref:powershell-reference,d-block</maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> diff --git a/src/Chocolatey.PowerShell/Commands/InstallChocolateyPathCommand.cs b/src/Chocolatey.PowerShell/Commands/InstallChocolateyPathCommand.cs index c9da5edd3b..6ea999f47a 100644 --- a/src/Chocolatey.PowerShell/Commands/InstallChocolateyPathCommand.cs +++ b/src/Chocolatey.PowerShell/Commands/InstallChocolateyPathCommand.cs @@ -21,7 +21,7 @@ namespace Chocolatey.PowerShell.Commands { - [Cmdlet(VerbsLifecycle.Install, "ChocolateyPath")] + [Cmdlet(VerbsLifecycle.Install, "ChocolateyPath", SupportsShouldProcess = true, ConfirmImpact = ConfirmImpact.Medium)] [OutputType(typeof(void))] public class InstallChocolateyPathCommand : ChocolateyCmdlet { diff --git a/src/Chocolatey.PowerShell/Commands/SetEnvironmentVariableCommand.cs b/src/Chocolatey.PowerShell/Commands/SetEnvironmentVariableCommand.cs index a73c996aa5..1c68a79517 100644 --- a/src/Chocolatey.PowerShell/Commands/SetEnvironmentVariableCommand.cs +++ b/src/Chocolatey.PowerShell/Commands/SetEnvironmentVariableCommand.cs @@ -21,7 +21,7 @@ namespace Chocolatey.PowerShell.Commands { - [Cmdlet(VerbsCommon.Set, "EnvironmentVariable")] + [Cmdlet(VerbsCommon.Set, "EnvironmentVariable", SupportsShouldProcess = true, ConfirmImpact = ConfirmImpact.Medium)] [OutputType(typeof(void))] public sealed class SetEnvironmentVariableCommand : ChocolateyCmdlet { diff --git a/src/Chocolatey.PowerShell/Commands/UninstallChocolateyPathCommand.cs b/src/Chocolatey.PowerShell/Commands/UninstallChocolateyPathCommand.cs index 92faf6a826..e8b4742a2e 100644 --- a/src/Chocolatey.PowerShell/Commands/UninstallChocolateyPathCommand.cs +++ b/src/Chocolatey.PowerShell/Commands/UninstallChocolateyPathCommand.cs @@ -21,7 +21,7 @@ namespace Chocolatey.PowerShell.Commands { - [Cmdlet(VerbsLifecycle.Uninstall, "ChocolateyPath")] + [Cmdlet(VerbsLifecycle.Uninstall, "ChocolateyPath", SupportsShouldProcess = true, ConfirmImpact = ConfirmImpact.Medium)] [OutputType(typeof(void))] public class UninstallChocolateyPathCommand : ChocolateyCmdlet { diff --git a/src/Chocolatey.PowerShell/Commands/UpdateSessionEnvironmentCommand.cs b/src/Chocolatey.PowerShell/Commands/UpdateSessionEnvironmentCommand.cs index 65c32d514e..a22acf07ac 100644 --- a/src/Chocolatey.PowerShell/Commands/UpdateSessionEnvironmentCommand.cs +++ b/src/Chocolatey.PowerShell/Commands/UpdateSessionEnvironmentCommand.cs @@ -20,7 +20,7 @@ namespace Chocolatey.PowerShell.Commands { - [Cmdlet(VerbsData.Update, "SessionEnvironment")] + [Cmdlet(VerbsData.Update, "SessionEnvironment", SupportsShouldProcess = true, ConfirmImpact = ConfirmImpact.Low)] [OutputType(typeof(void))] public sealed class UpdateSessionEnvironmentCommand : ChocolateyCmdlet { diff --git a/src/Chocolatey.PowerShell/Helpers/EnvironmentHelper.cs b/src/Chocolatey.PowerShell/Helpers/EnvironmentHelper.cs index fedc3d86e2..173fb910c0 100644 --- a/src/Chocolatey.PowerShell/Helpers/EnvironmentHelper.cs +++ b/src/Chocolatey.PowerShell/Helpers/EnvironmentHelper.cs @@ -139,7 +139,11 @@ public static void SetVariable(PSCmdlet cmdlet, string name, EnvironmentVariable { if (scope == EnvironmentVariableTarget.Process) { - Environment.SetEnvironmentVariable(name, value); + if (cmdlet.ShouldProcess(name, "Set Process environment variable")) + { + Environment.SetEnvironmentVariable(name, value); + } + return; } @@ -166,32 +170,38 @@ public static void SetVariable(PSCmdlet cmdlet, string name, EnvironmentVariable cmdlet.WriteDebug($"Registry type for {name} is/will be {registryType}"); - if (string.IsNullOrEmpty(value)) - { - registryKey.DeleteValue(name, throwOnMissingValue: false); - } - else + if (cmdlet.ShouldProcess(name, $"Set {scope} environment variable")) { - registryKey.SetValue(name, value, registryType); + if (string.IsNullOrEmpty(value)) + { + registryKey.DeleteValue(name, throwOnMissingValue: false); + } + else + { + registryKey.SetValue(name, value, registryType); + } } } try { - // Trigger environment refresh in explorer.exe: - // 1. Notify all windows of environment block change - NativeMethods.SendMessageTimeout( - hWnd: (IntPtr)NativeMethods.HWND_BROADCAST, - Msg: NativeMethods.WM_SETTINGCHANGE, - wParam: UIntPtr.Zero, - lParam: "Environment", - fuFlags: 2, - uTimeout: 5000, - out UIntPtr result); - - // 2. Set a user environment variable making the system refresh - var setxPath = string.Format(@"{0}\System32\setx.exe", GetVariable(cmdlet, EnvironmentVariables.SystemRoot, EnvironmentVariableTarget.Process)); - cmdlet.InvokeCommand.InvokeScript($"& \"{setxPath}\" {EnvironmentVariables.ChocolateyLastPathUpdate} \"{DateTime.Now.ToFileTime()}\""); + if (cmdlet.ShouldProcess("Environment variables", "Notify system of changes")) + { + // Trigger environment refresh in explorer.exe: + // 1. Notify all windows of environment block change + NativeMethods.SendMessageTimeout( + hWnd: (IntPtr)NativeMethods.HWND_BROADCAST, + Msg: NativeMethods.WM_SETTINGCHANGE, + wParam: UIntPtr.Zero, + lParam: "Environment", + fuFlags: 2, + uTimeout: 5000, + out UIntPtr result); + + // 2. Set a user environment variable making the system refresh + var setxPath = string.Format(@"{0}\System32\setx.exe", GetVariable(cmdlet, EnvironmentVariables.SystemRoot, EnvironmentVariableTarget.Process)); + cmdlet.InvokeCommand.InvokeScript($"& \"{setxPath}\" {EnvironmentVariables.ChocolateyLastPathUpdate} \"{DateTime.Now.ToFileTime()}\""); + } } catch (Exception error) { @@ -221,37 +231,40 @@ public static void UpdateSession(PSCmdlet cmdlet) scopeList.Add(EnvironmentVariableTarget.User); } - foreach (var scope in scopeList) + if (cmdlet.ShouldProcess("Current process", "Refresh all environment variables")) { - foreach (var name in GetVariableNames(scope)) + foreach (var scope in scopeList) { - var value = GetVariable(cmdlet, name, scope); - if (!string.IsNullOrEmpty(value)) + foreach (var name in GetVariableNames(scope)) { - SetVariable(cmdlet, name, EnvironmentVariableTarget.Process, value); + var value = GetVariable(cmdlet, name, scope); + if (!string.IsNullOrEmpty(value)) + { + SetVariable(cmdlet, name, EnvironmentVariableTarget.Process, value); + } } } - } - // Update PATH, combining both scopes' values. - var paths = new string[2]; - paths[0] = GetVariable(cmdlet, EnvironmentVariables.Path, EnvironmentVariableTarget.Machine); - paths[1] = GetVariable(cmdlet, EnvironmentVariables.Path, EnvironmentVariableTarget.User); + // Update PATH, combining both scopes' values. + var paths = new string[2]; + paths[0] = GetVariable(cmdlet, EnvironmentVariables.Path, EnvironmentVariableTarget.Machine); + paths[1] = GetVariable(cmdlet, EnvironmentVariables.Path, EnvironmentVariableTarget.User); - SetVariable(cmdlet, EnvironmentVariables.Path, EnvironmentVariableTarget.Process, string.Join(";", paths)); + SetVariable(cmdlet, EnvironmentVariables.Path, EnvironmentVariableTarget.Process, string.Join(";", paths)); - // Preserve PSModulePath as it's almost always updated by process, preserve it - SetVariable(cmdlet, EnvironmentVariables.PSModulePath, EnvironmentVariableTarget.Process, psModulePath); + // Preserve PSModulePath as it's almost always updated by process, preserve it + SetVariable(cmdlet, EnvironmentVariables.PSModulePath, EnvironmentVariableTarget.Process, psModulePath); - // Preserve user and architecture - if (!string.IsNullOrEmpty(userName)) - { - SetVariable(cmdlet, EnvironmentVariables.Username, EnvironmentVariableTarget.Process, userName); - } + // Preserve user and architecture + if (!string.IsNullOrEmpty(userName)) + { + SetVariable(cmdlet, EnvironmentVariables.Username, EnvironmentVariableTarget.Process, userName); + } - if (!string.IsNullOrEmpty(architecture)) - { - SetVariable(cmdlet, EnvironmentVariables.ProcessorArchitecture, EnvironmentVariableTarget.Process, architecture); + if (!string.IsNullOrEmpty(architecture)) + { + SetVariable(cmdlet, EnvironmentVariables.ProcessorArchitecture, EnvironmentVariableTarget.Process, architecture); + } } } } diff --git a/src/chocolatey.benchmark/App.config b/src/chocolatey.benchmark/App.config new file mode 100644 index 0000000000..f8e1309c75 --- /dev/null +++ b/src/chocolatey.benchmark/App.config @@ -0,0 +1,78 @@ +<?xml version="1.0" encoding="utf-8"?> +<configuration> + <startup> + <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" /> + </startup> + <runtime> + <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> + <dependentAssembly> + <assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.1.2" newVersion="4.0.1.2" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="Microsoft.Extensions.DependencyInjection.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-8.0.0.1" newVersion="8.0.0.1" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="Microsoft.Extensions.Logging.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-8.0.0.1" newVersion="8.0.0.1" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="Microsoft.Extensions.Options" publicKeyToken="adb9793829ddae60" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-8.0.0.2" newVersion="8.0.0.2" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Diagnostics.DiagnosticSource" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-8.0.0.1" newVersion="8.0.0.1" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="Microsoft.Bcl.AsyncInterfaces" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Collections.Immutable" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="Microsoft.Diagnostics.NETCore.Client" publicKeyToken="31bf3856ad364e35" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-0.2.10.10501" newVersion="0.2.10.10501" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="Microsoft.CodeAnalysis" publicKeyToken="31bf3856ad364e35" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.9.0.0" newVersion="4.9.0.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="Microsoft.CodeAnalysis.CSharp" publicKeyToken="31bf3856ad364e35" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.9.0.0" newVersion="4.9.0.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.CodeDom" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="Iced" publicKeyToken="5baba79f4264913b" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-1.21.0.0" newVersion="1.21.0.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="Microsoft.Diagnostics.Runtime" publicKeyToken="31bf3856ad364e35" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-3.1.10.12801" newVersion="3.1.10.12801" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="Microsoft.Diagnostics.Tracing.TraceEvent" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-3.1.10.0" newVersion="3.1.10.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Numerics.Vectors" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.1.4.0" newVersion="4.1.4.0" /> + </dependentAssembly> + </assemblyBinding> + </runtime> +</configuration> diff --git a/src/chocolatey.benchmark/BenchmarkConfig.cs b/src/chocolatey.benchmark/BenchmarkConfig.cs new file mode 100644 index 0000000000..7e9f243a7c --- /dev/null +++ b/src/chocolatey.benchmark/BenchmarkConfig.cs @@ -0,0 +1,51 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using BenchmarkDotNet.Analysers; +using BenchmarkDotNet.Columns; +using BenchmarkDotNet.Configs; +using BenchmarkDotNet.Diagnosers; +using BenchmarkDotNet.Environments; +using BenchmarkDotNet.Exporters; +using BenchmarkDotNet.Exporters.Csv; +using BenchmarkDotNet.Jobs; +using BenchmarkDotNet.Loggers; + +namespace chocolatey.benchmark +{ + internal static class BenchmarkConfig + { + public static IConfig Get() + { + var config = ManualConfig.CreateEmpty(); + + foreach (var platform in new[] { Platform.X64/*, Platform.X86*/ }) + { + config = config.AddJob(Job.Default.WithRuntime(ClrRuntime.Net48).WithPlatform(platform).WithJit(Jit.LegacyJit)); + } + + return config + .AddDiagnoser(MemoryDiagnoser.Default) + .AddColumnProvider(DefaultColumnProviders.Instance) + .AddLogger(ConsoleLogger.Default) + .AddExporter(CsvExporter.Default) + .AddExporter(HtmlExporter.Default) + .AddExporter(MarkdownExporter.Default) + .AddExporter(AsciiDocExporter.Default) + .AddAnalyser(GetAnalysers().ToArray()); + } + + private static IEnumerable<IAnalyser> GetAnalysers() + { + yield return EnvironmentAnalyser.Default; + yield return OutliersAnalyser.Default; + yield return MinIterationTimeAnalyser.Default; + yield return MultimodalDistributionAnalyzer.Default; + yield return RuntimeErrorAnalyser.Default; + yield return ZeroMeasurementAnalyser.Default; + yield return BaselineCustomAnalyzer.Default; + } + } +} diff --git a/src/chocolatey.benchmark/ParentProcessBenchmarks.cs b/src/chocolatey.benchmark/ParentProcessBenchmarks.cs new file mode 100644 index 0000000000..21486b8304 --- /dev/null +++ b/src/chocolatey.benchmark/ParentProcessBenchmarks.cs @@ -0,0 +1,69 @@ +using System.Runtime.CompilerServices; +using BenchmarkDotNet.Attributes; +using chocolatey.benchmark.helpers; +using chocolatey.infrastructure.information; + +namespace chocolatey.benchmark +{ + public class ParentProcessBenchmarks + { + [Benchmark, MethodImpl(MethodImplOptions.NoInlining)] + public string GetParentProcessDocumentedPinvoke() + { + return PinvokeProcessHelper.GetDocumentedParent(); + } + + [Benchmark, MethodImpl(MethodImplOptions.NoInlining)] + public string GetParentProcessFilteredDocumentedPinvoke() + { + return PinvokeProcessHelper.GetDocumentedParentFiltered(); + } + + [Benchmark, MethodImpl(MethodImplOptions.NoInlining)] + public string GetParentProcessFilteredManaged() + { + return ManagedProcessHelper.GetParent(); + } + + [Benchmark, MethodImpl(MethodImplOptions.NoInlining)] + public string GetParentProcessFilteredUndocumentedPinvoke() + { + return PinvokeProcessHelper.GetUndocumentedParentFiltered(); + } + + [Benchmark(Baseline = true), MethodImpl(MethodImplOptions.NoInlining)] + public string GetParentProcessManaged() + { + return ManagedProcessHelper.GetParent(); + } + + [Benchmark, MethodImpl(MethodImplOptions.NoInlining)] + public ProcessTree GetParentProcessTreeDocumentedPinvoke() + { + return PinvokeProcessHelper.GetDocumentedProcessTree(); + } + + [Benchmark, MethodImpl(MethodImplOptions.NoInlining)] + public ProcessTree GetParentProcessTreeManaged() + { + return ManagedProcessHelper.GetProcessTree(); + } + + [Benchmark, MethodImpl(MethodImplOptions.NoInlining)] + public ProcessTree GetParentProcessTreeUndocumentedPinvoke() + { + return PinvokeProcessHelper.GetUndocumentedProcessTree(); + } + + [Benchmark, MethodImpl(MethodImplOptions.NoInlining)] + public string GetParentProcessUndocumentedPinvoke() + { + return PinvokeProcessHelper.GetUndocumentedParent(); + } + [Benchmark, MethodImpl(MethodImplOptions.NoInlining)] + public ProcessTree GetParentProcessTreeImplemented() + { + return ProcessInformation.GetProcessTree(); + } + } +} \ No newline at end of file diff --git a/src/chocolatey.benchmark/ProcessTreeBenchmark.cs b/src/chocolatey.benchmark/ProcessTreeBenchmark.cs new file mode 100644 index 0000000000..b6264324e7 --- /dev/null +++ b/src/chocolatey.benchmark/ProcessTreeBenchmark.cs @@ -0,0 +1,72 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Runtime.CompilerServices; +using System.Text; +using System.Threading.Tasks; +using BenchmarkDotNet.Attributes; +using chocolatey.benchmark.helpers; +using chocolatey.infrastructure.information; + +namespace chocolatey.benchmark +{ + public class ProcessTreeBenchmark + { + [Benchmark, MethodImpl(MethodImplOptions.NoInlining)] + [ArgumentsSource(nameof(GetProcessTree))] + public string GetFirstFilteredProcessName(ProcessTree tree) + { + return tree.FirstFilteredProcessName; + } + + [Benchmark, MethodImpl(MethodImplOptions.NoInlining)] + [ArgumentsSource(nameof(GetProcessTree))] + public string GetFirstProcessName(ProcessTree tree) + { + return tree.FirstProcessName; + } + + [Benchmark, MethodImpl(MethodImplOptions.NoInlining)] + [ArgumentsSource(nameof(GetProcessTree))] + public string GetLastFilteredProcessName(ProcessTree tree) + { + return tree.LastFilteredProcessName; + } + + [Benchmark, MethodImpl(MethodImplOptions.NoInlining)] + [ArgumentsSource(nameof(GetProcessTree))] + public string GetLastProcessName(ProcessTree tree) + { + return tree.LastProcessName; + } + + [Benchmark(Baseline = true), MethodImpl(MethodImplOptions.NoInlining)] + [ArgumentsSource(nameof(GetProcessTree))] + public LinkedList<string> GetProcessesList(ProcessTree tree) + { + return tree.Processes; + } + + public IEnumerable<object> GetProcessTree() + { + var currentProcess = Process.GetCurrentProcess(); + + var tree = new ProcessTree(currentProcess.ProcessName); + tree.Processes.AddLast("devenv"); + tree.Processes.AddLast("cmd"); + tree.Processes.AddLast("Tabby"); + tree.Processes.AddLast("explorer"); + yield return tree; + + yield return new ProcessTree(currentProcess.ProcessName); + + tree = new ProcessTree(currentProcess.ProcessName); + tree.Processes.AddLast(currentProcess.ProcessName); + tree.Processes.AddLast("WindowsTerminal"); + yield return tree; + + yield return PinvokeProcessHelper.GetUndocumentedProcessTree(currentProcess); + } + } +} \ No newline at end of file diff --git a/src/chocolatey.benchmark/Program.cs b/src/chocolatey.benchmark/Program.cs new file mode 100644 index 0000000000..f6df03d30f --- /dev/null +++ b/src/chocolatey.benchmark/Program.cs @@ -0,0 +1,22 @@ +using System.Linq; +using BenchmarkDotNet.Running; + +namespace chocolatey.benchmark +{ + internal class Program + { + private static void Main(string[] args) + { + var switcher = BenchmarkSwitcher.FromAssembly(typeof(Program).Assembly); + + if (args.Length > 0) + { + switcher.Run(args, BenchmarkConfig.Get()).ToArray(); + } + else + { + switcher.RunAll(BenchmarkConfig.Get()).ToArray(); + } + } + } +} diff --git a/src/chocolatey.benchmark/Properties/AssemblyInfo.cs b/src/chocolatey.benchmark/Properties/AssemblyInfo.cs new file mode 100644 index 0000000000..ceb1f4def2 --- /dev/null +++ b/src/chocolatey.benchmark/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("chocolatey.benchmark")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("chocolatey.benchmark")] +[assembly: AssemblyCopyright("Copyright © 2024")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("2b98bb42-a7ae-4ef6-b0b8-aa7bfc1e1180")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/chocolatey.benchmark/chocolatey.benchmark.csproj b/src/chocolatey.benchmark/chocolatey.benchmark.csproj new file mode 100644 index 0000000000..f42ea66591 --- /dev/null +++ b/src/chocolatey.benchmark/chocolatey.benchmark.csproj @@ -0,0 +1,277 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <Import Project="..\packages\Microsoft.Diagnostics.Tracing.TraceEvent.3.1.10\build\Microsoft.Diagnostics.Tracing.TraceEvent.props" Condition="Exists('..\packages\Microsoft.Diagnostics.Tracing.TraceEvent.3.1.10\build\Microsoft.Diagnostics.Tracing.TraceEvent.props')" /> + <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProjectGuid>{2B98BB42-A7AE-4EF6-B0B8-AA7BFC1E1180}</ProjectGuid> + <OutputType>Exe</OutputType> + <RootNamespace>chocolatey.benchmark</RootNamespace> + <AssemblyName>chocolatey.benchmark</AssemblyName> + <TargetFrameworkVersion>v4.8</TargetFrameworkVersion> + <FileAlignment>512</FileAlignment> + <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> + <Deterministic>true</Deterministic> + <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir> + <NuGetPackageImportStamp> + </NuGetPackageImportStamp> + <TargetFrameworkProfile /> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <PlatformTarget>AnyCPU</PlatformTarget> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <PlatformTarget>AnyCPU</PlatformTarget> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'ReleaseOfficial|AnyCPU'"> + <OutputPath>bin\ReleaseOfficial\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <Optimize>true</Optimize> + <DebugType>pdbonly</DebugType> + <PlatformTarget>AnyCPU</PlatformTarget> + <ErrorReport>prompt</ErrorReport> + <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> + <Prefer32Bit>false</Prefer32Bit> + </PropertyGroup> + <ItemGroup> + <Reference Include="BenchmarkDotNet, Version=0.13.12.0, Culture=neutral, PublicKeyToken=aa0ca2f9092cefc4, processorArchitecture=MSIL"> + <HintPath>..\packages\BenchmarkDotNet.0.13.12\lib\netstandard2.0\BenchmarkDotNet.dll</HintPath> + </Reference> + <Reference Include="BenchmarkDotNet.Annotations, Version=0.13.12.0, Culture=neutral, PublicKeyToken=aa0ca2f9092cefc4, processorArchitecture=MSIL"> + <HintPath>..\packages\BenchmarkDotNet.Annotations.0.13.12\lib\netstandard2.0\BenchmarkDotNet.Annotations.dll</HintPath> + </Reference> + <Reference Include="BenchmarkDotNet.Diagnostics.Windows, Version=0.13.12.0, Culture=neutral, PublicKeyToken=aa0ca2f9092cefc4, processorArchitecture=MSIL"> + <HintPath>..\packages\BenchmarkDotNet.Diagnostics.Windows.0.13.12\lib\netstandard2.0\BenchmarkDotNet.Diagnostics.Windows.dll</HintPath> + </Reference> + <Reference Include="CommandLine, Version=2.9.1.0, Culture=neutral, PublicKeyToken=5a870481e358d379, processorArchitecture=MSIL"> + <HintPath>..\packages\CommandLineParser.2.9.1\lib\net461\CommandLine.dll</HintPath> + </Reference> + <Reference Include="Dia2Lib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <HintPath>..\packages\Microsoft.Diagnostics.Tracing.TraceEvent.3.1.10\lib\netstandard2.0\Dia2Lib.dll</HintPath> + <EmbedInteropTypes>True</EmbedInteropTypes> + </Reference> + <Reference Include="Gee.External.Capstone, Version=2.3.0.0, Culture=neutral, PublicKeyToken=b117d7a2dc33ffa6, processorArchitecture=MSIL"> + <HintPath>..\packages\Gee.External.Capstone.2.3.0\lib\netstandard2.0\Gee.External.Capstone.dll</HintPath> + </Reference> + <Reference Include="Iced, Version=1.21.0.0, Culture=neutral, PublicKeyToken=5baba79f4264913b, processorArchitecture=MSIL"> + <HintPath>..\packages\Iced.1.21.0\lib\net45\Iced.dll</HintPath> + </Reference> + <Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL"> + <HintPath>..\packages\Microsoft.Bcl.AsyncInterfaces.8.0.0\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll</HintPath> + </Reference> + <Reference Include="Microsoft.CodeAnalysis, Version=4.9.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> + <HintPath>..\packages\Microsoft.CodeAnalysis.Common.4.9.2\lib\netstandard2.0\Microsoft.CodeAnalysis.dll</HintPath> + </Reference> + <Reference Include="Microsoft.CodeAnalysis.CSharp, Version=4.9.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> + <HintPath>..\packages\Microsoft.CodeAnalysis.CSharp.4.9.2\lib\netstandard2.0\Microsoft.CodeAnalysis.CSharp.dll</HintPath> + </Reference> + <Reference Include="Microsoft.Diagnostics.FastSerialization, Version=3.1.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <HintPath>..\packages\Microsoft.Diagnostics.Tracing.TraceEvent.3.1.10\lib\netstandard2.0\Microsoft.Diagnostics.FastSerialization.dll</HintPath> + </Reference> + <Reference Include="Microsoft.Diagnostics.NETCore.Client, Version=0.2.10.10501, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> + <HintPath>..\packages\Microsoft.Diagnostics.NETCore.Client.0.2.510501\lib\netstandard2.0\Microsoft.Diagnostics.NETCore.Client.dll</HintPath> + </Reference> + <Reference Include="Microsoft.Diagnostics.Runtime, Version=3.1.10.12801, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> + <HintPath>..\packages\Microsoft.Diagnostics.Runtime.3.1.512801\lib\netstandard2.0\Microsoft.Diagnostics.Runtime.dll</HintPath> + </Reference> + <Reference Include="Microsoft.Diagnostics.Tracing.TraceEvent, Version=3.1.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <HintPath>..\packages\Microsoft.Diagnostics.Tracing.TraceEvent.3.1.10\lib\netstandard2.0\Microsoft.Diagnostics.Tracing.TraceEvent.dll</HintPath> + </Reference> + <Reference Include="Microsoft.DotNet.PlatformAbstractions, Version=3.1.6.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> + <HintPath>..\packages\Microsoft.DotNet.PlatformAbstractions.3.1.6\lib\net45\Microsoft.DotNet.PlatformAbstractions.dll</HintPath> + </Reference> + <Reference Include="Microsoft.Extensions.DependencyInjection, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> + <HintPath>..\packages\Microsoft.Extensions.DependencyInjection.8.0.0\lib\net462\Microsoft.Extensions.DependencyInjection.dll</HintPath> + </Reference> + <Reference Include="Microsoft.Extensions.DependencyInjection.Abstractions, Version=8.0.0.1, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> + <HintPath>..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.8.0.1\lib\net462\Microsoft.Extensions.DependencyInjection.Abstractions.dll</HintPath> + </Reference> + <Reference Include="Microsoft.Extensions.Logging, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> + <HintPath>..\packages\Microsoft.Extensions.Logging.8.0.0\lib\net462\Microsoft.Extensions.Logging.dll</HintPath> + </Reference> + <Reference Include="Microsoft.Extensions.Logging.Abstractions, Version=8.0.0.1, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> + <HintPath>..\packages\Microsoft.Extensions.Logging.Abstractions.8.0.1\lib\net462\Microsoft.Extensions.Logging.Abstractions.dll</HintPath> + </Reference> + <Reference Include="Microsoft.Extensions.Options, Version=8.0.0.2, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> + <HintPath>..\packages\Microsoft.Extensions.Options.8.0.2\lib\net462\Microsoft.Extensions.Options.dll</HintPath> + </Reference> + <Reference Include="Microsoft.Extensions.Primitives, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> + <HintPath>..\packages\Microsoft.Extensions.Primitives.8.0.0\lib\net462\Microsoft.Extensions.Primitives.dll</HintPath> + </Reference> + <Reference Include="Microsoft.Win32.Registry, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <HintPath>..\packages\Microsoft.Win32.Registry.5.0.0\lib\net461\Microsoft.Win32.Registry.dll</HintPath> + </Reference> + <Reference Include="Perfolizer, Version=0.2.1.0, Culture=neutral, PublicKeyToken=e864f2ec9c0b6d4c, processorArchitecture=MSIL"> + <HintPath>..\packages\Perfolizer.0.2.1\lib\netstandard2.0\Perfolizer.dll</HintPath> + </Reference> + <Reference Include="System" /> + <Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL"> + <HintPath>..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll</HintPath> + </Reference> + <Reference Include="System.CodeDom, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL"> + <HintPath>..\packages\System.CodeDom.8.0.0\lib\net462\System.CodeDom.dll</HintPath> + </Reference> + <Reference Include="System.Collections.Immutable, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <HintPath>..\packages\System.Collections.Immutable.8.0.0\lib\net462\System.Collections.Immutable.dll</HintPath> + </Reference> + <Reference Include="System.ComponentModel.Composition" /> + <Reference Include="System.ComponentModel.DataAnnotations" /> + <Reference Include="System.Core" /> + <Reference Include="System.Diagnostics.DiagnosticSource, Version=8.0.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL"> + <HintPath>..\packages\System.Diagnostics.DiagnosticSource.8.0.1\lib\net462\System.Diagnostics.DiagnosticSource.dll</HintPath> + </Reference> + <Reference Include="System.Diagnostics.Process, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <HintPath>..\packages\System.Diagnostics.Process.4.3.0\lib\net461\System.Diagnostics.Process.dll</HintPath> + <Private>True</Private> + <Private>True</Private> + </Reference> + <Reference Include="System.Diagnostics.TraceSource, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <HintPath>..\packages\System.Diagnostics.TraceSource.4.3.0\lib\net46\System.Diagnostics.TraceSource.dll</HintPath> + <Private>True</Private> + <Private>True</Private> + </Reference> + <Reference Include="System.IO, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <HintPath>..\packages\System.IO.4.3.0\lib\net462\System.IO.dll</HintPath> + <Private>True</Private> + <Private>True</Private> + </Reference> + <Reference Include="System.IO.Compression, Version=4.1.2.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL"> + <HintPath>..\packages\System.IO.Compression.4.3.0\lib\net46\System.IO.Compression.dll</HintPath> + <Private>True</Private> + <Private>True</Private> + </Reference> + <Reference Include="System.IO.FileSystem.Primitives, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <HintPath>..\packages\System.IO.FileSystem.Primitives.4.3.0\lib\net46\System.IO.FileSystem.Primitives.dll</HintPath> + <Private>True</Private> + <Private>True</Private> + </Reference> + <Reference Include="System.IO.UnmanagedMemoryStream, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <HintPath>..\packages\System.IO.UnmanagedMemoryStream.4.3.0\lib\net46\System.IO.UnmanagedMemoryStream.dll</HintPath> + <Private>True</Private> + <Private>True</Private> + </Reference> + <Reference Include="System.Management" /> + <Reference Include="System.Memory, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL"> + <HintPath>..\packages\System.Memory.4.5.5\lib\net461\System.Memory.dll</HintPath> + </Reference> + <Reference Include="System.Net.NameResolution, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <HintPath>..\packages\System.Net.NameResolution.4.3.0\lib\net46\System.Net.NameResolution.dll</HintPath> + <Private>True</Private> + <Private>True</Private> + </Reference> + <Reference Include="System.Numerics"> + <HintPath>..\..\..\..\..\..\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\System.Numerics.dll</HintPath> + </Reference> + <Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <HintPath>..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath> + </Reference> + <Reference Include="System.Reflection.Metadata, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <HintPath>..\packages\System.Reflection.Metadata.8.0.0\lib\net462\System.Reflection.Metadata.dll</HintPath> + </Reference> + <Reference Include="System.Reflection.TypeExtensions, Version=4.1.5.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <HintPath>..\packages\System.Reflection.TypeExtensions.4.7.0\lib\net461\System.Reflection.TypeExtensions.dll</HintPath> + </Reference> + <Reference Include="System.Runtime, Version=4.1.1.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <HintPath>..\packages\System.Runtime.4.3.1\lib\net462\System.Runtime.dll</HintPath> + <Private>True</Private> + <Private>True</Private> + </Reference> + <Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath> + </Reference> + <Reference Include="System.Runtime.InteropServices.RuntimeInformation, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <HintPath>..\packages\System.Runtime.InteropServices.RuntimeInformation.4.3.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll</HintPath> + <Private>True</Private> + <Private>True</Private> + </Reference> + <Reference Include="System.Security.AccessControl, Version=6.0.0.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <HintPath>..\packages\System.Security.AccessControl.6.0.1\lib\net461\System.Security.AccessControl.dll</HintPath> + </Reference> + <Reference Include="System.Security.Cryptography.Algorithms, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <HintPath>..\packages\System.Security.Cryptography.Algorithms.4.3.1\lib\net463\System.Security.Cryptography.Algorithms.dll</HintPath> + <Private>True</Private> + <Private>True</Private> + </Reference> + <Reference Include="System.Security.Cryptography.Encoding, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <HintPath>..\packages\System.Security.Cryptography.Encoding.4.3.0\lib\net46\System.Security.Cryptography.Encoding.dll</HintPath> + <Private>True</Private> + <Private>True</Private> + </Reference> + <Reference Include="System.Security.Cryptography.Primitives, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <HintPath>..\packages\System.Security.Cryptography.Primitives.4.3.0\lib\net46\System.Security.Cryptography.Primitives.dll</HintPath> + <Private>True</Private> + <Private>True</Private> + </Reference> + <Reference Include="System.Security.Principal.Windows, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <HintPath>..\packages\System.Security.Principal.Windows.5.0.0\lib\net461\System.Security.Principal.Windows.dll</HintPath> + </Reference> + <Reference Include="System.Text.Encoding.CodePages, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <HintPath>..\packages\System.Text.Encoding.CodePages.8.0.0\lib\net462\System.Text.Encoding.CodePages.dll</HintPath> + </Reference> + <Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL"> + <HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath> + </Reference> + <Reference Include="System.Threading.Thread, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <HintPath>..\packages\System.Threading.Thread.4.3.0\lib\net46\System.Threading.Thread.dll</HintPath> + <Private>True</Private> + <Private>True</Private> + </Reference> + <Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL"> + <HintPath>..\packages\System.ValueTuple.4.5.0\lib\net47\System.ValueTuple.dll</HintPath> + </Reference> + <Reference Include="System.Xml.Linq" /> + <Reference Include="System.Data.DataSetExtensions" /> + <Reference Include="Microsoft.CSharp" /> + <Reference Include="System.Data" /> + <Reference Include="System.Net.Http" /> + <Reference Include="System.Xml" /> + <Reference Include="TraceReloggerLib, Version=0.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <HintPath>..\packages\Microsoft.Diagnostics.Tracing.TraceEvent.3.1.10\lib\netstandard2.0\TraceReloggerLib.dll</HintPath> + <EmbedInteropTypes>True</EmbedInteropTypes> + </Reference> + </ItemGroup> + <ItemGroup> + <Compile Include="BenchmarkConfig.cs" /> + <Compile Include="helpers\ManagedProcessHelper.cs" /> + <Compile Include="helpers\PinvokeProcessHelper.cs" /> + <Compile Include="ParentProcessBenchmarks.cs" /> + <Compile Include="ProcessTreeBenchmark.cs" /> + <Compile Include="Program.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + </ItemGroup> + <ItemGroup> + <None Include="App.config" /> + <None Include="packages.config" /> + </ItemGroup> + <ItemGroup> + <Analyzer Include="..\packages\Microsoft.CodeAnalysis.Analyzers.3.3.4\analyzers\dotnet\cs\Microsoft.CodeAnalysis.Analyzers.dll" /> + <Analyzer Include="..\packages\Microsoft.CodeAnalysis.Analyzers.3.3.4\analyzers\dotnet\cs\Microsoft.CodeAnalysis.CSharp.Analyzers.dll" /> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\chocolatey\chocolatey.csproj"> + <Project>{5563dc61-35fd-4fab-b331-9ae1fdb23f80}</Project> + <Name>chocolatey</Name> + </ProjectReference> + </ItemGroup> + <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> + <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> + <PropertyGroup> + <ErrorText>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}.</ErrorText> + </PropertyGroup> + <Error Condition="!Exists('..\packages\Microsoft.Diagnostics.Tracing.TraceEvent.3.1.10\build\Microsoft.Diagnostics.Tracing.TraceEvent.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Diagnostics.Tracing.TraceEvent.3.1.10\build\Microsoft.Diagnostics.Tracing.TraceEvent.props'))" /> + </Target> +</Project> \ No newline at end of file diff --git a/src/chocolatey.benchmark/helpers/ManagedProcessHelper.cs b/src/chocolatey.benchmark/helpers/ManagedProcessHelper.cs new file mode 100644 index 0000000000..204728978c --- /dev/null +++ b/src/chocolatey.benchmark/helpers/ManagedProcessHelper.cs @@ -0,0 +1,180 @@ +using System; +using System.Diagnostics; +using System.Linq; +using chocolatey.infrastructure.information; + +namespace chocolatey.benchmark.helpers +{ + internal static class ManagedProcessHelper + { + private static readonly string[] _filteredParents = new[] + { + "explorer", + "powershell", + "pwsh", + "cmd", + "bash", + // The name used to launch windows services + // in the operating system. + "services", + // Known Terminal Emulators + "Tabby", + "WindowsTerminal", + "FireCMD", + "ConEmu64", + "ConEmuC64" + }; + + public static ProcessTree GetProcessTree(Process process = null) + { + if (process == null) + { + process = Process.GetCurrentProcess(); + } + + var tree = new ProcessTree(process.ProcessName); + + Process nextProcess = null; + + while (true) + { + var processId = nextProcess?.Id ?? process.Id; + var processName = FindIndexedProcessName(processId); + + if (string.IsNullOrEmpty(processName)) + { + break; + } + + var foundProcess = FindPidFromIndexedProcessName(processName); + + if (foundProcess == null) + { + break; + } + + nextProcess = foundProcess; + tree.Processes.AddLast(nextProcess.ProcessName); + } + + return tree; + } + + public static string GetParent(Process process = null) + { + if (process == null) + { + process = Process.GetCurrentProcess(); + } + + Process nextProcess = null; + + while (true) + { + var processId = nextProcess?.Id ?? process.Id; + + var processName = FindIndexedProcessName(processId); + + if (string.IsNullOrEmpty(processName)) + { + break; + } + + var foundProcess = FindPidFromIndexedProcessName(processName); + + if (foundProcess == null) + { + break; + } + + nextProcess = foundProcess; + } + + return nextProcess?.ProcessName; + } + + public static string GetParentFiltered(Process process = null) + { + if (process == null) + { + process = Process.GetCurrentProcess(); + } + + Process nextProcess = null; + Process selectedProcess = null; + + while (true) + { + var processId = nextProcess?.Id ?? process.Id; + + var processName = FindIndexedProcessName(processId); + + if (string.IsNullOrEmpty(processName)) + { + break; + } + + var foundProcess = FindPidFromIndexedProcessName(processName); + + if (foundProcess == null) + { + break; + } + + nextProcess = foundProcess; + + if (!IsIgnoredParent(nextProcess.ProcessName)) + { + selectedProcess = nextProcess; + } + } + + return selectedProcess?.ProcessName; + } + + private static bool IsIgnoredParent(string processName) + { + return _filteredParents.Contains(processName, StringComparer.OrdinalIgnoreCase); + } + + private static Process FindPidFromIndexedProcessName(string indexedProcessName) + { + try + { + var parentId = new PerformanceCounter("Process", "Creating Process ID", indexedProcessName); + return Process.GetProcessById((int)parentId.NextValue()); + } + catch + { + return null; + } + } + + private static string FindIndexedProcessName(int pid) + { + var processName = Process.GetProcessById(pid).ProcessName; + var processByName = Process.GetProcessesByName(processName); + string processIndexedName = null; + + for (var i = 0; i < processByName.Length; i++) + { + try + { + processIndexedName = i == 0 ? processName : processName + "#" + i; + var processId = new PerformanceCounter("Process", "ID Process", processIndexedName); + + if ((int)processId.NextValue() == pid) + { + return processIndexedName; + } + } + catch + { + // Empty on purpose + } + } + + return processIndexedName; + } + } +} diff --git a/src/chocolatey.benchmark/helpers/PinvokeProcessHelper.cs b/src/chocolatey.benchmark/helpers/PinvokeProcessHelper.cs new file mode 100644 index 0000000000..fb4f5d063e --- /dev/null +++ b/src/chocolatey.benchmark/helpers/PinvokeProcessHelper.cs @@ -0,0 +1,394 @@ +using System; +using System.ComponentModel; +using System.Diagnostics; +using System.Linq; +using System.Runtime.ConstrainedExecution; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; +using System.Security.Permissions; +using System.Security; +using chocolatey.infrastructure.information; +using chocolatey.infrastructure.platforms; + +namespace chocolatey.benchmark.helpers +{ + internal class PinvokeProcessHelper + { + private static readonly string[] _filteredParents = new[] + { + "explorer", + "powershell", + "pwsh", + "cmd", + "bash", + // The name used to launch windows services + // in the operating system. + "services", + // Known Terminal Emulators + "Tabby", + "WindowsTerminal", + "FireCMD", + "ConEmu64", + "ConEmuC64" + }; + + public static ProcessTree GetDocumentedProcessTree(Process process = null) + { + if (process == null) + { + process = Process.GetCurrentProcess(); + } + + var tree = new ProcessTree(process.ProcessName); + + if (Platform.GetPlatform() != PlatformType.Windows) + { + return tree; + } + + Process nextProcess = null; + + while (true) + { + var foundProcess = ParentDocumentedHelper.ParentProcess(nextProcess ?? process); + + if (foundProcess == null) + { + break; + } + + nextProcess = foundProcess; + tree.Processes.AddLast(nextProcess.ProcessName); + } + + return tree; + } + + public static string GetDocumentedParent(Process process = null) + { + if (Platform.GetPlatform() != PlatformType.Windows) + { + return null; + } + + if (process == null) + { + process = Process.GetCurrentProcess(); + } + + Process nextProcess = null; + + while (true) + { + var foundProcess = ParentDocumentedHelper.ParentProcess(nextProcess ?? process); + + if (foundProcess == null) + { + break; + } + + nextProcess = foundProcess; + } + + return nextProcess?.ProcessName; + } + + public static string GetDocumentedParentFiltered(Process process = null) + { + if (Platform.GetPlatform() != PlatformType.Windows) + { + return null; + } + + if (process == null) + { + process = Process.GetCurrentProcess(); + } + + Process nextProcess = null; + Process selectedProcess = null; + + while (true) + { + var foundProcess = ParentDocumentedHelper.ParentProcess(nextProcess ?? process); + + if (foundProcess == null) + { + break; + } + + nextProcess = foundProcess; + + if (!IsIgnoredParent(nextProcess.ProcessName)) + { + selectedProcess = nextProcess; + } + } + + return selectedProcess?.ProcessName; + } + + public static ProcessTree GetUndocumentedProcessTree(Process process = null) + { + if (process == null) + { + process = Process.GetCurrentProcess(); + } + + var tree = new ProcessTree(process.ProcessName); + + Process nextProcess = null; + + while (true) + { + var parentProcess = ParentProcessUtilities.GetParentProcess(nextProcess ?? process); + + if (parentProcess == null) + { + break; + } + + nextProcess = parentProcess; + tree.Processes.AddLast(nextProcess.ProcessName); + } + + return tree; + } + + public static string GetUndocumentedParent(Process process = null) + { + if (Platform.GetPlatform() != PlatformType.Windows) + { + return null; + } + + if (process == null) + { + process = Process.GetCurrentProcess(); + } + + Process nextProcess = null; + + while (true) + { + var foundProcess = ParentProcessUtilities.GetParentProcess(nextProcess ?? process); + + if (foundProcess == null) + { + break; + } + + nextProcess = foundProcess; + } + + return nextProcess?.ProcessName; + } + + public static string GetUndocumentedParentFiltered(Process process = null) + { + if (Platform.GetPlatform() != PlatformType.Windows) + { + return null; + } + + if (process == null) + { + process = Process.GetCurrentProcess(); + } + + Process nextProcess = null; + Process selectedProcess = null; + + while (true) + { + var foundProcess = ParentProcessUtilities.GetParentProcess(nextProcess ?? process); + + if (foundProcess == null) + { + break; + } + + nextProcess = foundProcess; + + if (!IsIgnoredParent(nextProcess.ProcessName)) + { + selectedProcess = nextProcess; + } + } + + return selectedProcess?.ProcessName; + } + + private static bool IsIgnoredParent(string processName) + { + return _filteredParents.Contains(processName, StringComparer.OrdinalIgnoreCase); + } + + private class ParentDocumentedHelper + { + public static Process ParentProcess(Process process) + { + try + { + var processId = ParentProcessId(process.Id); + + if (processId == -1) + { + return null; + } + else + { + return Process.GetProcessById(processId); + } + } + catch + { + return null; + } + } + + private static int ParentProcessId(int id) + { + var pe32 = new PROCESSENTRY32 + { + dwSize = (uint)Marshal.SizeOf(typeof(PROCESSENTRY32)) + }; + + using (var hSnapshot = CreateToolhelp32Snapshot(SnapshotFlags.Process, (uint)id)) + { + if (hSnapshot.IsInvalid) + { + throw new Win32Exception(); + } + + if (!Process32First(hSnapshot, ref pe32)) + { + var errno = Marshal.GetLastWin32Error(); + + if (errno == ERROR_NO_MORE_FILES) + { + return -1; + } + + throw new Win32Exception(errno); + } + + do + { + if (pe32.th32ProcessID == (uint)id) + { + return (int)pe32.th32ParentProcessID; + } + } while (Process32Next(hSnapshot, ref pe32)); + } + + return -1; + } + + private const int ERROR_NO_MORE_FILES = 0x12; + [DllImport("kernel32.dll", SetLastError = true)] + private static extern SafeSnapshotHandle CreateToolhelp32Snapshot(SnapshotFlags flags, uint id); + + [DllImport("kernel32.dll", SetLastError = true)] + private static extern bool Process32First(SafeSnapshotHandle hSnapshot, ref PROCESSENTRY32 lppe); + + [DllImport("kernel32.dll", SetLastError = true)] + private static extern bool Process32Next(SafeSnapshotHandle hSnapshot, ref PROCESSENTRY32 lppe); + + [Flags] + private enum SnapshotFlags : uint + { + HeapList = 0x00000001, + Process = 0x00000002, + Thread = 0x00000004, + Module = 0x00000008, + Module32 = 0x00000010, + All = (HeapList | Process | Thread | Module), + Inherit = 0x80000000, + NoHeaps = 0x40000000 + } + + [StructLayout(LayoutKind.Sequential)] + private struct PROCESSENTRY32 + { +#pragma warning disable IDE1006 // Naming Styles + public uint dwSize; + public uint cntUsage; + public uint th32ProcessID; + public IntPtr th32DefaultHeapID; + public uint th32ModuleID; + public uint cntThreads; + public uint th32ParentProcessID; + public int pcPriClassBase; + public uint dwFlags; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)] + public string szExeFile; +#pragma warning restore IDE1006 // Naming Styles + } + + [SuppressUnmanagedCodeSecurity, HostProtection(SecurityAction.LinkDemand, MayLeakOnAbort = true)] + internal sealed class SafeSnapshotHandle : SafeHandleMinusOneIsInvalid + { + internal SafeSnapshotHandle() + : base(true) + { + } + + [SecurityPermission(SecurityAction.LinkDemand, UnmanagedCode = true)] + internal SafeSnapshotHandle(IntPtr handle) + : base(true) + { + SetHandle(handle); + } + + protected override bool ReleaseHandle() + { + return CloseHandle(handle); + } + + [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)] + [DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true, ExactSpelling = true)] + private static extern bool CloseHandle(IntPtr handle); + } + } + + [StructLayout(LayoutKind.Sequential)] + private struct ParentProcessUtilities + { + internal IntPtr Reserved1; + internal IntPtr PebBaseAddress; + internal IntPtr Reserved2_0; + internal IntPtr Reselved2_1; + internal IntPtr UniqueProcessId; + internal IntPtr InheritedFromUniqueProcessId; + + [DllImport("ntdll.dll")] + private static extern int NtQueryInformationProcess(IntPtr processHandle, int processInformationClass, ref ParentProcessUtilities processInformaiton, int processInformationLength, out int returnLength); + + public static Process GetParentProcess(Process process) + { + return GetParentProcess(process.Handle); + } + + public static Process GetParentProcess(IntPtr handle) + { + var processUtilities = new ParentProcessUtilities(); + var status = NtQueryInformationProcess(handle, 0, ref processUtilities, Marshal.SizeOf(processUtilities), out _); + + if (status != 0) + { + return null; + } + + try + { + return Process.GetProcessById(processUtilities.InheritedFromUniqueProcessId.ToInt32()); + } + catch (ArgumentException) + { + return null; + } + } + } + } +} diff --git a/src/chocolatey.benchmark/packages.config b/src/chocolatey.benchmark/packages.config new file mode 100644 index 0000000000..568db12c80 --- /dev/null +++ b/src/chocolatey.benchmark/packages.config @@ -0,0 +1,57 @@ +<?xml version="1.0" encoding="utf-8"?> +<packages> + <package id="BenchmarkDotNet" version="0.13.12" targetFramework="net48" /> + <package id="BenchmarkDotNet.Annotations" version="0.13.12" targetFramework="net48" /> + <package id="BenchmarkDotNet.Diagnostics.Windows" version="0.13.12" targetFramework="net48" /> + <package id="CommandLineParser" version="2.9.1" targetFramework="net48" /> + <package id="Gee.External.Capstone" version="2.3.0" targetFramework="net48" /> + <package id="Iced" version="1.21.0" targetFramework="net48" /> + <package id="Microsoft.Bcl.AsyncInterfaces" version="8.0.0" targetFramework="net48" /> + <package id="Microsoft.CodeAnalysis.Analyzers" version="3.3.4" targetFramework="net48" developmentDependency="true" /> + <package id="Microsoft.CodeAnalysis.Common" version="4.9.2" targetFramework="net48" /> + <package id="Microsoft.CodeAnalysis.CSharp" version="4.9.2" targetFramework="net48" /> + <package id="Microsoft.Diagnostics.NETCore.Client" version="0.2.510501" targetFramework="net48" /> + <package id="Microsoft.Diagnostics.Runtime" version="3.1.512801" targetFramework="net48" /> + <package id="Microsoft.Diagnostics.Tracing.TraceEvent" version="3.1.10" targetFramework="net48" /> + <package id="Microsoft.DotNet.PlatformAbstractions" version="3.1.6" targetFramework="net48" /> + <package id="Microsoft.Extensions.DependencyInjection" version="8.0.0" targetFramework="net48" /> + <package id="Microsoft.Extensions.DependencyInjection.Abstractions" version="8.0.1" targetFramework="net48" /> + <package id="Microsoft.Extensions.Logging" version="8.0.0" targetFramework="net48" /> + <package id="Microsoft.Extensions.Logging.Abstractions" version="8.0.1" targetFramework="net48" /> + <package id="Microsoft.Extensions.Options" version="8.0.2" targetFramework="net48" /> + <package id="Microsoft.Extensions.Primitives" version="8.0.0" targetFramework="net48" /> + <package id="Microsoft.Win32.Registry" version="5.0.0" targetFramework="net48" /> + <package id="Perfolizer" version="0.2.1" targetFramework="net48" /> + <package id="System.Buffers" version="4.5.1" targetFramework="net48" /> + <package id="System.CodeDom" version="8.0.0" targetFramework="net48" /> + <package id="System.Collections.Immutable" version="8.0.0" targetFramework="net48" /> + <package id="System.Diagnostics.DiagnosticSource" version="8.0.1" targetFramework="net48" /> + <package id="System.Diagnostics.Process" version="4.3.0" targetFramework="net48" /> + <package id="System.Diagnostics.TraceSource" version="4.3.0" targetFramework="net48" /> + <package id="System.IO" version="4.3.0" targetFramework="net48" /> + <package id="System.IO.Compression" version="4.3.0" targetFramework="net48" /> + <package id="System.IO.FileSystem.Primitives" version="4.3.0" targetFramework="net48" /> + <package id="System.IO.UnmanagedMemoryStream" version="4.3.0" targetFramework="net48" /> + <package id="System.Management" version="8.0.0" targetFramework="net48" /> + <package id="System.Memory" version="4.5.5" targetFramework="net48" /> + <package id="System.Net.NameResolution" version="4.3.0" targetFramework="net48" /> + <package id="System.Net.Requests" version="4.3.0" targetFramework="net48" /> + <package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net48" /> + <package id="System.Reflection.Emit" version="4.7.0" targetFramework="net48" /> + <package id="System.Reflection.Emit.Lightweight" version="4.7.0" targetFramework="net48" /> + <package id="System.Reflection.Metadata" version="8.0.0" targetFramework="net48" /> + <package id="System.Reflection.TypeExtensions" version="4.7.0" targetFramework="net48" /> + <package id="System.Runtime" version="4.3.1" targetFramework="net48" /> + <package id="System.Runtime.CompilerServices.Unsafe" version="6.0.0" targetFramework="net48" /> + <package id="System.Runtime.InteropServices.RuntimeInformation" version="4.3.0" targetFramework="net48" /> + <package id="System.Security.AccessControl" version="6.0.1" targetFramework="net48" /> + <package id="System.Security.Cryptography.Algorithms" version="4.3.1" targetFramework="net48" /> + <package id="System.Security.Cryptography.Encoding" version="4.3.0" targetFramework="net48" /> + <package id="System.Security.Cryptography.Primitives" version="4.3.0" targetFramework="net48" /> + <package id="System.Security.Principal.Windows" version="5.0.0" targetFramework="net48" /> + <package id="System.Text.Encoding.CodePages" version="8.0.0" targetFramework="net48" /> + <package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net48" /> + <package id="System.Threading.Tasks.Parallel" version="4.3.0" targetFramework="net48" /> + <package id="System.Threading.Thread" version="4.3.0" targetFramework="net48" /> + <package id="System.ValueTuple" version="4.5.0" targetFramework="net48" /> +</packages> \ No newline at end of file diff --git a/src/chocolatey.console/Program.cs b/src/chocolatey.console/Program.cs index 51c10e1535..312673a473 100644 --- a/src/chocolatey.console/Program.cs +++ b/src/chocolatey.console/Program.cs @@ -16,9 +16,9 @@ using System; using System.Collections.Generic; +using System.Diagnostics; using System.IO; using System.Linq; -using System.Reflection; using Microsoft.Win32; using chocolatey.infrastructure.information; using chocolatey.infrastructure.app; @@ -270,6 +270,7 @@ private static void RemoveOldChocoExe(IFileSystem fileSystem) ); } + [Conditional("DEBUG")] private static void PauseIfDebug() { #if DEBUG diff --git a/src/chocolatey.console/chocolatey.console.csproj b/src/chocolatey.console/chocolatey.console.csproj index 3da9b03260..2a2cf81627 100644 --- a/src/chocolatey.console/chocolatey.console.csproj +++ b/src/chocolatey.console/chocolatey.console.csproj @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <Import Project="..\packages\Chocolatey.BestPractices.1.0.0\build\Chocolatey.BestPractices.props" Condition="Exists('..\packages\Chocolatey.BestPractices.1.0.0\build\Chocolatey.BestPractices.props')" /> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">x86</Platform> @@ -16,6 +17,8 @@ <FileAlignment>512</FileAlignment> <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir> <EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild> + <NuGetPackageImportStamp> + </NuGetPackageImportStamp> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> <PlatformTarget>x86</PlatformTarget> @@ -147,26 +150,6 @@ <CodeAnalysisIgnoreBuiltInRuleSets>false</CodeAnalysisIgnoreBuiltInRuleSets> <CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules> </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'ReleaseOfficialNo7zip|x86'"> - <OutputPath>bin\x86\ReleaseOfficialNo7zip\</OutputPath> - <DefineConstants>TRACE;FORCE_CHOCOLATEY_OFFICIAL_KEY</DefineConstants> - <CheckForOverflowUnderflow>true</CheckForOverflowUnderflow> - <Optimize>true</Optimize> - <PlatformTarget>x86</PlatformTarget> - <ErrorReport>prompt</ErrorReport> - <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'ReleaseOfficialNo7zip|AnyCPU'"> - <OutputPath>bin\ReleaseOfficialNo7zip\</OutputPath> - <DefineConstants>TRACE;FORCE_CHOCOLATEY_OFFICIAL_KEY</DefineConstants> - <CheckForOverflowUnderflow>true</CheckForOverflowUnderflow> - <Optimize>true</Optimize> - <PlatformTarget>AnyCPU</PlatformTarget> - <ErrorReport>prompt</ErrorReport> - <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> - <CodeAnalysisIgnoreBuiltInRuleSets>false</CodeAnalysisIgnoreBuiltInRuleSets> - <CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules> - </PropertyGroup> <ItemGroup> <Reference Include="AlphaFS, Version=2.1.0.0, Culture=neutral, PublicKeyToken=4d31a58f7d7ad5c9, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> @@ -206,6 +189,7 @@ <ItemGroup> <EmbeddedResource Include="choco.exe.manifest"> <SubType>Designer</SubType> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </EmbeddedResource> <None Include="packages.config" /> </ItemGroup> @@ -248,4 +232,12 @@ </ItemGroup> <Copy SourceFiles="@(ChocolateyPowerShell)" DestinationFolder="$(TargetDir)\helpers\" SkipUnchangedFiles="true" /> </Target> + <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> + <PropertyGroup> + <ErrorText>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}.</ErrorText> + </PropertyGroup> + <Error Condition="!Exists('..\packages\Chocolatey.BestPractices.1.0.0\build\Chocolatey.BestPractices.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Chocolatey.BestPractices.1.0.0\build\Chocolatey.BestPractices.props'))" /> + <Error Condition="!Exists('..\packages\Chocolatey.BestPractices.1.0.0\build\Chocolatey.BestPractices.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Chocolatey.BestPractices.1.0.0\build\Chocolatey.BestPractices.targets'))" /> + </Target> + <Import Project="..\packages\Chocolatey.BestPractices.1.0.0\build\Chocolatey.BestPractices.targets" Condition="Exists('..\packages\Chocolatey.BestPractices.1.0.0\build\Chocolatey.BestPractices.targets')" /> </Project> \ No newline at end of file diff --git a/src/chocolatey.console/packages.config b/src/chocolatey.console/packages.config index be3de666cc..19f3237e22 100644 --- a/src/chocolatey.console/packages.config +++ b/src/chocolatey.console/packages.config @@ -1,6 +1,7 @@ <?xml version="1.0" encoding="utf-8"?> <packages> <package id="AlphaFS" version="2.1.3" targetFramework="net40" /> + <package id="Chocolatey.BestPractices" version="1.0.0" targetFramework="net48" /> <package id="log4net" version="2.0.12" targetFramework="net48" /> <package id="Microsoft.Web.Xdt" version="3.1.0" targetFramework="net48" /> <package id="SimpleInjector" version="2.8.3" targetFramework="net48" /> diff --git a/src/chocolatey.resources/chocolatey.resources.csproj b/src/chocolatey.resources/chocolatey.resources.csproj index 207c9f7487..3ce93d0838 100644 --- a/src/chocolatey.resources/chocolatey.resources.csproj +++ b/src/chocolatey.resources/chocolatey.resources.csproj @@ -64,98 +64,206 @@ <Compile Include="Properties\AssemblyInfo.cs" /> </ItemGroup> <ItemGroup> - <EmbeddedResource Include="helpers\chocolateyInstaller.psm1" /> - <EmbeddedResource Include="helpers\functions\Format-FileSize.ps1" /> - <EmbeddedResource Include="helpers\functions\Get-CheckSumValid.ps1" /> - <EmbeddedResource Include="helpers\functions\Get-ChocolateyConfigValue.ps1" /> - <EmbeddedResource Include="helpers\functions\Get-ChocolateyPath.ps1" /> - <EmbeddedResource Include="helpers\functions\Get-ChocolateyUnzip.ps1" /> - <EmbeddedResource Include="helpers\functions\Get-ChocolateyWebFile.ps1" /> - <EmbeddedResource Include="helpers\functions\Get-FtpFile.ps1" /> - <EmbeddedResource Include="helpers\functions\Get-OSArchitectureWidth.ps1" /> - <EmbeddedResource Include="helpers\functions\Get-UACEnabled.ps1" /> - <EmbeddedResource Include="helpers\functions\Get-VirusCheckValid.ps1" /> - <EmbeddedResource Include="helpers\functions\Get-WebFile.ps1" /> - <EmbeddedResource Include="helpers\functions\Get-WebHeaders.ps1" /> - <EmbeddedResource Include="helpers\functions\Install-ChocolateyEnvironmentVariable.ps1" /> - <EmbeddedResource Include="helpers\functions\Install-ChocolateyExplorerMenuItem.ps1" /> - <EmbeddedResource Include="helpers\functions\Install-ChocolateyFileAssociation.ps1" /> - <EmbeddedResource Include="helpers\functions\Install-ChocolateyInstallPackage.ps1" /> - <EmbeddedResource Include="helpers\functions\Install-ChocolateyPackage.ps1" /> - <EmbeddedResource Include="helpers\functions\Install-ChocolateyPinnedTaskBarItem.ps1" /> - <EmbeddedResource Include="helpers\functions\Install-ChocolateyPowershellCommand.ps1" /> - <EmbeddedResource Include="helpers\functions\Install-ChocolateyShortcut.ps1" /> - <EmbeddedResource Include="helpers\functions\Install-ChocolateyVsixPackage.ps1" /> - <EmbeddedResource Include="helpers\functions\Install-ChocolateyZipPackage.ps1" /> - <EmbeddedResource Include="helpers\functions\Start-ChocolateyProcessAsAdmin.ps1" /> - <EmbeddedResource Include="helpers\functions\Uninstall-ChocolateyPackage.ps1" /> - <EmbeddedResource Include="helpers\functions\UnInstall-ChocolateyZipPackage.ps1" /> - <EmbeddedResource Include="redirects\choco.exe.ignore" /> - <EmbeddedResource Include="tools\checksum.exe.ignore" /> - <EmbeddedResource Include="tools\shimgen.exe.ignore" /> + <EmbeddedResource Include="helpers\chocolateyInstaller.psm1"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </EmbeddedResource> + <EmbeddedResource Include="helpers\functions\Format-FileSize.ps1"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </EmbeddedResource> + <EmbeddedResource Include="helpers\functions\Get-CheckSumValid.ps1"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </EmbeddedResource> + <EmbeddedResource Include="helpers\functions\Get-ChocolateyConfigValue.ps1"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </EmbeddedResource> + <EmbeddedResource Include="helpers\functions\Get-ChocolateyPath.ps1"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </EmbeddedResource> + <EmbeddedResource Include="helpers\functions\Get-ChocolateyUnzip.ps1"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </EmbeddedResource> + <EmbeddedResource Include="helpers\functions\Get-ChocolateyWebFile.ps1"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </EmbeddedResource> + <EmbeddedResource Include="helpers\functions\Get-FtpFile.ps1"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </EmbeddedResource> + <EmbeddedResource Include="helpers\functions\Get-OSArchitectureWidth.ps1"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </EmbeddedResource> + <EmbeddedResource Include="helpers\functions\Get-UACEnabled.ps1"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </EmbeddedResource> + <EmbeddedResource Include="helpers\functions\Get-VirusCheckValid.ps1"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </EmbeddedResource> + <EmbeddedResource Include="helpers\functions\Get-WebFile.ps1"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </EmbeddedResource> + <EmbeddedResource Include="helpers\functions\Get-WebHeaders.ps1"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </EmbeddedResource> + <EmbeddedResource Include="helpers\functions\Install-ChocolateyEnvironmentVariable.ps1"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </EmbeddedResource> + <EmbeddedResource Include="helpers\functions\Install-ChocolateyExplorerMenuItem.ps1"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </EmbeddedResource> + <EmbeddedResource Include="helpers\functions\Install-ChocolateyFileAssociation.ps1"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </EmbeddedResource> + <EmbeddedResource Include="helpers\functions\Install-ChocolateyInstallPackage.ps1"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </EmbeddedResource> + <EmbeddedResource Include="helpers\functions\Install-ChocolateyPackage.ps1"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </EmbeddedResource> + <EmbeddedResource Include="helpers\functions\Install-ChocolateyPinnedTaskBarItem.ps1"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </EmbeddedResource> + <EmbeddedResource Include="helpers\functions\Install-ChocolateyPowershellCommand.ps1"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </EmbeddedResource> + <EmbeddedResource Include="helpers\functions\Install-ChocolateyShortcut.ps1"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </EmbeddedResource> + <EmbeddedResource Include="helpers\functions\Install-ChocolateyVsixPackage.ps1"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </EmbeddedResource> + <EmbeddedResource Include="helpers\functions\Install-ChocolateyZipPackage.ps1"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </EmbeddedResource> + <EmbeddedResource Include="helpers\functions\Start-ChocolateyProcessAsAdmin.ps1"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </EmbeddedResource> + <EmbeddedResource Include="helpers\functions\Uninstall-ChocolateyPackage.ps1"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </EmbeddedResource> + <EmbeddedResource Include="helpers\functions\UnInstall-ChocolateyZipPackage.ps1"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </EmbeddedResource> + <EmbeddedResource Include="redirects\choco.exe.ignore"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </EmbeddedResource> + <EmbeddedResource Include="tools\checksum.exe.ignore"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </EmbeddedResource> + <EmbeddedResource Include="tools\shimgen.exe.ignore"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </EmbeddedResource> </ItemGroup> <ItemGroup> - <EmbeddedResource Include="LICENSE.txt" /> - <EmbeddedResource Include="redirects\choco.exe" /> - <EmbeddedResource Include="tools\7zip.license.txt" Condition="'$(Configuration)' != 'ReleaseOfficialNo7zip'" /> - <EmbeddedResource Include="tools\checksum.exe" /> - <EmbeddedResource Include="tools\checksum.license.txt" /> - <EmbeddedResource Include="tools\shimgen.exe" /> - <EmbeddedResource Include="tools\shimgen.license.txt" /> + <EmbeddedResource Include="LICENSE.txt"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </EmbeddedResource> + <EmbeddedResource Include="redirects\choco.exe"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </EmbeddedResource> + <EmbeddedResource Include="tools\checksum.exe"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </EmbeddedResource> + <EmbeddedResource Include="tools\checksum.license.txt"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </EmbeddedResource> + <EmbeddedResource Include="tools\shimgen.exe"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </EmbeddedResource> + <EmbeddedResource Include="tools\shimgen.license.txt"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </EmbeddedResource> </ItemGroup> <ItemGroup> - <EmbeddedResource Include="redirects\RefreshEnv.cmd" /> + <EmbeddedResource Include="redirects\RefreshEnv.cmd"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </EmbeddedResource> </ItemGroup> <ItemGroup> - <EmbeddedResource Include="helpers\functions\Install-BinFile.ps1" /> - <EmbeddedResource Include="helpers\functions\Uninstall-BinFile.ps1" /> + <EmbeddedResource Include="helpers\functions\Install-BinFile.ps1"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </EmbeddedResource> + <EmbeddedResource Include="helpers\functions\Uninstall-BinFile.ps1"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </EmbeddedResource> </ItemGroup> <ItemGroup> - <EmbeddedResource Include="helpers\chocolateyScriptRunner.ps1" /> + <EmbeddedResource Include="helpers\chocolateyScriptRunner.ps1"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </EmbeddedResource> </ItemGroup> <ItemGroup> - <EmbeddedResource Include="helpers\functions\Get-WebFileName.ps1" /> + <EmbeddedResource Include="helpers\functions\Get-WebFileName.ps1"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </EmbeddedResource> </ItemGroup> <ItemGroup> - <EmbeddedResource Include="helpers\functions\Get-ToolsLocation.ps1" /> + <EmbeddedResource Include="helpers\functions\Get-ToolsLocation.ps1"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </EmbeddedResource> </ItemGroup> <ItemGroup> - <EmbeddedResource Include="helpers\chocolateyProfile.psm1" /> + <EmbeddedResource Include="helpers\chocolateyProfile.psm1"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </EmbeddedResource> </ItemGroup> <ItemGroup> - <EmbeddedResource Include="helpers\ChocolateyTabExpansion.ps1" /> + <EmbeddedResource Include="helpers\ChocolateyTabExpansion.ps1"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </EmbeddedResource> </ItemGroup> <ItemGroup> - <EmbeddedResource Include="helpers\functions\Set-PowerShellExitCode.ps1" /> + <EmbeddedResource Include="helpers\functions\Set-PowerShellExitCode.ps1"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </EmbeddedResource> </ItemGroup> <ItemGroup> - <EmbeddedResource Include="helpers\functions\Install-Vsix.ps1" /> + <EmbeddedResource Include="helpers\functions\Install-Vsix.ps1"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </EmbeddedResource> </ItemGroup> <ItemGroup> - <EmbeddedResource Include="helpers\functions\Uninstall-ChocolateyEnvironmentVariable.ps1" /> + <EmbeddedResource Include="helpers\functions\Uninstall-ChocolateyEnvironmentVariable.ps1"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </EmbeddedResource> </ItemGroup> <ItemGroup> - <EmbeddedResource Include="tools\checksum.exe.config" /> + <EmbeddedResource Include="tools\checksum.exe.config"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </EmbeddedResource> </ItemGroup> <ItemGroup> - <EmbeddedResource Include="helpers\functions\Get-UninstallRegistryKey.ps1" /> + <EmbeddedResource Include="helpers\functions\Get-UninstallRegistryKey.ps1"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </EmbeddedResource> </ItemGroup> <ItemGroup Condition="'$(Configuration)' != 'ReleaseOfficialNo7zip'"> - <EmbeddedResource Include="tools\7z.dll" /> - <EmbeddedResource Include="tools\7z.exe" /> - </ItemGroup> - <ItemGroup Condition="'$(Configuration)' != 'ReleaseOfficialNo7zip'"> - <EmbeddedResource Include="tools\7z.exe.ignore" /> - <EmbeddedResource Include="tools\7z.exe.manifest" /> - </ItemGroup> - <ItemGroup Condition="'$(Configuration)' != 'ReleaseOfficialNo7zip'"> - <EmbeddedResource Include="tools\7z.dll.manifest" /> + <EmbeddedResource Include="tools\7z.dll"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </EmbeddedResource> + <EmbeddedResource Include="tools\7z.exe"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </EmbeddedResource> + <EmbeddedResource Include="tools\7z.exe.ignore"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </EmbeddedResource> + <EmbeddedResource Include="tools\7z.exe.manifest"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </EmbeddedResource> + <EmbeddedResource Include="tools\7z.dll.manifest"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </EmbeddedResource> + <EmbeddedResource Include="tools\7zip.license.txt"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </EmbeddedResource> </ItemGroup> <ItemGroup> - <EmbeddedResource Include="helpers\functions\Write-FunctionCallLogMessage.ps1" /> + <EmbeddedResource Include="helpers\functions\Write-FunctionCallLogMessage.ps1"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </EmbeddedResource> </ItemGroup> <ItemGroup> - <EmbeddedResource Include="helpers\functions\Get-PackageParameters.ps1" /> + <EmbeddedResource Include="helpers\functions\Get-PackageParameters.ps1"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </EmbeddedResource> </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. diff --git a/src/chocolatey.resources/helpers/ChocolateyTabExpansion.ps1 b/src/chocolatey.resources/helpers/ChocolateyTabExpansion.ps1 index 149bcd0827..1e81dc6aa8 100644 --- a/src/chocolatey.resources/helpers/ChocolateyTabExpansion.ps1 +++ b/src/chocolatey.resources/helpers/ChocolateyTabExpansion.ps1 @@ -264,33 +264,58 @@ if ($PowerTab_RegisterTabExpansion) { return } -if (Test-Path Function:\TabExpansion) { - Rename-Item Function:\TabExpansion TabExpansionBackup -} - -function TabExpansion($line, $lastWord) { - $lastBlock = [System.Text.RegularExpressions.Regex]::Split($line, '[|;]')[-1].TrimStart() +# PowerShell up to v5.x: use a custom TabExpansion function. +if ($PSVersionTable.PSVersion.Major -lt 5) { + if (Test-Path Function:\TabExpansion) { + Rename-Item Function:\TabExpansion TabExpansionBackup + } - switch -regex ($lastBlock) { - # Execute Chocolatey tab completion for all choco-related commands - "^$(Get-AliasPattern choco) (.*)" { - ChocolateyTabExpansion $lastBlock - } + function TabExpansion($line, $lastWord) { + $lastBlock = [System.Text.RegularExpressions.Regex]::Split($line, '[|;]')[-1].TrimStart() + - # Fall back on existing tab expansion - default { - if (Test-Path Function:\TabExpansionBackup) { - TabExpansionBackup $line $lastWord + switch -regex ($lastBlock) { + # Execute Chocolatey tab completion for all choco-related commands + "^$(Get-AliasPattern choco) (.*)" { + ChocolateyTabExpansion $lastBlock + } + + # Fall back on existing tab expansion + default { + if (Test-Path Function:\TabExpansionBackup) { + TabExpansionBackup $line $lastWord + } } } } } +else { # PowerShell v5+: use the Register-ArgumentCompleter cmdlet (PowerShell no longer calls TabExpansion after 7.4, but this available from 5.x) + function script:Get-AliasNames($exe) { + @($exe) + @(Get-Alias | Where-Object { $_.Definition -eq $exe } | Select-Object -Exp Name) + } + + Register-ArgumentCompleter -Native -CommandName (Get-AliasNames choco) -ScriptBlock { + param($wordToComplete, $commandAst, $cursorColumn) + + # NOTE: + # * The stringified form of $commandAst is the command's own command line (irrespective of + # whether other statements are on the same line or whether it is part of a pipeline). + # * However, trailing whitespace is trimmed in the string representation of $commandAst. + # Therefore, when the actual command line ends in space(s), they must be added back + # so that ChocolateyTabExpansion recognizes the start of a new argument. + $ownCommandLine = [string] $commandAst + $ownCommandLine = $ownCommandLine.Substring(0, [Math]::Min($ownCommandLine.Length, $cursorColumn)) + $ownCommandLine += ' ' * ($cursorColumn - $ownCommandLine.Length) + + ChocolateyTabExpansion $ownCommandLine + } +} # SIG # Begin signature block -# MIInKwYJKoZIhvcNAQcCoIInHDCCJxgCAQExDzANBglghkgBZQMEAgEFADB5Bgor +# MIInJQYJKoZIhvcNAQcCoIInFjCCJxICAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG -# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCCQb9fZE/wJ7Uke -# 0U88arux0gfLUeMODuKqtFQ2Be4gVaCCIK4wggWNMIIEdaADAgECAhAOmxiO+dAt +# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCCrrVVd0TkryWd/ +# lQnstQWAiB3jLfsm+MkIv62xgjw9RaCCIKgwggWNMIIEdaADAgECAhAOmxiO+dAt # 5+/bUOIIQBhaMA0GCSqGSIb3DQEBDAUAMGUxCzAJBgNVBAYTAlVTMRUwEwYDVQQK # EwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xJDAiBgNV # BAMTG0RpZ2lDZXJ0IEFzc3VyZWQgSUQgUm9vdCBDQTAeFw0yMjA4MDEwMDAwMDBa @@ -391,109 +416,109 @@ function TabExpansion($line, $lastWord) { # Oj9FpsToFpFSi0HASIRLlk2rREDjjfAVKM7t8RhWByovEMQMCGQ8M4+uKIw8y4+I # Cw2/O/TOHnuO77Xry7fwdxPm5yg/rBKupS8ibEH5glwVZsxsDsrFhsP2JjMMB0ug # 0wcCampAMEhLNKhRILutG4UI4lkNbcoFUCvqShyepf2gpx8GdOfy1lKQ/a+FSCH5 -# Vzu0nAPthkX0tGFuv2jiJmCG6sivqf6UHedjGzqGVnhOMIIGwjCCBKqgAwIBAgIQ -# B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DA5NiBTSEEyNTYgVGltZVN0YW1waW5nIENBAhALrma8 +# Wrp/lYfG+ekE4zMEMA0GCWCGSAFlAwQCAQUAoGkwGAYJKoZIhvcNAQkDMQsGCSqG +# SIb3DQEHATAcBgkqhkiG9w0BCQUxDxcNMjQxMTA0MTkxOTQ2WjAvBgkqhkiG9w0B +# CQQxIgQgP8WSnvRLZUYfjuZAFxkdIQhswpxyr+rtr/LU0oR+DIQwDQYJKoZIhvcN +# AQEBBQAEggIArauuS+N1yx86sAFt/6HemR0XsMsy9dS6ZeKpcPn+S8BsbOT9JIHW +# /lFfNtzb7abHS2Ol4MFkY60fG6qKZ4uOD8pNIRO7sHD044rtPAk7YhTcbJp2GPxJ +# dgLIpdL9tSYDqdvH/LFO95VhOWFmHkqy0maeI2WK9xy7ZLwziDrEz7qMPF+TaQc3 +# bGIV8RhYPy1AAfklb4pwKi5+kKPR5lX5qV4933rjpLnugSG1/GMI7mE1L+55KBiD +# PmvW8EwcEKoEezEs5idusmh6F4pMYiyEO8/1rCcRMkbGmLeGnB85X+aHvsgTVq5f +# +YdjSYPRfBAXtiosPAvpHobeM0lfpCoeSU7A7z64gSkW1Fsv2GKTZjzbceNro/bW +# XRchT9BMArT3oHcAePb9wOH3hldkZ3tKuprh0TSUzzcYnCGIhlHE48atpkP/sVZU +# bhucTsVY8RuJyzAA4daAIvZ0xN/ca0V9KdeOsjSdTYw0grcnkiicsmitVYgonvnp +# 8SRjhWU9YUIniJRuUMITTBy2dOYCXYpE0vTPYr+LmZKkdG9SF6H74DBLjQmfSPP/ +# x6Wg7ZKia1WDVJezMOH77Lstr5pTs7GdSixphs+LvrCrkmjxYrBZ2EnJXcKHzPOX +# d7unSsvjYZzfmNot9e6W+vCWjV2EWmJNzFS2H01h+6CB5molbvlVZUw= # SIG # End signature block diff --git a/src/chocolatey.resources/helpers/chocolateyProfile.psm1 b/src/chocolatey.resources/helpers/chocolateyProfile.psm1 index aeed368810..9eb2ccbee4 100644 --- a/src/chocolatey.resources/helpers/chocolateyProfile.psm1 +++ b/src/chocolatey.resources/helpers/chocolateyProfile.psm1 @@ -27,13 +27,16 @@ Import-Module "$thisDirectory\Chocolatey.PowerShell.dll" -Cmdlet "Get-Environmen Set-Alias refreshenv Update-SessionEnvironment -Export-ModuleMember -Alias refreshenv -Cmdlet 'Update-SessionEnvironment' -Function 'TabExpansion' +Export-ModuleMember -Alias refreshenv -Cmdlet 'Update-SessionEnvironment' +if ($PSVersionTable.PSVersion.Major -lt 5) { + Export-ModuleMember -Function 'TabExpansion' # Legacy TabExpansion function is only used up to PowerShell v5.x +} # SIG # Begin signature block -# MIInKwYJKoZIhvcNAQcCoIInHDCCJxgCAQExDzANBglghkgBZQMEAgEFADB5Bgor +# MIInJQYJKoZIhvcNAQcCoIInFjCCJxICAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG -# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCC7eXGNrikxA4wn -# J9PdpPo/8IvwVFuZPVPleXxyzmxMLaCCIK4wggWNMIIEdaADAgECAhAOmxiO+dAt +# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCDRNz5OczjJM4Iy +# /G9o0TomxtejFlMXTVWBJaP+wcY3WKCCIKgwggWNMIIEdaADAgECAhAOmxiO+dAt # 5+/bUOIIQBhaMA0GCSqGSIb3DQEBDAUAMGUxCzAJBgNVBAYTAlVTMRUwEwYDVQQK # EwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xJDAiBgNV # BAMTG0RpZ2lDZXJ0IEFzc3VyZWQgSUQgUm9vdCBDQTAeFw0yMjA4MDEwMDAwMDBa @@ -134,109 +137,109 @@ Export-ModuleMember -Alias refreshenv -Cmdlet 'Update-SessionEnvironment' -Funct # Oj9FpsToFpFSi0HASIRLlk2rRED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wh6+/pQskGkZtqj0Od+Zedee +# b8zV1sj5T2XvEgi0jv+BTkTr9f9lBjn5OszSlW4mdVI4uRnZ3aTRfv/aTEMF6PyP +# AieBUXikXucaJv3Ydh2Pkyk4RmpTtLBYNpATcyU6SS+MKsF7PEhIpeo= # SIG # End signature block diff --git a/src/chocolatey.resources/helpers/functions/Install-ChocolateyPinnedTaskBarItem.ps1 b/src/chocolatey.resources/helpers/functions/Install-ChocolateyPinnedTaskBarItem.ps1 index 13f98a25a6..b8a763e7f8 100644 --- a/src/chocolatey.resources/helpers/functions/Install-ChocolateyPinnedTaskBarItem.ps1 +++ b/src/chocolatey.resources/helpers/functions/Install-ChocolateyPinnedTaskBarItem.ps1 @@ -21,7 +21,7 @@ Creates an item in the task bar linking to the provided path. .NOTES Does not work with SYSTEM, but does not error. It warns with the error -message. +message. This command is deprecated and will be removed in version 3.0.0. .INPUTS None @@ -53,6 +53,7 @@ Install-ChocolateyExplorerMenuItem ) Write-FunctionCallLogMessage -Invocation $MyInvocation -Parameters $PSBoundParameters + Write-Warning "Install-ChocolateyPinnedTaskBarItem has been deprecated in v2.4.0 and will be removed in v3.0.0." try { if (Test-Path($targetFilePath)) { @@ -86,8 +87,8 @@ Install-ChocolateyExplorerMenuItem # SIG # Begin signature block # MIInKwYJKoZIhvcNAQcCoIInHDCCJxgCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG -# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCACPNT8H8lk6G+z -# J5mz3jzyUCC6QP631eSzsXMvk6y786CCIK4wggWNMIIEdaADAgECAhAOmxiO+dAt +# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCCZgpEnUMK/Wm/+ +# ZziK8qbF5iR1ojdAndAsgdjxnOa9T6CCIK4wggWNMIIEdaADAgECAhAOmxiO+dA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QL9WT6Y+77ge30hySuxVlRew9lacBddQIXspsH4V4h8/Kb2GMCP +# QUGnmMQgs0fdmMzZMiHQN4fI7XugpVWXICqISH90aRCOfZcz+jEEsYVFPUPlbtVR +# PLJzPiD32m0GD5vZswIdjfUO4oGjvvHOo4ApdZnDNa88TxRer0l/WDPnpOfEHrjE +# Q04vFyrlJcf2m+blzjSXP27tLJlWHISoEX2K0Y88lS32sgshfw5rQ+6rTFdCGmTX +# KeVIG5FEUBAkGLzYWk2ZoUSPWlpN3hEw1V6tkavoRQZinov21z/7YLWUkCHE36K6 +# 5LperLp8X0O+e/CiIb7+M6YhoT4W2n+6c+GbH9B9G1h+NC1FVSSiTTMvdEi1l11C +# F3lr62WJbn9ZyzawNV03SM6EkW4cLsuMPGTMCzYO/TwzXBSiyCdmomBQdE1c9hc= # SIG # End signature block diff --git a/src/chocolatey.resources/tools/7z.dll b/src/chocolatey.resources/tools/7z.dll index 7c1527a09e..c7e728848e 100644 Binary files a/src/chocolatey.resources/tools/7z.dll and b/src/chocolatey.resources/tools/7z.dll differ diff --git a/src/chocolatey.resources/tools/7z.exe b/src/chocolatey.resources/tools/7z.exe index a8e8480b0f..4d3889e6b7 100644 Binary files a/src/chocolatey.resources/tools/7z.exe and b/src/chocolatey.resources/tools/7z.exe differ diff --git a/src/chocolatey.sln b/src/chocolatey.sln index 8bbca092e6..69055c116f 100644 --- a/src/chocolatey.sln +++ b/src/chocolatey.sln @@ -37,7 +37,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "chocolatey.lib", "chocolate EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "toplevel", "toplevel", "{18FEFF9F-7352-4230-8B4E-E8D8BE976095}" ProjectSection(SolutionItems) = preProject - ..\.editorconfig = ..\.editorconfig ..\CHANGELOG.md = ..\CHANGELOG.md ..\CHANGELOG_LICENSED.md = ..\CHANGELOG_LICENSED.md ..\COMMITTERS.md = ..\COMMITTERS.md @@ -56,6 +55,10 @@ Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "chocolatey.install", "choco EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Chocolatey.PowerShell", "Chocolatey.PowerShell\Chocolatey.PowerShell.csproj", "{88396C46-8089-4814-A7D1-E18777FF6083}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "benchmarks", "benchmarks", "{46D88287-13E4-4044-89FD-B52AAE7791BF}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "chocolatey.benchmark", "chocolatey.benchmark\chocolatey.benchmark.csproj", "{2B98BB42-A7AE-4EF6-B0B8-AA7BFC1E1180}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -128,10 +131,8 @@ Global {5C4C60F0-47B1-498E-ABF7-D315E1A94BC9}.ReleaseOfficial|x86.ActiveCfg = ReleaseOfficial|Any CPU {5C4C60F0-47B1-498E-ABF7-D315E1A94BC9}.ReleaseOfficial|x86.Build.0 = ReleaseOfficial|Any CPU {5C4C60F0-47B1-498E-ABF7-D315E1A94BC9}.ReleaseOfficialNo7zip|Any CPU.ActiveCfg = ReleaseOfficialNo7zip|Any CPU - {5C4C60F0-47B1-498E-ABF7-D315E1A94BC9}.ReleaseOfficialNo7zip|Any CPU.Build.0 = ReleaseOfficialNo7zip|Any CPU {5C4C60F0-47B1-498E-ABF7-D315E1A94BC9}.ReleaseOfficialNo7zip|Mixed Platforms.ActiveCfg = ReleaseOfficialNo7zip|Any CPU {5C4C60F0-47B1-498E-ABF7-D315E1A94BC9}.ReleaseOfficialNo7zip|x86.ActiveCfg = ReleaseOfficialNo7zip|Any CPU - {5C4C60F0-47B1-498E-ABF7-D315E1A94BC9}.ReleaseOfficialNo7zip|x86.Build.0 = ReleaseOfficialNo7zip|Any CPU {5C4C60F0-47B1-498E-ABF7-D315E1A94BC9}.WIX|Any CPU.ActiveCfg = ReleaseOfficialNo7zip|Any CPU {5C4C60F0-47B1-498E-ABF7-D315E1A94BC9}.WIX|Mixed Platforms.ActiveCfg = ReleaseOfficialNo7zip|Any CPU {5C4C60F0-47B1-498E-ABF7-D315E1A94BC9}.WIX|x86.ActiveCfg = ReleaseOfficialNo7zip|Any CPU @@ -214,10 +215,8 @@ Global {12ECAD4F-D463-4D72-A792-A4FCCFE9C456}.ReleaseOfficial|x86.ActiveCfg = ReleaseOfficial|Any CPU {12ECAD4F-D463-4D72-A792-A4FCCFE9C456}.ReleaseOfficial|x86.Build.0 = ReleaseOfficial|Any CPU {12ECAD4F-D463-4D72-A792-A4FCCFE9C456}.ReleaseOfficialNo7zip|Any CPU.ActiveCfg = ReleaseOfficialNo7zip|Any CPU - {12ECAD4F-D463-4D72-A792-A4FCCFE9C456}.ReleaseOfficialNo7zip|Any CPU.Build.0 = ReleaseOfficialNo7zip|Any CPU {12ECAD4F-D463-4D72-A792-A4FCCFE9C456}.ReleaseOfficialNo7zip|Mixed Platforms.ActiveCfg = ReleaseOfficialNo7zip|Any CPU {12ECAD4F-D463-4D72-A792-A4FCCFE9C456}.ReleaseOfficialNo7zip|x86.ActiveCfg = ReleaseOfficialNo7zip|Any CPU - {12ECAD4F-D463-4D72-A792-A4FCCFE9C456}.ReleaseOfficialNo7zip|x86.Build.0 = ReleaseOfficialNo7zip|Any CPU {12ECAD4F-D463-4D72-A792-A4FCCFE9C456}.WIX|Any CPU.ActiveCfg = ReleaseOfficialNo7zip|Any CPU {12ECAD4F-D463-4D72-A792-A4FCCFE9C456}.WIX|Mixed Platforms.ActiveCfg = ReleaseOfficialNo7zip|Any CPU {12ECAD4F-D463-4D72-A792-A4FCCFE9C456}.WIX|x86.ActiveCfg = ReleaseOfficialNo7zip|Any CPU @@ -236,12 +235,12 @@ Global {6B96B4AE-8FD2-4719-AAFB-BA027B798089}.ReleaseOfficialNo7zip|Any CPU.ActiveCfg = WIX|x86 {6B96B4AE-8FD2-4719-AAFB-BA027B798089}.ReleaseOfficialNo7zip|Mixed Platforms.ActiveCfg = WIX|x86 {6B96B4AE-8FD2-4719-AAFB-BA027B798089}.ReleaseOfficialNo7zip|x86.ActiveCfg = WIX|x86 - {6B96B4AE-8FD2-4719-AAFB-BA027B798089}.WIX|Any CPU.ActiveCfg = WIX|x86 - {6B96B4AE-8FD2-4719-AAFB-BA027B798089}.WIX|Any CPU.Build.0 = WIX|x86 - {6B96B4AE-8FD2-4719-AAFB-BA027B798089}.WIX|Mixed Platforms.ActiveCfg = WIX|x86 - {6B96B4AE-8FD2-4719-AAFB-BA027B798089}.WIX|Mixed Platforms.Build.0 = WIX|x86 - {6B96B4AE-8FD2-4719-AAFB-BA027B798089}.WIX|x86.ActiveCfg = WIX|x86 - {6B96B4AE-8FD2-4719-AAFB-BA027B798089}.WIX|x86.Build.0 = WIX|x86 + {6B96B4AE-8FD2-4719-AAFB-BA027B798089}.WIX|Any CPU.ActiveCfg = Release|x86 + {6B96B4AE-8FD2-4719-AAFB-BA027B798089}.WIX|Any CPU.Build.0 = Release|x86 + {6B96B4AE-8FD2-4719-AAFB-BA027B798089}.WIX|Mixed Platforms.ActiveCfg = Release|x86 + {6B96B4AE-8FD2-4719-AAFB-BA027B798089}.WIX|Mixed Platforms.Build.0 = Release|x86 + {6B96B4AE-8FD2-4719-AAFB-BA027B798089}.WIX|x86.ActiveCfg = Release|x86 + {6B96B4AE-8FD2-4719-AAFB-BA027B798089}.WIX|x86.Build.0 = Release|x86 {88396C46-8089-4814-A7D1-E18777FF6083}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {88396C46-8089-4814-A7D1-E18777FF6083}.Debug|Any CPU.Build.0 = Debug|Any CPU {88396C46-8089-4814-A7D1-E18777FF6083}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU @@ -266,18 +265,42 @@ Global {88396C46-8089-4814-A7D1-E18777FF6083}.ReleaseOfficial|Mixed Platforms.Build.0 = ReleaseOfficial|Any CPU {88396C46-8089-4814-A7D1-E18777FF6083}.ReleaseOfficial|x86.ActiveCfg = ReleaseOfficial|Any CPU {88396C46-8089-4814-A7D1-E18777FF6083}.ReleaseOfficial|x86.Build.0 = ReleaseOfficial|Any CPU - {88396C46-8089-4814-A7D1-E18777FF6083}.ReleaseOfficialNo7zip|Any CPU.ActiveCfg = ReleaseOfficial|Any CPU - {88396C46-8089-4814-A7D1-E18777FF6083}.ReleaseOfficialNo7zip|Any CPU.Build.0 = ReleaseOfficial|Any CPU - {88396C46-8089-4814-A7D1-E18777FF6083}.ReleaseOfficialNo7zip|Mixed Platforms.ActiveCfg = ReleaseOfficial|Any CPU - {88396C46-8089-4814-A7D1-E18777FF6083}.ReleaseOfficialNo7zip|Mixed Platforms.Build.0 = ReleaseOfficial|Any CPU - {88396C46-8089-4814-A7D1-E18777FF6083}.ReleaseOfficialNo7zip|x86.ActiveCfg = ReleaseOfficial|Any CPU - {88396C46-8089-4814-A7D1-E18777FF6083}.ReleaseOfficialNo7zip|x86.Build.0 = ReleaseOfficial|Any CPU - {88396C46-8089-4814-A7D1-E18777FF6083}.WIX|Any CPU.ActiveCfg = Debug|Any CPU - {88396C46-8089-4814-A7D1-E18777FF6083}.WIX|Any CPU.Build.0 = Debug|Any CPU - {88396C46-8089-4814-A7D1-E18777FF6083}.WIX|Mixed Platforms.ActiveCfg = Debug|Any CPU - {88396C46-8089-4814-A7D1-E18777FF6083}.WIX|Mixed Platforms.Build.0 = Debug|Any CPU - {88396C46-8089-4814-A7D1-E18777FF6083}.WIX|x86.ActiveCfg = Debug|Any CPU - {88396C46-8089-4814-A7D1-E18777FF6083}.WIX|x86.Build.0 = Debug|Any CPU + {88396C46-8089-4814-A7D1-E18777FF6083}.ReleaseOfficialNo7zip|Any CPU.ActiveCfg = ReleaseOfficialNo7zip|Any CPU + {88396C46-8089-4814-A7D1-E18777FF6083}.ReleaseOfficialNo7zip|Any CPU.Build.0 = ReleaseOfficialNo7zip|Any CPU + {88396C46-8089-4814-A7D1-E18777FF6083}.ReleaseOfficialNo7zip|Mixed Platforms.ActiveCfg = ReleaseOfficialNo7zip|Any CPU + {88396C46-8089-4814-A7D1-E18777FF6083}.ReleaseOfficialNo7zip|Mixed Platforms.Build.0 = ReleaseOfficialNo7zip|Any CPU + {88396C46-8089-4814-A7D1-E18777FF6083}.ReleaseOfficialNo7zip|x86.ActiveCfg = ReleaseOfficialNo7zip|Any CPU + {88396C46-8089-4814-A7D1-E18777FF6083}.ReleaseOfficialNo7zip|x86.Build.0 = ReleaseOfficialNo7zip|Any CPU + {88396C46-8089-4814-A7D1-E18777FF6083}.WIX|Any CPU.ActiveCfg = ReleaseOfficialNo7zip|Any CPU + {88396C46-8089-4814-A7D1-E18777FF6083}.WIX|Mixed Platforms.ActiveCfg = ReleaseOfficialNo7zip|Any CPU + {88396C46-8089-4814-A7D1-E18777FF6083}.WIX|x86.ActiveCfg = ReleaseOfficialNo7zip|Any CPU + {2B98BB42-A7AE-4EF6-B0B8-AA7BFC1E1180}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2B98BB42-A7AE-4EF6-B0B8-AA7BFC1E1180}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2B98BB42-A7AE-4EF6-B0B8-AA7BFC1E1180}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {2B98BB42-A7AE-4EF6-B0B8-AA7BFC1E1180}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {2B98BB42-A7AE-4EF6-B0B8-AA7BFC1E1180}.Debug|x86.ActiveCfg = Debug|Any CPU + {2B98BB42-A7AE-4EF6-B0B8-AA7BFC1E1180}.Debug|x86.Build.0 = Debug|Any CPU + {2B98BB42-A7AE-4EF6-B0B8-AA7BFC1E1180}.NoResources|Any CPU.ActiveCfg = Debug|Any CPU + {2B98BB42-A7AE-4EF6-B0B8-AA7BFC1E1180}.NoResources|Mixed Platforms.ActiveCfg = Debug|Any CPU + {2B98BB42-A7AE-4EF6-B0B8-AA7BFC1E1180}.NoResources|x86.ActiveCfg = Debug|Any CPU + {2B98BB42-A7AE-4EF6-B0B8-AA7BFC1E1180}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2B98BB42-A7AE-4EF6-B0B8-AA7BFC1E1180}.Release|Any CPU.Build.0 = Release|Any CPU + {2B98BB42-A7AE-4EF6-B0B8-AA7BFC1E1180}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {2B98BB42-A7AE-4EF6-B0B8-AA7BFC1E1180}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {2B98BB42-A7AE-4EF6-B0B8-AA7BFC1E1180}.Release|x86.ActiveCfg = Release|Any CPU + {2B98BB42-A7AE-4EF6-B0B8-AA7BFC1E1180}.Release|x86.Build.0 = Release|Any CPU + {2B98BB42-A7AE-4EF6-B0B8-AA7BFC1E1180}.ReleaseOfficial|Any CPU.ActiveCfg = ReleaseOfficial|Any CPU + {2B98BB42-A7AE-4EF6-B0B8-AA7BFC1E1180}.ReleaseOfficial|Any CPU.Build.0 = ReleaseOfficial|Any CPU + {2B98BB42-A7AE-4EF6-B0B8-AA7BFC1E1180}.ReleaseOfficial|Mixed Platforms.ActiveCfg = ReleaseOfficial|Any CPU + {2B98BB42-A7AE-4EF6-B0B8-AA7BFC1E1180}.ReleaseOfficial|Mixed Platforms.Build.0 = ReleaseOfficial|Any CPU + {2B98BB42-A7AE-4EF6-B0B8-AA7BFC1E1180}.ReleaseOfficial|x86.ActiveCfg = ReleaseOfficial|Any CPU + {2B98BB42-A7AE-4EF6-B0B8-AA7BFC1E1180}.ReleaseOfficial|x86.Build.0 = ReleaseOfficial|Any CPU + {2B98BB42-A7AE-4EF6-B0B8-AA7BFC1E1180}.ReleaseOfficialNo7zip|Any CPU.ActiveCfg = Release|Any CPU + {2B98BB42-A7AE-4EF6-B0B8-AA7BFC1E1180}.ReleaseOfficialNo7zip|Mixed Platforms.ActiveCfg = Release|Any CPU + {2B98BB42-A7AE-4EF6-B0B8-AA7BFC1E1180}.ReleaseOfficialNo7zip|x86.ActiveCfg = Release|Any CPU + {2B98BB42-A7AE-4EF6-B0B8-AA7BFC1E1180}.WIX|Any CPU.ActiveCfg = ReleaseOfficial|Any CPU + {2B98BB42-A7AE-4EF6-B0B8-AA7BFC1E1180}.WIX|Mixed Platforms.ActiveCfg = ReleaseOfficial|Any CPU + {2B98BB42-A7AE-4EF6-B0B8-AA7BFC1E1180}.WIX|x86.ActiveCfg = ReleaseOfficial|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -290,6 +313,7 @@ Global {DD9689F3-1D2D-41AE-A672-063EE70C0C9A} = {9AF88603-3E34-4B68-9B69-B0F1967A86BC} {9AF88603-3E34-4B68-9B69-B0F1967A86BC} = {FB6236DD-17EF-4C36-943C-47792FBC3306} {4795798A-2F92-467A-88FC-772E66BF8E57} = {FB6236DD-17EF-4C36-943C-47792FBC3306} + {2B98BB42-A7AE-4EF6-B0B8-AA7BFC1E1180} = {46D88287-13E4-4044-89FD-B52AAE7791BF} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {998CAC46-A2B8-447C-B4CC-3B11DC35ED46} diff --git a/src/chocolatey.slnf b/src/chocolatey.slnf index 3eee04a084..a491a4615a 100644 --- a/src/chocolatey.slnf +++ b/src/chocolatey.slnf @@ -2,6 +2,7 @@ "solution": { "path": "chocolatey.sln", "projects": [ + "Chocolatey.PowerShell\\Chocolatey.PowerShell.csproj", "chocolatey.console\\chocolatey.console.csproj", "chocolatey.resources\\chocolatey.resources.csproj", "chocolatey.tests.integration\\chocolatey.tests.integration.csproj", diff --git a/src/chocolatey.tests.integration/App.config b/src/chocolatey.tests.integration/App.config index 99445ab633..396cb5fae5 100644 --- a/src/chocolatey.tests.integration/App.config +++ b/src/chocolatey.tests.integration/App.config @@ -1,6 +1,60 @@ -<?xml version="1.0" encoding="utf-8"?> +<?xml version="1.0" encoding="utf-8"?> <configuration> <runtime> - <loadFromRemoteSources enabled="true"/> + <loadFromRemoteSources enabled="true" /> + <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> + <dependentAssembly> + <assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.2.0.1" newVersion="4.2.0.1" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.6.0" newVersion="4.0.6.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="NJsonSchema" publicKeyToken="c2f9c3bdfae56102" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-10.7.2.0" newVersion="10.7.2.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="Stef.Validation" publicKeyToken="8f3400880c321038" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-0.1.1.0" newVersion="0.1.1.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.1.1" newVersion="4.0.1.1" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Text.Encodings.Web" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.5.1" newVersion="4.0.5.1" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Numerics.Vectors" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.1.4.0" newVersion="4.1.4.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Security.Cryptography.Cng" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.3.1.0" newVersion="4.3.1.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="Microsoft.AspNetCore.Server.IIS" publicKeyToken="adb9793829ddae60" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-2.2.6.0" newVersion="2.2.6.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="FluentAssertions" publicKeyToken="33f2691a05b67b6a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-6.11.0.0" newVersion="6.11.0.0" /> + </dependentAssembly> + </assemblyBinding> </runtime> -<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/></startup></configuration> +<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" /></startup></configuration> diff --git a/src/chocolatey.tests.integration/chocolatey.tests.integration.csproj b/src/chocolatey.tests.integration/chocolatey.tests.integration.csproj index c3be6cc3c1..d5f8a0615f 100644 --- a/src/chocolatey.tests.integration/chocolatey.tests.integration.csproj +++ b/src/chocolatey.tests.integration/chocolatey.tests.integration.csproj @@ -1,6 +1,7 @@ <?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <Import Project="..\packages\NUnit3TestAdapter.4.4.2\build\net462\NUnit3TestAdapter.props" Condition="Exists('..\packages\NUnit3TestAdapter.4.4.2\build\net462\NUnit3TestAdapter.props')" /> + <Import Project="..\packages\Microsoft.Extensions.Configuration.UserSecrets.2.2.0\build\netstandard2.0\Microsoft.Extensions.Configuration.UserSecrets.props" Condition="Exists('..\packages\Microsoft.Extensions.Configuration.UserSecrets.2.2.0\build\netstandard2.0\Microsoft.Extensions.Configuration.UserSecrets.props')" /> + <Import Project="..\packages\NUnit3TestAdapter.4.5.0\build\net462\NUnit3TestAdapter.props" Condition="Exists('..\packages\NUnit3TestAdapter.4.5.0\build\net462\NUnit3TestAdapter.props')" /> <Import Project="..\packages\NUnit.3.13.3\build\NUnit.props" Condition="Exists('..\packages\NUnit.3.13.3\build\NUnit.props')" /> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> @@ -79,6 +80,9 @@ <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> </PropertyGroup> <ItemGroup> + <Reference Include="AnyOf, Version=0.3.0.0, Culture=neutral, PublicKeyToken=b35e6abbb527c6b1, processorArchitecture=MSIL"> + <HintPath>..\packages\AnyOf.0.3.0\lib\net45\AnyOf.dll</HintPath> + </Reference> <Reference Include="Chocolatey.NuGet.Common"> <HintPath>..\packages\Chocolatey.NuGet.Common.3.4.2\lib\net472\Chocolatey.NuGet.Common.dll</HintPath> </Reference> @@ -97,45 +101,343 @@ <Reference Include="Chocolatey.NuGet.Versioning"> <HintPath>..\packages\Chocolatey.NuGet.Versioning.3.4.2\lib\net472\Chocolatey.NuGet.Versioning.dll</HintPath> </Reference> + <Reference Include="Fare, Version=2.2.0.0, Culture=neutral, PublicKeyToken=ea68d375bf33a7c8, processorArchitecture=MSIL"> + <HintPath>..\packages\Fare.2.2.1\lib\net35\Fare.dll</HintPath> + </Reference> <Reference Include="FluentAssertions, Version=6.11.0.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL"> <HintPath>..\packages\FluentAssertions.6.11.0\lib\net47\FluentAssertions.dll</HintPath> </Reference> + <Reference Include="Handlebars, Version=2.1.6.0, Culture=neutral, PublicKeyToken=22225d0bf33cd661, processorArchitecture=MSIL"> + <HintPath>..\packages\Handlebars.Net.2.1.6\lib\net451\Handlebars.dll</HintPath> + </Reference> + <Reference Include="Handlebars.Net.Helpers, Version=2.4.4.0, Culture=neutral, PublicKeyToken=00d131fae0c250bc, processorArchitecture=MSIL"> + <HintPath>..\packages\Handlebars.Net.Helpers.2.4.4\lib\net46\Handlebars.Net.Helpers.dll</HintPath> + </Reference> + <Reference Include="HandlebarsDotNet.Helpers.Core, Version=2.4.4.0, Culture=neutral, PublicKeyToken=00d131fae0c250bc, processorArchitecture=MSIL"> + <HintPath>..\packages\Handlebars.Net.Helpers.Core.2.4.4\lib\net46\HandlebarsDotNet.Helpers.Core.dll</HintPath> + </Reference> + <Reference Include="HandlebarsDotNet.Helpers.DynamicLinq, Version=2.4.4.0, Culture=neutral, PublicKeyToken=00d131fae0c250bc, processorArchitecture=MSIL"> + <HintPath>..\packages\Handlebars.Net.Helpers.DynamicLinq.2.4.4\lib\net46\HandlebarsDotNet.Helpers.DynamicLinq.dll</HintPath> + </Reference> + <Reference Include="HandlebarsDotNet.Helpers.Humanizer, Version=2.4.4.0, Culture=neutral, PublicKeyToken=00d131fae0c250bc, processorArchitecture=MSIL"> + <HintPath>..\packages\Handlebars.Net.Helpers.Humanizer.2.4.4\lib\net46\HandlebarsDotNet.Helpers.Humanizer.dll</HintPath> + </Reference> + <Reference Include="HandlebarsDotNet.Helpers.Json, Version=2.4.4.0, Culture=neutral, PublicKeyToken=00d131fae0c250bc, processorArchitecture=MSIL"> + <HintPath>..\packages\Handlebars.Net.Helpers.Json.2.4.4\lib\net46\HandlebarsDotNet.Helpers.Json.dll</HintPath> + </Reference> + <Reference Include="HandlebarsDotNet.Helpers.Random, Version=2.4.4.0, Culture=neutral, PublicKeyToken=00d131fae0c250bc, processorArchitecture=MSIL"> + <HintPath>..\packages\Handlebars.Net.Helpers.Random.2.4.4\lib\net46\HandlebarsDotNet.Helpers.Random.dll</HintPath> + </Reference> + <Reference Include="HandlebarsDotNet.Helpers.Xeger, Version=2.4.4.0, Culture=neutral, PublicKeyToken=00d131fae0c250bc, processorArchitecture=MSIL"> + <HintPath>..\packages\Handlebars.Net.Helpers.Xeger.2.4.4\lib\net46\HandlebarsDotNet.Helpers.Xeger.dll</HintPath> + </Reference> + <Reference Include="HandlebarsDotNet.Helpers.XPath, Version=2.4.4.0, Culture=neutral, PublicKeyToken=00d131fae0c250bc, processorArchitecture=MSIL"> + <HintPath>..\packages\Handlebars.Net.Helpers.XPath.2.4.4\lib\net46\HandlebarsDotNet.Helpers.XPath.dll</HintPath> + </Reference> + <Reference Include="HandlebarsDotNet.Helpers.Xslt, Version=2.4.4.0, Culture=neutral, PublicKeyToken=00d131fae0c250bc, processorArchitecture=MSIL"> + <HintPath>..\packages\Handlebars.Net.Helpers.Xslt.2.4.4\lib\net46\HandlebarsDotNet.Helpers.Xslt.dll</HintPath> + </Reference> + <Reference Include="Humanizer, Version=2.14.0.0, Culture=neutral, PublicKeyToken=979442b78dfc278e, processorArchitecture=MSIL"> + <HintPath>..\packages\Humanizer.Core.2.14.1\lib\netstandard2.0\Humanizer.dll</HintPath> + </Reference> + <Reference Include="JmesPath.Net, Version=1.0.125.0, Culture=neutral, PublicKeyToken=b29d616b7f4faff0, processorArchitecture=MSIL"> + <HintPath>..\packages\JmesPath.Net.1.0.125\lib\net45\JmesPath.Net.dll</HintPath> + </Reference> + <Reference Include="JsonConverter.Abstractions, Version=0.5.0.0, Culture=neutral, PublicKeyToken=7ba85365b500f2e2, processorArchitecture=MSIL"> + <HintPath>..\packages\JsonConverter.Abstractions.0.5.0\lib\net461\JsonConverter.Abstractions.dll</HintPath> + </Reference> <Reference Include="log4net, Version=2.0.12.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL"> <HintPath>..\packages\log4net.2.0.12\lib\net45\log4net.dll</HintPath> </Reference> + <Reference Include="Microsoft.AspNetCore, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> + <HintPath>..\packages\Microsoft.AspNetCore.2.2.0\lib\netstandard2.0\Microsoft.AspNetCore.dll</HintPath> + </Reference> + <Reference Include="Microsoft.AspNetCore.Authentication.Abstractions, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> + <HintPath>..\packages\Microsoft.AspNetCore.Authentication.Abstractions.2.2.0\lib\netstandard2.0\Microsoft.AspNetCore.Authentication.Abstractions.dll</HintPath> + </Reference> + <Reference Include="Microsoft.AspNetCore.Authentication.Core, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> + <HintPath>..\packages\Microsoft.AspNetCore.Authentication.Core.2.2.0\lib\netstandard2.0\Microsoft.AspNetCore.Authentication.Core.dll</HintPath> + </Reference> + <Reference Include="Microsoft.AspNetCore.Connections.Abstractions, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> + <HintPath>..\packages\Microsoft.AspNetCore.Connections.Abstractions.2.2.0\lib\netstandard2.0\Microsoft.AspNetCore.Connections.Abstractions.dll</HintPath> + </Reference> + <Reference Include="Microsoft.AspNetCore.Diagnostics, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> + <HintPath>..\packages\Microsoft.AspNetCore.Diagnostics.2.2.0\lib\netstandard2.0\Microsoft.AspNetCore.Diagnostics.dll</HintPath> + </Reference> + <Reference Include="Microsoft.AspNetCore.Diagnostics.Abstractions, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> + <HintPath>..\packages\Microsoft.AspNetCore.Diagnostics.Abstractions.2.2.0\lib\netstandard2.0\Microsoft.AspNetCore.Diagnostics.Abstractions.dll</HintPath> + </Reference> + <Reference Include="Microsoft.AspNetCore.HostFiltering, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> + <HintPath>..\packages\Microsoft.AspNetCore.HostFiltering.2.2.0\lib\netstandard2.0\Microsoft.AspNetCore.HostFiltering.dll</HintPath> + </Reference> + <Reference Include="Microsoft.AspNetCore.Hosting, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> + <HintPath>..\packages\Microsoft.AspNetCore.Hosting.2.2.0\lib\netstandard2.0\Microsoft.AspNetCore.Hosting.dll</HintPath> + </Reference> + <Reference Include="Microsoft.AspNetCore.Hosting.Abstractions, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> + <HintPath>..\packages\Microsoft.AspNetCore.Hosting.Abstractions.2.2.0\lib\netstandard2.0\Microsoft.AspNetCore.Hosting.Abstractions.dll</HintPath> + </Reference> + <Reference Include="Microsoft.AspNetCore.Hosting.Server.Abstractions, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> + <HintPath>..\packages\Microsoft.AspNetCore.Hosting.Server.Abstractions.2.2.0\lib\netstandard2.0\Microsoft.AspNetCore.Hosting.Server.Abstractions.dll</HintPath> + </Reference> + <Reference Include="Microsoft.AspNetCore.Http, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> + <HintPath>..\packages\Microsoft.AspNetCore.Http.2.2.0\lib\netstandard2.0\Microsoft.AspNetCore.Http.dll</HintPath> + </Reference> + <Reference Include="Microsoft.AspNetCore.Http.Abstractions, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> + <HintPath>..\packages\Microsoft.AspNetCore.Http.Abstractions.2.2.0\lib\netstandard2.0\Microsoft.AspNetCore.Http.Abstractions.dll</HintPath> + </Reference> + <Reference Include="Microsoft.AspNetCore.Http.Extensions, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> + <HintPath>..\packages\Microsoft.AspNetCore.Http.Extensions.2.2.0\lib\netstandard2.0\Microsoft.AspNetCore.Http.Extensions.dll</HintPath> + </Reference> + <Reference Include="Microsoft.AspNetCore.Http.Features, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> + <HintPath>..\packages\Microsoft.AspNetCore.Http.Features.2.2.0\lib\netstandard2.0\Microsoft.AspNetCore.Http.Features.dll</HintPath> + </Reference> + <Reference Include="Microsoft.AspNetCore.HttpOverrides, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> + <HintPath>..\packages\Microsoft.AspNetCore.HttpOverrides.2.2.0\lib\netstandard2.0\Microsoft.AspNetCore.HttpOverrides.dll</HintPath> + </Reference> + <Reference Include="Microsoft.AspNetCore.Routing, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> + <HintPath>..\packages\Microsoft.AspNetCore.Routing.2.2.0\lib\netstandard2.0\Microsoft.AspNetCore.Routing.dll</HintPath> + </Reference> + <Reference Include="Microsoft.AspNetCore.Routing.Abstractions, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> + <HintPath>..\packages\Microsoft.AspNetCore.Routing.Abstractions.2.2.0\lib\netstandard2.0\Microsoft.AspNetCore.Routing.Abstractions.dll</HintPath> + </Reference> + <Reference Include="Microsoft.AspNetCore.Server.IIS, Version=2.2.6.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> + <HintPath>..\packages\Microsoft.AspNetCore.Server.IIS.2.2.6\lib\netstandard2.0\Microsoft.AspNetCore.Server.IIS.dll</HintPath> + </Reference> + <Reference Include="Microsoft.AspNetCore.Server.IISIntegration, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> + <HintPath>..\packages\Microsoft.AspNetCore.Server.IISIntegration.2.2.0\lib\netstandard2.0\Microsoft.AspNetCore.Server.IISIntegration.dll</HintPath> + </Reference> + <Reference Include="Microsoft.AspNetCore.Server.Kestrel, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> + <HintPath>..\packages\Microsoft.AspNetCore.Server.Kestrel.2.2.0\lib\netstandard2.0\Microsoft.AspNetCore.Server.Kestrel.dll</HintPath> + </Reference> + <Reference Include="Microsoft.AspNetCore.Server.Kestrel.Core, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> + <HintPath>..\packages\Microsoft.AspNetCore.Server.Kestrel.Core.2.2.0\lib\netstandard2.0\Microsoft.AspNetCore.Server.Kestrel.Core.dll</HintPath> + </Reference> + <Reference Include="Microsoft.AspNetCore.Server.Kestrel.Https, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> + <HintPath>..\packages\Microsoft.AspNetCore.Server.Kestrel.Https.2.2.0\lib\netstandard2.0\Microsoft.AspNetCore.Server.Kestrel.Https.dll</HintPath> + </Reference> + <Reference Include="Microsoft.AspNetCore.Server.Kestrel.Transport.Abstractions, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> + <HintPath>..\packages\Microsoft.AspNetCore.Server.Kestrel.Transport.Abstractions.2.2.0\lib\netstandard2.0\Microsoft.AspNetCore.Server.Kestrel.Transport.Abstractions.dll</HintPath> + </Reference> + <Reference Include="Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> + <HintPath>..\packages\Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.2.2.0\lib\netstandard2.0\Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.dll</HintPath> + </Reference> + <Reference Include="Microsoft.AspNetCore.WebUtilities, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> + <HintPath>..\packages\Microsoft.AspNetCore.WebUtilities.2.2.0\lib\netstandard2.0\Microsoft.AspNetCore.WebUtilities.dll</HintPath> + </Reference> + <Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL"> + <HintPath>..\packages\Microsoft.Bcl.AsyncInterfaces.1.1.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll</HintPath> + </Reference> + <Reference Include="Microsoft.Extensions.Configuration, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> + <HintPath>..\packages\Microsoft.Extensions.Configuration.2.2.0\lib\netstandard2.0\Microsoft.Extensions.Configuration.dll</HintPath> + </Reference> + <Reference Include="Microsoft.Extensions.Configuration.Abstractions, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> + <HintPath>..\packages\Microsoft.Extensions.Configuration.Abstractions.2.2.0\lib\netstandard2.0\Microsoft.Extensions.Configuration.Abstractions.dll</HintPath> + </Reference> + <Reference Include="Microsoft.Extensions.Configuration.Binder, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> + <HintPath>..\packages\Microsoft.Extensions.Configuration.Binder.2.2.0\lib\netstandard2.0\Microsoft.Extensions.Configuration.Binder.dll</HintPath> + </Reference> + <Reference Include="Microsoft.Extensions.Configuration.CommandLine, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> + <HintPath>..\packages\Microsoft.Extensions.Configuration.CommandLine.2.2.0\lib\netstandard2.0\Microsoft.Extensions.Configuration.CommandLine.dll</HintPath> + </Reference> + <Reference Include="Microsoft.Extensions.Configuration.EnvironmentVariables, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> + <HintPath>..\packages\Microsoft.Extensions.Configuration.EnvironmentVariables.2.2.0\lib\netstandard2.0\Microsoft.Extensions.Configuration.EnvironmentVariables.dll</HintPath> + </Reference> + <Reference Include="Microsoft.Extensions.Configuration.FileExtensions, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> + <HintPath>..\packages\Microsoft.Extensions.Configuration.FileExtensions.2.2.0\lib\netstandard2.0\Microsoft.Extensions.Configuration.FileExtensions.dll</HintPath> + </Reference> + <Reference Include="Microsoft.Extensions.Configuration.Json, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> + <HintPath>..\packages\Microsoft.Extensions.Configuration.Json.2.2.0\lib\netstandard2.0\Microsoft.Extensions.Configuration.Json.dll</HintPath> + </Reference> + <Reference Include="Microsoft.Extensions.Configuration.UserSecrets, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> + <HintPath>..\packages\Microsoft.Extensions.Configuration.UserSecrets.2.2.0\lib\netstandard2.0\Microsoft.Extensions.Configuration.UserSecrets.dll</HintPath> + </Reference> + <Reference Include="Microsoft.Extensions.DependencyInjection, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> + <HintPath>..\packages\Microsoft.Extensions.DependencyInjection.2.2.0\lib\net461\Microsoft.Extensions.DependencyInjection.dll</HintPath> + </Reference> + <Reference Include="Microsoft.Extensions.DependencyInjection.Abstractions, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> + <HintPath>..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.2.2.0\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll</HintPath> + </Reference> + <Reference Include="Microsoft.Extensions.FileProviders.Abstractions, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> + <HintPath>..\packages\Microsoft.Extensions.FileProviders.Abstractions.2.2.0\lib\netstandard2.0\Microsoft.Extensions.FileProviders.Abstractions.dll</HintPath> + </Reference> + <Reference Include="Microsoft.Extensions.FileProviders.Physical, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> + <HintPath>..\packages\Microsoft.Extensions.FileProviders.Physical.2.2.0\lib\netstandard2.0\Microsoft.Extensions.FileProviders.Physical.dll</HintPath> + </Reference> + <Reference Include="Microsoft.Extensions.FileSystemGlobbing, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> + <HintPath>..\packages\Microsoft.Extensions.FileSystemGlobbing.2.2.0\lib\netstandard2.0\Microsoft.Extensions.FileSystemGlobbing.dll</HintPath> + </Reference> + <Reference Include="Microsoft.Extensions.Hosting.Abstractions, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> + <HintPath>..\packages\Microsoft.Extensions.Hosting.Abstractions.2.2.0\lib\netstandard2.0\Microsoft.Extensions.Hosting.Abstractions.dll</HintPath> + </Reference> + <Reference Include="Microsoft.Extensions.Logging, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> + <HintPath>..\packages\Microsoft.Extensions.Logging.2.2.0\lib\netstandard2.0\Microsoft.Extensions.Logging.dll</HintPath> + </Reference> + <Reference Include="Microsoft.Extensions.Logging.Abstractions, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> + <HintPath>..\packages\Microsoft.Extensions.Logging.Abstractions.2.2.0\lib\netstandard2.0\Microsoft.Extensions.Logging.Abstractions.dll</HintPath> + </Reference> + <Reference Include="Microsoft.Extensions.Logging.Configuration, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> + <HintPath>..\packages\Microsoft.Extensions.Logging.Configuration.2.2.0\lib\netstandard2.0\Microsoft.Extensions.Logging.Configuration.dll</HintPath> + </Reference> + <Reference Include="Microsoft.Extensions.Logging.Console, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> + <HintPath>..\packages\Microsoft.Extensions.Logging.Console.2.2.0\lib\netstandard2.0\Microsoft.Extensions.Logging.Console.dll</HintPath> + </Reference> + <Reference Include="Microsoft.Extensions.Logging.Debug, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> + <HintPath>..\packages\Microsoft.Extensions.Logging.Debug.2.2.0\lib\netstandard2.0\Microsoft.Extensions.Logging.Debug.dll</HintPath> + </Reference> + <Reference Include="Microsoft.Extensions.Logging.EventSource, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> + <HintPath>..\packages\Microsoft.Extensions.Logging.EventSource.2.2.0\lib\netstandard2.0\Microsoft.Extensions.Logging.EventSource.dll</HintPath> + </Reference> + <Reference Include="Microsoft.Extensions.ObjectPool, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> + <HintPath>..\packages\Microsoft.Extensions.ObjectPool.2.2.0\lib\netstandard2.0\Microsoft.Extensions.ObjectPool.dll</HintPath> + </Reference> + <Reference Include="Microsoft.Extensions.Options, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> + <HintPath>..\packages\Microsoft.Extensions.Options.2.2.0\lib\netstandard2.0\Microsoft.Extensions.Options.dll</HintPath> + </Reference> + <Reference Include="Microsoft.Extensions.Options.ConfigurationExtensions, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> + <HintPath>..\packages\Microsoft.Extensions.Options.ConfigurationExtensions.2.2.0\lib\netstandard2.0\Microsoft.Extensions.Options.ConfigurationExtensions.dll</HintPath> + </Reference> + <Reference Include="Microsoft.Extensions.Primitives, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> + <HintPath>..\packages\Microsoft.Extensions.Primitives.2.2.0\lib\netstandard2.0\Microsoft.Extensions.Primitives.dll</HintPath> + </Reference> + <Reference Include="Microsoft.IdentityModel.Abstractions, Version=6.34.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> + <HintPath>..\packages\Microsoft.IdentityModel.Abstractions.6.34.0\lib\net472\Microsoft.IdentityModel.Abstractions.dll</HintPath> + </Reference> + <Reference Include="Microsoft.IdentityModel.JsonWebTokens, Version=6.34.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> + <HintPath>..\packages\Microsoft.IdentityModel.JsonWebTokens.6.34.0\lib\net472\Microsoft.IdentityModel.JsonWebTokens.dll</HintPath> + </Reference> + <Reference Include="Microsoft.IdentityModel.Logging, Version=6.34.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> + <HintPath>..\packages\Microsoft.IdentityModel.Logging.6.34.0\lib\net472\Microsoft.IdentityModel.Logging.dll</HintPath> + </Reference> + <Reference Include="Microsoft.IdentityModel.Protocols, Version=6.34.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> + <HintPath>..\packages\Microsoft.IdentityModel.Protocols.6.34.0\lib\net472\Microsoft.IdentityModel.Protocols.dll</HintPath> + </Reference> + <Reference Include="Microsoft.IdentityModel.Protocols.OpenIdConnect, Version=6.34.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> + <HintPath>..\packages\Microsoft.IdentityModel.Protocols.OpenIdConnect.6.34.0\lib\net472\Microsoft.IdentityModel.Protocols.OpenIdConnect.dll</HintPath> + </Reference> + <Reference Include="Microsoft.IdentityModel.Tokens, Version=6.34.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> + <HintPath>..\packages\Microsoft.IdentityModel.Tokens.6.34.0\lib\net472\Microsoft.IdentityModel.Tokens.dll</HintPath> + </Reference> + <Reference Include="Microsoft.Net.Http.Headers, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> + <HintPath>..\packages\Microsoft.Net.Http.Headers.2.2.0\lib\netstandard2.0\Microsoft.Net.Http.Headers.dll</HintPath> + </Reference> + <Reference Include="Microsoft.OpenApi, Version=1.2.3.0, Culture=neutral, PublicKeyToken=3f5743946376f042, processorArchitecture=MSIL"> + <HintPath>..\packages\Microsoft.OpenApi.1.2.3\lib\net46\Microsoft.OpenApi.dll</HintPath> + </Reference> + <Reference Include="Microsoft.OpenApi.Readers, Version=1.2.3.0, Culture=neutral, PublicKeyToken=3f5743946376f042, processorArchitecture=MSIL"> + <HintPath>..\packages\Microsoft.OpenApi.Readers.1.2.3\lib\net46\Microsoft.OpenApi.Readers.dll</HintPath> + </Reference> <Reference Include="Microsoft.Web.XmlTransform, Version=3.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> <HintPath>..\packages\Microsoft.Web.Xdt.3.1.0\lib\net40\Microsoft.Web.XmlTransform.dll</HintPath> </Reference> <Reference Include="Moq"> <HintPath>..\packages\Moq.4.2.1402.2112\lib\net40\Moq.dll</HintPath> </Reference> + <Reference Include="Namotion.Reflection, Version=2.0.10.0, Culture=neutral, PublicKeyToken=c2f9c3bdfae56102, processorArchitecture=MSIL"> + <HintPath>..\packages\Namotion.Reflection.2.0.10\lib\net45\Namotion.Reflection.dll</HintPath> + </Reference> <Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> - <HintPath>..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath> + <HintPath>..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath> + </Reference> + <Reference Include="NJsonSchema, Version=10.7.2.0, Culture=neutral, PublicKeyToken=c2f9c3bdfae56102, processorArchitecture=MSIL"> + <HintPath>..\packages\NJsonSchema.10.7.2\lib\net45\NJsonSchema.dll</HintPath> + </Reference> + <Reference Include="NJsonSchema.Extensions, Version=0.1.0.0, Culture=neutral, PublicKeyToken=e52fadf300daf456, processorArchitecture=MSIL"> + <HintPath>..\packages\NJsonSchema.Extensions.0.1.0\lib\net45\NJsonSchema.Extensions.dll</HintPath> + </Reference> + <Reference Include="NSwag.Core, Version=13.16.1.0, Culture=neutral, PublicKeyToken=c2d88086e098d109, processorArchitecture=MSIL"> + <HintPath>..\packages\NSwag.Core.13.16.1\lib\net45\NSwag.Core.dll</HintPath> </Reference> <Reference Include="nunit.framework, Version=3.13.3.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL"> <HintPath>..\packages\NUnit.3.13.3\lib\net40\nunit.framework.dll</HintPath> </Reference> + <Reference Include="RamlToOpenApiConverter, Version=0.6.1.0, Culture=neutral, PublicKeyToken=f82a9044f86aaeda, processorArchitecture=MSIL"> + <HintPath>..\packages\RamlToOpenApiConverter.0.6.1\lib\net46\RamlToOpenApiConverter.dll</HintPath> + </Reference> + <Reference Include="RandomDataGenerator, Version=1.0.16.0, Culture=neutral, PublicKeyToken=ae5c571d29a3b8d9, processorArchitecture=MSIL"> + <HintPath>..\packages\RandomDataGenerator.Net.1.0.17\lib\net45\RandomDataGenerator.dll</HintPath> + </Reference> + <Reference Include="Scriban.Signed, Version=2.1.4.0, Culture=neutral, PublicKeyToken=5675fb69b15f2433, processorArchitecture=MSIL"> + <HintPath>..\packages\Scriban.Signed.2.1.4\lib\net45\Scriban.Signed.dll</HintPath> + </Reference> + <Reference Include="SharpYaml, Version=1.6.5.0, Culture=neutral, PublicKeyToken=1ced8108e942bc02, processorArchitecture=MSIL"> + <HintPath>..\packages\SharpYaml.1.6.5\lib\net45\SharpYaml.dll</HintPath> + </Reference> + <Reference Include="SimMetrics.Net, Version=1.0.5.0, Culture=neutral, PublicKeyToken=c58dc06d59f3391b, processorArchitecture=MSIL"> + <HintPath>..\packages\SimMetrics.Net.1.0.5\lib\net45\SimMetrics.Net.dll</HintPath> + </Reference> <Reference Include="SimpleInjector, Version=2.8.3.0, Culture=neutral, PublicKeyToken=984cb50dea722e99, processorArchitecture=MSIL"> <HintPath>..\packages\SimpleInjector.2.8.3\lib\net45\SimpleInjector.dll</HintPath> </Reference> + <Reference Include="Stef.Validation, Version=0.1.1.0, Culture=neutral, PublicKeyToken=8f3400880c321038, processorArchitecture=MSIL"> + <HintPath>..\packages\Stef.Validation.0.1.1\lib\net40\Stef.Validation.dll</HintPath> + </Reference> <Reference Include="System" /> + <Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL"> + <HintPath>..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll</HintPath> + </Reference> + <Reference Include="System.Collections.Immutable, Version=1.2.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <HintPath>..\packages\System.Collections.Immutable.1.5.0\lib\netstandard2.0\System.Collections.Immutable.dll</HintPath> + </Reference> + <Reference Include="System.ComponentModel.Annotations, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <HintPath>..\packages\System.ComponentModel.Annotations.4.5.0\lib\net461\System.ComponentModel.Annotations.dll</HintPath> + </Reference> + <Reference Include="System.ComponentModel.DataAnnotations" /> <Reference Include="System.Configuration" /> <Reference Include="System.Core" /> + <Reference Include="System.Diagnostics.DiagnosticSource, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL"> + <HintPath>..\packages\System.Diagnostics.DiagnosticSource.4.5.0\lib\net46\System.Diagnostics.DiagnosticSource.dll</HintPath> + </Reference> <Reference Include="System.IdentityModel" /> + <Reference Include="System.IdentityModel.Tokens.Jwt, Version=6.34.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> + <HintPath>..\packages\System.IdentityModel.Tokens.Jwt.6.34.0\lib\net472\System.IdentityModel.Tokens.Jwt.dll</HintPath> + </Reference> <Reference Include="System.IO.Compression" /> + <Reference Include="System.IO.Pipelines, Version=4.0.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL"> + <HintPath>..\packages\System.IO.Pipelines.4.5.3\lib\netstandard2.0\System.IO.Pipelines.dll</HintPath> + </Reference> + <Reference Include="System.Linq.Dynamic.Core, Version=1.3.12.0, Culture=neutral, PublicKeyToken=0f07ec44de6ac832, processorArchitecture=MSIL"> + <HintPath>..\packages\System.Linq.Dynamic.Core.1.3.12\lib\net46\System.Linq.Dynamic.Core.dll</HintPath> + </Reference> + <Reference Include="System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL"> + <HintPath>..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll</HintPath> + </Reference> + <Reference Include="System.Net" /> <Reference Include="System.Net.Http" /> <Reference Include="System.Net.Http.WebRequest" /> + <Reference Include="System.Numerics" /> + <Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <HintPath>..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath> + </Reference> <Reference Include="System.Reactive, Version=5.0.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL"> <HintPath>..\packages\System.Reactive.5.0.0\lib\net472\System.Reactive.dll</HintPath> </Reference> - <Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> - <HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.4.5.3\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath> + <Reference Include="System.Reflection.Metadata, Version=1.4.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <HintPath>..\packages\System.Reflection.Metadata.1.6.0\lib\netstandard2.0\System.Reflection.Metadata.dll</HintPath> </Reference> + <Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.6.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.4.7.1\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath> + </Reference> + <Reference Include="System.Runtime.Serialization" /> <Reference Include="System.Security" /> + <Reference Include="System.Security.Cryptography.Cng, Version=4.3.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <HintPath>..\packages\System.Security.Cryptography.Cng.4.5.0\lib\net47\System.Security.Cryptography.Cng.dll</HintPath> + </Reference> + <Reference Include="System.Security.Principal.Windows, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <HintPath>..\packages\System.Security.Principal.Windows.4.5.0\lib\net461\System.Security.Principal.Windows.dll</HintPath> + </Reference> <Reference Include="System.ServiceModel" /> + <Reference Include="System.Text.Encodings.Web, Version=4.0.5.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL"> + <HintPath>..\packages\System.Text.Encodings.Web.4.7.2\lib\net461\System.Text.Encodings.Web.dll</HintPath> + </Reference> + <Reference Include="System.Text.Json, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL"> + <HintPath>..\packages\System.Text.Json.4.7.2\lib\net461\System.Text.Json.dll</HintPath> + </Reference> <Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL"> <HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath> </Reference> + <Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL"> + <HintPath>..\packages\System.ValueTuple.4.5.0\lib\net47\System.ValueTuple.dll</HintPath> + </Reference> <Reference Include="System.Web" /> <Reference Include="System.Windows" /> <Reference Include="System.Windows.Forms" /> @@ -144,7 +446,42 @@ <Reference Include="Microsoft.CSharp" /> <Reference Include="System.Data" /> <Reference Include="System.Xml" /> + <Reference Include="System.Xml.XmlDocument, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <HintPath>..\packages\System.Xml.XmlDocument.4.3.0\lib\net46\System.Xml.XmlDocument.dll</HintPath> + <Private>True</Private> + <Private>True</Private> + </Reference> + <Reference Include="TinyMapper, Version=3.0.1.0, Culture=neutral, processorArchitecture=MSIL"> + <HintPath>..\packages\TinyMapper.3.0.3\lib\net40\TinyMapper.dll</HintPath> + </Reference> <Reference Include="WindowsBase" /> + <Reference Include="WireMock.Net, Version=1.5.62.0, Culture=neutral, PublicKeyToken=c8d65537854e1f03, processorArchitecture=MSIL"> + <HintPath>..\packages\WireMock.Net.1.5.62\lib\net461\WireMock.Net.dll</HintPath> + </Reference> + <Reference Include="WireMock.Net.Abstractions, Version=1.5.62.0, Culture=neutral, PublicKeyToken=c8d65537854e1f03, processorArchitecture=MSIL"> + <HintPath>..\packages\WireMock.Net.Abstractions.1.5.62\lib\net461\WireMock.Net.Abstractions.dll</HintPath> + </Reference> + <Reference Include="WireMock.Net.FluentAssertions, Version=1.5.62.0, Culture=neutral, PublicKeyToken=c8d65537854e1f03, processorArchitecture=MSIL"> + <HintPath>..\packages\WireMock.Net.FluentAssertions.1.5.62\lib\net47\WireMock.Net.FluentAssertions.dll</HintPath> + </Reference> + <Reference Include="WireMock.Net.OpenApiParser, Version=1.5.62.0, Culture=neutral, PublicKeyToken=c8d65537854e1f03, processorArchitecture=MSIL"> + <HintPath>..\packages\WireMock.Net.OpenApiParser.1.5.62\lib\net46\WireMock.Net.OpenApiParser.dll</HintPath> + </Reference> + <Reference Include="WireMock.Org.Abstractions, Version=1.5.62.0, Culture=neutral, PublicKeyToken=c8d65537854e1f03, processorArchitecture=MSIL"> + <HintPath>..\packages\WireMock.Org.Abstractions.1.5.62\lib\net45\WireMock.Org.Abstractions.dll</HintPath> + </Reference> + <Reference Include="XPath2, Version=1.1.5.0, Culture=neutral, PublicKeyToken=463c6d7fb740c7e5, processorArchitecture=MSIL"> + <HintPath>..\packages\XPath2.1.1.5\lib\net452\XPath2.dll</HintPath> + </Reference> + <Reference Include="XPath2.Extensions, Version=1.1.5.0, Culture=neutral, PublicKeyToken=463c6d7fb740c7e5, processorArchitecture=MSIL"> + <HintPath>..\packages\XPath2.Extensions.1.1.5\lib\net452\XPath2.Extensions.dll</HintPath> + </Reference> + <Reference Include="YamlDotNet, Version=8.0.0.0, Culture=neutral, PublicKeyToken=ec19458f3c15af5e, processorArchitecture=MSIL"> + <HintPath>..\packages\YamlDotNet.8.1.0\lib\net45\YamlDotNet.dll</HintPath> + </Reference> + </ItemGroup> + <ItemGroup> + <Reference Include="netstandard" /> </ItemGroup> <ItemGroup> <Compile Include="infrastructure.app\builders\ConfigurationBuilderSpecs.cs" /> @@ -217,8 +554,15 @@ <ErrorText>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}.</ErrorText> </PropertyGroup> <Error Condition="!Exists('..\packages\NUnit.3.13.3\build\NUnit.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NUnit.3.13.3\build\NUnit.props'))" /> - <Error Condition="!Exists('..\packages\NUnit3TestAdapter.4.4.2\build\net462\NUnit3TestAdapter.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NUnit3TestAdapter.4.4.2\build\net462\NUnit3TestAdapter.props'))" /> + <Error Condition="!Exists('..\packages\NUnit3TestAdapter.4.5.0\build\net462\NUnit3TestAdapter.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NUnit3TestAdapter.4.5.0\build\net462\NUnit3TestAdapter.props'))" /> + <Error Condition="!Exists('..\packages\Microsoft.Extensions.Configuration.UserSecrets.2.2.0\build\netstandard2.0\Microsoft.Extensions.Configuration.UserSecrets.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Extensions.Configuration.UserSecrets.2.2.0\build\netstandard2.0\Microsoft.Extensions.Configuration.UserSecrets.props'))" /> + <Error Condition="!Exists('..\packages\Microsoft.Extensions.Configuration.UserSecrets.2.2.0\build\netstandard2.0\Microsoft.Extensions.Configuration.UserSecrets.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Extensions.Configuration.UserSecrets.2.2.0\build\netstandard2.0\Microsoft.Extensions.Configuration.UserSecrets.targets'))" /> + <Error Condition="!Exists('..\packages\Microsoft.AspNetCore.Server.IIS.2.2.6\build\netstandard2.0\Microsoft.AspNetCore.Server.IIS.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.AspNetCore.Server.IIS.2.2.6\build\netstandard2.0\Microsoft.AspNetCore.Server.IIS.targets'))" /> + <Error Condition="!Exists('..\packages\Microsoft.AspNetCore.Server.IISIntegration.2.2.0\build\netstandard2.0\Microsoft.AspNetCore.Server.IISIntegration.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.AspNetCore.Server.IISIntegration.2.2.0\build\netstandard2.0\Microsoft.AspNetCore.Server.IISIntegration.targets'))" /> </Target> + <Import Project="..\packages\Microsoft.Extensions.Configuration.UserSecrets.2.2.0\build\netstandard2.0\Microsoft.Extensions.Configuration.UserSecrets.targets" Condition="Exists('..\packages\Microsoft.Extensions.Configuration.UserSecrets.2.2.0\build\netstandard2.0\Microsoft.Extensions.Configuration.UserSecrets.targets')" /> + <Import Project="..\packages\Microsoft.AspNetCore.Server.IIS.2.2.6\build\netstandard2.0\Microsoft.AspNetCore.Server.IIS.targets" Condition="Exists('..\packages\Microsoft.AspNetCore.Server.IIS.2.2.6\build\netstandard2.0\Microsoft.AspNetCore.Server.IIS.targets')" /> + <Import Project="..\packages\Microsoft.AspNetCore.Server.IISIntegration.2.2.0\build\netstandard2.0\Microsoft.AspNetCore.Server.IISIntegration.targets" Condition="Exists('..\packages\Microsoft.AspNetCore.Server.IISIntegration.2.2.0\build\netstandard2.0\Microsoft.AspNetCore.Server.IISIntegration.targets')" /> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. Other similar extension points exist, see Microsoft.Common.targets. <Target Name="BeforeBuild"> diff --git a/src/chocolatey.tests.integration/packages.config b/src/chocolatey.tests.integration/packages.config index d2a5ea1918..6a51a8e146 100644 --- a/src/chocolatey.tests.integration/packages.config +++ b/src/chocolatey.tests.integration/packages.config @@ -1,21 +1,181 @@ <?xml version="1.0" encoding="utf-8"?> <packages> + <package id="AnyOf" version="0.3.0" targetFramework="net48" /> <package id="Chocolatey.NuGet.Common" version="3.4.2" targetFramework="net48" /> <package id="Chocolatey.NuGet.Configuration" version="3.4.2" targetFramework="net48" /> <package id="Chocolatey.NuGet.Frameworks" version="3.4.2" targetFramework="net48" /> <package id="Chocolatey.NuGet.Packaging" version="3.4.2" targetFramework="net48" /> <package id="Chocolatey.NuGet.Protocol" version="3.4.2" targetFramework="net48" /> <package id="Chocolatey.NuGet.Versioning" version="3.4.2" targetFramework="net48" /> + <package id="Fare" version="2.2.1" targetFramework="net48" /> <package id="FluentAssertions" version="6.11.0" targetFramework="net48" /> <package id="FluentAssertions.Analyzers" version="0.19.1" targetFramework="net48" developmentDependency="true" /> + <package id="Handlebars.Net" version="2.1.6" targetFramework="net48" /> + <package id="Handlebars.Net.Helpers" version="2.4.4" targetFramework="net48" /> + <package id="Handlebars.Net.Helpers.Core" version="2.4.4" targetFramework="net48" /> + <package id="Handlebars.Net.Helpers.DynamicLinq" version="2.4.4" targetFramework="net48" /> + <package id="Handlebars.Net.Helpers.Humanizer" version="2.4.4" targetFramework="net48" /> + <package id="Handlebars.Net.Helpers.Json" version="2.4.4" targetFramework="net48" /> + <package id="Handlebars.Net.Helpers.Random" version="2.4.4" targetFramework="net48" /> + <package id="Handlebars.Net.Helpers.Xeger" version="2.4.4" targetFramework="net48" /> + <package id="Handlebars.Net.Helpers.XPath" version="2.4.4" targetFramework="net48" /> + <package id="Handlebars.Net.Helpers.Xslt" version="2.4.4" targetFramework="net48" /> + <package id="Humanizer" version="2.14.1" targetFramework="net48" /> + <package id="Humanizer.Core" version="2.14.1" targetFramework="net48" /> + <package id="Humanizer.Core.af" version="2.14.1" targetFramework="net48" /> + <package id="Humanizer.Core.ar" version="2.14.1" targetFramework="net48" /> + <package id="Humanizer.Core.az" version="2.14.1" targetFramework="net48" /> + <package id="Humanizer.Core.bg" version="2.14.1" targetFramework="net48" /> + <package id="Humanizer.Core.bn-BD" version="2.14.1" targetFramework="net48" /> + <package id="Humanizer.Core.cs" version="2.14.1" targetFramework="net48" /> + <package id="Humanizer.Core.da" version="2.14.1" targetFramework="net48" /> + <package id="Humanizer.Core.de" version="2.14.1" targetFramework="net48" /> + <package id="Humanizer.Core.el" version="2.14.1" targetFramework="net48" /> + <package id="Humanizer.Core.es" version="2.14.1" targetFramework="net48" /> + <package id="Humanizer.Core.fa" version="2.14.1" targetFramework="net48" /> + <package id="Humanizer.Core.fi-FI" version="2.14.1" targetFramework="net48" /> + <package id="Humanizer.Core.fr" version="2.14.1" targetFramework="net48" /> + <package id="Humanizer.Core.fr-BE" version="2.14.1" targetFramework="net48" /> + <package id="Humanizer.Core.he" version="2.14.1" targetFramework="net48" /> + <package id="Humanizer.Core.hr" version="2.14.1" targetFramework="net48" /> + <package id="Humanizer.Core.hu" version="2.14.1" targetFramework="net48" /> + <package id="Humanizer.Core.hy" version="2.14.1" targetFramework="net48" /> + <package id="Humanizer.Core.id" version="2.14.1" targetFramework="net48" /> + <package id="Humanizer.Core.is" version="2.14.1" targetFramework="net48" /> + <package id="Humanizer.Core.it" version="2.14.1" targetFramework="net48" /> + <package id="Humanizer.Core.ja" version="2.14.1" targetFramework="net48" /> + <package id="Humanizer.Core.ko-KR" version="2.14.1" targetFramework="net48" /> + <package id="Humanizer.Core.ku" version="2.14.1" targetFramework="net48" /> + <package id="Humanizer.Core.lv" version="2.14.1" targetFramework="net48" /> + <package id="Humanizer.Core.ms-MY" version="2.14.1" targetFramework="net48" /> + <package id="Humanizer.Core.mt" version="2.14.1" targetFramework="net48" /> + <package id="Humanizer.Core.nb" version="2.14.1" targetFramework="net48" /> + <package id="Humanizer.Core.nb-NO" version="2.14.1" targetFramework="net48" /> + <package id="Humanizer.Core.nl" version="2.14.1" targetFramework="net48" /> + <package id="Humanizer.Core.pl" version="2.14.1" targetFramework="net48" /> + <package id="Humanizer.Core.pt" version="2.14.1" targetFramework="net48" /> + <package id="Humanizer.Core.ro" version="2.14.1" targetFramework="net48" /> + <package id="Humanizer.Core.ru" version="2.14.1" targetFramework="net48" /> + <package id="Humanizer.Core.sk" version="2.14.1" targetFramework="net48" /> + <package id="Humanizer.Core.sl" version="2.14.1" targetFramework="net48" /> + <package id="Humanizer.Core.sr" version="2.14.1" targetFramework="net48" /> + <package id="Humanizer.Core.sr-Latn" version="2.14.1" targetFramework="net48" /> + <package id="Humanizer.Core.sv" version="2.14.1" targetFramework="net48" /> + <package id="Humanizer.Core.th-TH" version="2.14.1" targetFramework="net48" /> + <package id="Humanizer.Core.tr" version="2.14.1" targetFramework="net48" /> + <package id="Humanizer.Core.uk" version="2.14.1" targetFramework="net48" /> + <package id="Humanizer.Core.uz-Cyrl-UZ" version="2.14.1" targetFramework="net48" /> + <package id="Humanizer.Core.uz-Latn-UZ" version="2.14.1" targetFramework="net48" /> + <package id="Humanizer.Core.vi" version="2.14.1" targetFramework="net48" /> + <package id="Humanizer.Core.zh-CN" version="2.14.1" targetFramework="net48" /> + <package id="Humanizer.Core.zh-Hans" version="2.14.1" targetFramework="net48" /> + <package id="Humanizer.Core.zh-Hant" version="2.14.1" targetFramework="net48" /> + <package id="JmesPath.Net" version="1.0.125" targetFramework="net48" /> + <package id="JsonConverter.Abstractions" version="0.5.0" targetFramework="net48" /> <package id="log4net" version="2.0.12" targetFramework="net48" /> + <package id="Microsoft.AspNetCore" version="2.2.0" targetFramework="net48" /> + <package id="Microsoft.AspNetCore.Authentication.Abstractions" version="2.2.0" targetFramework="net48" /> + <package id="Microsoft.AspNetCore.Authentication.Core" version="2.2.0" targetFramework="net48" /> + <package id="Microsoft.AspNetCore.Connections.Abstractions" version="2.2.0" targetFramework="net48" /> + <package id="Microsoft.AspNetCore.Diagnostics" version="2.2.0" targetFramework="net48" /> + <package id="Microsoft.AspNetCore.Diagnostics.Abstractions" version="2.2.0" targetFramework="net48" /> + <package id="Microsoft.AspNetCore.HostFiltering" version="2.2.0" targetFramework="net48" /> + <package id="Microsoft.AspNetCore.Hosting" version="2.2.0" targetFramework="net48" /> + <package id="Microsoft.AspNetCore.Hosting.Abstractions" version="2.2.0" targetFramework="net48" /> + <package id="Microsoft.AspNetCore.Hosting.Server.Abstractions" version="2.2.0" targetFramework="net48" /> + <package id="Microsoft.AspNetCore.Http" version="2.2.0" targetFramework="net48" /> + <package id="Microsoft.AspNetCore.Http.Abstractions" version="2.2.0" targetFramework="net48" /> + <package id="Microsoft.AspNetCore.Http.Extensions" version="2.2.0" targetFramework="net48" /> + <package id="Microsoft.AspNetCore.Http.Features" version="2.2.0" targetFramework="net48" /> + <package id="Microsoft.AspNetCore.HttpOverrides" version="2.2.0" targetFramework="net48" /> + <package id="Microsoft.AspNetCore.Routing" version="2.2.0" targetFramework="net48" /> + <package id="Microsoft.AspNetCore.Routing.Abstractions" version="2.2.0" targetFramework="net48" /> + <package id="Microsoft.AspNetCore.Server.IIS" version="2.2.6" targetFramework="net48" /> + <package id="Microsoft.AspNetCore.Server.IISIntegration" version="2.2.0" targetFramework="net48" /> + <package id="Microsoft.AspNetCore.Server.Kestrel" version="2.2.0" targetFramework="net48" /> + <package id="Microsoft.AspNetCore.Server.Kestrel.Core" version="2.2.0" targetFramework="net48" /> + <package id="Microsoft.AspNetCore.Server.Kestrel.Https" version="2.2.0" targetFramework="net48" /> + <package id="Microsoft.AspNetCore.Server.Kestrel.Transport.Abstractions" version="2.2.0" targetFramework="net48" /> + <package id="Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets" version="2.2.0" targetFramework="net48" /> + <package id="Microsoft.AspNetCore.WebUtilities" version="2.2.0" targetFramework="net48" /> + <package id="Microsoft.Bcl.AsyncInterfaces" version="1.1.0" targetFramework="net48" /> + <package id="Microsoft.CSharp" version="4.5.0" targetFramework="net48" /> + <package id="Microsoft.Extensions.Configuration" version="2.2.0" targetFramework="net48" /> + <package id="Microsoft.Extensions.Configuration.Abstractions" version="2.2.0" targetFramework="net48" /> + <package id="Microsoft.Extensions.Configuration.Binder" version="2.2.0" targetFramework="net48" /> + <package id="Microsoft.Extensions.Configuration.CommandLine" version="2.2.0" targetFramework="net48" /> + <package id="Microsoft.Extensions.Configuration.EnvironmentVariables" version="2.2.0" targetFramework="net48" /> + <package id="Microsoft.Extensions.Configuration.FileExtensions" version="2.2.0" targetFramework="net48" /> + <package id="Microsoft.Extensions.Configuration.Json" version="2.2.0" targetFramework="net48" /> + <package id="Microsoft.Extensions.Configuration.UserSecrets" version="2.2.0" targetFramework="net48" /> + <package id="Microsoft.Extensions.DependencyInjection" version="2.2.0" targetFramework="net48" /> + <package id="Microsoft.Extensions.DependencyInjection.Abstractions" version="2.2.0" targetFramework="net48" /> + <package id="Microsoft.Extensions.FileProviders.Abstractions" version="2.2.0" targetFramework="net48" /> + <package id="Microsoft.Extensions.FileProviders.Physical" version="2.2.0" targetFramework="net48" /> + <package id="Microsoft.Extensions.FileSystemGlobbing" version="2.2.0" targetFramework="net48" /> + <package id="Microsoft.Extensions.Hosting.Abstractions" version="2.2.0" targetFramework="net48" /> + <package id="Microsoft.Extensions.Logging" version="2.2.0" targetFramework="net48" /> + <package id="Microsoft.Extensions.Logging.Abstractions" version="2.2.0" targetFramework="net48" /> + <package id="Microsoft.Extensions.Logging.Configuration" version="2.2.0" targetFramework="net48" /> + <package id="Microsoft.Extensions.Logging.Console" version="2.2.0" targetFramework="net48" /> + <package id="Microsoft.Extensions.Logging.Debug" version="2.2.0" targetFramework="net48" /> + <package id="Microsoft.Extensions.Logging.EventSource" version="2.2.0" targetFramework="net48" /> + <package id="Microsoft.Extensions.ObjectPool" version="2.2.0" targetFramework="net48" /> + <package id="Microsoft.Extensions.Options" version="2.2.0" targetFramework="net48" /> + <package id="Microsoft.Extensions.Options.ConfigurationExtensions" version="2.2.0" targetFramework="net48" /> + <package id="Microsoft.Extensions.Primitives" version="2.2.0" targetFramework="net48" /> + <package id="Microsoft.IdentityModel.Abstractions" version="6.34.0" targetFramework="net48" /> + <package id="Microsoft.IdentityModel.JsonWebTokens" version="6.34.0" targetFramework="net48" /> + <package id="Microsoft.IdentityModel.Logging" version="6.34.0" targetFramework="net48" /> + <package id="Microsoft.IdentityModel.Protocols" version="6.34.0" targetFramework="net48" /> + <package id="Microsoft.IdentityModel.Protocols.OpenIdConnect" version="6.34.0" targetFramework="net48" /> + <package id="Microsoft.IdentityModel.Tokens" version="6.34.0" targetFramework="net48" /> + <package id="Microsoft.Net.Http.Headers" version="2.2.0" targetFramework="net48" /> + <package id="Microsoft.OpenApi" version="1.2.3" targetFramework="net48" /> + <package id="Microsoft.OpenApi.Readers" version="1.2.3" targetFramework="net48" /> <package id="Microsoft.Web.Xdt" version="3.1.0" targetFramework="net48" /> <package id="Moq" version="4.2.1402.2112" targetFramework="net40" /> - <package id="Newtonsoft.Json" version="13.0.1" targetFramework="net48" /> + <package id="Namotion.Reflection" version="2.0.10" targetFramework="net48" /> + <package id="Newtonsoft.Json" version="13.0.3" targetFramework="net48" /> + <package id="NJsonSchema" version="10.7.2" targetFramework="net48" /> + <package id="NJsonSchema.Extensions" version="0.1.0" targetFramework="net48" /> + <package id="NSwag.Core" version="13.16.1" targetFramework="net48" /> <package id="NUnit" version="3.13.3" targetFramework="net48" /> - <package id="NUnit3TestAdapter" version="4.4.2" targetFramework="net48" /> + <package id="NUnit3TestAdapter" version="4.5.0" targetFramework="net48" /> + <package id="RamlToOpenApiConverter" version="0.6.1" targetFramework="net48" /> + <package id="RandomDataGenerator.Net" version="1.0.17" targetFramework="net48" /> + <package id="Scriban.Signed" version="2.1.4" targetFramework="net48" /> + <package id="SharpYaml" version="1.6.5" targetFramework="net48" /> + <package id="SimMetrics.Net" version="1.0.5" targetFramework="net48" /> <package id="SimpleInjector" version="2.8.3" targetFramework="net48" /> + <package id="Stef.Validation" version="0.1.1" targetFramework="net48" /> + <package id="System.Buffers" version="4.5.1" targetFramework="net48" /> + <package id="System.Collections.Immutable" version="1.5.0" targetFramework="net48" /> + <package id="System.ComponentModel.Annotations" version="4.5.0" targetFramework="net48" /> + <package id="System.Diagnostics.DiagnosticSource" version="4.5.0" targetFramework="net48" /> + <package id="System.IdentityModel.Tokens.Jwt" version="6.34.0" targetFramework="net48" /> + <package id="System.IO.Pipelines" version="4.5.3" targetFramework="net48" /> + <package id="System.Linq.Dynamic.Core" version="1.3.12" targetFramework="net48" /> + <package id="System.Memory" version="4.5.4" targetFramework="net48" /> + <package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net48" /> <package id="System.Reactive" version="5.0.0" targetFramework="net48" /> - <package id="System.Runtime.CompilerServices.Unsafe" version="4.5.3" targetFramework="net48" /> + <package id="System.Reflection.Metadata" version="1.6.0" targetFramework="net48" /> + <package id="System.Runtime.CompilerServices.Unsafe" version="4.7.1" targetFramework="net48" /> + <package id="System.Security.Cryptography.Cng" version="4.5.0" targetFramework="net48" /> + <package id="System.Security.Principal.Windows" version="4.5.0" targetFramework="net48" /> + <package id="System.Text.Encoding" version="4.3.0" targetFramework="net48" /> + <package id="System.Text.Encodings.Web" version="4.7.2" targetFramework="net48" /> + <package id="System.Text.Json" version="4.7.2" targetFramework="net48" /> <package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net48" /> + <package id="System.ValueTuple" version="4.5.0" targetFramework="net48" /> + <package id="System.Xml.XmlDocument" version="4.3.0" targetFramework="net48" /> + <package id="TinyMapper" version="3.0.3" targetFramework="net48" /> + <package id="WireMock.Net" version="1.5.62" targetFramework="net48" /> + <package id="WireMock.Net.Abstractions" version="1.5.62" targetFramework="net48" /> + <package id="WireMock.Net.FluentAssertions" version="1.5.62" targetFramework="net48" /> + <package id="WireMock.Net.OpenApiParser" version="1.5.62" targetFramework="net48" /> + <package id="WireMock.Org.Abstractions" version="1.5.62" targetFramework="net48" /> + <package id="XPath2" version="1.1.5" targetFramework="net48" /> + <package id="XPath2.Extensions" version="1.1.5" targetFramework="net48" /> + <package id="YamlDotNet" version="8.1.0" targetFramework="net48" /> </packages> \ No newline at end of file diff --git a/src/chocolatey.tests.integration/scenarios/ListScenarios.cs b/src/chocolatey.tests.integration/scenarios/ListScenarios.cs index d00930ddd8..0e01deb95c 100644 --- a/src/chocolatey.tests.integration/scenarios/ListScenarios.cs +++ b/src/chocolatey.tests.integration/scenarios/ListScenarios.cs @@ -116,7 +116,7 @@ public void Should_contain_package_name() [Fact] public void Should_not_contain_any_version_number() { - MockLogger.ContainsMessage(".0").Should().BeFalse(); + MockLogger.ContainsMessage(".0", LogLevel.Info).Should().BeFalse(); } } @@ -163,12 +163,6 @@ public void Should_not_contain_a_summary() { MockLogger.ContainsMessage("packages installed").Should().BeFalse(); } - - [Fact] - public void Should_not_contain_debugging_messages() - { - MockLogger.Messages.Should().NotContainKey(LogLevel.Debug.ToStringSafe()); - } } public class When_listing_local_packages_limiting_output_with_id_only : ScenariosBase @@ -196,7 +190,7 @@ public void Should_contain_packages_id() [Fact] public void Should_not_contain_any_version_number() { - MockLogger.ContainsMessage(".0").Should().BeFalse(); + MockLogger.ContainsMessage(".0", LogLevel.Info).Should().BeFalse(); } [Fact] diff --git a/src/chocolatey.tests.integration/scenarios/PinScenarios.cs b/src/chocolatey.tests.integration/scenarios/PinScenarios.cs index 7f1abdbf99..ae4bc10be0 100644 --- a/src/chocolatey.tests.integration/scenarios/PinScenarios.cs +++ b/src/chocolatey.tests.integration/scenarios/PinScenarios.cs @@ -67,6 +67,7 @@ public override void Context() } } + [WindowsOnly] public class When_listing_pins_with_no_pins : ScenariosBase { public override void Context() @@ -96,6 +97,7 @@ public void Should_not_contain_any_pins_by_default() } } + [WindowsOnly] public class When_listing_pins_with_an_existing_pin : ScenariosBase { public override void Context() @@ -130,6 +132,7 @@ public void Should_contain_existing_pin_messages() } } + [WindowsOnly] public class When_listing_pins_with_existing_pins : ScenariosBase { public override void Context() diff --git a/src/chocolatey.tests.integration/scenarios/SearchScenarios.cs b/src/chocolatey.tests.integration/scenarios/SearchScenarios.cs index c47a83a270..2fdf5d38f7 100644 --- a/src/chocolatey.tests.integration/scenarios/SearchScenarios.cs +++ b/src/chocolatey.tests.integration/scenarios/SearchScenarios.cs @@ -601,7 +601,7 @@ public void ShouldOutputWarningAboutThresholdBeingReached() { MockLogger.Messages.Should() .ContainKey(LogLevel.Warn.ToString()) - .WhoseValue.Should().ContainSingle(m => m == "The threshold of 2 packages per source has been met. Please refine your search, or specify a page to find any more results."); + .WhoseValue.Should().ContainSingle(m => m == "The threshold of 2 packages, or package versions, per source has been met. Please refine your search, or specify a page number to retrieve more results."); } [Fact] diff --git a/src/chocolatey.tests.integration/scenarios/UpgradeScenarios.cs b/src/chocolatey.tests.integration/scenarios/UpgradeScenarios.cs index 9fc45c629f..77e03962ed 100644 --- a/src/chocolatey.tests.integration/scenarios/UpgradeScenarios.cs +++ b/src/chocolatey.tests.integration/scenarios/UpgradeScenarios.cs @@ -28,6 +28,10 @@ using NuGet.Packaging; using NUnit.Framework; using FluentAssertions; +using WireMock.Server; +using WireMock.RequestBuilders; +using WireMock.ResponseBuilders; +using WireMock.FluentAssertions; namespace chocolatey.tests.integration.scenarios { @@ -2946,6 +2950,10 @@ public void Should_not_have_warning_package_result() } } + /// <summary> + /// This test suite tests upgrading isdependency from 1.0.0 while hasdependency is pinned to a version that does not allow + /// for isdependency to upgrade to the latest available in the source. + /// </summary> public class When_upgrading_a_dependency_with_parent_being_pinned_and_depends_on_a_range_less_than_upgrade_version : ScenariosBase { public override void Context() @@ -4237,6 +4245,7 @@ public void Should_not_have_executed_beforemodify_hook_script_for_upgrade_versio .WhoseValue.Should().NotContain(m => m.Contains("pre-beforemodify-all.ps1 hook ran for upgradepackage 1.1.0")); } } + public class When_upgrading_an_existing_package_with_uppercase_id : ScenariosBase { private PackageResult _packageResult; @@ -4785,7 +4794,6 @@ public override void Context() } } - public class When_upgrading_a_package_with_beforeModify_script_with_dependencies_with_beforeModify_scripts_and_hooks : ScenariosBase { private const string TargetPackageName = "hasdependencywithbeforemodify"; @@ -4953,5 +4961,413 @@ public void Should_not_have_warning_package_result() Results.Should().AllSatisfy(r => r.Value.Warning.Should().BeFalse()); } } + + [WindowsOnly] + public class When_upgrading_a_package_when_there_is_an_exception_thrown_from_server_when_downloading_nupkg_file : ScenariosBase + { + private WireMockServer _wireMockServer; + + private PackageResult _packageResult; + + public override void Context() + { + base.Context(); + + // Start WireMockServer using a random port + _wireMockServer = WireMockServer.Start(); + + // Force outgoing Chocolatey CLI HTTP requests to go to WireMock.NET Server + Configuration.Sources = $"{_wireMockServer.Url}/api/v2/"; + + // Set configuration to prevent re-use of cached HTTP Requests + Configuration.CacheExpirationInMinutes = -1; + + // The WireMock.Net Server is setup to reply to requests made when _NOT_ + // using repository optimizations, so let's make sure that we are using + // that configuration explicitly. It was found that when running all + // the integration tests together, this value could be set to true + // elsewhere, which then causes tests here to fail. This is far from ideal, + // and the Configuration should have been reset when starting this scenario + // but for now, let's explicitly set to false, as this is what we know + // the WireMock.Net server will respond with. + Configuration.Features.UsePackageRepositoryOptimizations = false; + + _wireMockServer.Given( + Request.Create().WithPath("/api/v2/").UsingGet() + ) + .RespondWith( + Response.Create() + .WithStatusCode(200) + .WithHeader("Content-Type", "application/xml;charset=utf-8") + .WithHeader("DataServiceVersion", "1.0;") + .WithBody(@"<?xml version=""1.0"" encoding=""utf-8"" standalone=""yes""?> +<service xml:base=""{0}/api/v2/"" xmlns:atom=""http://www.w3.org/2005/Atom"" xmlns:app=""http://www.w3.org/2007/app"" xmlns=""http://www.w3.org/2007/app""> +<workspace> +<atom:title>Default</atom:title> +<collection href=""Packages""> +<atom:title>Packages</atom:title> +</collection> +</workspace> +</service>".FormatWith(_wireMockServer.Url)) + ); + + _wireMockServer.Given( + Request.Create().WithPath("/api/v2/$metadata").UsingGet() + ) + .RespondWith( + Response.Create() + .WithStatusCode(200) + .WithHeader("Content-Type", "application/xml;charset=utf-8") + .WithHeader("DataServiceVersion", "2.0;") + .WithBody(@"<?xml version=""1.0"" encoding=""utf-8"" standalone=""yes""?> +<edmx:Edmx Version=""1.0"" xmlns:edmx=""http://schemas.microsoft.com/ado/2007/06/edmx""> + <edmx:DataServices xmlns:m=""http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"" m:DataServiceVersion=""2.0""> + <Schema Namespace=""CCR.Website"" xmlns:d=""http://schemas.microsoft.com/ado/2007/08/dataservices"" xmlns:m=""http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"" xmlns=""http://schemas.microsoft.com/ado/2006/04/edm""> + <EntityType Name=""V2FeedPackage"" m:HasStream=""true""> + <Key> + <PropertyRef Name=""Id"" /> + <PropertyRef Name=""Version"" /> + </Key> + <Property Name=""Id"" Type=""Edm.String"" Nullable=""false"" m:FC_TargetPath=""SyndicationTitle"" m:FC_ContentKind=""text"" m:FC_KeepInContent=""false"" /> + <Property Name=""Version"" Type=""Edm.String"" Nullable=""false"" /> + <Property Name=""Title"" Type=""Edm.String"" Nullable=""true"" /> + <Property Name=""Summary"" Type=""Edm.String"" Nullable=""true"" m:FC_TargetPath=""SyndicationSummary"" m:FC_ContentKind=""text"" m:FC_KeepInContent=""false"" /> + <Property Name=""Description"" Type=""Edm.String"" Nullable=""true"" /> + <Property Name=""Tags"" Type=""Edm.String"" Nullable=""true"" /> + <Property Name=""Authors"" Type=""Edm.String"" Nullable=""true"" m:FC_TargetPath=""SyndicationAuthorName"" m:FC_ContentKind=""text"" m:FC_KeepInContent=""false"" /> + <Property Name=""Copyright"" Type=""Edm.String"" Nullable=""true"" /> + <Property Name=""Created"" Type=""Edm.DateTime"" Nullable=""false"" /> + <Property Name=""Dependencies"" Type=""Edm.String"" Nullable=""true"" /> + <Property Name=""DownloadCount"" Type=""Edm.Int32"" Nullable=""false"" /> + <Property Name=""VersionDownloadCount"" Type=""Edm.Int32"" Nullable=""false"" /> + <Property Name=""GalleryDetailsUrl"" Type=""Edm.String"" Nullable=""true"" /> + <Property Name=""ReportAbuseUrl"" Type=""Edm.String"" Nullable=""true"" /> + <Property Name=""IconUrl"" Type=""Edm.String"" Nullable=""true"" /> + <Property Name=""IsLatestVersion"" Type=""Edm.Boolean"" Nullable=""false"" /> + <Property Name=""IsAbsoluteLatestVersion"" Type=""Edm.Boolean"" Nullable=""false"" /> + <Property Name=""IsPrerelease"" Type=""Edm.Boolean"" Nullable=""false"" /> + <Property Name=""Language"" Type=""Edm.String"" Nullable=""true"" /> + <Property Name=""LastUpdated"" Type=""Edm.DateTime"" Nullable=""false"" m:FC_TargetPath=""SyndicationUpdated"" m:FC_ContentKind=""text"" m:FC_KeepInContent=""false"" /> + <Property Name=""Published"" Type=""Edm.DateTime"" Nullable=""false"" /> + <Property Name=""LicenseUrl"" Type=""Edm.String"" Nullable=""true"" /> + <Property Name=""RequireLicenseAcceptance"" Type=""Edm.Boolean"" Nullable=""false"" /> + <Property Name=""PackageHash"" Type=""Edm.String"" Nullable=""true"" /> + <Property Name=""PackageHashAlgorithm"" Type=""Edm.String"" Nullable=""true"" /> + <Property Name=""PackageSize"" Type=""Edm.Int64"" Nullable=""false"" /> + <Property Name=""ProjectUrl"" Type=""Edm.String"" Nullable=""true"" /> + <Property Name=""ReleaseNotes"" Type=""Edm.String"" Nullable=""true"" /> + <Property Name=""ProjectSourceUrl"" Type=""Edm.String"" Nullable=""true"" /> + <Property Name=""PackageSourceUrl"" Type=""Edm.String"" Nullable=""true"" /> + <Property Name=""DocsUrl"" Type=""Edm.String"" Nullable=""true"" /> + <Property Name=""MailingListUrl"" Type=""Edm.String"" Nullable=""true"" /> + <Property Name=""BugTrackerUrl"" Type=""Edm.String"" Nullable=""true"" /> + <Property Name=""IsApproved"" Type=""Edm.Boolean"" Nullable=""false"" /> + <Property Name=""PackageStatus"" Type=""Edm.String"" Nullable=""true"" /> + <Property Name=""PackageSubmittedStatus"" Type=""Edm.String"" Nullable=""true"" /> + <Property Name=""PackageTestResultUrl"" Type=""Edm.String"" Nullable=""true"" /> + <Property Name=""PackageTestResultStatus"" Type=""Edm.String"" Nullable=""true"" /> + <Property Name=""PackageTestResultStatusDate"" Type=""Edm.DateTime"" Nullable=""true"" /> + <Property Name=""PackageValidationResultStatus"" Type=""Edm.String"" Nullable=""true"" /> + <Property Name=""PackageValidationResultDate"" Type=""Edm.DateTime"" Nullable=""true"" /> + <Property Name=""PackageCleanupResultDate"" Type=""Edm.DateTime"" Nullable=""true"" /> + <Property Name=""PackageReviewedDate"" Type=""Edm.DateTime"" Nullable=""true"" /> + <Property Name=""PackageApprovedDate"" Type=""Edm.DateTime"" Nullable=""true"" /> + <Property Name=""PackageReviewer"" Type=""Edm.String"" Nullable=""true"" /> + <Property Name=""IsDownloadCacheAvailable"" Type=""Edm.Boolean"" Nullable=""false"" /> + <Property Name=""DownloadCacheStatus"" Type=""Edm.String"" Nullable=""true"" /> + <Property Name=""DownloadCacheDate"" Type=""Edm.DateTime"" Nullable=""true"" /> + <Property Name=""DownloadCache"" Type=""Edm.String"" Nullable=""true"" /> + <Property Name=""PackageScanStatus"" Type=""Edm.String"" Nullable=""true"" /> + <Property Name=""PackageScanResultDate"" Type=""Edm.DateTime"" Nullable=""true"" /> + <Property Name=""PackageScanFlagResult"" Type=""Edm.String"" Nullable=""true"" /> + </EntityType> + <EntityContainer Name=""FeedContext_x0060_1"" m:IsDefaultEntityContainer=""true""> + <EntitySet Name=""Packages"" EntityType=""CCR.Website.V2FeedPackage"" /> + <FunctionImport Name=""Packages"" EntitySet=""Packages"" ReturnType=""Collection(CCR.Website.V2FeedPackage)"" m:HttpMethod=""GET"" /> + <FunctionImport Name=""Search"" EntitySet=""Packages"" ReturnType=""Collection(CCR.Website.V2FeedPackage)"" m:HttpMethod=""GET""> + <Parameter Name=""searchTerm"" Type=""Edm.String"" Mode=""In"" /> + <Parameter Name=""targetFramework"" Type=""Edm.String"" Mode=""In"" /> + <Parameter Name=""includePrerelease"" Type=""Edm.Boolean"" Mode=""In"" /> + </FunctionImport> + <FunctionImport Name=""FindPackagesById"" EntitySet=""Packages"" ReturnType=""Collection(CCR.Website.V2FeedPackage)"" m:HttpMethod=""GET""> + <Parameter Name=""id"" Type=""Edm.String"" Mode=""In"" /> + </FunctionImport> + <FunctionImport Name=""GetUpdates"" EntitySet=""Packages"" ReturnType=""Collection(CCR.Website.V2FeedPackage)"" m:HttpMethod=""GET""> + <Parameter Name=""packageIds"" Type=""Edm.String"" Mode=""In"" /> + <Parameter Name=""versions"" Type=""Edm.String"" Mode=""In"" /> + <Parameter Name=""includePrerelease"" Type=""Edm.Boolean"" Mode=""In"" /> + <Parameter Name=""includeAllVersions"" Type=""Edm.Boolean"" Mode=""In"" /> + <Parameter Name=""targetFrameworks"" Type=""Edm.String"" Mode=""In"" /> + </FunctionImport> + </EntityContainer> + </Schema> + </edmx:DataServices> +</edmx:Edmx>") + ); + + _wireMockServer.Given( + Request.Create() + .WithPath("/api/v2/FindPackagesById()") + .UsingGet() + ) + .RespondWith( + Response.Create() + .WithStatusCode(200) + .WithHeader("Content-Type", "application/atom+xml;charset=utf-8") + .WithHeader("DataServiceVersion", "2.0;") + .WithBody(@"<?xml version=""1.0"" encoding=""utf-8"" standalone=""yes""?> +<feed xml:base=""{0}/api/v2/"" xmlns:d=""http://schemas.microsoft.com/ado/2007/08/dataservices"" xmlns:m=""http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"" xmlns=""http://www.w3.org/2005/Atom""> + <title type=""text"">Packages + {0}/api/v2/Packages + 2024-08-13T21:56:43Z + + + {0}/api/v2/Packages(Id='upgradepackage',Version='2.0.0') + upgradepackage + A package used to test upgrading of packages. + 2024-08-08T05:11:50Z + + Chocolatey Software, Inc. + + + + + + + 2.0.0 + Upgrade Package + My Description! + a b c d + Chocolatey Software, Inc. + 2024-08-07T00:06:31.233 + + 289183 + 63 + {0}/packages/upgradepackage/2.0.0 + {0}/package/ReportAbuse/upgradepackage/2.0.0 + https://chocolatey.org/assets/images/nupkg/chocolateyicon.png + true + false + false + + 2024-08-07T00:06:31.233 + https://raw.githubusercontent.com/chocolatey/choco/master/LICENSE + false + GUXyvEC3y5y5S371LWHRbkEQ+fBxHAcm7d+/fweK+FYx1N2xMSlph+NGLyC3MEvecWY+EXNgRF7L7Km/u0oS8g== + SHA512 + 5358 + https://github.com/chocolatey/choco + See all - https://docs.chocolatey.org/en-us/choco/release-notes + + https://github.com/chocolatey/choco/tree/develop/nuspec/chocolatey/chocolatey + https://docs.chocolatey.org/en-us/ + https://groups.google.com/forum/#!forum/chocolatey + https://github.com/chocolatey/choco/issues + true + Approved + Ready + + Exempted + + Passing + 2024-08-07T02:36:24.62 + + 2024-08-07T03:58:15.683 + 2024-08-07T03:58:15.683 + + false + Checked + 2024-08-07T04:59:31.147 + + NotFlagged + 2024-08-07T03:58:15.683 + None + + +".FormatWith(_wireMockServer.Url)) + ); + + _wireMockServer.Given( + Request.Create() + .WithPath("/api/v2/Packages(Id='upgradepackage',Version='2.0.0')") + .UsingGet() + ) + .RespondWith( + Response.Create() + .WithStatusCode(200) + .WithHeader("Content-Type", "application/xml;charset=utf-8") + .WithHeader("DataServiceVersion", "2.0;") + .WithBody(@" + + {0}}/api/v2/Packages(Id='upgradepackage',Version='2.0.0') + upgradepackage + A package used to test upgrading of packages. + 2024-08-08T05:11:50Z + + Chocolatey Software, Inc. + + + + + + + 2.0.0 + Upgrade Package + My Description! + a b c d + Chocolatey Software, Inc. + 2024-08-07T00:06:31.233 + + 289183 + 63 + {0}/packages/upgradepackage/2.0.0 + {0}/package/ReportAbuse/upgradepackage/2.0.0 + https://chocolatey.org/assets/images/nupkg/chocolateyicon.png + true + false + false + + 2024-08-07T00:06:31.233 + https://raw.githubusercontent.com/chocolatey/choco/master/LICENSE + false + GUXyvEC3y5y5S371LWHRbkEQ+fBxHAcm7d+/fweK+FYx1N2xMSlph+NGLyC3MEvecWY+EXNgRF7L7Km/u0oS8g== + SHA512 + 5358 + https://github.com/chocolatey/choco + See all - https://docs.chocolatey.org/en-us/choco/release-notes + + https://github.com/chocolatey/choco/tree/develop/nuspec/chocolatey/chocolatey + https://docs.chocolatey.org/en-us/ + https://groups.google.com/forum/#!forum/chocolatey + https://github.com/chocolatey/choco/issues + true + Approved + Ready + + Exempted + + Passing + 2024-08-07T02:36:24.62 + + 2024-08-07T03:58:15.683 + 2024-08-07T03:58:15.683 + + false + Checked + 2024-08-07T04:59:31.147 + + NotFlagged + 2024-08-07T03:58:15.683 + None + +".FormatWith(_wireMockServer.Url)) + ); + + _wireMockServer.Given( + Request.Create() + .WithPath("/api/v2/package/upgradepackage/2.0.0") + .UsingGet() + ) + .RespondWith( + Response.Create() + .WithStatusCode(503) + ); + } + + public override void AfterObservations() + { + base.AfterObservations(); + _wireMockServer.Stop(); + } + + public override void Because() + { + Results = Service.Upgrade(Configuration); + _packageResult = Results.FirstOrDefault().Value; + } + + [Fact] + public void Should_not_remove_package_from_the_lib_directory() + { + var packageDir = Path.Combine(Scenario.GetTopLevel(), "lib", Configuration.PackageNames); + + DirectoryAssert.Exists(packageDir); + } + + [Fact] + public void Should_not_upgrade_the_package() + { + var packageFile = Path.Combine(Scenario.GetTopLevel(), "lib", Configuration.PackageNames, Configuration.PackageNames + NuGetConstants.PackageExtension); + using (var packageReader = new PackageArchiveReader(packageFile)) + { + packageReader.NuspecReader.GetVersion().ToNormalizedStringChecked().Should().Be("1.0.0"); + } + } + + [Fact] + public void Should_not_have_the_erroring_upgraded_package_in_the_lib_bad_directory() + { + // This is due to the fact that no nupkg was actually downloaded from the server + + var packageDir = Path.Combine(Scenario.GetTopLevel(), "lib-bad", Configuration.PackageNames); + + DirectoryAssert.DoesNotExist(packageDir); + } + + [Fact] + public void Should_delete_the_rollback() + { + var packageDir = Path.Combine(Scenario.GetTopLevel(), "lib-bkp", Configuration.PackageNames); + + DirectoryAssert.DoesNotExist(packageDir); + } + + [Fact] + public void Should_contain_a_warning_message_that_it_was_unable_to_upgrade_a_package() + { + MockLogger.Messages.Should().ContainKey(LogLevel.Warn.ToStringSafe()) + .WhoseValue.Should().Contain(m => m.Contains("0/1")); + } + + [Fact] + public void Should_not_have_a_successful_package_result() + { + _packageResult.Success.Should().BeFalse(); + } + + [Fact] + public void Should_not_have_inconclusive_package_result() + { + _packageResult.Inconclusive.Should().BeFalse(); + } + + [Fact] + public void Should_not_have_warning_package_result() + { + _packageResult.Warning.Should().BeFalse(); + } + + [Fact] + public void Should_have_an_error_package_result() + { + _packageResult.Messages.Should().Contain(m => m.MessageType == ResultType.Error); + } + + [Fact] + public void Should_have_expected_error_in_package_result() + { + Results.Should().AllSatisfy(r => + r.Value.Messages.Should().Contain(m => + m.MessageType == ResultType.Error && + m.Message.Contains(@"upgradepackage not upgraded. An error occurred during installation: + Error downloading 'upgradepackage.2.0.0' from '{0}/api/v2/package/upgradepackage/2.0.0'.".FormatWith(_wireMockServer.Url)))); + } + + [Fact] + public void Should_have_requested_download_of_package() + { + _wireMockServer.Should().HaveReceivedACall().AtUrl("{0}/api/v2/package/upgradepackage/2.0.0".FormatWith(_wireMockServer.Url)); + } + } } } diff --git a/src/chocolatey.tests/chocolatey.tests.csproj b/src/chocolatey.tests/chocolatey.tests.csproj index 06f30d8af3..c075719642 100644 --- a/src/chocolatey.tests/chocolatey.tests.csproj +++ b/src/chocolatey.tests/chocolatey.tests.csproj @@ -1,6 +1,6 @@  - + Debug @@ -244,7 +244,7 @@ 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}. - + - - - - - - - - - - - - get-chocolateyunzip-licensed - - - 3.21.2 - - __REPLACE__ - - - - - __REPLACE__ (Portable) - __REPLACE__ + chocolatey + get-chocolateyunzip-licensed (Portable) + Chocolatey Software - __REPLACE__ + Chocolatey Software get-chocolateyunzip-licensed - __REPLACE__MarkDown_Okay - + + This package contains a commercial edition of the cmdlet `Get-ChocolateyUnzip`, and can be used to verify that installation with that cmdlet works as intended. - - +Additionally it can be tested that the package will fail if being installed on FOSS Edition of Chocolatey. - - - +The package defines the license types `business`, `Education` and `professional` as being valid licenses. + - diff --git a/tests/packages/hasfailingnesteddependency/1.0.0/hasfailingnesteddependency.nuspec b/tests/packages/hasfailingnesteddependency/1.0.0/hasfailingnesteddependency.nuspec new file mode 100644 index 0000000000..6f13009705 --- /dev/null +++ b/tests/packages/hasfailingnesteddependency/1.0.0/hasfailingnesteddependency.nuspec @@ -0,0 +1,27 @@ + + + + hasfailingnesteddependency + 1.0.0 + hasfailingnesteddependency + Chocolatey Software + chocolatey + false + + Package that contains dependencies that have dependencies that may fail to install. + + Used for testing dependency resolution and ensuring dependency failures do not allow package installation. + + Package that contains dependencies that have dependencies that may fail to install. + + + hasfailingnesteddependency admin + + + + + + + + + diff --git a/tests/packages/hasfailingnesteddependency/1.0.0/tools/chocolateyinstall.ps1 b/tests/packages/hasfailingnesteddependency/1.0.0/tools/chocolateyinstall.ps1 new file mode 100644 index 0000000000..d64eb8f47b --- /dev/null +++ b/tests/packages/hasfailingnesteddependency/1.0.0/tools/chocolateyinstall.ps1 @@ -0,0 +1 @@ +Write-Output "$env:PackageName $env:PackageVersion Installed" \ No newline at end of file diff --git a/tests/packages/hasfailingnesteddependency/1.0.0/tools/chocolateyuninstall.ps1 b/tests/packages/hasfailingnesteddependency/1.0.0/tools/chocolateyuninstall.ps1 new file mode 100644 index 0000000000..9ead91ffa3 --- /dev/null +++ b/tests/packages/hasfailingnesteddependency/1.0.0/tools/chocolateyuninstall.ps1 @@ -0,0 +1 @@ +Write-Output "$env:PackageName $env:PackageVersion Uninstalled" \ No newline at end of file diff --git a/tests/packages/hasnesteddependency/1.0.0/hasnesteddependency.nuspec b/tests/packages/hasnesteddependency/1.0.0/hasnesteddependency.nuspec new file mode 100644 index 0000000000..fbc8d2df82 --- /dev/null +++ b/tests/packages/hasnesteddependency/1.0.0/hasnesteddependency.nuspec @@ -0,0 +1,22 @@ + + + + hasnesteddependency + 1.0.0 + hasnesteddependency + Chocolatey Software + chocolatey + false + Package used for testing nested dependencies. + Package used for testing nested dependencies. + + + hasnesteddependency admin + + + + + + + + diff --git a/tests/packages/hasnesteddependency/1.0.0/tools/chocolateyinstall.ps1 b/tests/packages/hasnesteddependency/1.0.0/tools/chocolateyinstall.ps1 new file mode 100644 index 0000000000..d64eb8f47b --- /dev/null +++ b/tests/packages/hasnesteddependency/1.0.0/tools/chocolateyinstall.ps1 @@ -0,0 +1 @@ +Write-Output "$env:PackageName $env:PackageVersion Installed" \ No newline at end of file diff --git a/tests/packages/hasnesteddependency/1.0.0/tools/chocolateyuninstall.ps1 b/tests/packages/hasnesteddependency/1.0.0/tools/chocolateyuninstall.ps1 new file mode 100644 index 0000000000..9ead91ffa3 --- /dev/null +++ b/tests/packages/hasnesteddependency/1.0.0/tools/chocolateyuninstall.ps1 @@ -0,0 +1 @@ +Write-Output "$env:PackageName $env:PackageVersion Uninstalled" \ No newline at end of file diff --git a/tests/packages/test-chocolateypath/test-chocolateypath.nuspec b/tests/packages/test-chocolateypath/test-chocolateypath.nuspec index 9756ecb9c7..580a48463b 100644 --- a/tests/packages/test-chocolateypath/test-chocolateypath.nuspec +++ b/tests/packages/test-chocolateypath/test-chocolateypath.nuspec @@ -1,81 +1,17 @@ - - - - - - - - - - - - - - test-chocolateypath - - - 0.1.0 - - - - - - - test-packagepath (Install) __REPLACE_AUTHORS_OF_SOFTWARE_COMMA_SEPARATED__ - https://_Software_Location_REMOVE_OR_FILL_OUT_ - - - - - - - - - - test-packagepath SPACE_SEPARATED - __REPLACE__ - __REPLACE__MarkDown_Okay - - - - - - - - - - + Package to test the Get-ChocolateyPath Chocolatey PowerShell function. + Package to test the Get-ChocolateyPath Chocolatey PowerShell function. - diff --git a/tests/packages/upgradedowngradesdependency/1.0.0/downgradesdependency.nuspec b/tests/packages/upgradedowngradesdependency/1.0.0/downgradesdependency.nuspec new file mode 100644 index 0000000000..0ad0f09d93 --- /dev/null +++ b/tests/packages/upgradedowngradesdependency/1.0.0/downgradesdependency.nuspec @@ -0,0 +1,29 @@ + + + + downgradesdependency + 1.0.0 + Has out of range Dependency + Chocolatey Software + chocolatey + false + + These packages can be used to test the installation or upgrading of packages that require an existing package to downgrade. + +Each version is available as `upgradedowngradesdependency` and `downgradesdependency`. This is to allow testing of scenarios where `choco upgrade all` would process the dependency before and after the parent package. + +- Version 1.0.0 contains a range that can be used in an upgrade scenario and has a dependency on `isdependency 1.0.0 or greater` +- Version 2.0.0 contains an exact dependency on `isdependency` with a version of `1.0.0` + + Package to test for out of range dependencies. This 1st version have a valid exact range. + + + upgradedowngradesdependency admin + + + + + + + + diff --git a/tests/packages/upgradedowngradesdependency/1.0.0/tools/chocolateybeforemodify.ps1 b/tests/packages/upgradedowngradesdependency/1.0.0/tools/chocolateybeforemodify.ps1 new file mode 100644 index 0000000000..7d0b91fece --- /dev/null +++ b/tests/packages/upgradedowngradesdependency/1.0.0/tools/chocolateybeforemodify.ps1 @@ -0,0 +1 @@ +Write-Output "Upgrading or Uninstalling $env:PackageName $env:PackageVersion" \ No newline at end of file diff --git a/tests/packages/upgradedowngradesdependency/1.0.0/tools/chocolateyinstall.ps1 b/tests/packages/upgradedowngradesdependency/1.0.0/tools/chocolateyinstall.ps1 new file mode 100644 index 0000000000..d64eb8f47b --- /dev/null +++ b/tests/packages/upgradedowngradesdependency/1.0.0/tools/chocolateyinstall.ps1 @@ -0,0 +1 @@ +Write-Output "$env:PackageName $env:PackageVersion Installed" \ No newline at end of file diff --git a/tests/packages/upgradedowngradesdependency/1.0.0/tools/chocolateyuninstall.ps1 b/tests/packages/upgradedowngradesdependency/1.0.0/tools/chocolateyuninstall.ps1 new file mode 100644 index 0000000000..9ead91ffa3 --- /dev/null +++ b/tests/packages/upgradedowngradesdependency/1.0.0/tools/chocolateyuninstall.ps1 @@ -0,0 +1 @@ +Write-Output "$env:PackageName $env:PackageVersion Uninstalled" \ No newline at end of file diff --git a/tests/packages/upgradedowngradesdependency/1.0.0/upgradedowngradesdependency.nuspec b/tests/packages/upgradedowngradesdependency/1.0.0/upgradedowngradesdependency.nuspec new file mode 100644 index 0000000000..bb723ce36e --- /dev/null +++ b/tests/packages/upgradedowngradesdependency/1.0.0/upgradedowngradesdependency.nuspec @@ -0,0 +1,29 @@ + + + + upgradedowngradesdependency + 1.0.0 + Has out of range Dependency + Chocolatey Software + chocolatey + false + + These packages can be used to test the installation or upgrading of packages that require an existing package to downgrade. + +Each version is available as `upgradedowngradesdependency` and `downgradesdependency`. This is to allow testing of scenarios where `choco upgrade all` would process the dependency before and after the parent package. + +- Version 1.0.0 contains a range that can be used in an upgrade scenario and has a dependency on `isdependency 1.0.0 or greater` +- Version 2.0.0 contains an exact dependency on `isdependency` with a version of `1.0.0` + + Package to test for out of range dependencies. This 1st version have a valid exact range. + + + upgradedowngradesdependency admin + + + + + + + + diff --git a/tests/packages/upgradedowngradesdependency/2.0.0/downgradesdependency.nuspec b/tests/packages/upgradedowngradesdependency/2.0.0/downgradesdependency.nuspec new file mode 100644 index 0000000000..efccc67761 --- /dev/null +++ b/tests/packages/upgradedowngradesdependency/2.0.0/downgradesdependency.nuspec @@ -0,0 +1,29 @@ + + + + downgradesdependency + 2.0.0 + Has out of range Dependency (Below available) + Chocolatey Software + chocolatey + false + + These packages can be used to test the installation or upgrading of packages that require an existing package to downgrade. + +Each version is available as `upgradedowngradesdependency` and `downgradesdependency`. This is to allow testing of scenarios where `choco upgrade all` would process the dependency before and after the parent package. + +- Version 1.0.0 contains a range that can be used in an upgrade scenario and has a dependency on `isdependency 1.0.0 or greater` +- Version 2.0.0 contains an exact dependency on `isdependency` with a version of `1.0.0` + + Package to test for out of range dependencies. This version uses a dependency that require a lower version. + + + upgradedowngradesdependency admin + + + + + + + + diff --git a/tests/packages/upgradedowngradesdependency/2.0.0/tools/chocolateybeforemodify.ps1 b/tests/packages/upgradedowngradesdependency/2.0.0/tools/chocolateybeforemodify.ps1 new file mode 100644 index 0000000000..7d0b91fece --- /dev/null +++ b/tests/packages/upgradedowngradesdependency/2.0.0/tools/chocolateybeforemodify.ps1 @@ -0,0 +1 @@ +Write-Output "Upgrading or Uninstalling $env:PackageName $env:PackageVersion" \ No newline at end of file diff --git a/tests/packages/upgradedowngradesdependency/2.0.0/tools/chocolateyinstall.ps1 b/tests/packages/upgradedowngradesdependency/2.0.0/tools/chocolateyinstall.ps1 new file mode 100644 index 0000000000..d64eb8f47b --- /dev/null +++ b/tests/packages/upgradedowngradesdependency/2.0.0/tools/chocolateyinstall.ps1 @@ -0,0 +1 @@ +Write-Output "$env:PackageName $env:PackageVersion Installed" \ No newline at end of file diff --git a/tests/packages/upgradedowngradesdependency/2.0.0/tools/chocolateyuninstall.ps1 b/tests/packages/upgradedowngradesdependency/2.0.0/tools/chocolateyuninstall.ps1 new file mode 100644 index 0000000000..9ead91ffa3 --- /dev/null +++ b/tests/packages/upgradedowngradesdependency/2.0.0/tools/chocolateyuninstall.ps1 @@ -0,0 +1 @@ +Write-Output "$env:PackageName $env:PackageVersion Uninstalled" \ No newline at end of file diff --git a/tests/packages/upgradedowngradesdependency/2.0.0/upgradedowngradesdependency.nuspec b/tests/packages/upgradedowngradesdependency/2.0.0/upgradedowngradesdependency.nuspec new file mode 100644 index 0000000000..e00f3c9dea --- /dev/null +++ b/tests/packages/upgradedowngradesdependency/2.0.0/upgradedowngradesdependency.nuspec @@ -0,0 +1,29 @@ + + + + upgradedowngradesdependency + 2.0.0 + Has out of range Dependency (Below available) + Chocolatey Software + chocolatey + false + + These packages can be used to test the installation or upgrading of packages that require an existing package to downgrade. + +Each version is available as `upgradedowngradesdependency` and `downgradesdependency`. This is to allow testing of scenarios where `choco upgrade all` would process the dependency before and after the parent package. + +- Version 1.0.0 contains a range that can be used in an upgrade scenario and has a dependency on `isdependency 1.0.0 or greater` +- Version 2.0.0 contains an exact dependency on `isdependency` with a version of `1.0.0` + + Package to test for out of range dependencies. This version uses a dependency that require a lower version. + + + upgradedowngradesdependency admin + + + + + + + + diff --git a/tests/packages/upgradedowngradesdependency/Readme.md b/tests/packages/upgradedowngradesdependency/Readme.md new file mode 100644 index 0000000000..0f2c4f806f --- /dev/null +++ b/tests/packages/upgradedowngradesdependency/Readme.md @@ -0,0 +1,6 @@ +These packages can be used to test the installation or upgrading of packages that require an existing package to downgrade. + +Each version is available as `upgradedowngradesdependency` and `downgradesdependency`. This is to allow testing of scenarios where `choco upgrade all` would process the dependency before and after the parent package. + +- Version 1.0.0 contains a range that can be used in an upgrade scenario and has a dependency on `isdependency 1.0.0 or greater` +- Version 2.0.0 contains an exact dependency on `isdependency` with a version of `1.0.0` diff --git a/tests/pester-tests/BundledApplications.Tests.ps1 b/tests/pester-tests/BundledApplications.Tests.ps1 index a348189d5b..075771e9b7 100644 --- a/tests/pester-tests/BundledApplications.Tests.ps1 +++ b/tests/pester-tests/BundledApplications.Tests.ps1 @@ -1,11 +1,11 @@ Import-Module helpers/common-helpers Describe 'Ensuring correct version of is installed' -Tag BundledApplications -ForEach @( - @{ Name = 'shimgen' ; Version = '2.0.0' ; ChocolateyVersion = '2.0.0-alpha' ; IsSigned = $true } - @{ Name = 'checksum' ; Version = '0.3.1' ; ChocolateyVersion = '2.0.0-alpha' ; IsSigned = $true } - @{ Name = '7z' ; Version = '23.01' ; ChocolateyVersion = '2.2.1-alpha' ; IsSigned = $false } -) -Skip:(-not (Test-ChocolateyVersionEqualOrHigherThan "1.0.0")) { - Context ' is correctly installed' -Skip:(-not (Test-ChocolateyVersionEqualOrHigherThan $ChocolateyVersion)) { + @{ Name = 'shimgen' ; Version = '2.0.0' ; IsSigned = $true } + @{ Name = 'checksum' ; Version = '0.3.1' ; IsSigned = $true } + @{ Name = '7z' ; Version = '24.08' ; IsSigned = $false } +) { + Context ' is correctly installed' { BeforeAll { # Because we're not modifying the install in any way, there is no need to Initialize-ChocolateyTestInstall $ToolPath = "$env:ChocolateyInstall/tools/$Name.exe" diff --git a/tests/pester-tests/chocolateyProfile.Tests.ps1 b/tests/pester-tests/chocolateyProfile.Tests.ps1 index 0064e2432e..51f46d4dd3 100644 --- a/tests/pester-tests/chocolateyProfile.Tests.ps1 +++ b/tests/pester-tests/chocolateyProfile.Tests.ps1 @@ -11,14 +11,6 @@ Describe "Chocolatey Profile" -Tag Chocolatey, Profile, Environment { } Context "Tab Completion" { - It "Should Exist" { - Test-Path Function:\TabExpansion | Should -BeTrue - } - - It "Should have overridden TabExpansion with a new scriptblock including ChocolateyTabExpansion" { - [bool]((Get-Command TabExpansion).ScriptBlock -match "ChocolateyTabExpansion") | Should -BeTrue - } - It "Should list completions for all Top Level Commands, sorted alphabetically, but not aliases or unpackself" { $Command = "choco " $Completions = (TabExpansion2 -inputScript $Command -cursorColumn $Command.Length).CompletionMatches.CompletionText diff --git a/tests/pester-tests/commands/choco-install.Tests.ps1 b/tests/pester-tests/commands/choco-install.Tests.ps1 index 67b40473f2..cbac68a900 100644 --- a/tests/pester-tests/commands/choco-install.Tests.ps1 +++ b/tests/pester-tests/commands/choco-install.Tests.ps1 @@ -217,7 +217,8 @@ It "Should mention that package hash verification was skipped since local folder source is being used" { if ((Test-HasNuGetV3Source) -or (-not $env:TEST_KITCHEN)) { $Output.Lines | Should -Contain "Source does not provide a package hash, skipping package hash validation." -Because $Output.String - } else { + } + else { $Output.Lines | Should -Contain "Package hash matches expected hash." -Because $Output.String } } @@ -1690,7 +1691,7 @@ To install a local, or remote file, you may use: $PackageUnderTest = "installpackage", "packagewithscript" - $Output = "a`n"*2 | Invoke-Choco install @PackageUnderTest + $Output = "a`n" * 2 | Invoke-Choco install @PackageUnderTest } It "Installs successfully and exits with success (0)" { @@ -1740,7 +1741,8 @@ To install a local, or remote file, you may use: It 'Outputs download completed' { $testMessage = if ($features.License) { "Download of 'cmake-3.21.2-windows-x86_64.zip' (36.01 MB) completed." - } else { + } + else { "Download of cmake-3.21.2-windows-x86_64.zip (36.01 MB) completed." } $Output.Lines | Should -Contain $testMessage -Because $Output.String @@ -1749,7 +1751,8 @@ To install a local, or remote file, you may use: It 'Outputs extracting correct archive' { $testMessage = if ($features.License) { "Extracting cmake-3.21.2-windows-x86_64.zip to $env:ChocolateyInstall\lib\install-chocolateyzip\tools..." - } else { + } + else { "Extracting $($paths.CachePathLong)\install-chocolateyzip\3.21.2\cmake-3.21.2-windows-x86_64.zip to $env:ChocolateyInstall\lib\install-chocolateyzip\tools..." } $Output.Lines | Should -Contain $testMessage -Because $Output.String @@ -1925,8 +1928,8 @@ To install a local, or remote file, you may use: } Context "Installing a package with a non-normalized version number" -ForEach @( - @{ ExpectedPackageVersion = '1.0.0' ; SearchVersion = '1' ; NuspecVersion = '01.0.0.0'} - @{ ExpectedPackageVersion = '1.0.0' ; SearchVersion = '1.0' ; NuspecVersion = '01.0.0.0'} + @{ ExpectedPackageVersion = '1.0.0' ; SearchVersion = '1' ; NuspecVersion = '01.0.0.0' } + @{ ExpectedPackageVersion = '1.0.0' ; SearchVersion = '1.0' ; NuspecVersion = '01.0.0.0' } @{ ExpectedPackageVersion = '1.0.0' ; SearchVersion = '1.0.0' ; NuspecVersion = '01.0.0.0' } @{ ExpectedPackageVersion = '4.0.1' ; SearchVersion = '4.0.1' ; NuspecVersion = '004.0.01.0' } @{ ExpectedPackageVersion = '1.0.0' ; SearchVersion = '01.0.0.0' ; NuspecVersion = '01.0.0.0' } @@ -2027,22 +2030,243 @@ To install a local, or remote file, you may use: } It 'Outputs as ' -ForEach @(@{ - Name = 'chocolateyPackageVersion' - Value= '0.9.0' + Name = 'chocolateyPackageVersion' + Value = '0.9.0' + } + @{ + Name = 'packageVersion' + Value = '0.9.0' + } + @{ + Name = 'chocolateyPackageNuspecVersion' + Value = '0.9' + } + @{ + Name = 'packageNuspecVersion' + Value = '0.9' + }) { + $Output.Lines | Should -Contain "$Name=$Value" } + } + + Context 'Installing package with large number of dependency versions' { + BeforeAll { + Restore-ChocolateyInstallSnapshot -SetWorkDir + + # demo-projects is a zip file that contains 5 packages with over 2000 versions between them. + # They can be freshly generated by running the GeneratePackages.ps1 script inside of it with + # PowerShell 7+. This zip file is placed in the repository as it is expected to not change, + # and makes this test simpler. If this zip file requires regular changes, we would want to + # remove it from the repository and store it elsewhere that we can retrieve it during CI testing. + Expand-Archive $PSScriptRoot/demo-projects.zip -DestinationPath $PWD + $Output = Invoke-Choco install package-a -s 'a,b,c' --confirm + } + + It "Exits with Success (0)" { + $Output.ExitCode | Should -Be 0 -Because $Output.String + } + + It "Completes quickly" { + # 30 seconds was chosen for this timeout because the benchmark of Chocolatey was that this would take about 15 seconds. + # Prior to the change that this is testing, this execution would be measured in minutes with the fastest being 7 minutes. + $Output.Duration | Should -BeLessOrEqual '00:00:30' -Because $Output.String + } + } + + Context 'Installing a package with argument () should () downgrade an existing package dependency.' -Tag Downgrade -ForEach @( @{ - Name = 'packageVersion' - Value= '0.9.0' + Argument = '--force' + AllowsDowngrade = $true + ExpectedExit = 0 } @{ - Name = 'chocolateyPackageNuspecVersion' - Value= '0.9' + Argument = '--allow-downgrade' + AllowsDowngrade = $true + ExpectedExit = 0 } @{ - Name = 'packageNuspecVersion' - Value= '0.9' - }) { - $Output.Lines | Should -Contain "$Name=$Value" + Argument = '' + AllowsDowngrade = $false + ExpectedExit = 1 + } + ) { + BeforeAll { + $DependentPackage = @{ + Name = 'isdependency' + Version = '2.1.0' + } + + Restore-ChocolateyInstallSnapshot + + $Setup = Invoke-Choco install $DependentPackage.Name --version $DependentPackage.Version --confirm + $Output = Invoke-Choco install downgradesdependency --confirm $Argument + $Packages = Get-ChocolateyInstalledPackages + } + + It "Exits correctly ()" { + $Output.ExitCode | Should -Be $ExpectedExit -Because $Output.String + } + + It "Reports that it can () downgrade isdependency" { + if ($AllowsDowngrade) { + $Output.Lines | Should -Contain 'Chocolatey installed 2/2 packages.' -Because $Output.String + } + else { + $Output.Lines | Should -Contain 'Chocolatey installed 0/2 packages. 2 packages failed.' -Because $Output.String + } + + $Output.Lines | Should -Contain -Not:($AllowsDowngrade) "A newer version of $($DependentPackage.Name) (v$($DependentPackage.Version)) is already installed." -Because $Output.String + $Output.Lines | Should -Contain -Not:($AllowsDowngrade) 'Use --allow-downgrade or --force to attempt to install older versions.' -Because $Output.String + } + + It "Should have the expected packages" { + if ($AllowsDowngrade) { + $Packages | where { $_.Name -eq $DependentPackage.Name -and $_.Version -eq '1.0.0' } | Should -Not -BeNullOrEmpty -Because "Packages: $Packages $($Output.String)" + } + else { + $Packages | where { $_.Name -eq $DependentPackage.Name -and $_.Version -eq $DependentPackage.Version } | Should -Not -BeNullOrEmpty -Because "Packages: $Packages $($Output.String)" + } + } + } + + Context 'Installing a package with argument () and StopOnFirstPackageFailure enabled should () downgrade an existing package dependency and correctly handle installpackage.' -Tag Downgrade, StopOnFirstPackageFailure -ForEach @( + @{ + Argument = '--force' + AllowsDowngrade = $true + ExpectedExit = 0 + } + @{ + Argument = '--allow-downgrade' + AllowsDowngrade = $true + ExpectedExit = 0 + } + @{ + Argument = '' + AllowsDowngrade = $false + ExpectedExit = 1 + } + ) { + BeforeAll { + $DependentPackage = @{ + Name = 'isdependency' + Version = '2.1.0' + } + + Restore-ChocolateyInstallSnapshot + + $Setup = Invoke-Choco install $DependentPackage.Name --version $DependentPackage.Version --confirm + $null = Enable-ChocolateyFeature -Name StopOnFirstPackageFailure + $Output = Invoke-Choco install downgradesdependency installpackage --confirm $Argument + $Packages = Get-ChocolateyInstalledPackages + } + + It "Exits correctly ()" { + $Output.ExitCode | Should -Be $ExpectedExit -Because $Output.String + } + + It "Reports that it can () downgrade isdependency" { + $Output.Lines | Should -Contain -Not:($AllowsDowngrade) "A newer version of $($DependentPackage.Name) (v$($DependentPackage.Version)) is already installed." -Because $Output.String + $Output.Lines | Should -Contain -Not:($AllowsDowngrade) 'Use --allow-downgrade or --force to attempt to install older versions.' -Because $Output.String + } + + It "Should have the expected packages" { + if ($AllowsDowngrade) { + $Packages | where { $_.Name -eq $DependentPackage.Name -and $_.Version -eq '1.0.0' } | Should -Not -BeNullOrEmpty -Because "Packages: $Packages $($Output.String)" + } + else { + $Packages | where { $_.Name -eq $DependentPackage.Name -and $_.Version -eq $DependentPackage.Version } | Should -Not -BeNullOrEmpty -Because "Packages: $Packages $($Output.String)" + } + } + } + + Context 'Installing a package () with a failing nested dependency should not install the package with failing dependencies' -ForEach @( + @{ + PackageName = 'dependencyfailure;downgradesdependency;failingdependency;hasdependency;hasfailingnesteddependency;hasnesteddependency;isdependency;isexactversiondependency'.Split(';') + } + @{ + PackageName = @('packages.config') + } + @{ + PackageName = @('all') + } + ) { + BeforeAll { + + Restore-ChocolateyInstallSnapshot -SetWorkingDirectory + + Copy-Item "$PSScriptRoot/failingnested.packages.config" './packages.config' + Disable-ChocolateySource -All + Enable-ChocolateySource -Name 'hermes-all' + + $Output = Invoke-Choco install @PackageName --confirm + $Packages = Get-ChocolateyInstalledPackages + } + + It "Exits correctly (15608)" { + # failingdependency exits with 15608, so Chocolatey exits with that. + $Output.ExitCode | Should -Be 15608 -Because $Output.String + } + + It "Should have the expected packages" { + $ExpectedPackages = @( + "downgradesdependency" + "isdependency" + "isexactversiondependency" + ) + $UnexpectedPackages = @( + 'dependencyfailure' + "dependencyfailure" + 'hasfailingnesteddependency' + ) + + foreach ($package in $ExpectedPackages) { + $Packages.Name | Should -Contain $package -Because "Package: $package $($Output.String)" + } + + foreach ($package in $UnexpectedPackages) { + $Packages.Name | Should -Not -Contain $package -Because "Package: $package $($Output.String)" + } + } + } + + Context 'Installing a package () with a failing nested dependency should not install the package with failing dependencies' -ForEach @( @{ PackageName = 'hasfailingnesteddependency;hasnesteddependency' } ) { + BeforeAll { + + Restore-ChocolateyInstallSnapshot -SetWorkingDirectory + + Disable-ChocolateySource -All + Enable-ChocolateySource -Name 'hermes-all' + + $Output = Invoke-Choco install $PackageName --confirm + $Packages = Get-ChocolateyInstalledPackages + } + + It "Exits correctly (15608)" { + # failingdependency exits with 15608, so Chocolatey exits with that. + $Output.ExitCode | Should -Be 15608 -Because $Output.String + } + + It "Should have the expected packages" { + $ExpectedPackages = @( + "downgradesdependency" + "hasnesteddependency" + "isdependency" + "hasdependency" + ) + $UnexpectedPackages = @( + "dependencyfailure" + "isexactversiondependency" + 'dependencyfailure' + 'hasfailingnesteddependency' + ) + + foreach ($package in $ExpectedPackages) { + $Packages.Name | Should -Contain $package -Because "Package: $package $($Output.String)" + } + + foreach ($package in $UnexpectedPackages) { + $Packages.Name | Should -Not -Contain $package -Because "Package: $package $($Output.String)" + } } } diff --git a/tests/pester-tests/commands/choco-upgrade.Tests.ps1 b/tests/pester-tests/commands/choco-upgrade.Tests.ps1 index c0f876b07d..5f427d57fc 100644 --- a/tests/pester-tests/commands/choco-upgrade.Tests.ps1 +++ b/tests/pester-tests/commands/choco-upgrade.Tests.ps1 @@ -695,6 +695,144 @@ To upgrade a local, or remote file, you may use: } } + # This test is taken from UpgradeScenarios.cs from the integration test suite: + # When_upgrading_a_dependency_with_parent_being_pinned_and_depends_on_a_range_less_than_upgrade_version + # Further details about this test can be found there. + Context 'Upgrading a dependency with pinned parent and depends on a range less than upgrade version' { + BeforeAll { + $DependentPackageName = 'isdependency' + Restore-ChocolateyInstallSnapshot + $Setup = @( + Invoke-Choco install $DependentPackageName --version 1.0.0 --confirm + Invoke-Choco install hasdependency --pin --version 1.0.0 --confirm + ) + $Output = Invoke-Choco upgrade $DependentPackageName --confirm + $Packages = (Invoke-Choco list -r).Lines | ConvertFrom-ChocolateyOutput -Command List + } + + AfterAll { + Remove-ChocolateyInstallSnapshot + } + + It "Exits with Success (0)" { + $Output.ExitCode | Should -Be 0 -Because (@($Setup.String; $Output.String) -join [System.Environment]::NewLine) + } + + It "Should report upgraded successfully" { + $Output.Lines | Should -Contain "Chocolatey upgraded 1/1 packages." -Because (@($Setup.String; $Output.String) -join [System.Environment]::NewLine) + } + + It "Should report package conflicts" { + $message = "[NuGet] One or more unresolved package dependency constraints detected in the Chocolatey lib folder. All dependency constraints must be resolved to add or update packages. If these packages are being updated this message may be ignored, if not the following error(s) may be blocking the current package operation: 'hasdependency 1.0.0 constraint: isdependency (>= 1.0.0 && < 2.0.0)'" + $Output.Lines | Should -Contain $message -Because (@($Setup.String; $Output.String) -join [System.Environment]::NewLine) + } + + It "Should upgrade the dependent package to the highest version in the range" { + ($Packages | Where-Object Name -eq $DependentPackageName).Version | Should -Be '1.1.0' -Because (@($Setup.String; $Output.String) -join [System.Environment]::NewLine) + } + + It "Should not upgrade the exact version dependency package" { + ($Packages | Where-Object Name -eq 'isexactversiondependency').Version | Should -Be '1.0.0' -Because (@($Setup.String; $Output.String) -join [System.Environment]::NewLine) + } + } + + Context 'Upgrading a package () with should downgrade () an existing package dependency.' -Tag Downgrade -ForEach @( + @{ + Argument = '--force' + AllowsDowngrade = $true + ExpectedExit = 0 + PackageName = 'upgradedowngradesdependency' + BasePackage = 'upgradedowngradesdependency' + } + @{ + Argument = '--allow-downgrade' + AllowsDowngrade = $true + ExpectedExit = 0 + PackageName = 'upgradedowngradesdependency' + BasePackage = 'upgradedowngradesdependency' + } + @{ + Argument = '' + AllowsDowngrade = $false + ExpectedExit = 1 + PackageName = 'upgradedowngradesdependency' + BasePackage = 'upgradedowngradesdependency' + } + @{ + Argument = '--force' + AllowsDowngrade = $true + ExpectedExit = 0 + PackageName = 'all' + BasePackage = 'upgradedowngradesdependency' + } + @{ + Argument = '--allow-downgrade' + AllowsDowngrade = $true + ExpectedExit = 0 + PackageName = 'all' + BasePackage = 'upgradedowngradesdependency' + } + @{ + Argument = '' + AllowsDowngrade = $false + ExpectedExit = 1 + PackageName = 'all' + BasePackage = 'upgradedowngradesdependency' + } + @{ + Argument = '--force' + AllowsDowngrade = $true + ExpectedExit = 0 + PackageName = 'all' + BasePackage = 'downgradesdependency' + } + @{ + Argument = '--allow-downgrade' + AllowsDowngrade = $true + ExpectedExit = 0 + PackageName = 'all' + BasePackage = 'downgradesdependency' + } + @{ + Argument = '' + AllowsDowngrade = $false + ExpectedExit = 1 + PackageName = 'all' + BasePackage = 'downgradesdependency' + } + ) { + BeforeAll { + $DependentPackage = @{ + Name = 'isdependency' + Version = '2.1.0' + } + + Restore-ChocolateyInstallSnapshot + + $Setup = Invoke-Choco install $DependentPackage.Name --version $DependentPackage.Version --confirm + $Setup2 = Invoke-Choco install $BasePackage --version 1.0.0 --confirm + # We need to exclude packages that are in Test Kitchen but not the other environments. + $Output = Invoke-Choco upgrade $PackageName --confirm --except="chocolatey,chocolatey.extension,chocolatey-agent,pester,chocolatey-license-business" $Argument + } + + It "Exits with expected result ()" { + $Output.ExitCode | Should -Be $ExpectedExit -Because $Output.String + } + + It "Reports correctly about downgrading isdependency" { + if ($AllowsDowngrade) { + $Output.Lines | Should -Not -Contain 'A newer version of isdependency (v2.1.0) is already installed.' -Because $Output.String + $Output.Lines | Should -Not -Contain 'Use --allow-downgrade or --force to attempt to install older versions.' -Because $Output.String + $Output.String | Should -MatchExactly 'Chocolatey upgraded 2/\d+ packages.' + } + else { + $Output.Lines | Should -Contain 'A newer version of isdependency (v2.1.0) is already installed.' -Because $Output.String + $Output.Lines | Should -Contain 'Use --allow-downgrade or --force to attempt to install older versions.' -Because $Output.String + $Output.String | Should -MatchExactly 'Chocolatey upgraded 0/\d+ packages. 2 packages failed.' + } + } + } + # This needs to be (almost) the last test in this block, to ensure NuGet configurations aren't being created. # Any tests after this block are expected to generate the configuration as they're explicitly using the NuGet CLI Test-NuGetPaths diff --git a/tests/pester-tests/commands/demo-projects.zip b/tests/pester-tests/commands/demo-projects.zip new file mode 100644 index 0000000000..521a017f9e Binary files /dev/null and b/tests/pester-tests/commands/demo-projects.zip differ diff --git a/tests/pester-tests/commands/failingnested.packages.config b/tests/pester-tests/commands/failingnested.packages.config new file mode 100644 index 0000000000..698f931c4f --- /dev/null +++ b/tests/pester-tests/commands/failingnested.packages.config @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/tests/pester-tests/features/ArgumentsDecryption.Tests.ps1 b/tests/pester-tests/features/ArgumentsDecryption.Tests.ps1 new file mode 100644 index 0000000000..d4fcca8654 --- /dev/null +++ b/tests/pester-tests/features/ArgumentsDecryption.Tests.ps1 @@ -0,0 +1,118 @@ +Describe 'Ensuring that corrupted .arguments file responds correctly for ' -ForEach @( + @{ + Command = 'install' + CommandDescription = 'default' + ExpectedExitCode = 0 + Parameters = @('installpackage') + } + # It seems that upgrade and uninstall exit with -1 when the beforemodify fails. + # As such, these tests will expect those exit codes for success. + @{ + Command = 'upgrade' + CommandDescription = 'default' + ExpectedExitCode = -1 + Parameters = @('upgradepackage') + } + @{ + Command = 'upgrade' + CommandDescription = 'remember' + ExpectedExitCode = 1 + Parameters = @('upgradepackage') + } + @{ + Command = 'download' + CommandDescription = 'default' + ExpectedExitCode = 0 + Parameters = @('upgradepackage') + } + @{ + Command = 'list' + CommandDescription = 'verbose' + ExpectedExitCode = 0 + Parameters = @('--verbose') + } + @{ + Command = 'list' + CommandDescription = 'default' + ExpectedExitCode = 0 + Parameters = @() + } + @{ + Command = 'info' + CommandDescription = 'verbose' + ExpectedExitCode = 0 + Parameters = @('upgradepackage', '--local-only') + } + # It seems that upgrade and uninstall exit with -1 when the beforemodify fails. + # As such, these tests will expect those exit codes for success. + @{ + Command = 'uninstall' + CommandDescription = 'default' + ExpectedExitCode = -1 + Parameters = @('upgradepackage') + } + @{ + Command = 'pin' + CommandDescription = 'default' + ExpectedExitCode = 0 + Parameters = @('list') + } + @{ + Command = 'pin' + CommandDescription = 'default' + ExpectedExitCode = 0 + Parameters = @('add','-n=upgradepackage') + } +) -Tag ArgumentsFileDecryption { + BeforeDiscovery { + $HasLicensedExtension = Test-PackageIsEqualOrHigher -PackageName 'chocolatey.extension' -Version '6.0.0' + } + + BeforeAll { + Initialize-ChocolateyTestInstall + } + + # Skip the download command if chocolatey.extension is not installed. + Context 'Command () failure scenario ()' -Skip:($Command -eq 'download' -and -not $HasLicensedExtension) -ForEach @( + @{ + ErrorType = 'Base64 invalid' + DecryptionError = 'The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters.' + # `!` is an invalid Base64 character: https://en.wikipedia.org/wiki/Base64#Base64_table_from_RFC_4648 + FileContents = 'InvalidBase64!' + } + @{ + ErrorType = 'Invalid decryption' + DecryptionError = 'Key not valid for use in specified state.' + # The contents of this was taken from a throw away VM. As such, DPAPI will not be able to decrypt it, and will error. + FileContents = 'AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAAn1/taDnOFUqGb17fBymxHQQAAAACAAAAAAAQZgAAAAEAACAAAAAU8gmqznJYKdkuj8bgk8sgg6Le3sbGoGkZOV3YtRFfwwAAAAAOgAAAAAIAACAAAAD1I9LYxrEhx9m71eF3VqyAike+XJTePhDAcrOilAFjQlAAAAA8lfiMR5Ns/AntLdVR3eBQSduCnipRCbdu/er/+YABMTzJDMGqnXuIsKwWoNIhrB14Yit4jVPipt3a/Nx18xx+YsnUewI4P6GlDL5do1y8mkAAAABMxvyPgCtN36BwAOXvJghIh9Hs8jUZOJtQIlWci8BnJkBmaaoSZ6pTGULk4TbFXMf/FK1NPo2mPM0YVL8QgJyK' + } + ) { + BeforeAll { + Restore-ChocolateyInstallSnapshot + + if ($CommandDescription -eq 'remember') { + Enable-ChocolateyFeature -Name useRememberedArgumentsForUpgrades + } + + Invoke-Choco install upgradepackage --version 1.0.0 + $argumentsFile = Join-Path $env:ChocolateyInstall ".chocolatey/upgradepackage.1.0.0/.arguments" + $FileContents | Set-Content -Path $argumentsFile -Encoding utf8 -Force + + $Output = Invoke-Choco $Command @Parameters --debug + } + + AfterAll { + Remove-ChocolateyInstallSnapshot + } + + It 'Exits correctly ()' { + $Output.ExitCode | Should -Be $ExpectedExitCode -Because $Output.String + } + + It 'Outputs expected messages' { + $shouldContain = -not ($CommandDescription -eq 'verbose' -or $CommandDescription -eq 'remember') + $Output.Lines | Should -Not:$shouldContain -Contain "We failed to decrypt '$($env:ChocolateyInstall)\.chocolatey\upgradepackage.1.0.0\.arguments'. Error from decryption:" -Because $Output.String + $Output.Lines | Should -Not:$shouldContain -Contain "'$DecryptionError'" -Because $Output.String + } + } +} diff --git a/tests/pester-tests/features/PageSize.Tests.ps1 b/tests/pester-tests/features/PageSize.Tests.ps1 new file mode 100644 index 0000000000..f6bedb51d3 --- /dev/null +++ b/tests/pester-tests/features/PageSize.Tests.ps1 @@ -0,0 +1,64 @@ +Describe 'Ensuring honours page size settings' -ForEach @( + @{ + Command = 'search' + } +) -Tag PageSize { + BeforeAll { + Initialize-ChocolateyTestInstall + } + + Context 'Page size ' -ForEach @( + @{ + ExpectedExitCode = 1 + ProvidedSize = 0 + } + @{ + ExpectedExitCode = 1 + ProvidedSize = 101 + } + @{ + ExpectedExitCode = 0 + ProvidedSize = 1 + } + @{ + ExpectedExitCode = 0 + ProvidedSize = 30 + } + @{ + ExpectedExitCode = 0 + ProvidedSize = 40 + } + @{ + ExpectedExitCode = 0 + ProvidedSize = 100 + } + ) { + BeforeAll { + Disable-ChocolateySource + Enable-ChocolateySource -Name hermes + $Output = Invoke-Choco $Command --page-size $ProvidedSize + } + + It 'Exits correctly ()' { + $Output.ExitCode | Should -Be $ExpectedExitCode -Because $Output.String + } + + It 'Outputs expected messages' { + $ExpectedMessage = if ($ExpectedExitCode -eq 1) { + "The page size has been specified to be $ProvidedSize packages. The page size cannot be lower than 1 package, and no larger than 100 packages." + } else { + if ($ProvidedSize -ne 30) { + "The page size has been specified to be $ProvidedSize packages. There are known issues with some repositories when you use a page size other than 30." + } + # There are currently 43 test packages in the repository. + # Any number above this amount will not result in the below message. + if ($ProvidedSize -le 40) { + "The threshold of $ProvidedSize packages, or package versions, per source has been met. Please refine your search, or specify a page number to retrieve more results." + } + } + foreach ($message in $ExpectedMessage) { + $Output.Lines | Should -Contain $message -Because $Output.String + } + } + } +} diff --git a/tests/pester-tests/features/UserAgent.Tests.ps1 b/tests/pester-tests/features/UserAgent.Tests.ps1 new file mode 100644 index 0000000000..1b3f433741 --- /dev/null +++ b/tests/pester-tests/features/UserAgent.Tests.ps1 @@ -0,0 +1,91 @@ +Import-Module helpers/common-helpers + +Describe "Chocolatey User Agent" -Tag Chocolatey, UserAgent { + BeforeAll { + Initialize-ChocolateyTestInstall + New-ChocolateyInstallSnapshot + + $Output = Invoke-Choco search chocolatey --debug + $ChocolateyVersion = Get-ChocolateyVersion + + $Processes = [System.Collections.Generic.List[string]]::new() + + # IGNORED USER AGENT PROCESSES + # This list should match the one in CLI code for things we don't expect to see in the user agent + # after filtering the process tree. + # The corresponding list can be found in chocolatey.infrastructure.information.ProcessTree; + # search the repo for the above string in caps if you have trouble finding it. + $ExcludedProcesses = @( + "explorer" + "winlogon" + "powershell" + "pwsh" + "cmd" + "bash" + "services" + "svchost" + "Chocolatey CLI" + "alacritty" + "code" + "ConEmu64" + "ConEmuC64" + "conhost" + "c3270" + "FireCMD" + "Hyper" + "SecureCRT" + "Tabby" + "wezterm" + "wezterm-gui" + "WindowsTerminal" + ) + } + + AfterAll { + Remove-ChocolateyTestInstall + } + + It 'Logs the full process tree to debug' { + $logLine = $Output.Lines | Where-Object { $_ -match '^Process Tree' } | Select-Object -Last 1 + + $logLine | Should -Not -BeNullOrEmpty -Because 'choco.exe should log the process tree to debug' + + Write-Host "================== PROCESS TREE ==================" + Write-Host $logLine + + $parentProcesses = [string[]]@($logLine -replace '^Process Tree: ' -split ' => ' | Select-Object -Skip 1) + if ($parentProcesses.Count -gt 0) { + $Processes.AddRange($parentProcesses) + } + } + + It 'Logs the final user agent to debug' { + $logLine = $Output.Lines | Where-Object { $_ -match '^Updating User Agent' } | Select-Object -Last 1 + + $logLine | Should -Not -BeNullOrEmpty -Because "choco.exe should log the user agent string to debug`n$($Output.Lines)" + + Write-Host "================== USER AGENT ==================" + Write-Host $logLine + + $result = $logLine -match "'(?Chocolatey Command Line/[^']+)'" + $result | Should -BeTrue -Because "the user agent string should start with Chocolatey Command Line. $logLine" + + $userAgent = $matches['UserAgent'] + + $userAgent -match 'Chocolatey Command Line/(?[a-z0-9.-]+) ([a-z ]+/([a-z0-9.-]+) )?\((?[^,)]+)(?:, (?[^)]+))?\) via NuGet Client' | + Should -BeTrue -Because "the user agent string should contain the choco.exe version, the licensed extension version if any, and any parent processes. $logLine" + + $matches['Version'] | Should -Be $ChocolateyVersion -Because "the user agent string should contain the currently running Chocolatey version. $logLine" + $filteredProcesses = @($Processes | Where-Object { $_ -notin $ExcludedProcesses }) + + if ($filteredProcesses.Count -gt 1) { + $rootProcess = $filteredProcesses[-1] + $matches['RootProcess'] | Should -Be $rootProcess -Because "the user agent string should show the root calling process '$rootProcess'. $logLine" + } + + if ($filteredProcesses.Count -gt 0) { + $callingProcess = $filtered[0] + $matches['ParentProcess'] | Should -Be $callingProcess -Because "the user agent string should show the parent process '$callingProcess'. $logLine" + } + } +} \ No newline at end of file diff --git a/tests/pester-tests/powershell-commands/Install-ChocolateyPath.Tests.ps1 b/tests/pester-tests/powershell-commands/Install-ChocolateyPath.Tests.ps1 index 379a73db76..5f3ad5272f 100644 --- a/tests/pester-tests/powershell-commands/Install-ChocolateyPath.Tests.ps1 +++ b/tests/pester-tests/powershell-commands/Install-ChocolateyPath.Tests.ps1 @@ -1,4 +1,4 @@ -Describe 'Install-ChocolateyPath helper function tests' -Tags Cmdlets { +Describe 'Install-ChocolateyPath helper function tests' -Tags InstallChocolateyPath, Cmdlets { BeforeAll { Initialize-ChocolateyTestInstall @@ -10,7 +10,36 @@ Remove-Module "chocolateyInstaller" -Force } - Context 'Adding and removing PATH values' -ForEach @( + Context 'Unit tests' -Tags WhatIf -ForEach @( + @{ Scope = 'Process' } + @{ Scope = 'User' } + @{ Scope = 'Machine' } + ) { + BeforeAll { + $Preamble = [scriptblock]::Create("Import-Module '$testLocation\helpers\chocolateyInstaller.psm1' -Global") + } + + It 'stores the value <_> in the desired PATH scope' -TestCases @("C:\test", "C:\tools") { + $Command = [scriptblock]::Create("Install-ChocolateyPath -Path '$_' -Scope $Scope -WhatIf") + + $results = Get-WhatIfResult -Preamble $Preamble -Command $Command + $results.WhatIf[0] | Should -BeExactly "What if: Performing the operation ""Set $Scope environment variable"" on target ""PATH""." -Because $results.Output + + if ($Scope -ne 'Process') { + $results.WhatIf[1] | Should -BeExactly 'What if: Performing the operation "Notify system of changes" on target "Environment variables".' -Because $results.Output + $results.WhatIf[2] | Should -BeExactly 'What if: Performing the operation "Refresh all environment variables" on target "Current process".' -Because $results.Output + } + } + + It 'skips adding the value if it is already present' { + $targetPathEntry = [Environment]::GetEnvironmentVariable('PATH', $Scope) -split ';' | Select-Object -Last 1 + $Command = [scriptblock]::Create("Install-ChocolateyPath -Path '$targetPathEntry' -Scope $Scope -WhatIf") + $result = Get-WhatIfResult -Preamble $Preamble -Command $Command + $result.WhatIf | Should -BeNullOrEmpty -Because "we should skip adding values that already exist. Output:`n$($result.Output)" + } + } + + Context 'Adding and removing PATH values' -Tag VMOnly -ForEach @( @{ Scope = 'Process' } @{ Scope = 'User' } @{ Scope = 'Machine' } @@ -55,7 +84,7 @@ } } -Describe 'Install-ChocolateyPath end-to-end tests with add-path package modifying PATH' -Tags Cmdlet -ForEach @( +Describe 'Install-ChocolateyPath end-to-end tests with add-path package modifying PATH' -Tags Cmdlet, UninstallChocolateyPath, VMOnly -ForEach @( @{ Scope = 'User' } @{ Scope = 'Machine' } ) { diff --git a/tests/pester-tests/powershell-commands/Set-EnvironmentVariable.Tests.ps1 b/tests/pester-tests/powershell-commands/Set-EnvironmentVariable.Tests.ps1 index 7e67ca9e2a..6dbe0a913c 100644 --- a/tests/pester-tests/powershell-commands/Set-EnvironmentVariable.Tests.ps1 +++ b/tests/pester-tests/powershell-commands/Set-EnvironmentVariable.Tests.ps1 @@ -1,4 +1,4 @@ -Describe 'Set-EnvironmentVariable helper function tests' -Tags Cmdlets { +Describe 'Set-EnvironmentVariable helper function tests' -Tags SetEnvironmentVariable, Cmdlets { BeforeAll { Initialize-ChocolateyTestInstall @@ -6,6 +6,26 @@ Describe 'Set-EnvironmentVariable helper function tests' -Tags Cmdlets { Import-Module "$testLocation\helpers\chocolateyInstaller.psm1" } + Context 'Unit tests' -Tags WhatIf -ForEach @( + @{ Scope = 'Process' } + @{ Scope = 'User' } + @{ Scope = 'Machine' } + ) { + It 'Sets an environment variable value at the target ' { + $testVariableName = 'testVariable' + $Preamble = [scriptblock]::Create("Import-Module '$testLocation\helpers\chocolateyInstaller.psm1'") + $Command = [scriptblock]::Create("Set-EnvironmentVariable -Name $testVariableName -Value 'TEST' -Scope $Scope -WhatIf") + + $results = Get-WhatIfResult -Preamble $Preamble -Command $Command + $results.WhatIf[0] | Should -BeExactly "What if: Performing the operation ""Set $Scope environment variable"" on target ""testVariable""." -Because $results.Output + + if ($Scope -ne 'Process') { + $results.WhatIf[1] | Should -BeExactly 'What if: Performing the operation "Notify system of changes" on target "Environment variables".' -Because $results.Output + $results.WhatIf[2] | Should -BeExactly 'What if: Performing the operation "Refresh all environment variables" on target "Current process".' -Because $results.Output + } + } + } + Context 'Sets an environment variable value at the target ' -ForEach @( @{ Scope = 'Process' } @{ Scope = 'User' } diff --git a/tests/pester-tests/powershell-commands/Uninstall-ChocolateyPath.Tests.ps1 b/tests/pester-tests/powershell-commands/Uninstall-ChocolateyPath.Tests.ps1 index 29dbeec65b..238a405855 100644 --- a/tests/pester-tests/powershell-commands/Uninstall-ChocolateyPath.Tests.ps1 +++ b/tests/pester-tests/powershell-commands/Uninstall-ChocolateyPath.Tests.ps1 @@ -1,4 +1,4 @@ -Describe 'Uninstall-ChocolateyPath helper function tests' -Tags Cmdlets { +Describe 'Uninstall-ChocolateyPath helper function tests' -Tags UninstallChocolateyPath, Cmdlets { BeforeAll { Initialize-ChocolateyTestInstall @@ -6,7 +6,37 @@ Import-Module "$testLocation\helpers\chocolateyInstaller.psm1" } - Context 'Adding and removing PATH values' -ForEach @( + Context 'Unit tests (Scope: )' -Tags WhatIf -ForEach @( + @{ Scope = 'Process' } + @{ Scope = 'User' } + @{ Scope = 'Machine' } + ) { + BeforeAll { + $Preamble = [scriptblock]::Create("Import-Module '$testLocation\helpers\chocolateyInstaller.psm1'") + } + + It 'removes a stored PATH value in the desired PATH scope' { + $targetPathEntry = [Environment]::GetEnvironmentVariable('PATH', $Scope) -split ';' | Select-Object -Last 1 + $Command = [scriptblock]::Create("Uninstall-ChocolateyPath -Path '$targetPathEntry' -Scope $Scope -WhatIf") + + $results = Get-WhatIfResult -Preamble $Preamble -Command $Command + $results.WhatIf[0] | Should -BeExactly "What if: Performing the operation ""Set $Scope environment variable"" on target ""PATH""." -Because $results.Output + + if ($Scope -ne 'Process') { + $results.WhatIf[1] | Should -BeExactly 'What if: Performing the operation "Notify system of changes" on target "Environment variables".' -Because $results.Output + $results.WhatIf[2] | Should -BeExactly 'What if: Performing the operation "Refresh all environment variables" on target "Current process".' -Because $results.Output + } + } + + It 'skips removing the value if it is not present' { + $targetPathEntry = [Environment]::GetEnvironmentVariable('PATH', $Scope) -split ';' | Select-Object -First 1 + $Command = [scriptblock]::Create("Uninstall-ChocolateyPath -Path 'C:\ThisShouldNotBePresent' -Scope $Scope -WhatIf") + $result = Get-WhatIfResult -Preamble $Preamble -Command $Command + $result.WhatIf | Should -BeNullOrEmpty -Because "we should skip removing a value that does not exist. Output:`n$($result.Output)" + } + } + + Context 'Adding and removing PATH values' -Tags VMOnly -ForEach @( @{ Scope = 'Process' } @{ Scope = 'User' } @{ Scope = 'Machine' } @@ -40,7 +70,7 @@ } } -Describe 'Uninstall-ChocolateyPath end-to-end tests with add-path package' -Tags Cmdlet -ForEach @( +Describe 'Uninstall-ChocolateyPath end-to-end tests with add-path package' -Tags Cmdlet, UninstallChocolateyPath, VMOnly -ForEach @( @{ Scope = 'User' } @{ Scope = 'Machine' } ) { diff --git a/tests/pester-tests/powershell-commands/Update-SessionEnvironment.Tests.ps1 b/tests/pester-tests/powershell-commands/Update-SessionEnvironment.Tests.ps1 index 9f8bcccbc6..67cd0acf08 100644 --- a/tests/pester-tests/powershell-commands/Update-SessionEnvironment.Tests.ps1 +++ b/tests/pester-tests/powershell-commands/Update-SessionEnvironment.Tests.ps1 @@ -1,10 +1,20 @@ -Describe 'Update-SessionEnvironment helper function tests' -Tag Cmdlets { +Describe 'Update-SessionEnvironment helper function tests' -Tag UpdateSessionEnvironment, Cmdlets { BeforeAll { Initialize-ChocolateyTestInstall $testLocation = Get-ChocolateyTestLocation Import-Module "$testLocation\helpers\chocolateyInstaller.psm1" } + + Context 'Unit tests' -Tag WhatIf { + It 'refreshes the current session environment variables' { + $Preamble = [scriptblock]::Create("Import-Module '$testLocation\helpers\chocolateyInstaller.psm1'") + $Command = [scriptblock]::Create("Update-SessionEnvironment -WhatIf") + + $results = Get-WhatIfResult -Preamble $Preamble -Command $Command + $results.WhatIf | Should -BeExactly 'What if: Performing the operation "Refresh all environment variables" on target "Current process".' + } + } Context 'Refreshing environment' { BeforeAll { diff --git a/update-cmdlet-documentation.ps1 b/update-cmdlet-documentation.ps1 index c9eb6dff69..b5d033bf8c 100644 --- a/update-cmdlet-documentation.ps1 +++ b/update-cmdlet-documentation.ps1 @@ -31,17 +31,53 @@ if (-not (Get-Module -ListAvailable PlatyPS)) { Install-Module PlatyPS -Scope CurrentUser } -$documentationPath = Join-Path $DocsRepositoryPath -ChildPath "input/en-us/create/cmdlets" +$documentationPath = Join-Path $DocsRepositoryPath -ChildPath "src\content\docs\en-us\create\cmdlets" if (-not (Test-Path $DocsRepositoryPath)) { throw "PowerShell commands docs folder was not found at '$documentationPath'. Please clone the chocolatey/docs repository locally first, and/or provide the path to the repo root as -DocsRepositoryPath to this script." } -$dllPath = "$PSScriptRoot/code_drop/temp/_PublishedLibs/Chocolatey.PowerShell_signed/Chocolatey.PowerShell.dll" +$dllPath = "$PSScriptRoot/code_drop/temp/_PublishedLibs/Chocolatey.PowerShell/Chocolatey.PowerShell.dll" if (-not (Test-Path $dllPath)) { throw "Please run this repository's build.ps1 file before trying to build markdown help for this module." } +# Rename .mdx to .md and transform anything platyps doesn't like and can't handle +$renamedFiles = Get-ChildItem -Path $documentationPath -Filter '*.md*' | + Where-Object Name -notlike "index.*" | + Rename-Item -NewName { $_.BaseName + ".md" } -PassThru | + ForEach-Object { + $content = Get-Content -Path $_.FullName + $content = $content | ForEach-Object { + # replace xref with markdown-ish link so platyPS can process things + if ($_ -match ']+?>') { + $xml = [xml]$_ + $label = $xml.Xref.title + $xref = $xml.Xref.value + $anchor = $xml.Xref.anchor + $classes = $xml.Xref.classes + + if ($anchor -and $classes) { + "[${label}](xref:${xref}#${anchor},${classes})" + } + elseif ($classes) { + "[${label}](xref:${xref},${classes})" + } + elseif ($anchor) { + "[${label}](xref:${xref}#${anchor})" + } + else { + "[${label}](xref:${xref})" + } + + } + else { + $_ + } + } + $content | Set-Content -Path $_.FullName + } + # Import the module .dll to generate / update help from. Import-Module $dllPath @@ -70,8 +106,58 @@ if ($incompleteFiles) { Write-Warning "Run this script again once these files have been updated in order to generate the XML help documentation for the module." } else { - New-ExternalHelp -Path $documentationPath -OutputPath "$PSScriptRoot/src/Chocolatey.PowerShell" + New-ExternalHelp -Path $documentationPath -OutputPath "$PSScriptRoot/src/Chocolatey.PowerShell" -Force } +$newOrUpdatedFiles = $newOrUpdatedFiles | + Rename-Item -NewName { $_.BaseName + ".mdx" } -PassThru | + ForEach-Object { + $content = Get-Content -Path $_.FullName + + $frontMatterBounds = 0 + $content = $content | ForEach-Object { + if ($_ -match '\[(?[^\]]+)\]\(xref:(?[^#,]+)(#(?[^,]+))?,(?[^)]+)\)') { + # replace any lines that are an xref link with the html/xml format that astro uses + $xml = [xml]::new() + $node = $xml.CreateElement('Xref') + $title = $xml.CreateAttribute('title') + $title.Value = $matches['name'] + $null = $node.Attributes.Append($title) + + $target = $xml.CreateAttribute('value') + $target.Value = $matches['xref'] + $null = $node.Attributes.Append($target) + + if ($matches['anchor']) { + $anchor = $xml.CreateAttribute('anchor') + $anchor.Value = $matches['anchor'] + $null = $node.Attributes.Append($anchor) + } + + $classes = $xml.CreateAttribute('classes') + $classes.Value = $matches['classes'] + $null = $node.Attributes.Append($classes) + + $node.OuterXml + } + else { + # after the second --- where we exit the frontmatter, add the xref import to the document + $_ + + if ($_ -eq '---') { + $frontMatterBounds++ + + if ($frontMatterBounds -eq 2) { + "import Xref from '@components/Xref.astro';" + } + } + } + } + + $content | Set-Content -Path $_.FullName + + $_ + } + # Output the new/updated files so calling user knows what files the script has touched. $newOrUpdatedFiles \ No newline at end of file