├── src ├── clickonce │ ├── native │ │ ├── projects │ │ │ ├── CMakeLists.txt │ │ │ ├── NetCoreCheck │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── CA │ │ │ │ │ ├── NetCoreCheckCA.def │ │ │ │ │ ├── NetCoreCheckCA.h │ │ │ │ │ ├── MsiLogger.h │ │ │ │ │ ├── MsiLogger.cpp │ │ │ │ │ ├── MsiWrapper.h │ │ │ │ │ ├── CMakeLists.txt │ │ │ │ │ ├── version_info.h │ │ │ │ │ └── MsiWrapper.cpp │ │ │ │ ├── EXE │ │ │ │ │ ├── NetCoreCheckExe.h │ │ │ │ │ ├── FileLogger.h │ │ │ │ │ ├── CMakeLists.txt │ │ │ │ │ ├── version_info.h │ │ │ │ │ └── FileLogger.cpp │ │ │ │ ├── TempRuntimeConfigFile.h │ │ │ │ ├── Logger.h │ │ │ │ └── NetCoreCheck.h │ │ │ ├── exe.cmake │ │ │ ├── lib.cmake │ │ │ ├── lib_static.cmake │ │ │ ├── version_compatibility_range.h │ │ │ ├── roll_fwd_on_no_candidate_fx_option.h │ │ │ ├── version_compatibility_range.cpp │ │ │ ├── setup.cmake │ │ │ ├── version.h │ │ │ ├── hostpolicy.h │ │ │ ├── roll_forward_option.h │ │ │ ├── native.rc │ │ │ ├── coreclr_delegates.h │ │ │ ├── json_parser.h │ │ │ ├── roll_forward_option.cpp │ │ │ └── common.cmake │ │ ├── CMakeLists.txt │ │ └── build.sh │ ├── MageCLI │ │ ├── AppMan.cs │ │ └── MageCLI.csproj │ ├── Directory.Build.targets │ ├── NetCoreCheck │ │ ├── NetCoreCheck-Shipping.pkgproj │ │ ├── NetCoreCheck-NonShipping.pkgproj │ │ └── Directory.Build.props │ ├── launcher │ │ ├── Launcher.csproj │ │ ├── LauncherException.cs │ │ └── ProcessHelper.cs │ └── Directory.Build.props ├── DotNetRuntimeValidation │ ├── appsettings.json │ ├── Program.cs │ ├── DotNetRuntimeValidation.csproj │ └── Directory.Build.targets └── Microsoft.Deployment.DotNet.Releases │ ├── tests │ ├── Microsoft.Deployment.DotNet.Releases.Tests.csproj │ ├── CveTests.cs │ ├── ReleaseComponentTests.cs │ └── UtilsTests.cs │ └── src │ ├── ReleaseType.cs │ ├── WindowsDesktopReleaseComponent.cs │ ├── Microsoft.Deployment.DotNet.Releases.csproj │ ├── SupportPhase.cs │ ├── RuntimeReleaseComponent.cs │ └── AspNetCoreReleaseComponent.cs ├── eng ├── common │ ├── BuildConfiguration │ │ └── build-configuration.json │ ├── dotnet-install.cmd │ ├── build.cmd │ ├── sdl │ │ ├── packages.config │ │ ├── NuGet.config │ │ ├── sdl.ps1 │ │ ├── run-sdl.ps1 │ │ ├── trim-assets-version.ps1 │ │ └── extract-artifact-archives.ps1 │ ├── CIBuild.cmd │ ├── init-tools-native.cmd │ ├── templates │ │ ├── jobs │ │ │ ├── jobs.yml │ │ │ ├── source-build.yml │ │ │ └── codeql-build.yml │ │ ├── job │ │ │ ├── onelocbuild.yml │ │ │ ├── source-build.yml │ │ │ ├── publish-build-assets.yml │ │ │ └── source-index-stage1.yml │ │ ├── steps │ │ │ ├── publish-logs.yml │ │ │ ├── retain-build.yml │ │ │ ├── source-build.yml │ │ │ ├── generate-sbom.yml │ │ │ ├── send-to-helix.yml │ │ │ ├── component-governance.yml │ │ │ ├── get-delegation-sas.yml │ │ │ ├── enable-internal-sources.yml │ │ │ ├── get-federated-access-token.yml │ │ │ ├── source-index-stage1-publish.yml │ │ │ ├── enable-internal-runtimes.yml │ │ │ ├── publish-build-artifacts.yml │ │ │ └── publish-pipeline-artifacts.yml │ │ ├── post-build │ │ │ ├── post-build.yml │ │ │ ├── common-variables.yml │ │ │ └── setup-maestro-vars.yml │ │ └── vmr-build-pr.yml │ ├── templates-official │ │ ├── jobs │ │ │ ├── jobs.yml │ │ │ ├── source-build.yml │ │ │ └── codeql-build.yml │ │ ├── job │ │ │ ├── onelocbuild.yml │ │ │ ├── source-build.yml │ │ │ ├── publish-build-assets.yml │ │ │ └── source-index-stage1.yml │ │ ├── steps │ │ │ ├── generate-sbom.yml │ │ │ ├── publish-logs.yml │ │ │ ├── retain-build.yml │ │ │ ├── send-to-helix.yml │ │ │ ├── source-build.yml │ │ │ ├── get-delegation-sas.yml │ │ │ ├── component-governance.yml │ │ │ ├── enable-internal-sources.yml │ │ │ ├── get-federated-access-token.yml │ │ │ ├── source-index-stage1-publish.yml │ │ │ ├── enable-internal-runtimes.yml │ │ │ ├── publish-pipeline-artifacts.yml │ │ │ └── publish-build-artifacts.yml │ │ ├── post-build │ │ │ ├── post-build.yml │ │ │ ├── common-variables.yml │ │ │ └── setup-maestro-vars.yml │ │ └── variables │ │ │ ├── sdl-variables.yml │ │ │ └── pool-providers.yml │ ├── dotnet.cmd │ ├── core-templates │ │ ├── variables │ │ │ └── pool-providers.yml │ │ ├── steps │ │ │ ├── publish-pipeline-artifacts.yml │ │ │ ├── component-governance.yml │ │ │ ├── publish-build-artifacts.yml │ │ │ ├── cleanup-microbuild.yml │ │ │ ├── enable-internal-runtimes.yml │ │ │ ├── retain-build.yml │ │ │ ├── get-federated-access-token.yml │ │ │ ├── get-delegation-sas.yml │ │ │ ├── source-index-stage1-publish.yml │ │ │ └── enable-internal-sources.yml │ │ ├── post-build │ │ │ └── common-variables.yml │ │ ├── jobs │ │ │ ├── codeql-build.yml │ │ │ └── source-build.yml │ │ └── job │ │ │ └── source-index-stage1.yml │ ├── dotnet.ps1 │ ├── internal │ │ ├── NuGet.config │ │ ├── Directory.Build.props │ │ └── Tools.csproj │ ├── cross │ │ ├── x86 │ │ │ └── tizen │ │ │ │ └── tizen.patch │ │ ├── armel │ │ │ └── tizen │ │ │ │ └── tizen.patch │ │ ├── arm │ │ │ └── tizen │ │ │ │ └── tizen.patch │ │ ├── x64 │ │ │ └── tizen │ │ │ │ └── tizen.patch │ │ ├── arm64 │ │ │ └── tizen │ │ │ │ └── tizen.patch │ │ ├── riscv64 │ │ │ └── tizen │ │ │ │ └── tizen.patch │ │ └── tizen-build-rootfs.sh │ ├── PSScriptAnalyzerSettings.psd1 │ ├── cibuild.sh │ ├── enable-cross-org-publishing.ps1 │ ├── msbuild.ps1 │ ├── post-build │ │ ├── nuget-validation.ps1 │ │ ├── check-channel-consistency.ps1 │ │ └── publish-using-darc.ps1 │ ├── dotnet-install.ps1 │ ├── dotnet.sh │ ├── helixpublish.proj │ ├── generate-sbom-prep.ps1 │ ├── msbuild.sh │ ├── README.md │ ├── retain-build.ps1 │ ├── generate-sbom-prep.sh │ ├── loc │ │ └── P22DotNetHtmlLocalization.lss │ ├── darc-init.ps1 │ ├── native │ │ ├── install-dependencies.sh │ │ └── init-os-and-arch.sh │ └── dotnet-install.sh ├── Build.props ├── native │ ├── generateexportedsymbols.awk │ ├── configureoptimization.cmake │ ├── generateversionscript.awk │ ├── genmoduleindex.sh │ ├── genmoduleindex.cmd │ ├── sanitizer-ignorelist.txt │ ├── init-os-and-arch.sh │ └── configuretools.cmake ├── sdl-tsa-vars.config ├── internal │ └── NuGet.config ├── Publishing.props ├── Version.Details.xml ├── SignCheckExclusionsFile.txt ├── Version.Details.props ├── Versions.props ├── empty.csproj └── Signing.props ├── .azuredevops └── dependabot.yml ├── es-metadata.yml ├── CODE-OF-CONDUCT.md ├── .github ├── CODEOWNERS ├── ISSUE_TEMPLATE │ ├── config.yml │ └── bug_report.md ├── policies │ └── untriaged.yml └── workflows │ ├── labeler-cache-retention.yml │ ├── labeler.md │ ├── labeler-promote.yml │ └── labeler-predict-issues.yml ├── global.json ├── .config └── tsaoptions.json ├── NuGet.config ├── THIRD-PARTY-NOTICES.TXT ├── SECURITY.md ├── LICENSE.TXT ├── azure-pipelines-PR.yml ├── Directory.Build.targets ├── Directory.Packages.props ├── Build.proj └── docs └── dotnet-mage └── README.md /src/clickonce/native/projects/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(NetCoreCheck) 2 | -------------------------------------------------------------------------------- /src/clickonce/native/projects/NetCoreCheck/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(CA) 2 | add_subdirectory(EXE) 3 | -------------------------------------------------------------------------------- /src/clickonce/MageCLI/AppMan.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dotnet/deployment-tools/HEAD/src/clickonce/MageCLI/AppMan.cs -------------------------------------------------------------------------------- /eng/common/BuildConfiguration/build-configuration.json: -------------------------------------------------------------------------------- 1 | { 2 | "RetryCountLimit": 1, 3 | "RetryByAnyError": false 4 | } 5 | -------------------------------------------------------------------------------- /src/clickonce/native/projects/NetCoreCheck/CA/NetCoreCheckCA.def: -------------------------------------------------------------------------------- 1 | LIBRARY "NETCoreCheckCA" 2 | 3 | EXPORTS 4 | CheckNETRuntime 5 | -------------------------------------------------------------------------------- /eng/common/dotnet-install.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0dotnet-install.ps1""" %*" -------------------------------------------------------------------------------- /eng/Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /eng/common/build.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0build.ps1""" %*" 3 | exit /b %ErrorLevel% 4 | -------------------------------------------------------------------------------- /eng/common/sdl/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /eng/common/CIBuild.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0Build.ps1""" -restore -build -test -sign -pack -publish -ci %*" 3 | -------------------------------------------------------------------------------- /eng/common/init-tools-native.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | powershell -NoProfile -NoLogo -ExecutionPolicy ByPass -command "& """%~dp0init-tools-native.ps1""" %*" 3 | exit /b %ErrorLevel% -------------------------------------------------------------------------------- /.azuredevops/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | 3 | # Disabling dependabot on Azure DevOps as this is a mirrored repo. Updates should go through github. 4 | enable-campaigned-updates: false 5 | enable-security-updates: false 6 | -------------------------------------------------------------------------------- /src/DotNetRuntimeValidation/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*" 9 | } 10 | -------------------------------------------------------------------------------- /eng/common/templates/jobs/jobs.yml: -------------------------------------------------------------------------------- 1 | jobs: 2 | - template: /eng/common/core-templates/jobs/jobs.yml 3 | parameters: 4 | is1ESPipeline: false 5 | 6 | ${{ each parameter in parameters }}: 7 | ${{ parameter.key }}: ${{ parameter.value }} 8 | -------------------------------------------------------------------------------- /src/clickonce/Directory.Build.targets: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /eng/common/templates-official/jobs/jobs.yml: -------------------------------------------------------------------------------- 1 | jobs: 2 | - template: /eng/common/core-templates/jobs/jobs.yml 3 | parameters: 4 | is1ESPipeline: true 5 | 6 | ${{ each parameter in parameters }}: 7 | ${{ parameter.key }}: ${{ parameter.value }} 8 | -------------------------------------------------------------------------------- /eng/common/templates/job/onelocbuild.yml: -------------------------------------------------------------------------------- 1 | jobs: 2 | - template: /eng/common/core-templates/job/onelocbuild.yml 3 | parameters: 4 | is1ESPipeline: false 5 | 6 | ${{ each parameter in parameters }}: 7 | ${{ parameter.key }}: ${{ parameter.value }} 8 | -------------------------------------------------------------------------------- /eng/common/templates/job/source-build.yml: -------------------------------------------------------------------------------- 1 | jobs: 2 | - template: /eng/common/core-templates/job/source-build.yml 3 | parameters: 4 | is1ESPipeline: false 5 | 6 | ${{ each parameter in parameters }}: 7 | ${{ parameter.key }}: ${{ parameter.value }} 8 | -------------------------------------------------------------------------------- /eng/common/templates/jobs/source-build.yml: -------------------------------------------------------------------------------- 1 | jobs: 2 | - template: /eng/common/core-templates/jobs/source-build.yml 3 | parameters: 4 | is1ESPipeline: false 5 | 6 | ${{ each parameter in parameters }}: 7 | ${{ parameter.key }}: ${{ parameter.value }} -------------------------------------------------------------------------------- /es-metadata.yml: -------------------------------------------------------------------------------- 1 | schemaVersion: 0.0.1 2 | isProduction: true 3 | accountableOwners: 4 | service: 33d7954d-0688-4e7b-9208-087c9e57f21a 5 | routing: 6 | defaultAreaPath: 7 | org: devdiv 8 | path: DevDiv\NET Fundamentals\.NET Acquisition\Deployment-tools 9 | -------------------------------------------------------------------------------- /eng/common/templates-official/job/onelocbuild.yml: -------------------------------------------------------------------------------- 1 | jobs: 2 | - template: /eng/common/core-templates/job/onelocbuild.yml 3 | parameters: 4 | is1ESPipeline: true 5 | 6 | ${{ each parameter in parameters }}: 7 | ${{ parameter.key }}: ${{ parameter.value }} 8 | -------------------------------------------------------------------------------- /eng/common/templates-official/jobs/source-build.yml: -------------------------------------------------------------------------------- 1 | jobs: 2 | - template: /eng/common/core-templates/jobs/source-build.yml 3 | parameters: 4 | is1ESPipeline: true 5 | 6 | ${{ each parameter in parameters }}: 7 | ${{ parameter.key }}: ${{ parameter.value }} -------------------------------------------------------------------------------- /eng/common/templates/jobs/codeql-build.yml: -------------------------------------------------------------------------------- 1 | jobs: 2 | - template: /eng/common/core-templates/jobs/codeql-build.yml 3 | parameters: 4 | is1ESPipeline: false 5 | 6 | ${{ each parameter in parameters }}: 7 | ${{ parameter.key }}: ${{ parameter.value }} 8 | -------------------------------------------------------------------------------- /eng/common/templates/steps/publish-logs.yml: -------------------------------------------------------------------------------- 1 | steps: 2 | - template: /eng/common/core-templates/steps/publish-logs.yml 3 | parameters: 4 | is1ESPipeline: false 5 | 6 | ${{ each parameter in parameters }}: 7 | ${{ parameter.key }}: ${{ parameter.value }} 8 | -------------------------------------------------------------------------------- /eng/common/templates/steps/retain-build.yml: -------------------------------------------------------------------------------- 1 | steps: 2 | - template: /eng/common/core-templates/steps/retain-build.yml 3 | parameters: 4 | is1ESPipeline: false 5 | 6 | ${{ each parameter in parameters }}: 7 | ${{ parameter.key }}: ${{ parameter.value }} 8 | -------------------------------------------------------------------------------- /eng/common/templates/steps/source-build.yml: -------------------------------------------------------------------------------- 1 | steps: 2 | - template: /eng/common/core-templates/steps/source-build.yml 3 | parameters: 4 | is1ESPipeline: false 5 | 6 | ${{ each parameter in parameters }}: 7 | ${{ parameter.key }}: ${{ parameter.value }} 8 | -------------------------------------------------------------------------------- /eng/common/templates-official/job/source-build.yml: -------------------------------------------------------------------------------- 1 | jobs: 2 | - template: /eng/common/core-templates/job/source-build.yml 3 | parameters: 4 | is1ESPipeline: true 5 | 6 | ${{ each parameter in parameters }}: 7 | ${{ parameter.key }}: ${{ parameter.value }} 8 | -------------------------------------------------------------------------------- /eng/common/templates-official/jobs/codeql-build.yml: -------------------------------------------------------------------------------- 1 | jobs: 2 | - template: /eng/common/core-templates/jobs/codeql-build.yml 3 | parameters: 4 | is1ESPipeline: true 5 | 6 | ${{ each parameter in parameters }}: 7 | ${{ parameter.key }}: ${{ parameter.value }} 8 | -------------------------------------------------------------------------------- /eng/common/templates/steps/generate-sbom.yml: -------------------------------------------------------------------------------- 1 | steps: 2 | - template: /eng/common/core-templates/steps/generate-sbom.yml 3 | parameters: 4 | is1ESPipeline: false 5 | 6 | ${{ each parameter in parameters }}: 7 | ${{ parameter.key }}: ${{ parameter.value }} 8 | -------------------------------------------------------------------------------- /eng/common/templates/steps/send-to-helix.yml: -------------------------------------------------------------------------------- 1 | steps: 2 | - template: /eng/common/core-templates/steps/send-to-helix.yml 3 | parameters: 4 | is1ESPipeline: false 5 | 6 | ${{ each parameter in parameters }}: 7 | ${{ parameter.key }}: ${{ parameter.value }} 8 | -------------------------------------------------------------------------------- /eng/common/dotnet.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | :: This script is used to install the .NET SDK. 4 | :: It will also invoke the SDK with any provided arguments. 5 | 6 | powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0dotnet.ps1""" %*" 7 | exit /b %ErrorLevel% 8 | -------------------------------------------------------------------------------- /eng/common/templates-official/steps/generate-sbom.yml: -------------------------------------------------------------------------------- 1 | steps: 2 | - template: /eng/common/core-templates/steps/generate-sbom.yml 3 | parameters: 4 | is1ESPipeline: true 5 | 6 | ${{ each parameter in parameters }}: 7 | ${{ parameter.key }}: ${{ parameter.value }} 8 | -------------------------------------------------------------------------------- /eng/common/templates-official/steps/publish-logs.yml: -------------------------------------------------------------------------------- 1 | steps: 2 | - template: /eng/common/core-templates/steps/publish-logs.yml 3 | parameters: 4 | is1ESPipeline: true 5 | 6 | ${{ each parameter in parameters }}: 7 | ${{ parameter.key }}: ${{ parameter.value }} 8 | -------------------------------------------------------------------------------- /eng/common/templates-official/steps/retain-build.yml: -------------------------------------------------------------------------------- 1 | steps: 2 | - template: /eng/common/core-templates/steps/retain-build.yml 3 | parameters: 4 | is1ESPipeline: true 5 | 6 | ${{ each parameter in parameters }}: 7 | ${{ parameter.key }}: ${{ parameter.value }} 8 | -------------------------------------------------------------------------------- /eng/common/templates-official/steps/send-to-helix.yml: -------------------------------------------------------------------------------- 1 | steps: 2 | - template: /eng/common/core-templates/steps/send-to-helix.yml 3 | parameters: 4 | is1ESPipeline: true 5 | 6 | ${{ each parameter in parameters }}: 7 | ${{ parameter.key }}: ${{ parameter.value }} 8 | -------------------------------------------------------------------------------- /eng/common/templates-official/steps/source-build.yml: -------------------------------------------------------------------------------- 1 | steps: 2 | - template: /eng/common/core-templates/steps/source-build.yml 3 | parameters: 4 | is1ESPipeline: true 5 | 6 | ${{ each parameter in parameters }}: 7 | ${{ parameter.key }}: ${{ parameter.value }} 8 | -------------------------------------------------------------------------------- /eng/common/templates/job/publish-build-assets.yml: -------------------------------------------------------------------------------- 1 | jobs: 2 | - template: /eng/common/core-templates/job/publish-build-assets.yml 3 | parameters: 4 | is1ESPipeline: false 5 | 6 | ${{ each parameter in parameters }}: 7 | ${{ parameter.key }}: ${{ parameter.value }} 8 | -------------------------------------------------------------------------------- /eng/common/templates/job/source-index-stage1.yml: -------------------------------------------------------------------------------- 1 | jobs: 2 | - template: /eng/common/core-templates/job/source-index-stage1.yml 3 | parameters: 4 | is1ESPipeline: false 5 | 6 | ${{ each parameter in parameters }}: 7 | ${{ parameter.key }}: ${{ parameter.value }} 8 | -------------------------------------------------------------------------------- /eng/common/templates/steps/component-governance.yml: -------------------------------------------------------------------------------- 1 | steps: 2 | - template: /eng/common/core-templates/steps/component-governance.yml 3 | parameters: 4 | is1ESPipeline: false 5 | 6 | ${{ each parameter in parameters }}: 7 | ${{ parameter.key }}: ${{ parameter.value }} 8 | -------------------------------------------------------------------------------- /eng/common/templates/steps/get-delegation-sas.yml: -------------------------------------------------------------------------------- 1 | steps: 2 | - template: /eng/common/core-templates/steps/get-delegation-sas.yml 3 | parameters: 4 | is1ESPipeline: false 5 | 6 | ${{ each parameter in parameters }}: 7 | ${{ parameter.key }}: ${{ parameter.value }} 8 | -------------------------------------------------------------------------------- /eng/common/templates-official/job/publish-build-assets.yml: -------------------------------------------------------------------------------- 1 | jobs: 2 | - template: /eng/common/core-templates/job/publish-build-assets.yml 3 | parameters: 4 | is1ESPipeline: true 5 | 6 | ${{ each parameter in parameters }}: 7 | ${{ parameter.key }}: ${{ parameter.value }} 8 | -------------------------------------------------------------------------------- /eng/common/templates-official/job/source-index-stage1.yml: -------------------------------------------------------------------------------- 1 | jobs: 2 | - template: /eng/common/core-templates/job/source-index-stage1.yml 3 | parameters: 4 | is1ESPipeline: true 5 | 6 | ${{ each parameter in parameters }}: 7 | ${{ parameter.key }}: ${{ parameter.value }} 8 | -------------------------------------------------------------------------------- /eng/common/templates-official/steps/get-delegation-sas.yml: -------------------------------------------------------------------------------- 1 | steps: 2 | - template: /eng/common/core-templates/steps/get-delegation-sas.yml 3 | parameters: 4 | is1ESPipeline: true 5 | 6 | ${{ each parameter in parameters }}: 7 | ${{ parameter.key }}: ${{ parameter.value }} 8 | -------------------------------------------------------------------------------- /eng/common/templates/steps/enable-internal-sources.yml: -------------------------------------------------------------------------------- 1 | steps: 2 | - template: /eng/common/core-templates/steps/enable-internal-sources.yml 3 | parameters: 4 | is1ESPipeline: false 5 | 6 | ${{ each parameter in parameters }}: 7 | ${{ parameter.key }}: ${{ parameter.value }} -------------------------------------------------------------------------------- /CODE-OF-CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Code of Conduct 2 | 3 | This project has adopted the code of conduct defined by the Contributor Covenant 4 | to clarify expected behavior in our community. 5 | For more information, see the [.NET Foundation Code of Conduct](https://dotnetfoundation.org/code-of-conduct). 6 | -------------------------------------------------------------------------------- /eng/common/templates-official/steps/component-governance.yml: -------------------------------------------------------------------------------- 1 | steps: 2 | - template: /eng/common/core-templates/steps/component-governance.yml 3 | parameters: 4 | is1ESPipeline: true 5 | 6 | ${{ each parameter in parameters }}: 7 | ${{ parameter.key }}: ${{ parameter.value }} 8 | -------------------------------------------------------------------------------- /eng/common/templates-official/steps/enable-internal-sources.yml: -------------------------------------------------------------------------------- 1 | steps: 2 | - template: /eng/common/core-templates/steps/enable-internal-sources.yml 3 | parameters: 4 | is1ESPipeline: true 5 | 6 | ${{ each parameter in parameters }}: 7 | ${{ parameter.key }}: ${{ parameter.value }} -------------------------------------------------------------------------------- /eng/common/templates/steps/get-federated-access-token.yml: -------------------------------------------------------------------------------- 1 | steps: 2 | - template: /eng/common/core-templates/steps/get-federated-access-token.yml 3 | parameters: 4 | is1ESPipeline: false 5 | 6 | ${{ each parameter in parameters }}: 7 | ${{ parameter.key }}: ${{ parameter.value }} -------------------------------------------------------------------------------- /eng/common/templates-official/steps/get-federated-access-token.yml: -------------------------------------------------------------------------------- 1 | steps: 2 | - template: /eng/common/core-templates/steps/get-federated-access-token.yml 3 | parameters: 4 | is1ESPipeline: true 5 | 6 | ${{ each parameter in parameters }}: 7 | ${{ parameter.key }}: ${{ parameter.value }} -------------------------------------------------------------------------------- /eng/common/templates/steps/source-index-stage1-publish.yml: -------------------------------------------------------------------------------- 1 | steps: 2 | - template: /eng/common/core-templates/steps/source-index-stage1-publish.yml 3 | parameters: 4 | is1ESPipeline: false 5 | 6 | ${{ each parameter in parameters }}: 7 | ${{ parameter.key }}: ${{ parameter.value }} 8 | -------------------------------------------------------------------------------- /eng/common/templates-official/steps/source-index-stage1-publish.yml: -------------------------------------------------------------------------------- 1 | steps: 2 | - template: /eng/common/core-templates/steps/source-index-stage1-publish.yml 3 | parameters: 4 | is1ESPipeline: true 5 | 6 | ${{ each parameter in parameters }}: 7 | ${{ parameter.key }}: ${{ parameter.value }} 8 | -------------------------------------------------------------------------------- /eng/common/templates/post-build/post-build.yml: -------------------------------------------------------------------------------- 1 | stages: 2 | - template: /eng/common/core-templates/post-build/post-build.yml 3 | parameters: 4 | # Specifies whether to use 1ES 5 | is1ESPipeline: false 6 | 7 | ${{ each parameter in parameters }}: 8 | ${{ parameter.key }}: ${{ parameter.value }} -------------------------------------------------------------------------------- /eng/common/templates-official/post-build/post-build.yml: -------------------------------------------------------------------------------- 1 | stages: 2 | - template: /eng/common/core-templates/post-build/post-build.yml 3 | parameters: 4 | # Specifies whether to use 1ES 5 | is1ESPipeline: true 6 | 7 | ${{ each parameter in parameters }}: 8 | ${{ parameter.key }}: ${{ parameter.value }} 9 | -------------------------------------------------------------------------------- /eng/common/templates/post-build/common-variables.yml: -------------------------------------------------------------------------------- 1 | variables: 2 | - template: /eng/common/core-templates/post-build/common-variables.yml 3 | parameters: 4 | # Specifies whether to use 1ES 5 | is1ESPipeline: false 6 | 7 | ${{ each parameter in parameters }}: 8 | ${{ parameter.key }}: ${{ parameter.value }} -------------------------------------------------------------------------------- /eng/common/templates/post-build/setup-maestro-vars.yml: -------------------------------------------------------------------------------- 1 | steps: 2 | - template: /eng/common/core-templates/post-build/setup-maestro-vars.yml 3 | parameters: 4 | # Specifies whether to use 1ES 5 | is1ESPipeline: false 6 | 7 | ${{ each parameter in parameters }}: 8 | ${{ parameter.key }}: ${{ parameter.value }} -------------------------------------------------------------------------------- /src/DotNetRuntimeValidation/Program.cs: -------------------------------------------------------------------------------- 1 | try 2 | { 3 | WebApplication.Create(); 4 | 5 | Console.WriteLine("Runtime validation success."); 6 | return 0; 7 | } 8 | catch (Exception ex) 9 | { 10 | Console.WriteLine("Runtime validation failure."); 11 | Console.WriteLine(ex.Message); 12 | return 1; 13 | } -------------------------------------------------------------------------------- /eng/common/templates-official/post-build/common-variables.yml: -------------------------------------------------------------------------------- 1 | variables: 2 | - template: /eng/common/core-templates/post-build/common-variables.yml 3 | parameters: 4 | # Specifies whether to use 1ES 5 | is1ESPipeline: true 6 | 7 | ${{ each parameter in parameters }}: 8 | ${{ parameter.key }}: ${{ parameter.value }} -------------------------------------------------------------------------------- /eng/common/templates-official/post-build/setup-maestro-vars.yml: -------------------------------------------------------------------------------- 1 | steps: 2 | - template: /eng/common/core-templates/post-build/setup-maestro-vars.yml 3 | parameters: 4 | # Specifies whether to use 1ES 5 | is1ESPipeline: true 6 | 7 | ${{ each parameter in parameters }}: 8 | ${{ parameter.key }}: ${{ parameter.value }} -------------------------------------------------------------------------------- /eng/common/core-templates/variables/pool-providers.yml: -------------------------------------------------------------------------------- 1 | parameters: 2 | is1ESPipeline: false 3 | 4 | variables: 5 | - ${{ if eq(parameters.is1ESPipeline, 'true') }}: 6 | - template: /eng/common/templates-official/variables/pool-providers.yml 7 | - ${{ else }}: 8 | - template: /eng/common/templates/variables/pool-providers.yml -------------------------------------------------------------------------------- /src/clickonce/native/projects/NetCoreCheck/EXE/NetCoreCheckExe.h: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | #pragma once 6 | 7 | #include "..\NetCoreCheck.h" 8 | #include "FileLogger.h" 9 | -------------------------------------------------------------------------------- /eng/common/templates-official/variables/sdl-variables.yml: -------------------------------------------------------------------------------- 1 | variables: 2 | # The Guardian version specified in 'eng/common/sdl/packages.config'. This value must be kept in 3 | # sync with the packages.config file. 4 | - name: DefaultGuardianVersion 5 | value: 0.109.0 6 | - name: GuardianPackagesConfigFile 7 | value: $(System.DefaultWorkingDirectory)\eng\common\sdl\packages.config -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | # Users referenced in this file will automatically be requested as reviewers for PRs that modify the given paths. 2 | # See https://help.github.com/articles/about-code-owners/ 3 | 4 | * @dotnet/deployment-tools-admins 5 | 6 | # ClickOne 7 | /src/clickonce @NikolaMilosavljevic 8 | 9 | # Releases library 10 | /src/Microsoft.Deployment.DotNet.Releases @joeloff 11 | -------------------------------------------------------------------------------- /eng/common/dotnet.ps1: -------------------------------------------------------------------------------- 1 | # This script is used to install the .NET SDK. 2 | # It will also invoke the SDK with any provided arguments. 3 | 4 | . $PSScriptRoot\tools.ps1 5 | $dotnetRoot = InitializeDotNetCli -install:$true 6 | 7 | # Invoke acquired SDK with args if they are provided 8 | if ($args.count -gt 0) { 9 | $env:DOTNET_NOLOGO=1 10 | & "$dotnetRoot\dotnet.exe" $args 11 | } 12 | -------------------------------------------------------------------------------- /global.json: -------------------------------------------------------------------------------- 1 | { 2 | "sdk": { 3 | "version": "10.0.100", 4 | "allowPrerelease": true, 5 | "rollForward": "major" 6 | }, 7 | "tools": { 8 | "dotnet": "10.0.100" 9 | }, 10 | "msbuild-sdks": { 11 | "Microsoft.DotNet.Arcade.Sdk": "10.0.0-beta.25601.102", 12 | "Microsoft.Build.NoTargets": "3.7.0", 13 | "Microsoft.Build.Traversal": "3.4.0" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/clickonce/native/projects/NetCoreCheck/CA/NetCoreCheckCA.h: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | #pragma once 6 | 7 | #include "..\NetCoreCheck.h" 8 | 9 | #include 10 | #include 11 | -------------------------------------------------------------------------------- /eng/native/generateexportedsymbols.awk: -------------------------------------------------------------------------------- 1 | { 2 | # Remove the CR character in case the sources are mapped from 3 | # a Windows share and contain CRLF line endings 4 | gsub(/\r/,"", $0); 5 | 6 | # Skip empty lines and comment lines starting with semicolon 7 | if (NF && !match($0, /^[[:space:]]*;/)) 8 | { 9 | gsub(/^#/,"", $0); 10 | print "_" $0; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /eng/common/internal/NuGet.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.config/tsaoptions.json: -------------------------------------------------------------------------------- 1 | { 2 | "instanceUrl": "https://devdiv.visualstudio.com/", 3 | "template": "TFSDEVDIV", 4 | "projectName": "DEVDIV", 5 | "areaPath": "DevDiv\\NET Fundamentals\\.NET Acquisition\\Deployment-tools", 6 | "iterationPath": "DevDiv", 7 | "notificationAliases": [ "deptoolsrepo-infra@microsoft.com" ], 8 | "repositoryName":"Deployment-tools", 9 | "codebaseName": "Deployment-tools" 10 | } -------------------------------------------------------------------------------- /eng/sdl-tsa-vars.config: -------------------------------------------------------------------------------- 1 | -SourceToolsList @("policheck","credscan") 2 | -TsaInstanceURL https://devdiv.visualstudio.com/ 3 | -TsaProjectName DEVDIV 4 | -TsaNotificationEmail runtimerepo-infra@microsoft.com 5 | -TsaCodebaseAdmin REDMOND\danmose 6 | -TsaBugAreaPath "DevDiv\NET Runtime\Reliability\Docs" 7 | -TsaIterationPath DevDiv 8 | -TsaRepositoryName Runtime 9 | -TsaCodebaseName Runtime 10 | -TsaOnboard $True 11 | -TsaPublish $True -------------------------------------------------------------------------------- /src/clickonce/native/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.14.2) 2 | 3 | project(native) 4 | 5 | include(${CLR_ENG_NATIVE_DIR}/configurecompiler.cmake) 6 | 7 | if(MSVC) 8 | add_compile_options(/W1) 9 | 10 | # Host components don't try to handle asynchronous exceptions 11 | add_compile_options(/EHsc) 12 | endif() 13 | 14 | set(APP_HOST_LIB_DIR ${APP_HOST_LIB_DIR}) 15 | 16 | add_subdirectory(projects) 17 | -------------------------------------------------------------------------------- /eng/common/templates-official/steps/enable-internal-runtimes.yml: -------------------------------------------------------------------------------- 1 | # Obtains internal runtime download credentials and populates the 'dotnetbuilds-internal-container-read-token-base64' 2 | # variable with the base64-encoded SAS token, by default 3 | steps: 4 | - template: /eng/common/core-templates/steps/enable-internal-runtimes.yml 5 | parameters: 6 | is1ESPipeline: true 7 | 8 | ${{ each parameter in parameters }}: 9 | ${{ parameter.key }}: ${{ parameter.value }} 10 | -------------------------------------------------------------------------------- /eng/common/templates/steps/enable-internal-runtimes.yml: -------------------------------------------------------------------------------- 1 | # Obtains internal runtime download credentials and populates the 'dotnetbuilds-internal-container-read-token-base64' 2 | # variable with the base64-encoded SAS token, by default 3 | 4 | steps: 5 | - template: /eng/common/core-templates/steps/enable-internal-runtimes.yml 6 | parameters: 7 | is1ESPipeline: false 8 | 9 | ${{ each parameter in parameters }}: 10 | ${{ parameter.key }}: ${{ parameter.value }} 11 | -------------------------------------------------------------------------------- /eng/common/internal/Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | false 6 | false 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/Microsoft.Deployment.DotNet.Releases/tests/Microsoft.Deployment.DotNet.Releases.Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $(NetCurrent) 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /eng/common/cross/x86/tizen/tizen.patch: -------------------------------------------------------------------------------- 1 | diff -u -r a/usr/lib/libc.so b/usr/lib/libc.so 2 | --- a/usr/lib/libc.so 2016-12-30 23:00:08.284951863 +0900 3 | +++ b/usr/lib/libc.so 2016-12-30 23:00:32.140951815 +0900 4 | @@ -2,4 +2,4 @@ 5 | Use the shared library, but some functions are only in 6 | the static library, so try that secondarily. */ 7 | OUTPUT_FORMAT(elf32-i386) 8 | -GROUP ( /lib/libc.so.6 /usr/lib/libc_nonshared.a AS_NEEDED ( /lib/ld-linux.so.2 ) ) 9 | +GROUP ( libc.so.6 libc_nonshared.a AS_NEEDED ( ld-linux.so.2 ) ) 10 | -------------------------------------------------------------------------------- /eng/common/cross/armel/tizen/tizen.patch: -------------------------------------------------------------------------------- 1 | diff -u -r a/usr/lib/libc.so b/usr/lib/libc.so 2 | --- a/usr/lib/libc.so 2016-12-30 23:00:08.284951863 +0900 3 | +++ b/usr/lib/libc.so 2016-12-30 23:00:32.140951815 +0900 4 | @@ -2,4 +2,4 @@ 5 | Use the shared library, but some functions are only in 6 | the static library, so try that secondarily. */ 7 | OUTPUT_FORMAT(elf32-littlearm) 8 | -GROUP ( /lib/libc.so.6 /usr/lib/libc_nonshared.a AS_NEEDED ( /lib/ld-linux.so.3 ) ) 9 | +GROUP ( libc.so.6 libc_nonshared.a AS_NEEDED ( ld-linux.so.3 ) ) 10 | -------------------------------------------------------------------------------- /eng/common/PSScriptAnalyzerSettings.psd1: -------------------------------------------------------------------------------- 1 | @{ 2 | IncludeRules=@('PSAvoidUsingCmdletAliases', 3 | 'PSAvoidUsingWMICmdlet', 4 | 'PSAvoidUsingPositionalParameters', 5 | 'PSAvoidUsingInvokeExpression', 6 | 'PSUseDeclaredVarsMoreThanAssignments', 7 | 'PSUseCmdletCorrectly', 8 | 'PSStandardDSCFunctionsInResource', 9 | 'PSUseIdenticalMandatoryParametersForDSC', 10 | 'PSUseIdenticalParametersForDSC') 11 | } -------------------------------------------------------------------------------- /eng/native/configureoptimization.cmake: -------------------------------------------------------------------------------- 1 | if(CLR_CMAKE_HOST_WIN32) 2 | add_compile_options($<$:/Od>) 3 | add_compile_options($<$:/O1>) 4 | add_compile_options($<$:/Ox>) 5 | add_compile_options($<$:/O2>) 6 | elseif(CLR_CMAKE_HOST_UNIX) 7 | add_compile_options($<$:-O0>) 8 | add_compile_options($<$:-O2>) 9 | add_compile_options($<$:-O3>) 10 | add_compile_options($<$:-O2>) 11 | endif() 12 | -------------------------------------------------------------------------------- /eng/common/cross/arm/tizen/tizen.patch: -------------------------------------------------------------------------------- 1 | diff -u -r a/usr/lib/libc.so b/usr/lib/libc.so 2 | --- a/usr/lib/libc.so 2016-12-30 23:00:08.284951863 +0900 3 | +++ b/usr/lib/libc.so 2016-12-30 23:00:32.140951815 +0900 4 | @@ -2,4 +2,4 @@ 5 | Use the shared library, but some functions are only in 6 | the static library, so try that secondarily. */ 7 | OUTPUT_FORMAT(elf32-littlearm) 8 | -GROUP ( /lib/libc.so.6 /usr/lib/libc_nonshared.a AS_NEEDED ( /lib/ld-linux-armhf.so.3 ) ) 9 | +GROUP ( libc.so.6 libc_nonshared.a AS_NEEDED ( ld-linux-armhf.so.3 ) ) 10 | -------------------------------------------------------------------------------- /eng/internal/NuGet.config: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/clickonce/native/projects/NetCoreCheck/TempRuntimeConfigFile.h: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | #pragma once 6 | 7 | #include "NetCoreCheck.h" 8 | 9 | DWORD GetTempRuntimeConfigPath(LPWSTR runtimeConfigPath, bool useTempDirectory); 10 | DWORD CreateTempRuntimeConfigFile(LPCWSTR runtimeConfigPath, LPCWSTR frameworkName, LPCWSTR frameworkVersion, LPCWSTR rollForwardPolicy); 11 | -------------------------------------------------------------------------------- /eng/common/cross/x64/tizen/tizen.patch: -------------------------------------------------------------------------------- 1 | diff -u -r a/usr/lib64/libc.so b/usr/lib64/libc.so 2 | --- a/usr/lib64/libc.so 2016-12-30 23:00:08.284951863 +0900 3 | +++ b/usr/lib64/libc.so 2016-12-30 23:00:32.140951815 +0900 4 | @@ -2,4 +2,4 @@ 5 | Use the shared library, but some functions are only in 6 | the static library, so try that secondarily. */ 7 | OUTPUT_FORMAT(elf64-x86-64) 8 | -GROUP ( /lib64/libc.so.6 /usr/lib64/libc_nonshared.a AS_NEEDED ( /lib64/ld-linux-x86-64.so.2 ) ) 9 | +GROUP ( libc.so.6 libc_nonshared.a AS_NEEDED ( ld-linux-x86-64.so.2 ) ) 10 | -------------------------------------------------------------------------------- /eng/common/cross/arm64/tizen/tizen.patch: -------------------------------------------------------------------------------- 1 | diff -u -r a/usr/lib/libc.so b/usr/lib/libc.so 2 | --- a/usr/lib64/libc.so 2016-12-30 23:00:08.284951863 +0900 3 | +++ b/usr/lib64/libc.so 2016-12-30 23:00:32.140951815 +0900 4 | @@ -2,4 +2,4 @@ 5 | Use the shared library, but some functions are only in 6 | the static library, so try that secondarily. */ 7 | OUTPUT_FORMAT(elf64-littleaarch64) 8 | -GROUP ( /lib64/libc.so.6 /usr/lib64/libc_nonshared.a AS_NEEDED ( /lib64/ld-linux-aarch64.so.1 ) ) 9 | +GROUP ( libc.so.6 libc_nonshared.a AS_NEEDED ( ld-linux-aarch64.so.1 ) ) 10 | -------------------------------------------------------------------------------- /eng/common/cross/riscv64/tizen/tizen.patch: -------------------------------------------------------------------------------- 1 | diff -u -r a/usr/lib/libc.so b/usr/lib/libc.so 2 | --- a/usr/lib64/libc.so 2016-12-30 23:00:08.284951863 +0900 3 | +++ b/usr/lib64/libc.so 2016-12-30 23:00:32.140951815 +0900 4 | @@ -2,4 +2,4 @@ 5 | Use the shared library, but some functions are only in 6 | the static library, so try that secondarily. */ 7 | OUTPUT_FORMAT(elf64-littleriscv) 8 | -GROUP ( /lib64/libc.so.6 /usr/lib64/libc_nonshared.a AS_NEEDED ( /lib64/ld-linux-riscv64-lp64d.so.1 ) ) 9 | +GROUP ( libc.so.6 libc_nonshared.a AS_NEEDED ( ld-linux-riscv64-lp64d.so.1 ) ) 10 | -------------------------------------------------------------------------------- /src/clickonce/native/projects/NetCoreCheck/CA/MsiLogger.h: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | #pragma once 6 | 7 | #include "MsiWrapper.h" 8 | 9 | class MsiLogger : public Logger 10 | { 11 | public: 12 | void Log(LPCWSTR format, ...) const noexcept; 13 | 14 | MsiLogger(MsiWrapper *msiWrapper) noexcept; 15 | ~MsiLogger(void) noexcept; 16 | 17 | private: 18 | MsiWrapper *m_msiWrapper; 19 | }; 20 | -------------------------------------------------------------------------------- /eng/common/cibuild.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | source="${BASH_SOURCE[0]}" 4 | 5 | # resolve $SOURCE until the file is no longer a symlink 6 | while [[ -h $source ]]; do 7 | scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" 8 | source="$(readlink "$source")" 9 | 10 | # if $source was a relative symlink, we need to resolve it relative to the path where 11 | # the symlink file was located 12 | [[ $source != /* ]] && source="$scriptroot/$source" 13 | done 14 | scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" 15 | 16 | . "$scriptroot/build.sh" --restore --build --test --pack --publish --ci $@ 17 | -------------------------------------------------------------------------------- /src/clickonce/NetCoreCheck/NetCoreCheck-Shipping.pkgproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 10 | 11 | Microsoft.NET.Tools.NETCoreCheck.$(TargetArchitecture) 12 | true 13 | true 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/clickonce/native/projects/NetCoreCheck/EXE/FileLogger.h: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | #pragma once 6 | 7 | #include "NetCoreCheckExe.h" 8 | 9 | class FileLogger : public Logger 10 | { 11 | public: 12 | void Initialize(LPCWSTR logFilePath); 13 | void Log(LPCWSTR pszFormat, ...) const noexcept; 14 | 15 | FileLogger (void) noexcept; 16 | ~FileLogger (void) noexcept; 17 | 18 | private: 19 | FILE *m_file; 20 | }; 21 | -------------------------------------------------------------------------------- /eng/common/sdl/NuGet.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /eng/common/enable-cross-org-publishing.ps1: -------------------------------------------------------------------------------- 1 | param( 2 | [string] $token 3 | ) 4 | 5 | 6 | . $PSScriptRoot\pipeline-logging-functions.ps1 7 | 8 | # Write-PipelineSetVariable will no-op if a variable named $ci is not defined 9 | # Since this script is only ever called in AzDO builds, just universally set it 10 | $ci = $true 11 | 12 | Write-PipelineSetVariable -Name 'VSS_NUGET_ACCESSTOKEN' -Value $token -IsMultiJobVariable $false 13 | Write-PipelineSetVariable -Name 'VSS_NUGET_URI_PREFIXES' -Value 'https://dnceng.pkgs.visualstudio.com/;https://pkgs.dev.azure.com/dnceng/;https://devdiv.pkgs.visualstudio.com/;https://pkgs.dev.azure.com/devdiv/' -IsMultiJobVariable $false 14 | -------------------------------------------------------------------------------- /src/clickonce/NetCoreCheck/NetCoreCheck-NonShipping.pkgproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | 11 | 12 | VS.Redist.Common.NETCoreCheck.$(TargetArchitecture) 13 | false 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/clickonce/native/projects/NetCoreCheck/Logger.h: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | #pragma once 6 | 7 | #include 8 | 9 | class Logger 10 | { 11 | public: 12 | virtual void Log(LPCWSTR pszFormat, ...) const noexcept = 0; 13 | 14 | protected: 15 | void LogStart() 16 | { 17 | Log(L"============= NetCoreCheck Start ==============="); 18 | } 19 | 20 | void LogEnd() 21 | { 22 | Log(L"============= NetCoreCheck End ==============="); 23 | } 24 | }; 25 | -------------------------------------------------------------------------------- /eng/common/core-templates/steps/publish-pipeline-artifacts.yml: -------------------------------------------------------------------------------- 1 | parameters: 2 | - name: is1ESPipeline 3 | type: boolean 4 | default: false 5 | 6 | - name: args 7 | type: object 8 | default: {} 9 | 10 | steps: 11 | - ${{ if ne(parameters.is1ESPipeline, true) }}: 12 | - template: /eng/common/templates/steps/publish-pipeline-artifacts.yml 13 | parameters: 14 | ${{ each parameter in parameters }}: 15 | ${{ parameter.key }}: ${{ parameter.value }} 16 | - ${{ else }}: 17 | - template: /eng/common/templates-official/steps/publish-pipeline-artifacts.yml 18 | parameters: 19 | ${{ each parameter in parameters }}: 20 | ${{ parameter.key }}: ${{ parameter.value }} 21 | -------------------------------------------------------------------------------- /eng/Publishing.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | false 6 | 7 | 8 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /eng/common/msbuild.ps1: -------------------------------------------------------------------------------- 1 | [CmdletBinding(PositionalBinding=$false)] 2 | Param( 3 | [string] $verbosity = 'minimal', 4 | [bool] $warnAsError = $true, 5 | [bool] $nodeReuse = $true, 6 | [switch] $ci, 7 | [switch] $prepareMachine, 8 | [switch] $excludePrereleaseVS, 9 | [string] $msbuildEngine = $null, 10 | [Parameter(ValueFromRemainingArguments=$true)][String[]]$extraArgs 11 | ) 12 | 13 | . $PSScriptRoot\tools.ps1 14 | 15 | try { 16 | if ($ci) { 17 | $nodeReuse = $false 18 | } 19 | 20 | MSBuild @extraArgs 21 | } 22 | catch { 23 | Write-Host $_.ScriptStackTrace 24 | Write-PipelineTelemetryError -Category 'Build' -Message $_ 25 | ExitWithExitCode 1 26 | } 27 | 28 | ExitWithExitCode 0 -------------------------------------------------------------------------------- /src/clickonce/native/projects/exe.cmake: -------------------------------------------------------------------------------- 1 | # Licensed to the .NET Foundation under one or more agreements. 2 | # The .NET Foundation licenses this file to you under the MIT license. 3 | # See the LICENSE file in the project root for more information. 4 | 5 | project (${DOTNET_PROJECT_NAME}) 6 | 7 | cmake_policy(SET CMP0011 NEW) 8 | cmake_policy(SET CMP0083 NEW) 9 | 10 | include(${CMAKE_CURRENT_LIST_DIR}/common.cmake) 11 | 12 | add_executable(${DOTNET_PROJECT_NAME} ${SOURCES} ${RESOURCES}) 13 | 14 | if(NOT CLR_CMAKE_TARGET_WIN32) 15 | disable_pax_mprotect(${DOTNET_PROJECT_NAME}) 16 | endif() 17 | 18 | install_with_stripped_symbols(${DOTNET_PROJECT_NAME} TARGETS native) 19 | 20 | set_common_libs("exe") 21 | -------------------------------------------------------------------------------- /eng/native/generateversionscript.awk: -------------------------------------------------------------------------------- 1 | BEGIN { 2 | print "V1.0 {"; 3 | print " global:"; 4 | } 5 | { 6 | # Remove the CR character in case the sources are mapped from 7 | # a Windows share and contain CRLF line endings 8 | gsub(/\r/,"", $0); 9 | 10 | # Skip empty lines and comment lines starting with semicolon 11 | if (NF && !match($0, /^[ \t]*;/)) 12 | { 13 | # Only prefix the entries that start with "#" 14 | if (match($0, /^#.*/)) 15 | { 16 | gsub(/^#/,"", $0); 17 | print " "prefix $0 ";"; 18 | } 19 | else 20 | { 21 | print " "$0 ";"; 22 | } 23 | } 24 | } 25 | END { 26 | print " local: *;" 27 | print "};"; 28 | } 29 | -------------------------------------------------------------------------------- /src/clickonce/native/projects/lib.cmake: -------------------------------------------------------------------------------- 1 | # Licensed to the .NET Foundation under one or more agreements. 2 | # The .NET Foundation licenses this file to you under the MIT license. 3 | # See the LICENSE file in the project root for more information. 4 | 5 | project(${DOTNET_PROJECT_NAME}) 6 | 7 | include(${CMAKE_CURRENT_LIST_DIR}/common.cmake) 8 | 9 | add_definitions(-D_NO_ASYNCRTIMP) 10 | add_definitions(-D_NO_PPLXIMP) 11 | add_definitions(-DEXPORT_SHARED_API=1) 12 | 13 | add_library(${DOTNET_PROJECT_NAME} SHARED ${SOURCES} ${RESOURCES}) 14 | 15 | set_target_properties(${DOTNET_PROJECT_NAME} PROPERTIES MACOSX_RPATH TRUE) 16 | 17 | install_with_stripped_symbols(${DOTNET_PROJECT_NAME} TARGETS native) 18 | 19 | set_common_libs("lib") 20 | -------------------------------------------------------------------------------- /eng/common/core-templates/post-build/common-variables.yml: -------------------------------------------------------------------------------- 1 | variables: 2 | - group: Publish-Build-Assets 3 | 4 | # Whether the build is internal or not 5 | - name: IsInternalBuild 6 | value: ${{ and(ne(variables['System.TeamProject'], 'public'), contains(variables['Build.SourceBranch'], 'internal')) }} 7 | 8 | # Default Maestro++ API Endpoint and API Version 9 | - name: MaestroApiEndPoint 10 | value: "https://maestro.dot.net" 11 | - name: MaestroApiVersion 12 | value: "2020-02-20" 13 | 14 | - name: SourceLinkCLIVersion 15 | value: 3.0.0 16 | - name: SymbolToolVersion 17 | value: 1.0.1 18 | - name: BinlogToolVersion 19 | value: 1.0.11 20 | 21 | - name: runCodesignValidationInjection 22 | value: false 23 | -------------------------------------------------------------------------------- /eng/Version.Details.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | https://github.com/dotnet/dotnet 6 | f2d1a92c2429848e41e78af560381a597f933090 7 | 8 | 9 | 10 | 11 | https://github.com/dotnet/dotnet 12 | f2d1a92c2429848e41e78af560381a597f933090 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/clickonce/native/projects/lib_static.cmake: -------------------------------------------------------------------------------- 1 | # Licensed to the .NET Foundation under one or more agreements. 2 | # The .NET Foundation licenses this file to you under the MIT license. 3 | # See the LICENSE file in the project root for more information. 4 | 5 | project(lib${DOTNET_PROJECT_NAME}) 6 | 7 | include(${CMAKE_CURRENT_LIST_DIR}/common.cmake) 8 | 9 | add_definitions(-D_NO_ASYNCRTIMP) 10 | add_definitions(-D_NO_PPLXIMP) 11 | add_definitions(-DEXPORT_SHARED_API=1) 12 | 13 | add_library(lib${DOTNET_PROJECT_NAME} STATIC ${SOURCES} ${RESOURCES}) 14 | 15 | set_target_properties(lib${DOTNET_PROJECT_NAME} PROPERTIES MACOSX_RPATH TRUE) 16 | set_target_properties(lib${DOTNET_PROJECT_NAME} PROPERTIES PREFIX "") 17 | 18 | set_common_libs("lib-static") 19 | -------------------------------------------------------------------------------- /eng/common/core-templates/steps/component-governance.yml: -------------------------------------------------------------------------------- 1 | parameters: 2 | disableComponentGovernance: false 3 | componentGovernanceIgnoreDirectories: '' 4 | is1ESPipeline: false 5 | displayName: 'Component Detection' 6 | 7 | steps: 8 | - ${{ if eq(parameters.disableComponentGovernance, 'true') }}: 9 | - script: echo "##vso[task.setvariable variable=skipComponentGovernanceDetection]true" 10 | displayName: Set skipComponentGovernanceDetection variable 11 | - ${{ if ne(parameters.disableComponentGovernance, 'true') }}: 12 | - task: ComponentGovernanceComponentDetection@0 13 | continueOnError: true 14 | displayName: ${{ parameters.displayName }} 15 | inputs: 16 | ignoreDirectories: ${{ parameters.componentGovernanceIgnoreDirectories }} 17 | -------------------------------------------------------------------------------- /eng/SignCheckExclusionsFile.txt: -------------------------------------------------------------------------------- 1 | ;; Exclusions for SignCheck. Corresponds to info in Signing.props. 2 | ;; Format: https://github.com/dotnet/arcade/blob/397316e195639450b6c76bfeb9823b40bee72d6d/src/SignCheck/Microsoft.SignCheck/Verification/Exclusion.cs#L23-L35 3 | ;; 4 | ;; This issue tracks a way to implement exclusions via Signing.props and avoid this extra file: https://github.com/dotnet/arcade/issues/2888 5 | 6 | ;; Examples: 7 | ;; *apphost.exe;;Template, https://github.com/dotnet/core-setup/pull/7549 8 | ;; *apphosttemplateapphostexe.exe;;Template, https://github.com/dotnet/core-setup/pull/7549 9 | *launcher.exe;;Template 10 | *MessagePack.dll;;Non-Microsoft binary 11 | *MessagePack.Annotations.dll;;Non-Microsoft binary 12 | *Nerdbank.Streams.dll;;Non-Microsoft binary 13 | -------------------------------------------------------------------------------- /src/DotNetRuntimeValidation/DotNetRuntimeValidation.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | $(NetCurrent) 6 | win-x64;win-x86;win-arm64 7 | true 8 | true 9 | false 10 | true 11 | embedded 12 | true 13 | enable 14 | enable 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /eng/common/core-templates/steps/publish-build-artifacts.yml: -------------------------------------------------------------------------------- 1 | parameters: 2 | - name: is1ESPipeline 3 | type: boolean 4 | default: false 5 | - name: args 6 | type: object 7 | default: {} 8 | steps: 9 | - ${{ if ne(parameters.is1ESPipeline, true) }}: 10 | - template: /eng/common/templates/steps/publish-build-artifacts.yml 11 | parameters: 12 | is1ESPipeline: ${{ parameters.is1ESPipeline }} 13 | ${{ each parameter in parameters.args }}: 14 | ${{ parameter.key }}: ${{ parameter.value }} 15 | - ${{ else }}: 16 | - template: /eng/common/templates-official/steps/publish-build-artifacts.yml 17 | parameters: 18 | is1ESPipeline: ${{ parameters.is1ESPipeline }} 19 | ${{ each parameter in parameters.args }}: 20 | ${{ parameter.key }}: ${{ parameter.value }} -------------------------------------------------------------------------------- /NuGet.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /eng/Version.Details.props: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10.0.0-beta.25601.102 10 | 17.10.46 11 | 12 | 13 | 14 | 15 | $(MicrosoftDotNetArcadeSdkPackageVersion) 16 | 17 | 18 | -------------------------------------------------------------------------------- /THIRD-PARTY-NOTICES.TXT: -------------------------------------------------------------------------------- 1 | .NET Core uses third-party libraries or other resources that may be 2 | distributed under licenses different than the .NET Core software. 3 | 4 | Attributions and license notices for test cases originally authored by 5 | third parties can be found in the respective test directories. 6 | 7 | In the event that we accidentally failed to list a required notice, please 8 | bring it to our attention. Post an issue or email us: 9 | 10 | dotnet@microsoft.com 11 | 12 | The attached notices are provided for information only. 13 | 14 | License notice for Project Name 15 | ------------------------------- 16 | 17 | Prefered: Include a web link to the project license 18 | 19 | Required: Include full license for project/component. 20 | Preferred: Re-format license to ~78 characters to make readable. 21 | -------------------------------------------------------------------------------- /eng/Versions.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 10.0.0 6 | 7 | 10 8 | 0 9 | 0 10 | preview 11 | 1 12 | 13 | false 14 | release 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/clickonce/native/projects/NetCoreCheck/CA/MsiLogger.cpp: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | #include "MsiLogger.h" 6 | 7 | MsiLogger::MsiLogger(MsiWrapper *msiWrapper) noexcept : m_msiWrapper(msiWrapper) 8 | { 9 | LogStart(); 10 | } 11 | 12 | MsiLogger::~MsiLogger(void) noexcept 13 | { 14 | LogEnd(); 15 | } 16 | 17 | void MsiLogger::Log(LPCWSTR format, ...) const noexcept 18 | { 19 | WCHAR buffer[LOG_BUFFER]; 20 | 21 | va_list args; 22 | va_start(args, format); 23 | StringCchVPrintfW(buffer, _countof(buffer), format, args); 24 | va_end(args); 25 | 26 | if (m_msiWrapper) 27 | { 28 | m_msiWrapper->Log(buffer); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /eng/common/post-build/nuget-validation.ps1: -------------------------------------------------------------------------------- 1 | # This script validates NuGet package metadata information using this 2 | # tool: https://github.com/NuGet/NuGetGallery/tree/jver-verify/src/VerifyMicrosoftPackage 3 | 4 | param( 5 | [Parameter(Mandatory=$true)][string] $PackagesPath # Path to where the packages to be validated are 6 | ) 7 | 8 | # `tools.ps1` checks $ci to perform some actions. Since the post-build 9 | # scripts don't necessarily execute in the same agent that run the 10 | # build.ps1/sh script this variable isn't automatically set. 11 | $ci = $true 12 | $disableConfigureToolsetImport = $true 13 | . $PSScriptRoot\..\tools.ps1 14 | 15 | try { 16 | & $PSScriptRoot\nuget-verification.ps1 ${PackagesPath}\*.nupkg 17 | } 18 | catch { 19 | Write-Host $_.ScriptStackTrace 20 | Write-PipelineTelemetryError -Category 'NuGetValidation' -Message $_ 21 | ExitWithExitCode 1 22 | } 23 | -------------------------------------------------------------------------------- /eng/native/genmoduleindex.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # Generate module index header 4 | # 5 | set -euo pipefail 6 | 7 | if [[ "$#" -lt 2 ]]; then 8 | echo "Usage: genmoduleindex.sh ModuleBinaryFile IndexHeaderFile" 9 | exit 1 10 | fi 11 | 12 | OSName=$(uname -s) 13 | 14 | case "$OSName" in 15 | Darwin) 16 | # Extract the build id and prefix it with its length in bytes 17 | dwarfdump -u $1 | 18 | awk '/UUID:/ { gsub(/\-/,"", $2); printf("%02x", length($2)/2); print $2}' | 19 | # Convert each byte of the id to 0x prefixed constant followed by comma 20 | sed -E s/\(\.\.\)/0x\\1,\ /g > $2 21 | ;; 22 | *) 23 | # Extract the build id and prefix it with its length in bytes 24 | readelf -n $1 | 25 | awk '/Build ID:/ { printf("%02x", length($3)/2); print $3 }' | 26 | # Convert each byte of the id to 0x prefixed constant followed by comma 27 | sed -E s/\(\.\.\)/0x\\1,\ /g > $2 28 | ;; 29 | esac 30 | -------------------------------------------------------------------------------- /eng/common/dotnet-install.ps1: -------------------------------------------------------------------------------- 1 | [CmdletBinding(PositionalBinding=$false)] 2 | Param( 3 | [string] $verbosity = 'minimal', 4 | [string] $architecture = '', 5 | [string] $version = 'Latest', 6 | [string] $runtime = 'dotnet', 7 | [string] $RuntimeSourceFeed = '', 8 | [string] $RuntimeSourceFeedKey = '' 9 | ) 10 | 11 | . $PSScriptRoot\tools.ps1 12 | 13 | $dotnetRoot = Join-Path $RepoRoot '.dotnet' 14 | 15 | $installdir = $dotnetRoot 16 | try { 17 | if ($architecture -and $architecture.Trim() -eq 'x86') { 18 | $installdir = Join-Path $installdir 'x86' 19 | } 20 | InstallDotNet $installdir $version $architecture $runtime $true -RuntimeSourceFeed $RuntimeSourceFeed -RuntimeSourceFeedKey $RuntimeSourceFeedKey 21 | } 22 | catch { 23 | Write-Host $_.ScriptStackTrace 24 | Write-PipelineTelemetryError -Category 'InitializeToolset' -Message $_ 25 | ExitWithExitCode 1 26 | } 27 | 28 | ExitWithExitCode 0 29 | -------------------------------------------------------------------------------- /eng/common/dotnet.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # This script is used to install the .NET SDK. 4 | # It will also invoke the SDK with any provided arguments. 5 | 6 | source="${BASH_SOURCE[0]}" 7 | # resolve $SOURCE until the file is no longer a symlink 8 | while [[ -h $source ]]; do 9 | scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" 10 | source="$(readlink "$source")" 11 | 12 | # if $source was a relative symlink, we need to resolve it relative to the path where the 13 | # symlink file was located 14 | [[ $source != /* ]] && source="$scriptroot/$source" 15 | done 16 | scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" 17 | 18 | source $scriptroot/tools.sh 19 | InitializeDotNetCli true # install 20 | 21 | # Invoke acquired SDK with args if they are provided 22 | if [[ $# > 0 ]]; then 23 | __dotnetDir=${_InitializeDotNetCli} 24 | dotnetPath=${__dotnetDir}/dotnet 25 | ${dotnetPath} "$@" 26 | fi 27 | -------------------------------------------------------------------------------- /src/clickonce/native/projects/NetCoreCheck/CA/MsiWrapper.h: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | #pragma once 6 | 7 | #include "NetCoreCheckCA.h" 8 | 9 | #define LOG_BUFFER 2048 10 | #define FreeStr(s) if (s) { delete[] s; } 11 | 12 | class MsiWrapper 13 | { 14 | public: 15 | void Log(LPCWSTR msg) const noexcept; 16 | void LogFailure(HRESULT hr, LPCWSTR format, ...) const noexcept; 17 | 18 | // Caller is responsible for freeing propertyValue 19 | HRESULT GetProperty(LPCWSTR propertyName, LPWSTR* propertyValue); 20 | 21 | HRESULT SetProperty(LPCWSTR propertyName, LPCWSTR propertyValue); 22 | 23 | MsiWrapper(MSIHANDLE msiHandle) noexcept; 24 | ~MsiWrapper(void) noexcept; 25 | 26 | private: 27 | MSIHANDLE m_msiHandle; 28 | }; 29 | -------------------------------------------------------------------------------- /eng/native/genmoduleindex.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | REM Generate module index header 3 | 4 | if [%1]==[] goto :Usage 5 | if [%2]==[] goto :Usage 6 | 7 | setlocal 8 | for /f "tokens=1" %%i in ('dumpbin /HEADERS %1 ^| findstr /c:"size of image"') do set imagesize=%%i 9 | REM Pad the extracted size to 8 hex digits 10 | set imagesize=00000000%imagesize% 11 | set imagesize=%imagesize:~-8% 12 | 13 | for /f "tokens=1" %%i in ('dumpbin /HEADERS %1 ^| findstr /c:"time date"') do set timestamp=%%i 14 | REM Pad the extracted time stamp to 8 hex digits 15 | set timestamp=00000000%timestamp% 16 | set timestamp=%timestamp:~-8% 17 | 18 | echo 0x08, 0x%timestamp:~6,2%, 0x%timestamp:~4,2%, 0x%timestamp:~2,2%, 0x%timestamp:~0,2%, 0x%imagesize:~6,2%, 0x%imagesize:~4,2%, 0x%imagesize:~2,2%, 0x%imagesize:~0,2%, > %2 19 | 20 | endlocal 21 | exit /b 0 22 | 23 | :Usage 24 | echo Usage: genmoduleindex.cmd ModuleBinaryFile IndexHeaderFile 25 | exit /b 1 26 | -------------------------------------------------------------------------------- /src/clickonce/native/projects/version_compatibility_range.h: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | #ifndef __VERSION_COMPATIBILITY_RANGE_H_ 6 | #define __VERSION_COMPATIBILITY_RANGE_H_ 7 | 8 | // Defines teh allowed range of versions to consider during roll-forward search 9 | enum class version_compatibility_range_t 10 | { 11 | exact = 0, // Only the specified version is allowed 12 | patch = 1, // Any equal or higher version with the same major.minor 13 | minor = 2, // Any equal or higher version with the same major 14 | major = 3, // Any equal or higher version 15 | 16 | __last // Sentinel value 17 | }; 18 | 19 | pal::string_t version_compatibility_range_to_string(version_compatibility_range_t value); 20 | 21 | #endif // __VERSION_COMPATIBILITY_RANGE_H_ 22 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: true 2 | contact_links: 3 | - name: Issue with ClickOnce in Visual Studio environment 4 | url: https://docs.microsoft.com/en-us/visualstudio/ide/how-to-report-a-problem-with-visual-studio 5 | about: Please open issues relating to ClickOnce in Visual Studio by following the steps. 6 | - name: Issue with .NET runtime or core .NET libraries 7 | url: https://github.com/dotnet/runtime/issues/new/choose 8 | about: Please open issues relating to the .NET runtime or core .NET libraries in dotnet/runtime. 9 | - name: Issue with .NET SDK 10 | url: https://github.com/dotnet/sdk/issues/new/choose 11 | about: Please open issues relating to the .NET SDK itself in dotnet/sdk. 12 | - name: Issue with other .NET components 13 | url: https://github.com/dotnet/core/blob/master/Documentation/core-repos.md 14 | about: Having issues with other .NET components? Please find the correct location where to open an issue. 15 | -------------------------------------------------------------------------------- /src/clickonce/native/projects/roll_fwd_on_no_candidate_fx_option.h: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | #ifndef __ROLL_FWD_ON_NO_CANDIDATE_FX_OPTION_H_ 6 | #define __ROLL_FWD_ON_NO_CANDIDATE_FX_OPTION_H_ 7 | 8 | // Specifies the roll forward capability for finding the closest (most compatible) framework 9 | // Note that the "applyPatches" bool option is separate from this and occurs after roll forward. 10 | enum class roll_fwd_on_no_candidate_fx_option 11 | { 12 | disabled = 0, 13 | minor, // also inludes patch 14 | major // also inludes minor and patch 15 | }; 16 | 17 | enum class roll_forward_option; 18 | roll_forward_option roll_fwd_on_no_candidate_fx_to_roll_forward(roll_fwd_on_no_candidate_fx_option roll_fwd_on_no_candidate_fx); 19 | 20 | #endif // __ROLL_FWD_ON_NO_CANDIDATE_FX_OPTION_H_ 21 | -------------------------------------------------------------------------------- /src/clickonce/native/projects/version_compatibility_range.cpp: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | #include "pal.h" 6 | #include "version_compatibility_range.h" 7 | 8 | namespace 9 | { 10 | const pal::char_t* OptionNameMapping[] = 11 | { 12 | _X("exact"), 13 | _X("patch"), 14 | _X("minor"), 15 | _X("major") 16 | }; 17 | 18 | static_assert((sizeof(OptionNameMapping) / sizeof(*OptionNameMapping)) == static_cast(version_compatibility_range_t::__last), "Invalid option count"); 19 | } 20 | 21 | pal::string_t version_compatibility_range_to_string(version_compatibility_range_t value) 22 | { 23 | int idx = static_cast(value); 24 | assert(0 <= idx && idx < static_cast(version_compatibility_range_t::__last)); 25 | 26 | return OptionNameMapping[idx]; 27 | } 28 | -------------------------------------------------------------------------------- /eng/native/sanitizer-ignorelist.txt: -------------------------------------------------------------------------------- 1 | # This file has exclusions to the Clang address sanitizer to suppress error reports 2 | # When Clang 3.8 is available, convert these to suppression list instead as that is preferred for internal code 3 | 4 | # CMiniMdBase::UsesAllocatedMemory - suppress stack-buffer-underflow (code backs up pointer by -1 to check allocation ownership) 5 | fun:_ZN11CMiniMdBase19UsesAllocatedMemoryEP11CMiniColDef 6 | 7 | # JIT_InitPInvokeFrame - suppress unknown sanitizer issue causing SEGV on unknown address 0x000000000000 8 | # 0 0x4e8a0c in __ubsan::checkDynamicType(void*, void*, unsigned long) 9 | # 1 0x4e807f in HandleDynamicTypeCacheMiss(__ubsan::DynamicTypeCacheMissData*, unsigned long, unsigned long, __ubsan::ReportOptions) 10 | # 2 0x4e8051 in __ubsan_handle_dynamic_type_cache_miss 11 | # 3 0x7f02ce676cd8 in JIT_InitPInvokeFrame(InlinedCallFrame*, void*) /home/steveharter/git/dotnet_coreclr/src/vm/jithelpers.cpp:6491:9 12 | # 4 0x7f0252bbceb2 () 13 | fun:_Z20JIT_InitPInvokeFrameP16InlinedCallFramePv 14 | 15 | -------------------------------------------------------------------------------- /eng/common/helixpublish.proj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | msbuild 6 | 7 | 8 | 9 | 10 | %(Identity) 11 | 12 | 13 | 14 | 15 | 16 | $(WorkItemDirectory) 17 | $(WorkItemCommand) 18 | $(WorkItemTimeout) 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /src/clickonce/native/projects/NetCoreCheck/CA/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the .NET Foundation under one or more agreements. 2 | # The .NET Foundation licenses this file to you under the MIT license. 3 | # See the LICENSE file in the project root for more information. 4 | 5 | project(NETCoreCheckCA) 6 | set(DOTNET_PROJECT_NAME "NETCoreCheckCA") 7 | 8 | set(CMAKE_CONFIGURATION_TYPES "Debug;Release" 9 | CACHE STRING "Configuration types" FORCE) 10 | 11 | set(SOURCES 12 | ./MsiLogger.cpp 13 | ./MsiWrapper.cpp 14 | ./NETCoreCheckCA.cpp 15 | ./NetCoreCheckCA.def 16 | ./../NetCoreCheck.cpp 17 | ./../TempRuntimeConfigFile.cpp 18 | ) 19 | 20 | link_directories(${APP_HOST_LIB_DIR}) 21 | 22 | include(../../lib.cmake) 23 | 24 | add_definitions(-DUNICODE) 25 | add_definitions(-D_UNICODE) 26 | add_definitions(-DFEATURE_APPHOST=1) 27 | add_definitions(-DNETHOST_USE_AS_STATIC) 28 | remove_definitions(-D_DEBUG) 29 | 30 | target_link_libraries(NETCoreCheckCA 31 | libnethost.lib 32 | shlwapi.lib 33 | msi.lib 34 | Version.lib 35 | ) 36 | -------------------------------------------------------------------------------- /eng/common/core-templates/steps/cleanup-microbuild.yml: -------------------------------------------------------------------------------- 1 | parameters: 2 | # Enable cleanup tasks for MicroBuild 3 | enableMicrobuild: false 4 | # Enable cleanup tasks for MicroBuild on Mac and Linux 5 | # Will be ignored if 'enableMicrobuild' is false or 'Agent.Os' is 'Windows_NT' 6 | enableMicrobuildForMacAndLinux: false 7 | continueOnError: false 8 | 9 | steps: 10 | - ${{ if eq(parameters.enableMicrobuild, 'true') }}: 11 | - task: MicroBuildCleanup@1 12 | displayName: Execute Microbuild cleanup tasks 13 | condition: and( 14 | always(), 15 | or( 16 | and( 17 | eq(variables['Agent.Os'], 'Windows_NT'), 18 | in(variables['_SignType'], 'real', 'test') 19 | ), 20 | and( 21 | ${{ eq(parameters.enableMicrobuildForMacAndLinux, true) }}, 22 | ne(variables['Agent.Os'], 'Windows_NT'), 23 | eq(variables['_SignType'], 'real') 24 | ) 25 | )) 26 | continueOnError: ${{ parameters.continueOnError }} 27 | env: 28 | TeamName: $(_TeamName) 29 | -------------------------------------------------------------------------------- /src/clickonce/launcher/Launcher.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | true 5 | true 6 | false 7 | VS.Redist.Common.NetCore.Launcher 8 | true 9 | 13 | true 14 | 15 | 16 | 17 | net45 18 | Launcher 19 | WinExe 20 | true 21 | false 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | ## Supported Versions 4 | 5 | The .NET Core and ASP.NET Core support policy, including supported versions can be found at the [.NET Core Support Policy Page](https://dotnet.microsoft.com/platform/support/policy/dotnet-core). 6 | 7 | ## Reporting a Vulnerability 8 | 9 | Security issues and bugs should be reported privately to the Microsoft Security Response Center (MSRC), either by emailing secure@microsoft.com or via the portal at https://msrc.microsoft.com. 10 | You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your 11 | original message. Further information, including the MSRC PGP key, can be found in the [MSRC Report an Issue FAQ](https://www.microsoft.com/en-us/msrc/faqs-report-an-issue). 12 | 13 | Reports via MSRC may qualify for the .NET Core Bug Bounty. Details of the .NET Core Bug Bounty including terms and conditions are at [https://aka.ms/corebounty](https://aka.ms/corebounty). 14 | 15 | Please do not open issues for anything you think might have a security implication. 16 | -------------------------------------------------------------------------------- /src/clickonce/launcher/LauncherException.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | using System; 5 | 6 | namespace Microsoft.Deployment.Launcher 7 | { 8 | [Serializable] 9 | public class LauncherException : Exception 10 | { 11 | public LauncherException() 12 | { 13 | } 14 | 15 | public LauncherException(string message) 16 | : base(message) 17 | { 18 | } 19 | 20 | public LauncherException(string format, params object[] args) 21 | : base(string.Format(format, args)) 22 | { 23 | } 24 | 25 | public LauncherException(string message, Exception inner) 26 | : base(message, inner) 27 | { 28 | } 29 | 30 | protected LauncherException(System.Runtime.Serialization.SerializationInfo serializationInfo, System.Runtime.Serialization.StreamingContext streamingContext) 31 | { 32 | throw new NotImplementedException(); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /eng/common/templates-official/steps/publish-pipeline-artifacts.yml: -------------------------------------------------------------------------------- 1 | parameters: 2 | - name: is1ESPipeline 3 | type: boolean 4 | default: true 5 | 6 | - name: args 7 | type: object 8 | default: {} 9 | 10 | steps: 11 | - ${{ if ne(parameters.is1ESPipeline, true) }}: 12 | - 'eng/common/templates-official cannot be referenced from a non-1ES managed template': error 13 | - task: 1ES.PublishPipelineArtifact@1 14 | displayName: ${{ coalesce(parameters.args.displayName, 'Publish to Build Artifact') }} 15 | ${{ if parameters.args.condition }}: 16 | condition: ${{ parameters.args.condition }} 17 | ${{ else }}: 18 | condition: succeeded() 19 | ${{ if parameters.args.continueOnError }}: 20 | continueOnError: ${{ parameters.args.continueOnError }} 21 | inputs: 22 | targetPath: ${{ parameters.args.targetPath }} 23 | ${{ if parameters.args.artifactName }}: 24 | artifactName: ${{ parameters.args.artifactName }} 25 | ${{ if parameters.args.properties }}: 26 | properties: ${{ parameters.args.properties }} 27 | ${{ if parameters.args.sbomEnabled }}: 28 | sbomEnabled: ${{ parameters.args.sbomEnabled }} 29 | -------------------------------------------------------------------------------- /src/DotNetRuntimeValidation/Directory.Build.targets: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | $(ArtifactsBinDir)DotNetRuntimeValidation\$(TargetArchitecture)\temp\zipcontents 7 | $(ArtifactsAssetsDir)DotNetRuntimeValidation-$(VersionPrefix)-$(VersionSuffix)-win-$(TargetArchitecture).zip 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 19 | 20 | 22 | 23 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /src/Microsoft.Deployment.DotNet.Releases/src/ReleaseType.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | namespace Microsoft.Deployment.DotNet.Releases 5 | { 6 | /// 7 | /// An enumeration describing different releases types based on their support duration. 8 | /// See the support lifecycle 9 | /// documentation for further details. 10 | /// 11 | public enum ReleaseType 12 | { 13 | /// 14 | /// Indicates a release is supported for the Long Term Support (LTS) timeframe (3 years). 15 | /// 16 | LTS, 17 | 18 | /// 19 | /// Indicates a release is supported for the Standard Term Support (STS) timeframe (18 months). 20 | /// 21 | STS, 22 | 23 | /// 24 | /// The release type is unknown and could not be parsed. 25 | /// 26 | Unknown = 99 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /.github/policies/untriaged.yml: -------------------------------------------------------------------------------- 1 | id: untriaged 2 | name: "Manage the 'untriaged' label for issues" 3 | resource: repository 4 | 5 | configuration: 6 | resourceManagementConfiguration: 7 | eventResponderTasks: 8 | - description: "Add untriaged label to new/reopened issues without a milestone or assignee" 9 | if: 10 | - payloadType: Issues 11 | - isOpen 12 | - not: 13 | isPartOfAnyMilestone 14 | - not: 15 | isAssignedToSomeone 16 | - not: 17 | hasLabel: 18 | label: untriaged 19 | - or: 20 | - isAction: 21 | action: Opened 22 | - isAction: 23 | action: Reopened 24 | 25 | then: 26 | - addLabel: 27 | label: untriaged 28 | 29 | - description: "Remove untriaged label from issues when closed, added to a milestone, or assigned" 30 | if: 31 | - payloadType: Issues 32 | - or: 33 | - isAction: 34 | action: Closed 35 | - isPartOfAnyMilestone 36 | - isAssignedToSomeone 37 | - hasLabel: 38 | label: untriaged 39 | then: 40 | - removeLabel: 41 | label: untriaged 42 | -------------------------------------------------------------------------------- /src/Microsoft.Deployment.DotNet.Releases/src/WindowsDesktopReleaseComponent.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using System.Text.Json; 5 | 6 | namespace Microsoft.Deployment.DotNet.Releases 7 | { 8 | /// 9 | /// Represents a Windows Desktop runtime release. 10 | /// 11 | public class WindowsDesktopReleaseComponent : ReleaseComponent 12 | { 13 | /// 14 | /// The friendly display name for the component. 15 | /// 16 | public override string Name => ReleasesResources.WindowsDesktopReleaseName; 17 | 18 | /// 19 | /// Creates a new instance. 20 | /// 21 | /// The JSON element of the component. 22 | /// The release to which the component belongs. 23 | internal WindowsDesktopReleaseComponent(JsonElement element, ProductRelease release) : base(element, release) 24 | { 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /LICENSE.TXT: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) .NET Foundation and Contributors 4 | 5 | All rights reserved. 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | -------------------------------------------------------------------------------- /src/clickonce/native/projects/NetCoreCheck/EXE/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the .NET Foundation under one or more agreements. 2 | # The .NET Foundation licenses this file to you under the MIT license. 3 | # See the LICENSE file in the project root for more information. 4 | 5 | project(NetCoreCheck) 6 | set(DOTNET_PROJECT_NAME "NetCoreCheck") 7 | 8 | set(CMAKE_CONFIGURATION_TYPES "Debug;Release" 9 | CACHE STRING "Configuration types" FORCE) 10 | 11 | set(SOURCES 12 | ./FileLogger.cpp 13 | ./NetCoreCheckExe.cpp 14 | ./../NetCoreCheck.cpp 15 | ./../TempRuntimeConfigFile.cpp 16 | ) 17 | 18 | link_directories(${APP_HOST_LIB_DIR}) 19 | 20 | include(../../exe.cmake) 21 | 22 | add_definitions(-DUNICODE) 23 | add_definitions(-D_UNICODE) 24 | add_definitions(-DFEATURE_APPHOST=1) 25 | add_definitions(-DNETHOST_USE_AS_STATIC) 26 | remove_definitions(-D_DEBUG) 27 | 28 | target_link_libraries(NetCoreCheck 29 | shlwapi.lib 30 | libnethost.lib 31 | ) 32 | 33 | # Disable manifest generation into the file .exe on Windows 34 | if(CLR_CMAKE_TARGET_WIN32) 35 | set_property(TARGET ${PROJECT_NAME} PROPERTY 36 | LINK_FLAGS "/MANIFEST:NO" 37 | ) 38 | endif() 39 | 40 | -------------------------------------------------------------------------------- /src/clickonce/native/projects/setup.cmake: -------------------------------------------------------------------------------- 1 | # Licensed to the .NET Foundation under one or more agreements. 2 | # The .NET Foundation licenses this file to you under the MIT license. 3 | # See the LICENSE file in the project root for more information. 4 | 5 | if (CLI_CMAKE_PORTABLE_BUILD) 6 | add_definitions(-DFEATURE_PORTABLE_BUILD=1) 7 | endif () 8 | 9 | if("${CLI_CMAKE_NATIVE_VER}" STREQUAL "") 10 | message(FATAL_ERROR "Native version is not specified") 11 | else() 12 | add_definitions(-DNATIVE_PKG_VER="${CLI_CMAKE_NATIVE_VER}") 13 | endif() 14 | 15 | if("${CLI_CMAKE_PKG_RID}" STREQUAL "") 16 | message(FATAL_ERROR "A minimum supported package rid is not specified (ex: win7-x86 or ubuntu.14.04-x64, osx.10.12-x64, rhel.7-x64)") 17 | else() 18 | add_definitions(-DHOST_POLICY_PKG_NAME="runtime.${CLI_CMAKE_PKG_RID}.Microsoft.NETCore.DotNetHostPolicy") 19 | add_definitions(-DHOST_POLICY_PKG_REL_DIR="runtimes/${CLI_CMAKE_PKG_RID}/native") 20 | endif() 21 | 22 | if("${CLI_CMAKE_COMMIT_HASH}" STREQUAL "") 23 | message(FATAL_ERROR "Commit hash needs to be specified to build the host") 24 | else() 25 | add_definitions(-DREPO_COMMIT_HASH="${CLI_CMAKE_COMMIT_HASH}") 26 | endif() 27 | 28 | -------------------------------------------------------------------------------- /eng/common/core-templates/steps/enable-internal-runtimes.yml: -------------------------------------------------------------------------------- 1 | # Obtains internal runtime download credentials and populates the 'dotnetbuilds-internal-container-read-token-base64' 2 | # variable with the base64-encoded SAS token, by default 3 | 4 | parameters: 5 | - name: federatedServiceConnection 6 | type: string 7 | default: 'dotnetbuilds-internal-read' 8 | - name: outputVariableName 9 | type: string 10 | default: 'dotnetbuilds-internal-container-read-token-base64' 11 | - name: expiryInHours 12 | type: number 13 | default: 1 14 | - name: base64Encode 15 | type: boolean 16 | default: true 17 | - name: is1ESPipeline 18 | type: boolean 19 | default: false 20 | 21 | steps: 22 | - ${{ if ne(variables['System.TeamProject'], 'public') }}: 23 | - template: /eng/common/core-templates/steps/get-delegation-sas.yml 24 | parameters: 25 | federatedServiceConnection: ${{ parameters.federatedServiceConnection }} 26 | outputVariableName: ${{ parameters.outputVariableName }} 27 | expiryInHours: ${{ parameters.expiryInHours }} 28 | base64Encode: ${{ parameters.base64Encode }} 29 | storageAccount: dotnetbuilds 30 | container: internal 31 | permissions: rl 32 | is1ESPipeline: ${{ parameters.is1ESPipeline }} -------------------------------------------------------------------------------- /azure-pipelines-PR.yml: -------------------------------------------------------------------------------- 1 | trigger: 2 | batch: true 3 | branches: 4 | include: 5 | - main 6 | - release/* 7 | 8 | pr: 9 | - main 10 | - release/* 11 | 12 | 13 | name: $(Date:yyyyMMdd)$(Rev:.r) 14 | 15 | variables: 16 | - name: TeamName 17 | value: dotnet-core-acquisition 18 | - name: _SignType 19 | value: test 20 | 21 | stages: 22 | - stage: Build 23 | jobs: 24 | # -------- Build Windows legs -------- 25 | # Windows x64 26 | - template: /eng/jobs/windows-build-PR.yml 27 | parameters: 28 | name: win_x64 29 | displayName: win-x64 30 | targetArchitecture: x64 31 | codeql: true 32 | 33 | # Windows x86 34 | - template: /eng/jobs/windows-build-PR.yml 35 | parameters: 36 | name: win_x86 37 | displayName: win-x86 38 | targetArchitecture: x86 39 | 40 | # Windows arm64 41 | - template: /eng/jobs/windows-build-PR.yml 42 | parameters: 43 | name: win_arm64 44 | displayName: win-arm64 45 | targetArchitecture: arm64 46 | 47 | # Source-build 48 | - template: /eng/common/templates/jobs/source-build.yml 49 | parameters: 50 | platform: 51 | name: 'Managed' 52 | container: 'mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream9' 53 | -------------------------------------------------------------------------------- /eng/common/generate-sbom-prep.ps1: -------------------------------------------------------------------------------- 1 | Param( 2 | [Parameter(Mandatory=$true)][string] $ManifestDirPath # Manifest directory where sbom will be placed 3 | ) 4 | 5 | . $PSScriptRoot\pipeline-logging-functions.ps1 6 | 7 | # Normally - we'd listen to the manifest path given, but 1ES templates will overwrite if this level gets uploaded directly 8 | # with their own overwriting ours. So we create it as a sub directory of the requested manifest path. 9 | $ArtifactName = "${env:SYSTEM_STAGENAME}_${env:AGENT_JOBNAME}_SBOM" 10 | $SafeArtifactName = $ArtifactName -replace '["/:<>\\|?@*"() ]', '_' 11 | $SbomGenerationDir = Join-Path $ManifestDirPath $SafeArtifactName 12 | 13 | Write-Host "Artifact name before : $ArtifactName" 14 | Write-Host "Artifact name after : $SafeArtifactName" 15 | 16 | Write-Host "Creating dir $ManifestDirPath" 17 | 18 | # create directory for sbom manifest to be placed 19 | if (!(Test-Path -path $SbomGenerationDir)) 20 | { 21 | New-Item -ItemType Directory -path $SbomGenerationDir 22 | Write-Host "Successfully created directory $SbomGenerationDir" 23 | } 24 | else{ 25 | Write-PipelineTelemetryError -category 'Build' "Unable to create sbom folder." 26 | } 27 | 28 | Write-Host "Updating artifact name" 29 | Write-Host "##vso[task.setvariable variable=ARTIFACT_NAME]$SafeArtifactName" 30 | -------------------------------------------------------------------------------- /src/clickonce/Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | $(TargetRid).$(Configuration) 8 | $(ArtifactsBinDir)$(OSPlatformConfig)\ 9 | $(ArtifactsObjDir)$(OSPlatformConfig)\ 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /eng/common/core-templates/steps/retain-build.yml: -------------------------------------------------------------------------------- 1 | parameters: 2 | # Optional azure devops PAT with build execute permissions for the build's organization, 3 | # only needed if the build that should be retained ran on a different organization than 4 | # the pipeline where this template is executing from 5 | Token: '' 6 | # Optional BuildId to retain, defaults to the current running build 7 | BuildId: '' 8 | # Azure devops Organization URI for the build in the https://dev.azure.com/ format. 9 | # Defaults to the organization the current pipeline is running on 10 | AzdoOrgUri: '$(System.CollectionUri)' 11 | # Azure devops project for the build. Defaults to the project the current pipeline is running on 12 | AzdoProject: '$(System.TeamProject)' 13 | 14 | steps: 15 | - task: powershell@2 16 | inputs: 17 | targetType: 'filePath' 18 | filePath: eng/common/retain-build.ps1 19 | pwsh: true 20 | arguments: > 21 | -AzdoOrgUri: ${{parameters.AzdoOrgUri}} 22 | -AzdoProject ${{parameters.AzdoProject}} 23 | -Token ${{coalesce(parameters.Token, '$env:SYSTEM_ACCESSTOKEN') }} 24 | -BuildId ${{coalesce(parameters.BuildId, '$env:BUILD_ID')}} 25 | displayName: Enable permanent build retention 26 | env: 27 | SYSTEM_ACCESSTOKEN: $(System.AccessToken) 28 | BUILD_ID: $(Build.BuildId) -------------------------------------------------------------------------------- /src/Microsoft.Deployment.DotNet.Releases/src/Microsoft.Deployment.DotNet.Releases.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | latest 6 | 7 | 2 8 | 0 9 | 1 10 | true 11 | 12 | 13 | true 14 | true 15 | Microsoft.Deployment.DotNet.Releases 16 | true 17 | true 18 | A client library for querying the .NET releases JSON files. 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /eng/common/templates/steps/publish-build-artifacts.yml: -------------------------------------------------------------------------------- 1 | parameters: 2 | - name: is1ESPipeline 3 | type: boolean 4 | default: false 5 | 6 | - name: displayName 7 | type: string 8 | default: 'Publish to Build Artifact' 9 | 10 | - name: condition 11 | type: string 12 | default: succeeded() 13 | 14 | - name: artifactName 15 | type: string 16 | 17 | - name: pathToPublish 18 | type: string 19 | 20 | - name: continueOnError 21 | type: boolean 22 | default: false 23 | 24 | - name: publishLocation 25 | type: string 26 | default: 'Container' 27 | 28 | - name: retryCountOnTaskFailure 29 | type: string 30 | default: 10 31 | 32 | steps: 33 | - ${{ if eq(parameters.is1ESPipeline, true) }}: 34 | - 'eng/common/templates cannot be referenced from a 1ES managed template': error 35 | - task: PublishBuildArtifacts@1 36 | displayName: ${{ parameters.displayName }} 37 | condition: ${{ parameters.condition }} 38 | ${{ if parameters.continueOnError }}: 39 | continueOnError: ${{ parameters.continueOnError }} 40 | inputs: 41 | PublishLocation: ${{ parameters.publishLocation }} 42 | PathtoPublish: ${{ parameters.pathToPublish }} 43 | ${{ if parameters.artifactName }}: 44 | ArtifactName: ${{ parameters.artifactName }} 45 | ${{ if parameters.retryCountOnTaskFailure }}: 46 | retryCountOnTaskFailure: ${{ parameters.retryCountOnTaskFailure }} 47 | -------------------------------------------------------------------------------- /eng/common/sdl/sdl.ps1: -------------------------------------------------------------------------------- 1 | 2 | function Install-Gdn { 3 | param( 4 | [Parameter(Mandatory=$true)] 5 | [string]$Path, 6 | 7 | # If omitted, install the latest version of Guardian, otherwise install that specific version. 8 | [string]$Version 9 | ) 10 | 11 | $ErrorActionPreference = 'Stop' 12 | Set-StrictMode -Version 2.0 13 | $disableConfigureToolsetImport = $true 14 | $global:LASTEXITCODE = 0 15 | 16 | # `tools.ps1` checks $ci to perform some actions. Since the SDL 17 | # scripts don't necessarily execute in the same agent that run the 18 | # build.ps1/sh script this variable isn't automatically set. 19 | $ci = $true 20 | . $PSScriptRoot\..\tools.ps1 21 | 22 | $argumentList = @("install", "Microsoft.Guardian.Cli", "-Source https://securitytools.pkgs.visualstudio.com/_packaging/Guardian/nuget/v3/index.json", "-OutputDirectory $Path", "-NonInteractive", "-NoCache") 23 | 24 | if ($Version) { 25 | $argumentList += "-Version $Version" 26 | } 27 | 28 | Start-Process nuget -Verbose -ArgumentList $argumentList -NoNewWindow -Wait 29 | 30 | $gdnCliPath = Get-ChildItem -Filter guardian.cmd -Recurse -Path $Path 31 | 32 | if (!$gdnCliPath) 33 | { 34 | Write-PipelineTelemetryError -Category 'Sdl' -Message 'Failure installing Guardian' 35 | } 36 | 37 | return $gdnCliPath.FullName 38 | } -------------------------------------------------------------------------------- /Directory.Build.targets: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 10 | 11 | 12 | true 13 | true 14 | true 15 | 16 | -$(VersionSuffix) 17 | $(MajorVersion).$(MinorVersion) 18 | $(ProductBandVersion).$(PatchVersion) 19 | $(ProductionVersion)$(ProductVersionSuffix) 20 | 21 | $(ProductVersion) 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /eng/common/templates-official/steps/publish-build-artifacts.yml: -------------------------------------------------------------------------------- 1 | parameters: 2 | - name: displayName 3 | type: string 4 | default: 'Publish to Build Artifact' 5 | 6 | - name: condition 7 | type: string 8 | default: succeeded() 9 | 10 | - name: artifactName 11 | type: string 12 | 13 | - name: pathToPublish 14 | type: string 15 | 16 | - name: continueOnError 17 | type: boolean 18 | default: false 19 | 20 | - name: publishLocation 21 | type: string 22 | default: 'Container' 23 | 24 | - name: is1ESPipeline 25 | type: boolean 26 | default: true 27 | 28 | - name: retryCountOnTaskFailure 29 | type: string 30 | default: 10 31 | 32 | steps: 33 | - ${{ if ne(parameters.is1ESPipeline, true) }}: 34 | - 'eng/common/templates-official cannot be referenced from a non-1ES managed template': error 35 | - task: 1ES.PublishBuildArtifacts@1 36 | displayName: ${{ parameters.displayName }} 37 | condition: ${{ parameters.condition }} 38 | ${{ if parameters.continueOnError }}: 39 | continueOnError: ${{ parameters.continueOnError }} 40 | inputs: 41 | PublishLocation: ${{ parameters.publishLocation }} 42 | PathtoPublish: ${{ parameters.pathToPublish }} 43 | ${{ if parameters.artifactName }}: 44 | ArtifactName: ${{ parameters.artifactName }} 45 | ${{ if parameters.retryCountOnTaskFailure }}: 46 | retryCountOnTaskFailure: ${{ parameters.retryCountOnTaskFailure }} 47 | -------------------------------------------------------------------------------- /eng/common/core-templates/jobs/codeql-build.yml: -------------------------------------------------------------------------------- 1 | parameters: 2 | # See schema documentation in /Documentation/AzureDevOps/TemplateSchema.md 3 | continueOnError: false 4 | # Required: A collection of jobs to run - https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema?view=vsts&tabs=schema#job 5 | jobs: [] 6 | # Optional: if specified, restore and use this version of Guardian instead of the default. 7 | overrideGuardianVersion: '' 8 | is1ESPipeline: '' 9 | 10 | jobs: 11 | - template: /eng/common/core-templates/jobs/jobs.yml 12 | parameters: 13 | is1ESPipeline: ${{ parameters.is1ESPipeline }} 14 | enableMicrobuild: false 15 | enablePublishBuildArtifacts: false 16 | enablePublishTestResults: false 17 | enablePublishBuildAssets: false 18 | enableTelemetry: true 19 | 20 | variables: 21 | - group: Publish-Build-Assets 22 | # The Guardian version specified in 'eng/common/sdl/packages.config'. This value must be kept in 23 | # sync with the packages.config file. 24 | - name: DefaultGuardianVersion 25 | value: 0.109.0 26 | - name: GuardianPackagesConfigFile 27 | value: $(System.DefaultWorkingDirectory)\eng\common\sdl\packages.config 28 | - name: GuardianVersion 29 | value: ${{ coalesce(parameters.overrideGuardianVersion, '$(DefaultGuardianVersion)') }} 30 | 31 | jobs: ${{ parameters.jobs }} 32 | 33 | -------------------------------------------------------------------------------- /eng/common/msbuild.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | source="${BASH_SOURCE[0]}" 4 | 5 | # resolve $source until the file is no longer a symlink 6 | while [[ -h "$source" ]]; do 7 | scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" 8 | source="$(readlink "$source")" 9 | # if $source was a relative symlink, we need to resolve it relative to the path where the 10 | # symlink file was located 11 | [[ $source != /* ]] && source="$scriptroot/$source" 12 | done 13 | scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" 14 | 15 | verbosity='minimal' 16 | warn_as_error=true 17 | node_reuse=true 18 | prepare_machine=false 19 | extra_args='' 20 | 21 | while (($# > 0)); do 22 | lowerI="$(echo $1 | tr "[:upper:]" "[:lower:]")" 23 | case $lowerI in 24 | --verbosity) 25 | verbosity=$2 26 | shift 2 27 | ;; 28 | --warnaserror) 29 | warn_as_error=$2 30 | shift 2 31 | ;; 32 | --nodereuse) 33 | node_reuse=$2 34 | shift 2 35 | ;; 36 | --ci) 37 | ci=true 38 | shift 1 39 | ;; 40 | --preparemachine) 41 | prepare_machine=true 42 | shift 1 43 | ;; 44 | *) 45 | extra_args="$extra_args $1" 46 | shift 1 47 | ;; 48 | esac 49 | done 50 | 51 | . "$scriptroot/tools.sh" 52 | 53 | if [[ "$ci" == true ]]; then 54 | node_reuse=false 55 | fi 56 | 57 | MSBuild $extra_args 58 | ExitWithExitCode 0 59 | -------------------------------------------------------------------------------- /eng/common/README.md: -------------------------------------------------------------------------------- 1 | # Don't touch this folder 2 | 3 | uuuuuuuuuuuuuuuuuuuu 4 | u" uuuuuuuuuuuuuuuuuu "u 5 | u" u$$$$$$$$$$$$$$$$$$$$u "u 6 | u" u$$$$$$$$$$$$$$$$$$$$$$$$u "u 7 | u" u$$$$$$$$$$$$$$$$$$$$$$$$$$$$u "u 8 | u" u$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$u "u 9 | u" u$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$u "u 10 | $ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $ 11 | $ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $ 12 | $ $$$" ... "$... ...$" ... "$$$ ... "$$$ $ 13 | $ $$$u `"$$$$$$$ $$$ $$$$$ $$ $$$ $$$ $ 14 | $ $$$$$$uu "$$$$ $$$ $$$$$ $$ """ u$$$ $ 15 | $ $$$""$$$ $$$$ $$$u "$$$" u$$ $$$$$$$$ $ 16 | $ $$$$....,$$$$$..$$$$$....,$$$$..$$$$$$$$ $ 17 | $ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $ 18 | "u "$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$" u" 19 | "u "$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$" u" 20 | "u "$$$$$$$$$$$$$$$$$$$$$$$$$$$$" u" 21 | "u "$$$$$$$$$$$$$$$$$$$$$$$$" u" 22 | "u "$$$$$$$$$$$$$$$$$$$$" u" 23 | "u """""""""""""""""" u" 24 | """""""""""""""""""" 25 | 26 | !!! Changes made in this directory are subject to being overwritten by automation !!! 27 | 28 | The files in this directory are shared by all Arcade repos and managed by automation. If you need to make changes to these files, open an issue or submit a pull request to https://github.com/dotnet/arcade first. 29 | -------------------------------------------------------------------------------- /eng/common/templates/steps/publish-pipeline-artifacts.yml: -------------------------------------------------------------------------------- 1 | parameters: 2 | - name: is1ESPipeline 3 | type: boolean 4 | default: false 5 | 6 | - name: args 7 | type: object 8 | default: {} 9 | 10 | steps: 11 | - ${{ if eq(parameters.is1ESPipeline, true) }}: 12 | - 'eng/common/templates cannot be referenced from a 1ES managed template': error 13 | - task: PublishPipelineArtifact@1 14 | displayName: ${{ coalesce(parameters.args.displayName, 'Publish to Build Artifact') }} 15 | ${{ if parameters.args.condition }}: 16 | condition: ${{ parameters.args.condition }} 17 | ${{ else }}: 18 | condition: succeeded() 19 | ${{ if parameters.args.continueOnError }}: 20 | continueOnError: ${{ parameters.args.continueOnError }} 21 | inputs: 22 | targetPath: ${{ parameters.args.targetPath }} 23 | ${{ if parameters.args.artifactName }}: 24 | artifactName: ${{ parameters.args.artifactName }} 25 | ${{ if parameters.args.publishLocation }}: 26 | publishLocation: ${{ parameters.args.publishLocation }} 27 | ${{ if parameters.args.fileSharePath }}: 28 | fileSharePath: ${{ parameters.args.fileSharePath }} 29 | ${{ if parameters.args.Parallel }}: 30 | parallel: ${{ parameters.args.Parallel }} 31 | ${{ if parameters.args.parallelCount }}: 32 | parallelCount: ${{ parameters.args.parallelCount }} 33 | ${{ if parameters.args.properties }}: 34 | properties: ${{ parameters.args.properties }} -------------------------------------------------------------------------------- /eng/common/templates/vmr-build-pr.yml: -------------------------------------------------------------------------------- 1 | # This pipeline is used for running the VMR verification of the PR changes in repo-level PRs. 2 | # 3 | # It will run a full set of verification jobs defined in: 4 | # https://github.com/dotnet/dotnet/blob/10060d128e3f470e77265f8490f5e4f72dae738e/eng/pipelines/templates/stages/vmr-build.yml#L27-L38 5 | # 6 | # For repos that do not need to run the full set, you would do the following: 7 | # 8 | # 1. Copy this YML file to a repo-specific location, i.e. outside of eng/common. 9 | # 10 | # 2. Add `verifications` parameter to VMR template reference 11 | # 12 | # Examples: 13 | # - For source-build stage 1 verification, add the following: 14 | # verifications: [ "source-build-stage1" ] 15 | # 16 | # - For Windows only verifications, add the following: 17 | # verifications: [ "unified-build-windows-x64", "unified-build-windows-x86" ] 18 | 19 | trigger: none 20 | pr: none 21 | 22 | variables: 23 | - template: /eng/common/templates/variables/pool-providers.yml@self 24 | 25 | - name: skipComponentGovernanceDetection # we run CG on internal builds only 26 | value: true 27 | 28 | - name: Codeql.Enabled # we run CodeQL on internal builds only 29 | value: false 30 | 31 | resources: 32 | repositories: 33 | - repository: vmr 34 | type: github 35 | name: dotnet/dotnet 36 | endpoint: dotnet 37 | 38 | stages: 39 | - template: /eng/pipelines/templates/stages/vmr-build.yml@vmr 40 | parameters: 41 | isBuiltFromVmr: false 42 | scope: lite 43 | -------------------------------------------------------------------------------- /src/clickonce/NetCoreCheck/Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | true 7 | true 8 | NetCoreCheck 9 | Provides NetCoreCheck tool, used for detection of .NET Core runtime. 10 | dotnet;deployment-tools;netcorecheck 11 | $(TargetRid) 12 | 13 | 14 | 18 | 19 | $(NetCurrent) 20 | true 21 | false 22 | false 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/clickonce/native/projects/version.h: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | #ifndef __VERSION_H__ 6 | #define __VERSION_H__ 7 | 8 | #include "pal.h" 9 | #include "utils.h" 10 | 11 | struct version_t 12 | { 13 | version_t(); 14 | version_t(int major, int minor, int build, int revision); 15 | 16 | int get_major() const { return m_major; } 17 | int get_minor() const { return m_minor; } 18 | int get_build() const { return m_build; } 19 | int get_revision() const { return m_revision; } 20 | 21 | void set_major(int m) { m_major = m; } 22 | void set_minor(int m) { m_minor = m; } 23 | void set_build(int m) { m_build = m; } 24 | void set_revision(int m) { m_revision = m; } 25 | 26 | pal::string_t as_str() const; 27 | 28 | bool operator ==(const version_t& b) const; 29 | bool operator !=(const version_t& b) const; 30 | bool operator <(const version_t& b) const; 31 | bool operator >(const version_t& b) const; 32 | bool operator <=(const version_t& b) const; 33 | bool operator >=(const version_t& b) const; 34 | 35 | static bool parse(const pal::string_t& ver, version_t* ver_out); 36 | 37 | private: 38 | int m_major; 39 | int m_minor; 40 | int m_build; 41 | int m_revision; 42 | 43 | static int compare(const version_t&a, const version_t& b); 44 | }; 45 | 46 | #endif // __VERSION_H__ 47 | -------------------------------------------------------------------------------- /src/clickonce/native/projects/hostpolicy.h: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | #ifndef __HOSTPOLICY_H__ 6 | #define __HOSTPOLICY_H__ 7 | 8 | #include "host_interface.h" 9 | #include 10 | 11 | #if defined(_WIN32) 12 | #define HOSTPOLICY_CALLTYPE __cdecl 13 | #else 14 | #define HOSTPOLICY_CALLTYPE 15 | #endif 16 | 17 | struct corehost_initialize_request_t; 18 | struct corehost_context_contract; 19 | 20 | typedef int(HOSTPOLICY_CALLTYPE *corehost_load_fn) (const host_interface_t *init); 21 | typedef int(HOSTPOLICY_CALLTYPE *corehost_unload_fn) (); 22 | 23 | typedef int(HOSTPOLICY_CALLTYPE *corehost_main_fn) ( 24 | const int argc, 25 | const pal::char_t **argv); 26 | typedef int(HOSTPOLICY_CALLTYPE *corehost_main_with_output_buffer_fn) ( 27 | const int argc, 28 | const pal::char_t **argv, 29 | pal::char_t *buffer, 30 | int32_t buffer_size, 31 | int32_t *required_buffer_size); 32 | 33 | typedef void(HOSTPOLICY_CALLTYPE *corehost_error_writer_fn) (const pal::char_t *message); 34 | typedef corehost_error_writer_fn(HOSTPOLICY_CALLTYPE *corehost_set_error_writer_fn) (corehost_error_writer_fn error_writer); 35 | 36 | typedef int(HOSTPOLICY_CALLTYPE *corehost_initialize_fn)( 37 | const corehost_initialize_request_t *init_request, 38 | int32_t options, 39 | corehost_context_contract *handle); 40 | 41 | #endif //__HOSTPOLICY_H__ 42 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | 11 | 12 | ### Description 13 | 14 | 19 | 20 | ### Configuration 21 | 22 | 28 | 29 | ### Regression? 30 | 31 | 34 | 35 | ### Other information 36 | 37 | 42 | -------------------------------------------------------------------------------- /eng/common/retain-build.ps1: -------------------------------------------------------------------------------- 1 | 2 | Param( 3 | [Parameter(Mandatory=$true)][int] $buildId, 4 | [Parameter(Mandatory=$true)][string] $azdoOrgUri, 5 | [Parameter(Mandatory=$true)][string] $azdoProject, 6 | [Parameter(Mandatory=$true)][string] $token 7 | ) 8 | 9 | $ErrorActionPreference = 'Stop' 10 | Set-StrictMode -Version 2.0 11 | 12 | function Get-AzDOHeaders( 13 | [string] $token) 14 | { 15 | $base64AuthInfo = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(":${token}")) 16 | $headers = @{"Authorization"="Basic $base64AuthInfo"} 17 | return $headers 18 | } 19 | 20 | function Update-BuildRetention( 21 | [string] $azdoOrgUri, 22 | [string] $azdoProject, 23 | [int] $buildId, 24 | [string] $token) 25 | { 26 | $headers = Get-AzDOHeaders -token $token 27 | $requestBody = "{ 28 | `"keepForever`": `"true`" 29 | }" 30 | 31 | $requestUri = "${azdoOrgUri}/${azdoProject}/_apis/build/builds/${buildId}?api-version=6.0" 32 | write-Host "Attempting to retain build using the following URI: ${requestUri} ..." 33 | 34 | try { 35 | Invoke-RestMethod -Uri $requestUri -Method Patch -Body $requestBody -Header $headers -contentType "application/json" 36 | Write-Host "Updated retention settings for build ${buildId}." 37 | } 38 | catch { 39 | Write-Error "Failed to update retention settings for build: $_.Exception.Response.StatusDescription" 40 | exit 1 41 | } 42 | } 43 | 44 | Update-BuildRetention -azdoOrgUri $azdoOrgUri -azdoProject $azdoProject -buildId $buildId -token $token 45 | exit 0 46 | -------------------------------------------------------------------------------- /src/clickonce/MageCLI/MageCLI.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $(NetMinimum) 5 | dotnet-mage 6 | Exe 7 | true 8 | true 9 | false 10 | true 11 | false 12 | 13 | 14 | 15 | true 16 | true 17 | true 18 | true 19 | Microsoft.DotNet.Mage 20 | tools/$(TargetFramework)/any 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /src/clickonce/native/projects/roll_forward_option.h: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | #ifndef __ROLL_FORWARD_OPTION_H_ 6 | #define __ROLL_FORWARD_OPTION_H_ 7 | 8 | // Specifies the roll forward option value 9 | // High-level notes on roll forward algorithm 10 | // - Try to use the version which the app asked for. If not possible try to use the closest higher version (unless modified via settings) 11 | // - Always pick the latest patch for servicing/security 12 | // - Allow customization of the behavior via rollForward setting 13 | // - Backward compatible with deprecated settings rollForwardOnNoCandidateFx and applyPatches 14 | enum class roll_forward_option 15 | { 16 | // The order is in increasing level of relaxation 17 | // Lower values are more restrictive than higher values 18 | 19 | Disable = 0, // No roll-forward is allowed - only exact match 20 | LatestPatch = 1, // Roll forward to latest patch. 21 | Minor = 2, // Roll forward to closest minor but same major and then highest patch 22 | LatestMinor = 3, // Roll forward to highest minor.patch but same major 23 | Major = 4, // Roll forward to closest major.minor and then highest patch 24 | LatestMajor = 5, // Roll forward to highest major.minor.patch 25 | 26 | __Last // Sentinel value 27 | }; 28 | 29 | roll_forward_option roll_forward_option_from_string(const pal::string_t& value); 30 | 31 | #endif // __ROLL_FORWARD_OPTION_H_ 32 | -------------------------------------------------------------------------------- /src/clickonce/native/projects/native.rc: -------------------------------------------------------------------------------- 1 | #include "version_info.h" 2 | 3 | VS_VERSION_INFO VERSIONINFO 4 | FILEVERSION VER_FILEVERSION 5 | PRODUCTVERSION VER_PRODUCTVERSION 6 | FILEFLAGSMASK VS_FFI_FILEFLAGSMASK 7 | FILEFLAGS VER_DEBUG 8 | FILEOS VOS__WINDOWS32 9 | FILETYPE VFT_DLL 10 | FILESUBTYPE VFT2_UNKNOWN 11 | BEGIN 12 | BLOCK "StringFileInfo" 13 | BEGIN 14 | BLOCK "040904E4" 15 | BEGIN 16 | VALUE "CompanyName", VER_COMPANYNAME_STR 17 | VALUE "FileDescription", VER_FILEDESCRIPTION_STR 18 | VALUE "FileVersion", VER_FILEVERSION_STR 19 | VALUE "InternalName", VER_INTERNALNAME_STR 20 | VALUE "LegalCopyright", VER_LEGALCOPYRIGHT_STR 21 | VALUE "OriginalFilename", VER_ORIGINALFILENAME_STR 22 | VALUE "ProductName", VER_PRODUCTNAME_STR 23 | VALUE "ProductVersion", VER_PRODUCTVERSION_STR 24 | END 25 | END 26 | 27 | BLOCK "VarFileInfo" 28 | BEGIN 29 | /* The following line should only be modified for localized versions. */ 30 | /* It consists of any number of WORD,WORD pairs, with each pair */ 31 | /* describing a language,codepage combination supported by the file. */ 32 | /* */ 33 | /* For example, a file might have values "0x409,1252" indicating that it */ 34 | /* supports English language (0x409) in the Windows ANSI codepage (1252). */ 35 | 36 | VALUE "Translation", 0x409, 1252 37 | 38 | END 39 | END 40 | 41 | -------------------------------------------------------------------------------- /eng/common/sdl/run-sdl.ps1: -------------------------------------------------------------------------------- 1 | Param( 2 | [string] $GuardianCliLocation, 3 | [string] $WorkingDirectory, 4 | [string] $GdnFolder, 5 | [string] $UpdateBaseline, 6 | [string] $GuardianLoggerLevel='Standard' 7 | ) 8 | 9 | $ErrorActionPreference = 'Stop' 10 | Set-StrictMode -Version 2.0 11 | $disableConfigureToolsetImport = $true 12 | $global:LASTEXITCODE = 0 13 | 14 | try { 15 | # `tools.ps1` checks $ci to perform some actions. Since the SDL 16 | # scripts don't necessarily execute in the same agent that run the 17 | # build.ps1/sh script this variable isn't automatically set. 18 | $ci = $true 19 | . $PSScriptRoot\..\tools.ps1 20 | 21 | # We store config files in the r directory of .gdn 22 | $gdnConfigPath = Join-Path $GdnFolder 'r' 23 | $ValidPath = Test-Path $GuardianCliLocation 24 | 25 | if ($ValidPath -eq $False) 26 | { 27 | Write-PipelineTelemetryError -Force -Category 'Sdl' -Message "Invalid Guardian CLI Location." 28 | ExitWithExitCode 1 29 | } 30 | 31 | $gdnConfigFiles = Get-ChildItem $gdnConfigPath -Recurse -Include '*.gdnconfig' 32 | Write-Host "Discovered Guardian config files:" 33 | $gdnConfigFiles | Out-String | Write-Host 34 | 35 | Exec-BlockVerbosely { 36 | & $GuardianCliLocation run ` 37 | --working-directory $WorkingDirectory ` 38 | --baseline mainbaseline ` 39 | --update-baseline $UpdateBaseline ` 40 | --logger-level $GuardianLoggerLevel ` 41 | --config @gdnConfigFiles 42 | Exit-IfNZEC "Sdl" 43 | } 44 | } 45 | catch { 46 | Write-Host $_.ScriptStackTrace 47 | Write-PipelineTelemetryError -Force -Category 'Sdl' -Message $_ 48 | ExitWithExitCode 1 49 | } 50 | -------------------------------------------------------------------------------- /.github/workflows/labeler-cache-retention.yml: -------------------------------------------------------------------------------- 1 | # Workflow template imported and updated from: 2 | # https://github.com/dotnet/issue-labeler/wiki/Onboarding 3 | # 4 | # See labeler.md for more information 5 | # 6 | # Regularly restore the prediction models from cache to prevent cache eviction 7 | name: "Labeler: Cache Retention" 8 | 9 | # For more information about GitHub's action cache limits and eviction policy, see: 10 | # https://docs.github.com/actions/writing-workflows/choosing-what-your-workflow-does/caching-dependencies-to-speed-up-workflows#usage-limits-and-eviction-policy 11 | 12 | on: 13 | schedule: 14 | - cron: "51 16 * * *" # 16:51 every day (arbitrary time daily) 15 | 16 | workflow_dispatch: 17 | inputs: 18 | cache_key: 19 | description: "The cache key suffix to use for restoring the model from cache. Defaults to 'ACTIVE'." 20 | required: true 21 | default: "ACTIVE" 22 | 23 | env: 24 | CACHE_KEY: ${{ inputs.cache_key || 'ACTIVE' }} 25 | 26 | jobs: 27 | restore-cache: 28 | # Do not automatically run the workflow on forks outside the 'dotnet' org 29 | if: ${{ github.event_name == 'workflow_dispatch' || github.repository_owner == 'dotnet' }} 30 | runs-on: ubuntu-latest 31 | strategy: 32 | fail-fast: false 33 | matrix: 34 | type: ["issues"] # Pulls are disabled in this repository, so "pulls" is removed from the matrix 35 | steps: 36 | - uses: dotnet/issue-labeler/restore@46125e85e6a568dc712f358c39f35317366f5eed # v2.0.0 37 | with: 38 | type: ${{ matrix.type }} 39 | cache_key: ${{ env.CACHE_KEY }} 40 | fail-on-cache-miss: true 41 | -------------------------------------------------------------------------------- /eng/common/internal/Tools.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | net472 6 | false 7 | false 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/clickonce/native/projects/NetCoreCheck/EXE/version_info.h: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | #pragma once 6 | 7 | #include 8 | 9 | #define BUILD_VERSION_STR_BASE( v1, v2, v3, v4 ) #v1 "." #v2 "." #v3 "." #v4 10 | #define BUILD_VERSION_STR( v1, v2, v3, v4 ) BUILD_VERSION_STR_BASE( v1, v2, v3, v4 ) 11 | 12 | #define VER_PRODUCT_MAJOR 1 13 | #define VER_PRODUCT_MINOR 0 14 | #define VER_BUILD_MAJOR 2 15 | #define VER_BUILD_MINOR 0 16 | 17 | #define VER_FILEVERSION VER_PRODUCT_MAJOR,VER_PRODUCT_MINOR,VER_BUILD_MAJOR,VER_BUILD_MINOR 18 | #define VER_FILEVERSION_STR BUILD_VERSION_STR(VER_PRODUCT_MAJOR,VER_PRODUCT_MINOR,VER_BUILD_MAJOR,VER_BUILD_MINOR) 19 | #define VER_PRODUCTVERSION VER_FILEVERSION 20 | #define VER_PRODUCTVERSION_STR VER_FILEVERSION_STR 21 | 22 | #define VER_COMPANYNAME_STR "Microsoft Corporation" 23 | #define VER_LEGALCOPYRIGHT_STR "Copyright (C) Microsoft Corporation. All rights reserved." 24 | 25 | #define VER_PRODUCTNAME_STR "Microsoft NetCoreCheck" 26 | #define VER_FILEDESCRIPTION_STR "Microsoft .NET Core checker tool" 27 | 28 | #ifdef VER_INTERNALNAME_STR 29 | #undef VER_INTERNALNAME_STR 30 | #endif 31 | #define VER_INTERNALNAME_STR "NetCoreCheck.exe" 32 | #define VER_ORIGINALFILENAME_STR "NetCoreCheck.exe" 33 | 34 | #ifndef DEBUG 35 | #define VER_DEBUG 0 36 | #else 37 | #define VER_DEBUG VS_FF_DEBUG 38 | #endif 39 | -------------------------------------------------------------------------------- /eng/native/init-os-and-arch.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Use uname to determine what the OS is. 4 | OSName=$(uname -s) 5 | 6 | if getprop ro.product.system.model 2>&1 | grep -qi android; then 7 | OSName="Android" 8 | fi 9 | 10 | case "$OSName" in 11 | FreeBSD|Linux|NetBSD|OpenBSD|SunOS|Android) 12 | os=$OSName ;; 13 | Darwin) 14 | os=OSX ;; 15 | *) 16 | echo "Unsupported OS $OSName detected, configuring as if for Linux" 17 | os=Linux ;; 18 | esac 19 | 20 | # On Solaris, `uname -m` is discoragued, see https://docs.oracle.com/cd/E36784_01/html/E36870/uname-1.html 21 | # and `uname -p` returns processor type (e.g. i386 on amd64). 22 | # The appropriate tool to determine CPU is isainfo(1) https://docs.oracle.com/cd/E36784_01/html/E36870/isainfo-1.html. 23 | if [ "$OSName" = "SunOS" ]; then 24 | CPUName=$(isainfo -n) 25 | else 26 | # For rest of the operating systems, use uname(1) to determine what the CPU is. 27 | CPUName=$(uname -m) 28 | fi 29 | 30 | case "$CPUName" in 31 | aarch64) 32 | arch=arm64 33 | ;; 34 | 35 | amd64|x86_64) 36 | arch=x64 37 | ;; 38 | 39 | armv7l) 40 | if (NAME=""; . /etc/os-release; test "$NAME" = "Tizen"); then 41 | __BuildArch=armel 42 | __HostArch=armel 43 | else 44 | __BuildArch=arm 45 | __HostArch=arm 46 | fi 47 | ;; 48 | 49 | i[3-6]86) 50 | echo "Unsupported CPU $CPUName detected, build might not succeed!" 51 | arch=x86 52 | ;; 53 | 54 | *) 55 | echo "Unknown CPU $CPUName detected, configuring as if for x64" 56 | arch=x64 57 | ;; 58 | esac 59 | -------------------------------------------------------------------------------- /eng/common/core-templates/steps/get-federated-access-token.yml: -------------------------------------------------------------------------------- 1 | parameters: 2 | - name: federatedServiceConnection 3 | type: string 4 | - name: outputVariableName 5 | type: string 6 | - name: is1ESPipeline 7 | type: boolean 8 | - name: stepName 9 | type: string 10 | default: 'getFederatedAccessToken' 11 | - name: condition 12 | type: string 13 | default: '' 14 | # Resource to get a token for. Common values include: 15 | # - '499b84ac-1321-427f-aa17-267ca6975798' for Azure DevOps 16 | # - 'https://storage.azure.com/' for storage 17 | # Defaults to Azure DevOps 18 | - name: resource 19 | type: string 20 | default: '499b84ac-1321-427f-aa17-267ca6975798' 21 | - name: isStepOutputVariable 22 | type: boolean 23 | default: false 24 | 25 | steps: 26 | - task: AzureCLI@2 27 | displayName: 'Getting federated access token for feeds' 28 | name: ${{ parameters.stepName }} 29 | ${{ if ne(parameters.condition, '') }}: 30 | condition: ${{ parameters.condition }} 31 | inputs: 32 | azureSubscription: ${{ parameters.federatedServiceConnection }} 33 | scriptType: 'pscore' 34 | scriptLocation: 'inlineScript' 35 | inlineScript: | 36 | $accessToken = az account get-access-token --query accessToken --resource ${{ parameters.resource }} --output tsv 37 | if ($LASTEXITCODE -ne 0) { 38 | Write-Error "Failed to get access token for resource '${{ parameters.resource }}'" 39 | exit 1 40 | } 41 | Write-Host "Setting '${{ parameters.outputVariableName }}' with the access token value" 42 | Write-Host "##vso[task.setvariable variable=${{ parameters.outputVariableName }};issecret=true;isOutput=${{ parameters.isStepOutputVariable }}]$accessToken" -------------------------------------------------------------------------------- /eng/common/generate-sbom-prep.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | source="${BASH_SOURCE[0]}" 4 | 5 | # resolve $SOURCE until the file is no longer a symlink 6 | while [[ -h $source ]]; do 7 | scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" 8 | source="$(readlink "$source")" 9 | 10 | # if $source was a relative symlink, we need to resolve it relative to the path where the 11 | # symlink file was located 12 | [[ $source != /* ]] && source="$scriptroot/$source" 13 | done 14 | scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" 15 | . $scriptroot/pipeline-logging-functions.sh 16 | 17 | 18 | # replace all special characters with _, some builds use special characters like : in Agent.Jobname, that is not a permissible name while uploading artifacts. 19 | artifact_name=$SYSTEM_STAGENAME"_"$AGENT_JOBNAME"_SBOM" 20 | safe_artifact_name="${artifact_name//["/:<>\\|?@*$" ]/_}" 21 | manifest_dir=$1 22 | 23 | # Normally - we'd listen to the manifest path given, but 1ES templates will overwrite if this level gets uploaded directly 24 | # with their own overwriting ours. So we create it as a sub directory of the requested manifest path. 25 | sbom_generation_dir="$manifest_dir/$safe_artifact_name" 26 | 27 | if [ ! -d "$sbom_generation_dir" ] ; then 28 | mkdir -p "$sbom_generation_dir" 29 | echo "Sbom directory created." $sbom_generation_dir 30 | else 31 | Write-PipelineTelemetryError -category 'Build' "Unable to create sbom folder." 32 | fi 33 | 34 | echo "Artifact name before : "$artifact_name 35 | echo "Artifact name after : "$safe_artifact_name 36 | export ARTIFACT_NAME=$safe_artifact_name 37 | echo "##vso[task.setvariable variable=ARTIFACT_NAME]$safe_artifact_name" 38 | 39 | exit 0 40 | -------------------------------------------------------------------------------- /src/clickonce/native/projects/NetCoreCheck/CA/version_info.h: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | #pragma once 6 | 7 | #include 8 | 9 | #define BUILD_VERSION_STR_BASE( v1, v2, v3, v4 ) #v1 "." #v2 "." #v3 "." #v4 10 | #define BUILD_VERSION_STR( v1, v2, v3, v4 ) BUILD_VERSION_STR_BASE( v1, v2, v3, v4 ) 11 | 12 | #define VER_PRODUCT_MAJOR 1 13 | #define VER_PRODUCT_MINOR 0 14 | #define VER_BUILD_MAJOR 2 15 | #define VER_BUILD_MINOR 0 16 | 17 | #define VER_FILEVERSION VER_PRODUCT_MAJOR,VER_PRODUCT_MINOR,VER_BUILD_MAJOR,VER_BUILD_MINOR 18 | #define VER_FILEVERSION_STR BUILD_VERSION_STR(VER_PRODUCT_MAJOR,VER_PRODUCT_MINOR,VER_BUILD_MAJOR,VER_BUILD_MINOR) 19 | #define VER_PRODUCTVERSION VER_FILEVERSION 20 | #define VER_PRODUCTVERSION_STR VER_FILEVERSION_STR 21 | 22 | #define VER_COMPANYNAME_STR "Microsoft Corporation" 23 | #define VER_LEGALCOPYRIGHT_STR "Copyright (C) Microsoft Corporation. All rights reserved." 24 | 25 | #define VER_PRODUCTNAME_STR "Microsoft NetCoreCheck Custom Actions" 26 | #define VER_FILEDESCRIPTION_STR "Microsoft .NET Core Custom Actions" 27 | 28 | #ifdef VER_INTERNALNAME_STR 29 | #undef VER_INTERNALNAME_STR 30 | #endif 31 | #define VER_INTERNALNAME_STR "NetCoreCheckCA.dll" 32 | #define VER_ORIGINALFILENAME_STR "NetCoreCheckCA.dll" 33 | 34 | #ifndef DEBUG 35 | #define VER_DEBUG 0 36 | #else 37 | #define VER_DEBUG VS_FF_DEBUG 38 | #endif 39 | -------------------------------------------------------------------------------- /src/clickonce/native/projects/coreclr_delegates.h: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | #ifndef __CORECLR_DELEGATES_H__ 6 | #define __CORECLR_DELEGATES_H__ 7 | 8 | #include 9 | 10 | #if defined(_WIN32) 11 | #define CORECLR_DELEGATE_CALLTYPE __stdcall 12 | #ifdef _WCHAR_T_DEFINED 13 | typedef wchar_t char_t; 14 | #else 15 | typedef unsigned short char_t; 16 | #endif 17 | #else 18 | #define CORECLR_DELEGATE_CALLTYPE 19 | typedef char char_t; 20 | #endif 21 | 22 | // Signature of delegate returned by coreclr_delegate_type::load_assembly_and_get_function_pointer 23 | typedef int (CORECLR_DELEGATE_CALLTYPE *load_assembly_and_get_function_pointer_fn)( 24 | const char_t *assembly_path /* Fully qualified path to assembly */, 25 | const char_t *type_name /* Assembly qualified type name */, 26 | const char_t *method_name /* Public static method name compatible with delegateType */, 27 | const char_t *delegate_type_name /* Assembly qualified delegate type name or null */, 28 | void *reserved /* Extensibility parameter (currently unused and must be 0) */, 29 | /*out*/ void **delegate /* Pointer where to store the function pointer result */); 30 | 31 | // Signature of delegate returned by load_assembly_and_get_function_pointer_fn when delegate_type_name == null (default) 32 | typedef int (CORECLR_DELEGATE_CALLTYPE *component_entry_point_fn)(void *arg, int32_t arg_size_in_bytes); 33 | 34 | #endif // __CORECLR_DELEGATES_H__ -------------------------------------------------------------------------------- /src/clickonce/native/projects/json_parser.h: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | #ifndef __JSON_PARSER_H__ 6 | #define __JSON_PARSER_H__ 7 | 8 | #include "pal.h" 9 | #include "rapidjson/document.h" 10 | #include "rapidjson/fwd.h" 11 | #include 12 | 13 | class json_parser_t { 14 | public: 15 | #ifdef _WIN32 16 | using internal_encoding_type_t = rapidjson::UTF16; 17 | #else 18 | using internal_encoding_type_t = rapidjson::UTF8; 19 | #endif 20 | using value_t = rapidjson::GenericValue; 21 | using document_t = rapidjson::GenericDocument; 22 | 23 | const document_t& document() const { return m_document; } 24 | bool parse_stream(pal::istream_t& stream, const pal::string_t& context); 25 | bool parse_file(const pal::string_t& path) 26 | { 27 | pal::ifstream_t file{path}; 28 | return parse_stream(file, path); 29 | } 30 | 31 | private: 32 | // This is a vector of char and not pal::char_t because JSON data 33 | // parsed by this class is always encoded in UTF-8. On Windows, 34 | // where wide strings are used, m_json is kept in UTF-8, but converted 35 | // to UTF-16 by m_document during load. 36 | std::vector m_json; 37 | document_t m_document; 38 | 39 | void realloc_buffer(size_t size); 40 | bool parse_json(const pal::string_t& context); 41 | }; 42 | 43 | #endif // __JSON_PARSER_H__ 44 | -------------------------------------------------------------------------------- /.github/workflows/labeler.md: -------------------------------------------------------------------------------- 1 | # Issue-Labeler Workflows 2 | 3 | This repository uses actions from [dotnet/issue-labeler](https://github.com/dotnet/issue-labeler) to predict area labels for issues and pull requests. 4 | 5 | The following workflow templates were imported and updated from [dotnet/issue-labeler/wiki/Onboarding](https://github.com/dotnet/issue-labeler/wiki/Onboarding): 6 | 7 | 1. `labeler-cache-retention.yml` 8 | 2. `labeler-predict-issues.yml` 9 | 3. `labeler-predict-pulls.yml` 10 | 4. `labeler-promote.yml` 11 | 5. `labeler-train.yml` 12 | 13 | ## Repository Configuration 14 | 15 | Across these workflows, the following changes were made to configure the issue labeler for this repository: 16 | 17 | 1. Set `LABEL_PREFIX` to `"area-"`: 18 | - `labeler-predict-issues.yml` 19 | - `labeler-predict-pulls.yml` 20 | - `labeler-train.yml` 21 | 2. Remove the `DEFAULT_LABEL` value as we do not apply a default label when no prediction is made in this repository: 22 | - `labeler-predict-issues.yml` 23 | - `labeler-predict-pulls.yml` 24 | 3. Remove the `EXCLUDED_AUTHORS` value as we do not bypass labeling for any authors' issues/pulls in this repository: 25 | - `labeler-predict-issues.yml` 26 | - `labeler-predict-pulls.yml` 27 | 4. Remove the `repository` input for training the models against another repository: 28 | - `labeler-train.yml` 29 | 5. Update the cache retention cron schedule to an arbitrary time of day: 30 | - `labeler-cache-retention.yml` 31 | 6. Disable pull request model cache retention and prediction: 32 | - `labeler-cache-retention.yml` - Remove "pulls" from the job matrix (leaving a comment) 33 | - `labeler-predict-pulls.yml` - Workflow marked as Disabled via GitHub UI 34 | -------------------------------------------------------------------------------- /eng/common/core-templates/job/source-index-stage1.yml: -------------------------------------------------------------------------------- 1 | parameters: 2 | runAsPublic: false 3 | sourceIndexBuildCommand: powershell -NoLogo -NoProfile -ExecutionPolicy Bypass -Command "eng/common/build.ps1 -restore -build -binarylog -ci" 4 | preSteps: [] 5 | binlogPath: artifacts/log/Debug/Build.binlog 6 | condition: '' 7 | dependsOn: '' 8 | pool: '' 9 | is1ESPipeline: '' 10 | 11 | jobs: 12 | - job: SourceIndexStage1 13 | dependsOn: ${{ parameters.dependsOn }} 14 | condition: ${{ parameters.condition }} 15 | variables: 16 | - name: BinlogPath 17 | value: ${{ parameters.binlogPath }} 18 | - template: /eng/common/core-templates/variables/pool-providers.yml 19 | parameters: 20 | is1ESPipeline: ${{ parameters.is1ESPipeline }} 21 | 22 | ${{ if ne(parameters.pool, '') }}: 23 | pool: ${{ parameters.pool }} 24 | ${{ if eq(parameters.pool, '') }}: 25 | pool: 26 | ${{ if eq(variables['System.TeamProject'], 'public') }}: 27 | name: $(DncEngPublicBuildPool) 28 | image: windows.vs2022.amd64.open 29 | ${{ if eq(variables['System.TeamProject'], 'internal') }}: 30 | name: $(DncEngInternalBuildPool) 31 | image: windows.vs2022.amd64 32 | 33 | steps: 34 | - ${{ if eq(parameters.is1ESPipeline, '') }}: 35 | - 'Illegal entry point, is1ESPipeline is not defined. Repository yaml should not directly reference templates in core-templates folder.': error 36 | 37 | - ${{ each preStep in parameters.preSteps }}: 38 | - ${{ preStep }} 39 | - script: ${{ parameters.sourceIndexBuildCommand }} 40 | displayName: Build Repository 41 | 42 | - template: /eng/common/core-templates/steps/source-index-stage1-publish.yml 43 | parameters: 44 | binLogPath: ${{ parameters.binLogPath }} -------------------------------------------------------------------------------- /src/Microsoft.Deployment.DotNet.Releases/tests/CveTests.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Text.Json; 7 | using Xunit; 8 | 9 | namespace Microsoft.Deployment.DotNet.Releases.Tests 10 | { 11 | public class CveTests 12 | { 13 | [Fact] 14 | public void ItImplementsIEquatable() 15 | { 16 | List cves = new List(); 17 | var cve1 = Cve.Create("cve-1", "https://cve.com"); 18 | var cve2 = Cve.Create("cve-1", "https://cve.com"); 19 | 20 | cves.Add(Cve.Create("cve-2", "https://cve.com")); 21 | cves.Add(cve1); 22 | cves.Add(cve2); 23 | 24 | Assert.Equal(cve1, cve2); 25 | Assert.Equal(2, cves.Distinct().Count()); 26 | } 27 | 28 | [Fact] 29 | public void GetHashCodeReturnsTheSameValueIfObjectsAreEqual() 30 | { 31 | var a = Cve.Create("cve-1", "https://cve.com"); 32 | var b = Cve.Create("cve-1", "https://cve.com"); 33 | 34 | Assert.Equal(a.GetHashCode(), b.GetHashCode()); 35 | } 36 | 37 | [Fact] 38 | public void ItCanDeserializeACveEntry() 39 | { 40 | Cve cve = new(JsonDocument.Parse(@"{""cve-id"": ""CVE-2020-1147"", ""cve-url"": ""https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-1147""}").RootElement); 41 | 42 | Assert.Equal("CVE-2020-1147", cve.Id); 43 | Assert.Equal("https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-1147", cve.DescriptionLink.ToString()); 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/Microsoft.Deployment.DotNet.Releases/src/SupportPhase.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | namespace Microsoft.Deployment.DotNet.Releases 5 | { 6 | /// 7 | /// An enumeration describing the different support phases of a . 8 | /// See the support lifecycle 9 | /// documentation for further details. 10 | /// 11 | public enum SupportPhase 12 | { 13 | /// 14 | /// The product is in active support and will continue to receive servicing and security updates. 15 | /// 16 | Active, 17 | 18 | /// 19 | /// The product is considered end-of-life and will not receive any updates. 20 | /// 21 | EOL, 22 | 23 | /// 24 | /// A preview or release candidate that is supported in production. 25 | /// 26 | GoLive, 27 | 28 | /// 29 | /// The product is no longer in active support and will be declared end-of-life. 30 | /// Only security fixes are provided until the product reaches end-of-life status. 31 | /// 32 | Maintenance, 33 | 34 | /// 35 | /// The product is a preview release and is unsupported. 36 | /// 37 | Preview, 38 | 39 | /// 40 | /// The support phase is unknown and could not be parsed. 41 | /// 42 | Unknown = 99 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /eng/common/core-templates/steps/get-delegation-sas.yml: -------------------------------------------------------------------------------- 1 | parameters: 2 | - name: federatedServiceConnection 3 | type: string 4 | - name: outputVariableName 5 | type: string 6 | - name: expiryInHours 7 | type: number 8 | default: 1 9 | - name: base64Encode 10 | type: boolean 11 | default: false 12 | - name: storageAccount 13 | type: string 14 | - name: container 15 | type: string 16 | - name: permissions 17 | type: string 18 | default: 'rl' 19 | - name: is1ESPipeline 20 | type: boolean 21 | default: false 22 | 23 | steps: 24 | - task: AzureCLI@2 25 | displayName: 'Generate delegation SAS Token for ${{ parameters.storageAccount }}/${{ parameters.container }}' 26 | inputs: 27 | azureSubscription: ${{ parameters.federatedServiceConnection }} 28 | scriptType: 'pscore' 29 | scriptLocation: 'inlineScript' 30 | inlineScript: | 31 | # Calculate the expiration of the SAS token and convert to UTC 32 | $expiry = (Get-Date).AddHours(${{ parameters.expiryInHours }}).ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ssZ") 33 | 34 | $sas = az storage container generate-sas --account-name ${{ parameters.storageAccount }} --name ${{ parameters.container }} --permissions ${{ parameters.permissions }} --expiry $expiry --auth-mode login --as-user -o tsv 35 | 36 | if ($LASTEXITCODE -ne 0) { 37 | Write-Error "Failed to generate SAS token." 38 | exit 1 39 | } 40 | 41 | if ('${{ parameters.base64Encode }}' -eq 'true') { 42 | $sas = [Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes($sas)) 43 | } 44 | 45 | Write-Host "Setting '${{ parameters.outputVariableName }}' with the access token value" 46 | Write-Host "##vso[task.setvariable variable=${{ parameters.outputVariableName }};issecret=true]$sas" 47 | -------------------------------------------------------------------------------- /src/Microsoft.Deployment.DotNet.Releases/tests/ReleaseComponentTests.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using System.Linq; 5 | using Xunit; 6 | 7 | namespace Microsoft.Deployment.DotNet.Releases.Tests 8 | { 9 | public class ReleaseComponentTests : TestBase 10 | { 11 | [Theory] 12 | [InlineData("5.0", "5.0.0-preview.7")] 13 | [InlineData("3.1", "3.1.5")] 14 | [InlineData("3.0", "3.0.2")] 15 | [InlineData("2.2", "2.2.8")] 16 | [InlineData("2.1", "2.1.7")] 17 | [InlineData("2.0", "2.0.9")] 18 | [InlineData("1.1", "1.1.10")] 19 | [InlineData("1.0", "1.0.14")] 20 | public void ItDoesNotContainMarketingFiles(string productVersion, string releaseVersion) 21 | { 22 | var release = GetProductRelease(productVersion, releaseVersion); 23 | 24 | Assert.All(release.Files, f => Assert.True(!f.Name.Contains("-gs") && !f.Name.Contains("-nj"))); 25 | } 26 | 27 | [Fact] 28 | public void ReleaseComponentNames() 29 | { 30 | var release = GetProductRelease("3.1", "3.1.5"); 31 | 32 | var sdkComponent = release.Sdks.FirstOrDefault(); 33 | var aspNetComponent = release.AspNetCoreRuntime; 34 | var runtimeComponent = release.Runtime; 35 | var desktopComponent = release.WindowsDesktopRuntime; 36 | 37 | Assert.Equal("SDK", sdkComponent.Name); 38 | Assert.Equal("ASP.NET Core Runtime", aspNetComponent.Name); 39 | Assert.Equal(".NET Core Runtime", runtimeComponent.Name); 40 | Assert.Equal("Desktop Runtime", desktopComponent.Name); 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/clickonce/native/projects/NetCoreCheck/NetCoreCheck.h: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | #pragma once 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | #include "Logger.h" 13 | 14 | // Return Codes 15 | #define EXIT_SUCCESS 0 // Required runtime is installed 16 | #define NETCORECHECK_BASEERROR 0x3000 17 | #define MAKE_NETCORECHECK_HRESULT(x) NETCORECHECK_BASEERROR+x 18 | #define EXIT_FAILURE_LOADHOSTFXR MAKE_NETCORECHECK_HRESULT(1) // No runtime is installed 19 | #define EXIT_FAILURE_INITHOSTFXR MAKE_NETCORECHECK_HRESULT(2) // Required runtime is not installed 20 | #define EXIT_FAILURE_HOSTFXREXPORTS MAKE_NETCORECHECK_HRESULT(3) // Failed to get hostfxr exports 21 | #define EXIT_FAILURE_INVALIDARGS MAKE_NETCORECHECK_HRESULT(4) // Invalid Arguments 22 | #define EXIT_FAILURE_TEMPRTJSONPATH MAKE_NETCORECHECK_HRESULT(5) // Failed to construct temp json file path 23 | #define EXIT_FAILURE_TEMPRTJSONFile MAKE_NETCORECHECK_HRESULT(6) // Failed to create temp json file 24 | 25 | int CheckRuntime(LPCWSTR frameworkName, LPCWSTR frameworkVersion, LPCWSTR rollForwardPolicy, LPCWSTR existingRuntimeConfigPath, bool useTempDirectory); 26 | 27 | typedef 28 | _Success_(return > 0 && return < BufferLength) 29 | DWORD 30 | WINAPI 31 | GETTEMPPATH2W( 32 | _In_ DWORD BufferLength, 33 | _Out_writes_to_opt_(BufferLength, return +1) LPWSTR Buffer 34 | ); 35 | 36 | _Success_(return > 0 && return < BufferLength) 37 | DWORD MyGetTempPath( 38 | _In_ DWORD BufferLength, 39 | _Out_writes_to_opt_(BufferLength, return + 1) PWSTR Buffer); 40 | -------------------------------------------------------------------------------- /src/Microsoft.Deployment.DotNet.Releases/src/RuntimeReleaseComponent.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using System.Text.Json; 5 | 6 | namespace Microsoft.Deployment.DotNet.Releases 7 | { 8 | /// 9 | /// Describes a single runtime release. 10 | /// 11 | public class RuntimeReleaseComponent : ReleaseComponent 12 | { 13 | /// 14 | /// The friendly display name for the component. 15 | /// 16 | public override string Name => ReleasesResources.RuntimeReleaseName; 17 | 18 | /// 19 | /// The versions of Visual Studio for Mac that includes this runtime. 20 | /// 21 | public string VisualStudioMacVersion 22 | { 23 | get; 24 | private set; 25 | } 26 | 27 | /// 28 | /// The versions of Visual Studio that includes this runtime. Multiple versions may be listed, e.g. 29 | /// "15.9.25, 16.0.16, 16.4.11, 16.6.4" 30 | /// 31 | public string VisualStudioVersion 32 | { 33 | get; 34 | private set; 35 | } 36 | 37 | /// 38 | /// Creates a new instance. 39 | /// 40 | /// The JSON element of the component. 41 | /// The release to which the component belongs. 42 | internal RuntimeReleaseComponent(JsonElement element, ProductRelease release) : base(element, release) 43 | { 44 | VisualStudioMacVersion = element.GetStringOrDefault("vs-mac-version"); 45 | VisualStudioVersion = element.GetStringOrDefault("vs-version"); 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /.github/workflows/labeler-promote.yml: -------------------------------------------------------------------------------- 1 | # Workflow template imported and updated from: 2 | # https://github.com/dotnet/issue-labeler/wiki/Onboarding 3 | # 4 | # See labeler.md for more information 5 | # 6 | # Promote a model from staging to 'ACTIVE', backing up the currently 'ACTIVE' model 7 | name: "Labeler: Promotion" 8 | 9 | on: 10 | # Dispatched via the Actions UI, promotes the staged models from 11 | # a staged slot into the prediction environment 12 | workflow_dispatch: 13 | inputs: 14 | issues: 15 | description: "Issues: Promote Model" 16 | type: boolean 17 | required: true 18 | pulls: 19 | description: "Pulls: Promote Model" 20 | type: boolean 21 | required: true 22 | staged_key: 23 | description: "The cache key suffix to use for promoting a staged model to 'ACTIVE'. Defaults to 'staged'." 24 | required: true 25 | default: "staged" 26 | backup_key: 27 | description: "The cache key suffix to use for backing up the currently active model. Defaults to 'backup'." 28 | default: "backup" 29 | 30 | permissions: 31 | actions: write 32 | 33 | jobs: 34 | promote-issues: 35 | if: ${{ inputs.issues }} 36 | runs-on: ubuntu-latest 37 | steps: 38 | - name: "Promote Model for Issues" 39 | uses: dotnet/issue-labeler/promote@46125e85e6a568dc712f358c39f35317366f5eed # v2.0.0 40 | with: 41 | type: "issues" 42 | staged_key: ${{ inputs.staged_key }} 43 | backup_key: ${{ inputs.backup_key }} 44 | 45 | promote-pulls: 46 | if: ${{ inputs.pulls }} 47 | runs-on: ubuntu-latest 48 | steps: 49 | - name: "Promote Model for Pull Requests" 50 | uses: dotnet/issue-labeler/promote@46125e85e6a568dc712f358c39f35317366f5eed # v2.0.0 51 | with: 52 | type: "pulls" 53 | staged_key: ${{ inputs.staged_key }} 54 | backup_key: ${{ inputs.backup_key }} 55 | -------------------------------------------------------------------------------- /src/clickonce/native/projects/roll_forward_option.cpp: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | #include "pal.h" 6 | #include "trace.h" 7 | #include "roll_forward_option.h" 8 | #include "roll_fwd_on_no_candidate_fx_option.h" 9 | 10 | roll_forward_option roll_fwd_on_no_candidate_fx_to_roll_forward(roll_fwd_on_no_candidate_fx_option roll_fwd_on_no_candidate_fx) 11 | { 12 | switch (roll_fwd_on_no_candidate_fx) 13 | { 14 | case roll_fwd_on_no_candidate_fx_option::disabled: 15 | return roll_forward_option::LatestPatch; 16 | case roll_fwd_on_no_candidate_fx_option::minor: 17 | return roll_forward_option::Minor; 18 | case roll_fwd_on_no_candidate_fx_option::major: 19 | return roll_forward_option::Major; 20 | default: 21 | assert(false); 22 | return roll_forward_option::Disable; 23 | } 24 | } 25 | 26 | namespace 27 | { 28 | const pal::char_t* OptionNameMapping[] = 29 | { 30 | _X("Disable"), 31 | _X("LatestPatch"), 32 | _X("Minor"), 33 | _X("LatestMinor"), 34 | _X("Major"), 35 | _X("LatestMajor") 36 | }; 37 | 38 | static_assert((sizeof(OptionNameMapping) / sizeof(*OptionNameMapping)) == static_cast(roll_forward_option::__Last), "Invalid option count"); 39 | } 40 | 41 | roll_forward_option roll_forward_option_from_string(const pal::string_t& value) 42 | { 43 | for (int idx = 0; idx < static_cast(roll_forward_option::__Last); idx++) 44 | { 45 | if (pal::strcasecmp(OptionNameMapping[idx], value.c_str()) == 0) 46 | { 47 | return static_cast(idx); 48 | } 49 | } 50 | 51 | trace::error(_X("Unrecognized roll forward setting value '%s'."), value.c_str()); 52 | return roll_forward_option::__Last; 53 | } 54 | 55 | -------------------------------------------------------------------------------- /eng/common/loc/P22DotNetHtmlLocalization.lss: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 22 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /eng/empty.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | 11 | 12 | $(NetCurrent) 13 | true 14 | 15 | 16 | 18 | 19 | $(ArtifactsObjDir)runtime_version.h 20 | 21 | <_RuntimeVersionFileContents> 22 | 37 | 38 | 39 | 40 | 41 | 42 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /eng/common/core-templates/jobs/source-build.yml: -------------------------------------------------------------------------------- 1 | parameters: 2 | # This template adds arcade-powered source-build to CI. A job is created for each platform, as 3 | # well as an optional server job that completes when all platform jobs complete. 4 | 5 | # See /eng/common/core-templates/job/source-build.yml 6 | jobNamePrefix: 'Source_Build' 7 | 8 | # This is the default platform provided by Arcade, intended for use by a managed-only repo. 9 | defaultManagedPlatform: 10 | name: 'Managed' 11 | container: 'mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream-10-amd64' 12 | 13 | # Defines the platforms on which to run build jobs. One job is created for each platform, and the 14 | # object in this array is sent to the job template as 'platform'. If no platforms are specified, 15 | # one job runs on 'defaultManagedPlatform'. 16 | platforms: [] 17 | 18 | is1ESPipeline: '' 19 | 20 | # If set to true and running on a non-public project, 21 | # Internal nuget and blob storage locations will be enabled. 22 | # This is not enabled by default because many repositories do not need internal sources 23 | # and do not need to have the required service connections approved in the pipeline. 24 | enableInternalSources: false 25 | 26 | jobs: 27 | 28 | - ${{ each platform in parameters.platforms }}: 29 | - template: /eng/common/core-templates/job/source-build.yml 30 | parameters: 31 | is1ESPipeline: ${{ parameters.is1ESPipeline }} 32 | jobNamePrefix: ${{ parameters.jobNamePrefix }} 33 | platform: ${{ platform }} 34 | enableInternalSources: ${{ parameters.enableInternalSources }} 35 | 36 | - ${{ if eq(length(parameters.platforms), 0) }}: 37 | - template: /eng/common/core-templates/job/source-build.yml 38 | parameters: 39 | is1ESPipeline: ${{ parameters.is1ESPipeline }} 40 | jobNamePrefix: ${{ parameters.jobNamePrefix }} 41 | platform: ${{ parameters.defaultManagedPlatform }} 42 | enableInternalSources: ${{ parameters.enableInternalSources }} 43 | -------------------------------------------------------------------------------- /eng/common/darc-init.ps1: -------------------------------------------------------------------------------- 1 | param ( 2 | $darcVersion = $null, 3 | $versionEndpoint = 'https://maestro.dot.net/api/assets/darc-version?api-version=2020-02-20', 4 | $verbosity = 'minimal', 5 | $toolpath = $null 6 | ) 7 | 8 | . $PSScriptRoot\tools.ps1 9 | 10 | function InstallDarcCli ($darcVersion, $toolpath) { 11 | $darcCliPackageName = 'microsoft.dotnet.darc' 12 | 13 | $dotnetRoot = InitializeDotNetCli -install:$true 14 | $dotnet = "$dotnetRoot\dotnet.exe" 15 | $toolList = & "$dotnet" tool list -g 16 | 17 | if ($toolList -like "*$darcCliPackageName*") { 18 | & "$dotnet" tool uninstall $darcCliPackageName -g 19 | } 20 | 21 | # If the user didn't explicitly specify the darc version, 22 | # query the Maestro API for the correct version of darc to install. 23 | if (-not $darcVersion) { 24 | $darcVersion = $(Invoke-WebRequest -Uri $versionEndpoint -UseBasicParsing).Content 25 | } 26 | 27 | $arcadeServicesSource = 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json' 28 | 29 | Write-Host "Installing Darc CLI version $darcVersion..." 30 | Write-Host 'You may need to restart your command window if this is the first dotnet tool you have installed.' 31 | if (-not $toolpath) { 32 | Write-Host "'$dotnet' tool install $darcCliPackageName --version $darcVersion --add-source '$arcadeServicesSource' -v $verbosity -g" 33 | & "$dotnet" tool install $darcCliPackageName --version $darcVersion --add-source "$arcadeServicesSource" -v $verbosity -g 34 | }else { 35 | Write-Host "'$dotnet' tool install $darcCliPackageName --version $darcVersion --add-source '$arcadeServicesSource' -v $verbosity --tool-path '$toolpath'" 36 | & "$dotnet" tool install $darcCliPackageName --version $darcVersion --add-source "$arcadeServicesSource" -v $verbosity --tool-path "$toolpath" 37 | } 38 | } 39 | 40 | try { 41 | InstallDarcCli $darcVersion $toolpath 42 | } 43 | catch { 44 | Write-Host $_.ScriptStackTrace 45 | Write-PipelineTelemetryError -Category 'Darc' -Message $_ 46 | ExitWithExitCode 1 47 | } -------------------------------------------------------------------------------- /Directory.Packages.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | true 5 | true 6 | 7 | $(NoWarn);NU1507 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /src/clickonce/native/projects/common.cmake: -------------------------------------------------------------------------------- 1 | # Licensed to the .NET Foundation under one or more agreements. 2 | # The .NET Foundation licenses this file to you under the MIT license. 3 | # See the LICENSE file in the project root for more information. 4 | 5 | project(${DOTNET_PROJECT_NAME}) 6 | 7 | if(CLR_CMAKE_HOST_WIN32) 8 | add_compile_options(/MT) 9 | else() 10 | add_compile_options(-fvisibility=hidden) 11 | endif() 12 | 13 | include(${CMAKE_CURRENT_LIST_DIR}/setup.cmake) 14 | 15 | # Include directories 16 | if(CLR_CMAKE_TARGET_WIN32) 17 | include_directories("${CLI_CMAKE_RESOURCE_DIR}/${DOTNET_PROJECT_NAME}") 18 | endif() 19 | include_directories(${CMAKE_CURRENT_SOURCE_DIR}/) 20 | include_directories(${CMAKE_CURRENT_LIST_DIR}/) 21 | include_directories(${CMAKE_CURRENT_LIST_DIR}/../) 22 | include_directories(${CMAKE_CURRENT_LIST_DIR}/hostmisc) 23 | 24 | set(RESOURCES) 25 | if(CLR_CMAKE_TARGET_WIN32 AND NOT SKIP_VERSIONING) 26 | list(APPEND RESOURCES ${CMAKE_CURRENT_LIST_DIR}/native.rc) 27 | endif() 28 | 29 | if(CLR_CMAKE_TARGET_WIN32) 30 | list(APPEND SOURCES ${HEADERS}) 31 | endif() 32 | 33 | function(set_common_libs TargetType) 34 | 35 | # Libraries used for exe projects 36 | if (${TargetType} STREQUAL "exe") 37 | if((CLR_CMAKE_TARGET_LINUX OR CLR_CMAKE_TARGET_FREEBSD) AND NOT CLR_CMAKE_TARGET_ANDROID) 38 | target_link_libraries (${DOTNET_PROJECT_NAME} "pthread") 39 | endif() 40 | 41 | if(CLR_CMAKE_TARGET_LINUX) 42 | target_link_libraries (${DOTNET_PROJECT_NAME} "dl") 43 | endif() 44 | endif() 45 | 46 | if (NOT ${TargetType} STREQUAL "lib-static") 47 | # Specify the import library to link against for Arm32 build since the default set is minimal 48 | if (CLR_CMAKE_TARGET_ARCH_ARM) 49 | if (CLR_CMAKE_TARGET_WIN32) 50 | target_link_libraries(${DOTNET_PROJECT_NAME} shell32.lib) 51 | else() 52 | target_link_libraries(${DOTNET_PROJECT_NAME} atomic.a) 53 | endif() 54 | endif() 55 | endif() 56 | endfunction() 57 | -------------------------------------------------------------------------------- /eng/Signing.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | true 11 | 12 | true 13 | 14 | 16 | false 19 | 20 | $([MSBuild]::NormalizeDirectory('$(ArtifactsDir)', 'assets', '$(Configuration)')) 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 34 | 35 | 36 | 37 | 38 | 39 | false 40 | assets/$(TargetArchitecture)/%(Filename)%(Extension) 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /eng/common/native/install-dependencies.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | # This is a simple script primarily used for CI to install necessary dependencies 6 | # 7 | # Usage: 8 | # 9 | # ./install-dependencies.sh 10 | 11 | os="$(echo "$1" | tr "[:upper:]" "[:lower:]")" 12 | 13 | if [ -z "$os" ]; then 14 | . "$(dirname "$0")"/init-os-and-arch.sh 15 | fi 16 | 17 | case "$os" in 18 | linux) 19 | if [ -e /etc/os-release ]; then 20 | . /etc/os-release 21 | fi 22 | 23 | if [ "$ID" = "debian" ] || [ "$ID_LIKE" = "debian" ]; then 24 | apt update 25 | 26 | apt install -y build-essential gettext locales cmake llvm clang lld lldb liblldb-dev libunwind8-dev libicu-dev liblttng-ust-dev \ 27 | libssl-dev libkrb5-dev pigz cpio 28 | 29 | localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 30 | elif [ "$ID" = "fedora" ] || [ "$ID" = "rhel" ] || [ "$ID" = "azurelinux" ]; then 31 | pkg_mgr="$(command -v tdnf 2>/dev/null || command -v dnf)" 32 | $pkg_mgr install -y cmake llvm lld lldb clang python curl libicu-devel openssl-devel krb5-devel lttng-ust-devel pigz cpio 33 | elif [ "$ID" = "alpine" ]; then 34 | apk add build-base cmake bash curl clang llvm-dev lld lldb krb5-dev lttng-ust-dev icu-dev openssl-dev pigz cpio 35 | else 36 | echo "Unsupported distro. distro: $ID" 37 | exit 1 38 | fi 39 | ;; 40 | 41 | osx|maccatalyst|ios|iossimulator|tvos|tvossimulator) 42 | echo "Installed xcode version: $(xcode-select -p)" 43 | 44 | export HOMEBREW_NO_INSTALL_CLEANUP=1 45 | export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 46 | # Skip brew update for now, see https://github.com/actions/setup-python/issues/577 47 | # brew update --preinstall 48 | brew bundle --no-upgrade --file=- <&1 | grep -qi android; then 7 | OSName="android" 8 | fi 9 | 10 | case "$OSName" in 11 | freebsd|linux|netbsd|openbsd|sunos|android|haiku) 12 | os="$OSName" ;; 13 | darwin) 14 | os=osx ;; 15 | *) 16 | echo "Unsupported OS $OSName detected!" 17 | exit 1 ;; 18 | esac 19 | 20 | # On Solaris, `uname -m` is discouraged, see https://docs.oracle.com/cd/E36784_01/html/E36870/uname-1.html 21 | # and `uname -p` returns processor type (e.g. i386 on amd64). 22 | # The appropriate tool to determine CPU is isainfo(1) https://docs.oracle.com/cd/E36784_01/html/E36870/isainfo-1.html. 23 | if [ "$os" = "sunos" ]; then 24 | if uname -o 2>&1 | grep -q illumos; then 25 | os="illumos" 26 | else 27 | os="solaris" 28 | fi 29 | CPUName=$(isainfo -n) 30 | else 31 | # For the rest of the operating systems, use uname(1) to determine what the CPU is. 32 | CPUName=$(uname -m) 33 | fi 34 | 35 | case "$CPUName" in 36 | arm64|aarch64) 37 | arch=arm64 38 | if [ "$(getconf LONG_BIT)" -lt 64 ]; then 39 | # This is 32-bit OS running on 64-bit CPU (for example Raspberry Pi OS) 40 | arch=arm 41 | fi 42 | ;; 43 | 44 | loongarch64) 45 | arch=loongarch64 46 | ;; 47 | 48 | riscv64) 49 | arch=riscv64 50 | ;; 51 | 52 | amd64|x86_64) 53 | arch=x64 54 | ;; 55 | 56 | armv7l|armv8l) 57 | # shellcheck disable=SC1091 58 | if (NAME=""; . /etc/os-release; test "$NAME" = "Tizen"); then 59 | arch=armel 60 | else 61 | arch=arm 62 | fi 63 | ;; 64 | 65 | armv6l) 66 | arch=armv6 67 | ;; 68 | 69 | i[3-6]86) 70 | echo "Unsupported CPU $CPUName detected, build might not succeed!" 71 | arch=x86 72 | ;; 73 | 74 | s390x) 75 | arch=s390x 76 | ;; 77 | 78 | ppc64le) 79 | arch=ppc64le 80 | ;; 81 | *) 82 | echo "Unknown CPU $CPUName detected!" 83 | exit 1 84 | ;; 85 | esac 86 | -------------------------------------------------------------------------------- /.github/workflows/labeler-predict-issues.yml: -------------------------------------------------------------------------------- 1 | # Workflow template imported and updated from: 2 | # https://github.com/dotnet/issue-labeler/wiki/Onboarding 3 | # 4 | # See labeler.md for more information 5 | # 6 | # Predict labels for Issues using a trained model 7 | name: "Labeler: Predict (Issues)" 8 | 9 | on: 10 | # Only automatically predict area labels when issues are first opened 11 | issues: 12 | types: opened 13 | 14 | # Allow dispatching the workflow via the Actions UI, specifying ranges of numbers 15 | workflow_dispatch: 16 | inputs: 17 | issues: 18 | description: "Issue Numbers (comma-separated list of ranges)." 19 | required: true 20 | cache_key: 21 | description: "The cache key suffix to use for restoring the model. Defaults to 'ACTIVE'." 22 | required: true 23 | default: "ACTIVE" 24 | 25 | env: 26 | # Do not allow failure for jobs triggered automatically (as this causes red noise on the workflows list) 27 | ALLOW_FAILURE: ${{ github.event_name == 'workflow_dispatch' }} 28 | 29 | LABEL_PREFIX: "area-" 30 | THRESHOLD: 0.40 31 | 32 | jobs: 33 | predict-issue-label: 34 | # Do not automatically run the workflow on forks outside the 'dotnet' org 35 | if: ${{ github.event_name == 'workflow_dispatch' || github.repository_owner == 'dotnet' }} 36 | runs-on: ubuntu-latest 37 | permissions: 38 | issues: write 39 | steps: 40 | - name: "Restore issues model from cache" 41 | id: restore-model 42 | uses: dotnet/issue-labeler/restore@46125e85e6a568dc712f358c39f35317366f5eed # v2.0.0 43 | with: 44 | type: issues 45 | fail-on-cache-miss: ${{ env.ALLOW_FAILURE }} 46 | quiet: true 47 | 48 | - name: "Predict issue labels" 49 | id: prediction 50 | if: ${{ steps.restore-model.outputs.cache-hit == 'true' }} 51 | uses: dotnet/issue-labeler/predict@46125e85e6a568dc712f358c39f35317366f5eed # v2.0.0 52 | with: 53 | issues: ${{ inputs.issues || github.event.issue.number }} 54 | label_prefix: ${{ env.LABEL_PREFIX }} 55 | threshold: ${{ env.THRESHOLD }} 56 | default_label: ${{ env.DEFAULT_LABEL }} 57 | env: 58 | GITHUB_TOKEN: ${{ github.token }} 59 | continue-on-error: ${{ !env.ALLOW_FAILURE }} 60 | -------------------------------------------------------------------------------- /eng/common/post-build/check-channel-consistency.ps1: -------------------------------------------------------------------------------- 1 | param( 2 | [Parameter(Mandatory=$true)][string] $PromoteToChannels, # List of channels that the build should be promoted to 3 | [Parameter(Mandatory=$true)][array] $AvailableChannelIds # List of channel IDs available in the YAML implementation 4 | ) 5 | 6 | try { 7 | $ErrorActionPreference = 'Stop' 8 | Set-StrictMode -Version 2.0 9 | 10 | # `tools.ps1` checks $ci to perform some actions. Since the post-build 11 | # scripts don't necessarily execute in the same agent that run the 12 | # build.ps1/sh script this variable isn't automatically set. 13 | $ci = $true 14 | $disableConfigureToolsetImport = $true 15 | . $PSScriptRoot\..\tools.ps1 16 | 17 | if ($PromoteToChannels -eq "") { 18 | Write-PipelineTaskError -Type 'warning' -Message "This build won't publish assets as it's not configured to any Maestro channel. If that wasn't intended use Darc to configure a default channel using add-default-channel for this branch or to promote it to a channel using add-build-to-channel. See https://github.com/dotnet/arcade/blob/main/Documentation/Darc.md#assigning-an-individual-build-to-a-channel for more info." 19 | ExitWithExitCode 0 20 | } 21 | 22 | # Check that every channel that Maestro told to promote the build to 23 | # is available in YAML 24 | $PromoteToChannelsIds = $PromoteToChannels -split "\D" | Where-Object { $_ } 25 | 26 | $hasErrors = $false 27 | 28 | foreach ($id in $PromoteToChannelsIds) { 29 | if (($id -ne 0) -and ($id -notin $AvailableChannelIds)) { 30 | Write-PipelineTaskError -Message "Channel $id is not present in the post-build YAML configuration! This is an error scenario. Please contact @dnceng." 31 | $hasErrors = $true 32 | } 33 | } 34 | 35 | # The `Write-PipelineTaskError` doesn't error the script and we might report several errors 36 | # in the previous lines. The check below makes sure that we return an error state from the 37 | # script if we reported any validation error 38 | if ($hasErrors) { 39 | ExitWithExitCode 1 40 | } 41 | 42 | Write-Host 'done.' 43 | } 44 | catch { 45 | Write-Host $_ 46 | Write-PipelineTelemetryError -Category 'CheckChannelConsistency' -Message "There was an error while trying to check consistency of Maestro default channels for the build and post-build YAML configuration." 47 | ExitWithExitCode 1 48 | } 49 | -------------------------------------------------------------------------------- /eng/common/templates-official/variables/pool-providers.yml: -------------------------------------------------------------------------------- 1 | # Select a pool provider based off branch name. Anything with branch name containing 'release' must go into an -Svc pool, 2 | # otherwise it should go into the "normal" pools. This separates out the queueing and billing of released branches. 3 | 4 | # Motivation: 5 | # Once a given branch of a repository's output has been officially "shipped" once, it is then considered to be COGS 6 | # (Cost of goods sold) and should be moved to a servicing pool provider. This allows both separation of queueing 7 | # (allowing release builds and main PR builds to not intefere with each other) and billing (required for COGS. 8 | # Additionally, the pool provider name itself may be subject to change when the .NET Core Engineering Services 9 | # team needs to move resources around and create new and potentially differently-named pools. Using this template 10 | # file from an Arcade-ified repo helps guard against both having to update one's release/* branches and renaming. 11 | 12 | # How to use: 13 | # This yaml assumes your shipped product branches use the naming convention "release/..." (which many do). 14 | # If we find alternate naming conventions in broad usage it can be added to the condition below. 15 | # 16 | # First, import the template in an arcade-ified repo to pick up the variables, e.g.: 17 | # 18 | # variables: 19 | # - template: /eng/common/templates-official/variables/pool-providers.yml 20 | # 21 | # ... then anywhere specifying the pool provider use the runtime variables, 22 | # $(DncEngInternalBuildPool) 23 | # 24 | # pool: 25 | # name: $(DncEngInternalBuildPool) 26 | # image: 1es-windows-2022 27 | 28 | variables: 29 | # Coalesce the target and source branches so we know when a PR targets a release branch 30 | # If these variables are somehow missing, fall back to main (tends to have more capacity) 31 | 32 | # Any new -Svc alternative pools should have variables added here to allow for splitting work 33 | 34 | - name: DncEngInternalBuildPool 35 | value: $[ 36 | replace( 37 | replace( 38 | eq(contains(coalesce(variables['System.PullRequest.TargetBranch'], variables['Build.SourceBranch'], 'refs/heads/main'), 'release'), 'true'), 39 | True, 40 | 'NetCore1ESPool-Svc-Internal' 41 | ), 42 | False, 43 | 'NetCore1ESPool-Internal' 44 | ) 45 | ] -------------------------------------------------------------------------------- /src/clickonce/native/projects/NetCoreCheck/CA/MsiWrapper.cpp: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | #include "MsiWrapper.h" 6 | 7 | MsiWrapper::MsiWrapper(MSIHANDLE msiHandle) noexcept 8 | { 9 | m_msiHandle = msiHandle; 10 | } 11 | 12 | MsiWrapper::~MsiWrapper(void) noexcept 13 | { 14 | } 15 | 16 | HRESULT MsiWrapper::GetProperty(LPCWSTR propertyName, LPWSTR* propertyValue) 17 | { 18 | if (!propertyName || !*propertyName || !propertyValue) 19 | { 20 | return E_INVALIDARG; 21 | } 22 | 23 | DWORD_PTR count = 0; 24 | WCHAR empty[1] = L""; 25 | UINT er = ::MsiGetPropertyW(m_msiHandle, propertyName, empty, (DWORD *)&count); 26 | if (ERROR_MORE_DATA == er || ERROR_SUCCESS == er) 27 | { 28 | *propertyValue = new WCHAR[++count]; 29 | } 30 | else 31 | { 32 | return HRESULT_FROM_WIN32(er); 33 | } 34 | 35 | er = ::MsiGetPropertyW(m_msiHandle, propertyName, *propertyValue, (DWORD *)&count); 36 | if (er == ERROR_SUCCESS) 37 | { 38 | return S_OK; 39 | } 40 | else 41 | { 42 | FreeStr(*propertyValue); 43 | return HRESULT_FROM_WIN32(er); 44 | } 45 | } 46 | 47 | HRESULT MsiWrapper::SetProperty(LPCWSTR propertyName, LPCWSTR propertyValue) 48 | { 49 | if (!propertyName || !*propertyName || !propertyValue) 50 | { 51 | return E_INVALIDARG; 52 | } 53 | 54 | UINT er = ::MsiSetPropertyW(m_msiHandle, propertyName, propertyValue); 55 | return er == ERROR_SUCCESS ? S_OK : HRESULT_FROM_WIN32(er); 56 | } 57 | 58 | void MsiWrapper::Log(LPCWSTR msg) const noexcept 59 | { 60 | PMSIHANDLE record = MsiCreateRecord(1); 61 | if (record) 62 | { 63 | ::MsiRecordSetStringW(record, 0, msg); 64 | ::MsiProcessMessage(m_msiHandle, INSTALLMESSAGE_INFO, record); 65 | } 66 | } 67 | 68 | void MsiWrapper::LogFailure(HRESULT hr, LPCWSTR format, ...) const noexcept 69 | { 70 | WCHAR failureMessage[LOG_BUFFER]; 71 | 72 | va_list args; 73 | va_start(args, format); 74 | StringCchVPrintfW(failureMessage, _countof(failureMessage), format, args); 75 | va_end(args); 76 | 77 | WCHAR buffer[LOG_BUFFER]; 78 | StringCchPrintfW(buffer, _countof(buffer), L"FAILURE: 0x%x. %s", hr, failureMessage); 79 | Log(buffer); 80 | } 81 | -------------------------------------------------------------------------------- /Build.proj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | true 6 | 7 | false 8 | 9 | 10 | 11 | 12 | 13 | 14 | 17 | Configuration=$(ClickOnceConfiguration) 18 | 19 | 20 | 25 | Configuration=$(ClickOnceConfiguration) 26 | 27 | 28 | 29 | 30 | 34 | 38 | 39 | 40 | 41 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /eng/native/configuretools.cmake: -------------------------------------------------------------------------------- 1 | include(${CMAKE_CURRENT_LIST_DIR}/configureplatform.cmake) 2 | 3 | # Get the version of the compiler that is in the file name for tool location. 4 | set (CLR_CMAKE_COMPILER_FILE_NAME_VERSION "") 5 | if (CMAKE_C_COMPILER MATCHES "-?[0-9]+(\.[0-9]+)?$") 6 | set(CLR_CMAKE_COMPILER_FILE_NAME_VERSION "${CMAKE_MATCH_0}") 7 | endif() 8 | 9 | if(NOT WIN32 AND NOT CLR_CMAKE_TARGET_BROWSER) 10 | if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") 11 | if(APPLE) 12 | set(TOOLSET_PREFIX "") 13 | else() 14 | set(TOOLSET_PREFIX "llvm-") 15 | endif() 16 | elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU") 17 | if(CMAKE_CROSSCOMPILING) 18 | set(TOOLSET_PREFIX "${CMAKE_CXX_COMPILER_TARGET}-") 19 | else() 20 | set(TOOLSET_PREFIX "") 21 | endif() 22 | endif() 23 | 24 | function(locate_toolchain_exec exec var) 25 | string(TOUPPER ${exec} EXEC_UPPERCASE) 26 | if(NOT "$ENV{CLR_${EXEC_UPPERCASE}}" STREQUAL "") 27 | set(${var} "$ENV{CLR_${EXEC_UPPERCASE}}" PARENT_SCOPE) 28 | return() 29 | endif() 30 | 31 | find_program(EXEC_LOCATION_${exec} 32 | NAMES 33 | "${TOOLSET_PREFIX}${exec}${CLR_CMAKE_COMPILER_FILE_NAME_VERSION}" 34 | "${TOOLSET_PREFIX}${exec}") 35 | 36 | if (EXEC_LOCATION_${exec} STREQUAL "EXEC_LOCATION_${exec}-NOTFOUND") 37 | message(FATAL_ERROR "Unable to find toolchain executable for: ${exec}.") 38 | endif() 39 | set(${var} ${EXEC_LOCATION_${exec}} PARENT_SCOPE) 40 | endfunction() 41 | 42 | locate_toolchain_exec(ar CMAKE_AR) 43 | locate_toolchain_exec(link CMAKE_LINKER) 44 | locate_toolchain_exec(nm CMAKE_NM) 45 | 46 | if(CMAKE_CXX_COMPILER_ID MATCHES "GNU") 47 | locate_toolchain_exec(ranlib CMAKE_RANLIB) 48 | endif() 49 | 50 | if(NOT CLR_CMAKE_TARGET_OSX AND NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CMAKE_TARGET_TVOS AND (NOT CLR_CMAKE_TARGET_ANDROID OR CROSS_ROOTFS)) 51 | locate_toolchain_exec(objdump CMAKE_OBJDUMP) 52 | 53 | if(CLR_CMAKE_TARGET_ANDROID) 54 | set(TOOLSET_PREFIX ${ANDROID_TOOLCHAIN_PREFIX}) 55 | elseif(CMAKE_CROSSCOMPILING AND NOT DEFINED CLR_CROSS_COMPONENTS_BUILD AND (CMAKE_SYSTEM_PROCESSOR STREQUAL armv7l OR 56 | CMAKE_SYSTEM_PROCESSOR STREQUAL aarch64 OR CMAKE_SYSTEM_PROCESSOR STREQUAL arm)) 57 | set(TOOLSET_PREFIX "${TOOLCHAIN}-") 58 | else() 59 | set(TOOLSET_PREFIX "") 60 | endif() 61 | 62 | locate_toolchain_exec(objcopy CMAKE_OBJCOPY) 63 | endif() 64 | endif() 65 | -------------------------------------------------------------------------------- /eng/common/cross/tizen-build-rootfs.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -e 3 | 4 | ARCH=$1 5 | LINK_ARCH=$ARCH 6 | 7 | case "$ARCH" in 8 | arm) 9 | TIZEN_ARCH="armv7hl" 10 | ;; 11 | armel) 12 | TIZEN_ARCH="armv7l" 13 | LINK_ARCH="arm" 14 | ;; 15 | arm64) 16 | TIZEN_ARCH="aarch64" 17 | ;; 18 | x86) 19 | TIZEN_ARCH="i686" 20 | ;; 21 | x64) 22 | TIZEN_ARCH="x86_64" 23 | LINK_ARCH="x86" 24 | ;; 25 | riscv64) 26 | TIZEN_ARCH="riscv64" 27 | LINK_ARCH="riscv" 28 | ;; 29 | *) 30 | echo "Unsupported architecture for tizen: $ARCH" 31 | exit 1 32 | esac 33 | 34 | __CrossDir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) 35 | __TIZEN_CROSSDIR="$__CrossDir/${ARCH}/tizen" 36 | 37 | if [[ -z "$ROOTFS_DIR" ]]; then 38 | echo "ROOTFS_DIR is not defined." 39 | exit 1; 40 | fi 41 | 42 | TIZEN_TMP_DIR=$ROOTFS_DIR/tizen_tmp 43 | mkdir -p $TIZEN_TMP_DIR 44 | 45 | # Download files 46 | echo ">>Start downloading files" 47 | VERBOSE=1 $__CrossDir/tizen-fetch.sh $TIZEN_TMP_DIR $TIZEN_ARCH 48 | echo "<>Start constructing Tizen rootfs" 51 | TIZEN_RPM_FILES=`ls $TIZEN_TMP_DIR/*.rpm` 52 | cd $ROOTFS_DIR 53 | for f in $TIZEN_RPM_FILES; do 54 | rpm2cpio $f | cpio -idm --quiet 55 | done 56 | echo "<>Start configuring Tizen rootfs" 63 | ln -sfn asm-${LINK_ARCH} ./usr/include/asm 64 | patch -p1 < $__TIZEN_CROSSDIR/tizen.patch 65 | if [[ "$TIZEN_ARCH" == "riscv64" ]]; then 66 | echo "Fixing broken symlinks in $PWD" 67 | rm ./usr/lib64/libresolv.so 68 | ln -s ../../lib64/libresolv.so.2 ./usr/lib64/libresolv.so 69 | rm ./usr/lib64/libpthread.so 70 | ln -s ../../lib64/libpthread.so.0 ./usr/lib64/libpthread.so 71 | rm ./usr/lib64/libdl.so 72 | ln -s ../../lib64/libdl.so.2 ./usr/lib64/libdl.so 73 | rm ./usr/lib64/libutil.so 74 | ln -s ../../lib64/libutil.so.1 ./usr/lib64/libutil.so 75 | rm ./usr/lib64/libm.so 76 | ln -s ../../lib64/libm.so.6 ./usr/lib64/libm.so 77 | rm ./usr/lib64/librt.so 78 | ln -s ../../lib64/librt.so.1 ./usr/lib64/librt.so 79 | rm ./lib/ld-linux-riscv64-lp64d.so.1 80 | ln -s ../lib64/ld-linux-riscv64-lp64d.so.1 ./lib/ld-linux-riscv64-lp64d.so.1 81 | fi 82 | echo "<(() => 18 | { 19 | Utils.GetFileHash(null, SHA512.Create()); 20 | }); 21 | } 22 | 23 | [Fact] 24 | public void GetFileHashThrowsIfFileNameIsEmpty() 25 | { 26 | ArgumentException e = Assert.Throws(() => 27 | { 28 | Utils.GetFileHash("", SHA512.Create()); 29 | }); 30 | 31 | Assert.Equal($"Value cannot be empty. (Parameter 'fileName')", e.Message); 32 | } 33 | 34 | [Fact] 35 | public void GetFileHashThrowsIfHashAlgorithmIsNull() 36 | { 37 | ArgumentNullException e = Assert.Throws(() => 38 | { 39 | Utils.GetFileHash("File.txt", null); 40 | }); 41 | 42 | Assert.Equal($"Value cannot be null. (Parameter 'hashAlgorithm')", e.Message); 43 | } 44 | 45 | [Fact] 46 | public async Task DownloadFileAsyncCanCopyFiles() 47 | { 48 | string sourceFile = Path.GetTempFileName(); 49 | 50 | using (FileStream fs = new FileStream(Path.GetTempFileName(), FileMode.Create, FileAccess.Write, FileShare.None)) 51 | { 52 | fs.SetLength(1024); 53 | } 54 | 55 | Uri sourceAddress = new Uri(Path.GetFullPath(sourceFile)); 56 | string destinationFile = Path.GetFullPath(Path.GetTempFileName()); 57 | await Utils.DownloadFileAsync(sourceAddress, destinationFile); 58 | 59 | HashAlgorithm sha256 = SHA256.Create(); 60 | string sourceHash = Utils.GetFileHash(sourceFile, sha256); 61 | string destinationHash = Utils.GetFileHash(destinationFile, sha256); 62 | 63 | Assert.True(File.Exists(destinationFile)); 64 | Assert.Equal(sourceHash, destinationHash); 65 | } 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /eng/common/sdl/trim-assets-version.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | .SYNOPSIS 3 | Install and run the 'Microsoft.DotNet.VersionTools.Cli' tool with the 'trim-artifacts-version' command to trim the version from the NuGet assets file name. 4 | 5 | .PARAMETER InputPath 6 | Full path to directory where artifact packages are stored 7 | 8 | .PARAMETER Recursive 9 | Search for NuGet packages recursively 10 | 11 | #> 12 | 13 | Param( 14 | [string] $InputPath, 15 | [bool] $Recursive = $true 16 | ) 17 | 18 | $CliToolName = "Microsoft.DotNet.VersionTools.Cli" 19 | 20 | function Install-VersionTools-Cli { 21 | param( 22 | [Parameter(Mandatory=$true)][string]$Version 23 | ) 24 | 25 | Write-Host "Installing the package '$CliToolName' with a version of '$version' ..." 26 | $feed = "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json" 27 | 28 | $argumentList = @("tool", "install", "--local", "$CliToolName", "--add-source $feed", "--no-cache", "--version $Version", "--create-manifest-if-needed") 29 | Start-Process "$dotnet" -Verbose -ArgumentList $argumentList -NoNewWindow -Wait 30 | } 31 | 32 | # ------------------------------------------------------------------- 33 | 34 | if (!(Test-Path $InputPath)) { 35 | Write-Host "Input Path '$InputPath' does not exist" 36 | ExitWithExitCode 1 37 | } 38 | 39 | $ErrorActionPreference = 'Stop' 40 | Set-StrictMode -Version 2.0 41 | 42 | $disableConfigureToolsetImport = $true 43 | $global:LASTEXITCODE = 0 44 | 45 | # `tools.ps1` checks $ci to perform some actions. Since the SDL 46 | # scripts don't necessarily execute in the same agent that run the 47 | # build.ps1/sh script this variable isn't automatically set. 48 | $ci = $true 49 | . $PSScriptRoot\..\tools.ps1 50 | 51 | try { 52 | $dotnetRoot = InitializeDotNetCli -install:$true 53 | $dotnet = "$dotnetRoot\dotnet.exe" 54 | 55 | $toolsetVersion = Read-ArcadeSdkVersion 56 | Install-VersionTools-Cli -Version $toolsetVersion 57 | 58 | $cliToolFound = (& "$dotnet" tool list --local | Where-Object {$_.Split(' ')[0] -eq $CliToolName}) 59 | if ($null -eq $cliToolFound) { 60 | Write-PipelineTelemetryError -Force -Category 'Sdl' -Message "The '$CliToolName' tool is not installed." 61 | ExitWithExitCode 1 62 | } 63 | 64 | Exec-BlockVerbosely { 65 | & "$dotnet" $CliToolName trim-assets-version ` 66 | --assets-path $InputPath ` 67 | --recursive $Recursive 68 | Exit-IfNZEC "Sdl" 69 | } 70 | } 71 | catch { 72 | Write-Host $_ 73 | Write-PipelineTelemetryError -Force -Category 'Sdl' -Message $_ 74 | ExitWithExitCode 1 75 | } 76 | -------------------------------------------------------------------------------- /src/clickonce/native/build.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | usage_list=("-nativever : Version of native binaries.") 4 | usage_list+=("-commithash : Current commit hash of the repo at build time.") 5 | 6 | set -e 7 | 8 | __scriptpath="$(cd "$(dirname "$0")"; pwd -P)" 9 | __RepoRootDir="$(cd "$__scriptpath"/../../..; pwd -P)" 10 | 11 | __BuildArch=x64 12 | __TargetOS=Linux 13 | __BuildType=Debug 14 | __CMakeArgs="" 15 | __Compiler=clang 16 | __CompilerMajorVersion= 17 | __CompilerMinorVersion= 18 | __CrossBuild=0 19 | __IsMSBuildOnNETCoreSupported=0 20 | __PortableBuild=1 21 | __RootBinDir="$__RepoRootDir/artifacts" 22 | __SkipConfigure=0 23 | __SkipGenerateVersion=0 24 | __StaticLibLink=0 25 | __UnprocessedBuildArgs= 26 | __VerboseBuild=false 27 | __native_ver= 28 | __commit_hash= 29 | 30 | handle_arguments() { 31 | 32 | case "$1" in 33 | nativever|-nativever) 34 | __native_ver="$2" 35 | __ShiftArgs=1 36 | ;; 37 | 38 | commithash|-commithash) 39 | __commit_hash="$2" 40 | __ShiftArgs=1 41 | ;; 42 | 43 | *) 44 | __UnprocessedBuildArgs="$__UnprocessedBuildArgs $1" 45 | esac 46 | } 47 | 48 | source "$__RepoRootDir"/eng/native/build-commons.sh 49 | 50 | # Set dependent variables 51 | __LogsDir="$__RootBinDir/log" 52 | __MsbuildDebugLogsDir="$__LogsDir/MsbuildDebugLogs" 53 | 54 | # Set the remaining variables based upon the determined build configuration 55 | __DistroRidLower="$(echo $__DistroRid | tr '[:upper:]' '[:lower:]')" 56 | __BinDir="$__RootBinDir/bin/$__DistroRidLower.$__BuildType" 57 | __IntermediatesDir="$__RootBinDir/obj/$__DistroRidLower.$__BuildType" 58 | 59 | export __BinDir __IntermediatesDir 60 | 61 | __CMakeArgs="-DCLI_CMAKE_NATIVE_VER=\"$__native_ver\" $__CMakeArgs" 62 | __CMakeArgs="-DCLI_CMAKE_PKG_RID=\"$__DistroRid\" -DCLI_CMAKE_COMMIT_HASH=\"$__commit_hash\" $__CMakeArgs" 63 | 64 | if [[ "$__PortableBuild" == 1 ]]; then 65 | __CMakeArgs="-DCLI_CMAKE_PORTABLE_BUILD=1 $__CMakeArgs" 66 | fi 67 | 68 | # Specify path to be set for CMAKE_INSTALL_PREFIX. 69 | # This is where all built binaries will be copied to. 70 | __CMakeBinDir="$__BinDir" 71 | export __CMakeBinDir 72 | 73 | # Make the directories necessary for build if they don't exist 74 | setup_dirs 75 | 76 | # Check prereqs. 77 | check_prereqs 78 | 79 | # Build the installer native components. 80 | # note the third argument, tryrun_dir is empty for installers 81 | build_native "$__BuildArch" "$__scriptpath" "" "$__IntermediatesDir" "installer component" 82 | -------------------------------------------------------------------------------- /docs/dotnet-mage/README.md: -------------------------------------------------------------------------------- 1 | # dotnet-mage 2 | 3 | dotnet-mage (previously also known as Mage.NET) is the open-sourced version of the familiar .NET FX tool Mage. 4 | 5 | You can find the latest version of [dotnet-mage on Nuget.org](https://www.nuget.org/packages/Microsoft.DotNet.Mage). 6 | 7 | dotnet-mage supports all existing command-line options of the old Mage tool, with few exceptions: 8 | - no support for partial trust 9 | - no support for sha1 hashing 10 | - no support for ia64 architecture 11 | 12 | For the full list of Mage command line options please visit https://docs.microsoft.com/en-us/dotnet/framework/tools/mage-exe-manifest-generation-and-editing-tool 13 | 14 | There is one new option, to add launcher. Here's the short documentation for this option: 15 | 16 | Adds Launcher to target directory and sets binary to be launched. 17 | 18 | `-AddLauncher ` or short `-al` 19 | 20 | Example: 21 | `-AddLauncher myapp.dll -TargetDirectory bin/release` 22 | 23 | Launcher is required for all modern .NET (including .NET 5+, .NET Core 3.1) apps in ClickOnce. 24 | 25 | You can obtain all command-line options by running `dotnet mage` or for verbose help `dotnet mage -help verbose`. 26 | 27 | ## Prerequisites for using this tool 28 | 29 | * [Install .NET SDK](https://dotnet.microsoft.com/download) 30 | 31 | * Install dotnet-mage global tool: 32 | 33 | `dotnet tool install --global microsoft.dotnet.mage` 34 | 35 | dotnet-mage is fully supported on Windows (we are gathering feedback about scenarios for dotnet-mage usage on Linux build agents). 36 | 37 | ## Common usage scenario 38 | 39 | * Build the project and copy the produced project output (binaries, json files, etc.) to a new folder 40 | * Add launcher 41 | * Create application manifest 42 | * Create deployment manifest 43 | 44 | ## Example steps 45 | 46 | Suppose that we have copied project output to a sub-folder `files` and our .NET application entry point is `myapp.exe` 47 | 48 | * Add Launcher 49 | 50 | `dotnet mage -al myapp.exe -td files` 51 | 52 | * Create application manifest 53 | 54 | `dotnet mage -new Application -t files\MyApp.manifest -fd files -v 1.0.0.1` 55 | 56 | * Create deployment manifest 57 | 58 | `dotnet mage -new Deployment -Install true -pub "My Publisher" -v 1.0.0.1 -AppManifest files\MyApp.manifest -t MyApp.application` 59 | 60 | ### Update an existing application 61 | 62 | * Update application manifest 63 | 64 | `dotnet mage -update files\MyApp.manifest -v 1.0.0.2` 65 | 66 | * Update deployment manifest 67 | 68 | `dotnet mage -update MyApp.Application -v 1.0.0.2 -AppManifest files\MyApp.manifest` 69 | 70 | -------------------------------------------------------------------------------- /src/clickonce/launcher/ProcessHelper.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | 4 | using System; 5 | using System.Diagnostics; 6 | using System.Threading; 7 | 8 | namespace Microsoft.Deployment.Launcher 9 | { 10 | internal class ProcessHelper 11 | { 12 | private readonly ProcessStartInfo psi; 13 | 14 | /// 15 | /// ProcessHelper constructor 16 | /// 17 | /// Executable name 18 | /// Arguments 19 | public ProcessHelper(string exe, string args) 20 | { 21 | psi = new ProcessStartInfo(exe, args) 22 | { 23 | UseShellExecute = false 24 | }; 25 | } 26 | 27 | /// 28 | /// Starts the process, with retries. 29 | /// Number of attempts and delay are specified in Constants class. 30 | /// 31 | public void StartProcessWithRetries() 32 | { 33 | Logger.LogInfo(Constants.InfoProcessToLaunch, psi.FileName, psi.Arguments); 34 | int count = 1; 35 | while (true) 36 | { 37 | try 38 | { 39 | StartProcess(); 40 | return; 41 | } 42 | catch (Exception e) 43 | { 44 | // Log each failure attempt 45 | Logger.LogError(Constants.ErrorProcessStart, e.Message); 46 | 47 | if (count++ < Constants.NumberOfProcessStartAttempts) 48 | { 49 | Logger.LogInfo(Constants.InfoProcessStartWaitRetry, Constants.DelayBeforeRetryMiliseconds); 50 | Thread.Sleep(Constants.DelayBeforeRetryMiliseconds); 51 | continue; 52 | } 53 | else 54 | { 55 | Logger.LogError(Constants.ErrorProcessFailedToLaunch, psi.FileName, psi.Arguments); 56 | throw; 57 | } 58 | } 59 | } 60 | } 61 | 62 | /// 63 | /// Starts the process. 64 | /// 65 | private void StartProcess() 66 | { 67 | if (null == Process.Start(psi)) 68 | { 69 | throw new LauncherException(Constants.ErrorProcessNotStarted); 70 | } 71 | } 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /eng/common/sdl/extract-artifact-archives.ps1: -------------------------------------------------------------------------------- 1 | # This script looks for each archive file in a directory and extracts it into the target directory. 2 | # For example, the file "$InputPath/bin.tar.gz" extracts to "$ExtractPath/bin.tar.gz.extracted/**". 3 | # Uses the "tar" utility added to Windows 10 / Windows 2019 that supports tar.gz and zip. 4 | param( 5 | # Full path to directory where archives are stored. 6 | [Parameter(Mandatory=$true)][string] $InputPath, 7 | # Full path to directory to extract archives into. May be the same as $InputPath. 8 | [Parameter(Mandatory=$true)][string] $ExtractPath 9 | ) 10 | 11 | $ErrorActionPreference = 'Stop' 12 | Set-StrictMode -Version 2.0 13 | 14 | $disableConfigureToolsetImport = $true 15 | 16 | try { 17 | # `tools.ps1` checks $ci to perform some actions. Since the SDL 18 | # scripts don't necessarily execute in the same agent that run the 19 | # build.ps1/sh script this variable isn't automatically set. 20 | $ci = $true 21 | . $PSScriptRoot\..\tools.ps1 22 | 23 | Measure-Command { 24 | $jobs = @() 25 | 26 | # Find archive files for non-Windows and Windows builds. 27 | $archiveFiles = @( 28 | Get-ChildItem (Join-Path $InputPath "*.tar.gz") 29 | Get-ChildItem (Join-Path $InputPath "*.zip") 30 | ) 31 | 32 | foreach ($targzFile in $archiveFiles) { 33 | $jobs += Start-Job -ScriptBlock { 34 | $file = $using:targzFile 35 | $fileName = [System.IO.Path]::GetFileName($file) 36 | $extractDir = Join-Path $using:ExtractPath "$fileName.extracted" 37 | 38 | New-Item $extractDir -ItemType Directory -Force | Out-Null 39 | 40 | Write-Host "Extracting '$file' to '$extractDir'..." 41 | 42 | # Pipe errors to stdout to prevent PowerShell detecting them and quitting the job early. 43 | # This type of quit skips the catch, so we wouldn't be able to tell which file triggered the 44 | # error. Save output so it can be stored in the exception string along with context. 45 | $output = tar -xf $file -C $extractDir 2>&1 46 | # Handle NZEC manually rather than using Exit-IfNZEC: we are in a background job, so we 47 | # don't have access to the outer scope. 48 | if ($LASTEXITCODE -ne 0) { 49 | throw "Error extracting '$file': non-zero exit code ($LASTEXITCODE). Output: '$output'" 50 | } 51 | 52 | Write-Host "Extracted to $extractDir" 53 | } 54 | } 55 | 56 | Receive-Job $jobs -Wait 57 | } 58 | } 59 | catch { 60 | Write-Host $_ 61 | Write-PipelineTelemetryError -Force -Category 'Sdl' -Message $_ 62 | ExitWithExitCode 1 63 | } 64 | -------------------------------------------------------------------------------- /src/Microsoft.Deployment.DotNet.Releases/src/AspNetCoreReleaseComponent.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.ObjectModel; 7 | using System.Text.Json; 8 | 9 | namespace Microsoft.Deployment.DotNet.Releases 10 | { 11 | /// 12 | /// Describes an ASP.NET Core release. 13 | /// 14 | public class AspNetCoreReleaseComponent : ReleaseComponent 15 | { 16 | /// 17 | /// The versions of the ASP.NET Core Module in this release. 18 | /// 19 | public ReadOnlyCollection AspNetCoreModuleVersions 20 | { 21 | get; 22 | } 23 | 24 | /// 25 | /// The friendly display name for the component. 26 | /// 27 | public override string Name => ReleasesResources.AspNetCoreReleaseName; 28 | 29 | /// 30 | /// The versions of Visual Studio that includes this runtime. Multiple versions may be listed, e.g. 31 | /// "15.9.25, 16.0.16, 16.4.11, 16.6.4" 32 | /// 33 | public string VisualStudioVersion 34 | { 35 | get; 36 | } 37 | 38 | /// 39 | /// Creates a new instance. 40 | /// 41 | /// The JSON element of the component. 42 | /// The release to which the component belongs. 43 | internal AspNetCoreReleaseComponent(JsonElement element, ProductRelease release) : base(element, release) 44 | { 45 | List ancmVersions = new(); 46 | 47 | if (element.TryGetProperty("version-aspnetcoremodule", out JsonElement ancmVersionValue) && ancmVersionValue.ValueKind != JsonValueKind.Null) 48 | { 49 | var enumerator = ancmVersionValue.EnumerateArray(); 50 | 51 | while (enumerator.MoveNext()) 52 | { 53 | if (System.Version.TryParse(enumerator.Current.GetString(), out Version version)) 54 | { 55 | ancmVersions.Add(version); 56 | } 57 | } 58 | } 59 | 60 | AspNetCoreModuleVersions = new ReadOnlyCollection(ancmVersions); 61 | VisualStudioVersion = element.GetStringOrDefault("vs-version"); 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /eng/common/dotnet-install.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | source="${BASH_SOURCE[0]}" 4 | # resolve $source until the file is no longer a symlink 5 | while [[ -h "$source" ]]; do 6 | scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" 7 | source="$(readlink "$source")" 8 | # if $source was a relative symlink, we need to resolve it relative to the path where the 9 | # symlink file was located 10 | [[ $source != /* ]] && source="$scriptroot/$source" 11 | done 12 | scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" 13 | 14 | . "$scriptroot/tools.sh" 15 | 16 | version='Latest' 17 | architecture='' 18 | runtime='dotnet' 19 | runtimeSourceFeed='' 20 | runtimeSourceFeedKey='' 21 | while [[ $# > 0 ]]; do 22 | opt="$(echo "$1" | tr "[:upper:]" "[:lower:]")" 23 | case "$opt" in 24 | -version|-v) 25 | shift 26 | version="$1" 27 | ;; 28 | -architecture|-a) 29 | shift 30 | architecture="$1" 31 | ;; 32 | -runtime|-r) 33 | shift 34 | runtime="$1" 35 | ;; 36 | -runtimesourcefeed) 37 | shift 38 | runtimeSourceFeed="$1" 39 | ;; 40 | -runtimesourcefeedkey) 41 | shift 42 | runtimeSourceFeedKey="$1" 43 | ;; 44 | *) 45 | Write-PipelineTelemetryError -Category 'Build' -Message "Invalid argument: $1" 46 | exit 1 47 | ;; 48 | esac 49 | shift 50 | done 51 | 52 | # Use uname to determine what the CPU is, see https://en.wikipedia.org/wiki/Uname#Examples 53 | cpuname=$(uname -m) 54 | case $cpuname in 55 | arm64|aarch64) 56 | buildarch=arm64 57 | if [ "$(getconf LONG_BIT)" -lt 64 ]; then 58 | # This is 32-bit OS running on 64-bit CPU (for example Raspberry Pi OS) 59 | buildarch=arm 60 | fi 61 | ;; 62 | loongarch64) 63 | buildarch=loongarch64 64 | ;; 65 | amd64|x86_64) 66 | buildarch=x64 67 | ;; 68 | armv*l) 69 | buildarch=arm 70 | ;; 71 | i[3-6]86) 72 | buildarch=x86 73 | ;; 74 | riscv64) 75 | buildarch=riscv64 76 | ;; 77 | *) 78 | echo "Unknown CPU $cpuname detected, treating it as x64" 79 | buildarch=x64 80 | ;; 81 | esac 82 | 83 | dotnetRoot="${repo_root}.dotnet" 84 | if [[ $architecture != "" ]] && [[ $architecture != $buildarch ]]; then 85 | dotnetRoot="$dotnetRoot/$architecture" 86 | fi 87 | 88 | InstallDotNet "$dotnetRoot" $version "$architecture" $runtime true $runtimeSourceFeed $runtimeSourceFeedKey || { 89 | local exit_code=$? 90 | Write-PipelineTelemetryError -Category 'InitializeToolset' -Message "dotnet-install.sh failed (exit code '$exit_code')." >&2 91 | ExitWithExitCode $exit_code 92 | } 93 | 94 | ExitWithExitCode 0 95 | -------------------------------------------------------------------------------- /eng/common/post-build/publish-using-darc.ps1: -------------------------------------------------------------------------------- 1 | param( 2 | [Parameter(Mandatory=$true)][int] $BuildId, 3 | [Parameter(Mandatory=$true)][int] $PublishingInfraVersion, 4 | [Parameter(Mandatory=$true)][string] $AzdoToken, 5 | [Parameter(Mandatory=$false)][string] $MaestroApiEndPoint = 'https://maestro.dot.net', 6 | [Parameter(Mandatory=$true)][string] $WaitPublishingFinish, 7 | [Parameter(Mandatory=$false)][string] $ArtifactsPublishingAdditionalParameters, 8 | [Parameter(Mandatory=$false)][string] $SymbolPublishingAdditionalParameters, 9 | [Parameter(Mandatory=$false)][string] $RequireDefaultChannels, 10 | [Parameter(Mandatory=$false)][string] $SkipAssetsPublishing 11 | ) 12 | 13 | try { 14 | # `tools.ps1` checks $ci to perform some actions. Since the post-build 15 | # scripts don't necessarily execute in the same agent that run the 16 | # build.ps1/sh script this variable isn't automatically set. 17 | $ci = $true 18 | $disableConfigureToolsetImport = $true 19 | . $PSScriptRoot\..\tools.ps1 20 | 21 | $darc = Get-Darc 22 | 23 | $optionalParams = [System.Collections.ArrayList]::new() 24 | 25 | if ("" -ne $ArtifactsPublishingAdditionalParameters) { 26 | $optionalParams.Add("--artifact-publishing-parameters") | Out-Null 27 | $optionalParams.Add($ArtifactsPublishingAdditionalParameters) | Out-Null 28 | } 29 | 30 | if ("" -ne $SymbolPublishingAdditionalParameters) { 31 | $optionalParams.Add("--symbol-publishing-parameters") | Out-Null 32 | $optionalParams.Add($SymbolPublishingAdditionalParameters) | Out-Null 33 | } 34 | 35 | if ("false" -eq $WaitPublishingFinish) { 36 | $optionalParams.Add("--no-wait") | Out-Null 37 | } 38 | 39 | if ("true" -eq $RequireDefaultChannels) { 40 | $optionalParams.Add("--default-channels-required") | Out-Null 41 | } 42 | 43 | if ("true" -eq $SkipAssetsPublishing) { 44 | $optionalParams.Add("--skip-assets-publishing") | Out-Null 45 | } 46 | 47 | & $darc add-build-to-channel ` 48 | --id $buildId ` 49 | --publishing-infra-version $PublishingInfraVersion ` 50 | --default-channels ` 51 | --source-branch main ` 52 | --azdev-pat "$AzdoToken" ` 53 | --bar-uri "$MaestroApiEndPoint" ` 54 | --ci ` 55 | --verbose ` 56 | @optionalParams 57 | 58 | if ($LastExitCode -ne 0) { 59 | Write-Host "Problems using Darc to promote build ${buildId} to default channels. Stopping execution..." 60 | exit 1 61 | } 62 | 63 | Write-Host 'done.' 64 | } 65 | catch { 66 | Write-Host $_ 67 | Write-PipelineTelemetryError -Category 'PromoteBuild' -Message "There was an error while trying to publish build '$BuildId' to default channels." 68 | ExitWithExitCode 1 69 | } 70 | --------------------------------------------------------------------------------