diff --git a/.github/actions/spelling/excludes.txt b/.github/actions/spelling/excludes.txt index e4452c78aa..085ed013a9 100644 --- a/.github/actions/spelling/excludes.txt +++ b/.github/actions/spelling/excludes.txt @@ -44,6 +44,7 @@ \.pdf$ \.pem$ \.png$ +\.props$ \.psd$ \.pyc$ \.s$ diff --git a/.github/actions/spelling/expect.txt b/.github/actions/spelling/expect.txt index 0a7d79857c..7ad7feb71e 100644 --- a/.github/actions/spelling/expect.txt +++ b/.github/actions/spelling/expect.txt @@ -68,6 +68,7 @@ cls clsctx clsid CODEOWNERS +Codeql COINIT COMGLB commandline @@ -216,20 +217,20 @@ LPICONDIR LPICONDIRENTRY LPICONIMAGE lpitemidlist -LPW -maclachlan LPSTR +LPW LPWCH LPWSTR LSTATUS LTDA luffy Luffytaro +maclachlan malware mapview +Maxed maxvalue maybenull -Maxed MBH mdmp MDs @@ -284,8 +285,8 @@ nuffing objbase objidl ofile -osfhandle OPTOUT +osfhandle Outptr packageinuse packageinusebyapplication @@ -348,8 +349,8 @@ riid roblox ronomon rosoft -roy rowids +roy RRF rrr runspace @@ -359,6 +360,7 @@ rzkzqaqjwj SARL schematab sddl +Semmle seof servercert servercertificate diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 4cc5b32c88..e0a1ebf247 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -19,6 +19,10 @@ pool: variables: solution: 'src\AppInstallerCLI.sln' appxPackageDir: '$(Build.ArtifactStagingDirectory)/AppxPackages/' + # Enable CodeQL/Semmle static analysis for default branch + Codeql.Enabled: true + # TODO: Remove. Only for testing, we should use standard cadence of 72h + CodeQL.Cadence: 0 # Do not set the build version for a PR build. @@ -60,6 +64,10 @@ jobs: packageLayoutDir: $(Build.BinariesDirectory)\WingetPackageLayout steps: + + # TODO: Remove; only to test in non-default branch + - task: CodeQL3000Init@0 + - task: NuGetToolInstaller@1 displayName: Install Nuget @@ -96,6 +104,9 @@ jobs: arguments: '-TargetFile binver\binver\version.h -BuildVersion $(BuildVer)' workingDirectory: 'src' + # TODO: remove + - powershell: Get-Volume; @('.', '$(Build.ArtifactStagingDirectory)') | %{ $mb = (Get-ChildItem $_ -Recurse | Measure-Object -Sum Length).Sum / (1024 * 1024); Write-Host "$_ :`t$mb MBs" } + # Build all solutions in the root directory. - task: VSBuild@1 displayName: Build Solution @@ -109,6 +120,9 @@ jobs: /p:AppxBundle=Always /p:UapAppxPackageBuildMode=SideloadOnly' + - powershell: Get-Volume; @('.', '$(Build.ArtifactStagingDirectory)') | %{ $mb = (Get-ChildItem $_ -Recurse | Measure-Object -Sum Length).Sum / (1024 * 1024); Write-Host "$_ :`t$mb MBs" } + condition: always() + - task: VSBuild@1 displayName: Build Test Project inputs: @@ -121,6 +135,41 @@ jobs: /p:AppxBundle=Always /p:UapAppxPackageBuildMode=SideloadOnly' + # Run static analysis and compliance checks for all the binaries + - task: ComponentGovernanceComponentDetection@0 + displayName: Component Governance + inputs: + scanType: 'LogOnly' + verbosity: 'Verbose' + alertWarningLevel: 'High' + failOnAlert: true + + - task: CredScan@3 + + # TODO: remove + - powershell: Get-Volume; @('.', '$(Build.ArtifactStagingDirectory)') | %{ $mb = (Get-ChildItem $_ -Recurse | Measure-Object -Sum Length).Sum / (1024 * 1024); Write-Host "$_ :`t$mb MBs" } + condition: always() + + - task: BinSkim@4 + inputs: + InputType: 'Basic' + Function: 'analyze' + TargetPattern: 'guardianGlob' + AnalyzeTargetGlob: 'f|$(buildOutDir)/**.dll;f|$(buildOutDir)/**.exe;f|$(Build.SourcesDirectory)\src\WinGetUtilInterop\bin\*.dll' + continueOnError: true # TODO: remove once we pass these checks + + # TODO: remove + - powershell: Get-Volume; @('.', '$(Build.ArtifactStagingDirectory)') | %{ $mb = (Get-ChildItem $_ -Recurse | Measure-Object -Sum Length).Sum / (1024 * 1024); Write-Host "$_ :`t$mb MBs" } + condition: always() + + - task: PublishSecurityAnalysisLogs@3 + inputs: + ArtifactName: 'CodeAnalysisLogs' + ArtifactType: 'Container' + AllTools: true + ToolLogsNotFoundAction: 'Standard' + condition: succeededOrFailed() + - task: CopyFiles@2 displayName: 'Copy WindowsPackageManager.dll Symbols to artifacts folder' inputs: @@ -329,28 +378,10 @@ jobs: targetPath: '$(artifactsDir)' condition: always() - - task: ComponentGovernanceComponentDetection@0 - displayName: Component Governance - inputs: - scanType: 'Register' - verbosity: 'Verbose' - alertWarningLevel: 'High' - # Run BimSkim for all the binaries - - task: BinSkim@3 - displayName: 'Run BinSkim ' - inputs: - arguments: 'analyze - "$(buildOutDir)\AppInstallerCLI\winget.exe" - "$(buildOutDir)\WinGetUtil\WinGetUtil.dll" - "$(buildOutDir)\WindowsPackageManager\WindowsPackageManager.dll" - "$(buildOutDir)\Microsoft.Management.Deployment.InProc\Microsoft.Management.Deployment.InProc.dll" - "$(Build.SourcesDirectory)\src\WinGetUtilInterop\bin\WinGetUtil*Interop.dll" - "$(buildOutDir)\UndockedRegFreeWinRT\winrtact.dll" - "$(buildOutDir)\Microsoft.WinGet.Client\Microsoft.WinGet.*Client.dll" --config default --recurse' - - - task: securedevelopmentteam.vss-secure-development-tools.build-task-publishsecurityanalysislogs.PublishSecurityAnalysisLogs@2 - displayName: 'Publish Security Analysis Logs' + # TODO: Remove; only to test in non-default branch + - task: CodeQL3000Finalize@0 + condition: always() - job: 'BuildPowerShellModule' timeoutInMinutes: 120 diff --git a/src/AppInstallerCLI.sln b/src/AppInstallerCLI.sln index 6de9467576..744f4f4fc8 100644 --- a/src/AppInstallerCLI.sln +++ b/src/AppInstallerCLI.sln @@ -98,6 +98,7 @@ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{1A5D7A7D-5CB2-47D5-B40D-4E61CAEDC798}" ProjectSection(SolutionItems) = preProject CodeAnalysis.ruleset = CodeAnalysis.ruleset + Directory.Build.props = Directory.Build.props nuget.config = nuget.config stylecop.json = stylecop.json EndProjectSection diff --git a/src/AppInstallerCLI/AppInstallerCLI.vcxproj b/src/AppInstallerCLI/AppInstallerCLI.vcxproj index 9d23801443..91dd975290 100644 --- a/src/AppInstallerCLI/AppInstallerCLI.vcxproj +++ b/src/AppInstallerCLI/AppInstallerCLI.vcxproj @@ -2,17 +2,9 @@ - true - true - true 15.0 {5b6f90df-fd19-4bae-83d9-24dad128e777} - Win32Proj AppInstallerCLI - 10.0.22000.0 - 10.0.17763.0 - true - true @@ -51,225 +43,22 @@ Application - v140 - v141 - v142 - v143 - Unicode - - - true - true - - - false - true - false - - - Spectre - - - Spectre - - - Spectre - - - Spectre + winget - - - - - - - - true - $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ - true - true - ..\CodeAnalysis.ruleset - winget - - - true - $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ - true - true - ..\CodeAnalysis.ruleset - winget - - - true - $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ - true - true - ..\CodeAnalysis.ruleset - winget - - - true - $(SolutionDir)x86\$(Configuration)\$(ProjectName)\ - true - true - ..\CodeAnalysis.ruleset - winget - - - false - $(SolutionDir)x86\$(Configuration)\$(ProjectName)\ - true - false - ..\CodeAnalysis.ruleset - winget - - - false - $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ - true - false - ..\CodeAnalysis.ruleset - winget - - - false - $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ - true - false - ..\CodeAnalysis.ruleset - winget - - - false - $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ - true - false - ..\CodeAnalysis.ruleset - winget - NotUsing - pch.h - $(IntDir)pch.pch - _CONSOLE;%(PreprocessorDefinitions) - Level4 - %(AdditionalOptions) /permissive- /bigobj - - - - - Disabled - _DEBUG;%(PreprocessorDefinitions) - $(ProjectDir);$(ProjectDir)..\WindowsPackageManager\;%(AdditionalIncludeDirectories) - $(ProjectDir);$(ProjectDir)..\WindowsPackageManager\;%(AdditionalIncludeDirectories) - $(ProjectDir);$(ProjectDir)..\WindowsPackageManager\;%(AdditionalIncludeDirectories) - true - true - true - false - false - false - stdcpp17 - stdcpp17 - stdcpp17 - true - true - true - true - true - true - - - Console - false - %(AdditionalDependencies) - - - $(ProjectDir)..\manifest\shared.manifest %(AdditionalManifestFiles) - - - $(ProjectDir)..\manifest\shared.manifest %(AdditionalManifestFiles) - - - $(ProjectDir)..\manifest\shared.manifest %(AdditionalManifestFiles) - - - - - WIN32;%(PreprocessorDefinitions) - $(ProjectDir);$(ProjectDir)..\WindowsPackageManager\;%(AdditionalIncludeDirectories) - true - false - stdcpp17 - true - true - - - $(ProjectDir)..\manifest\shared.manifest %(AdditionalManifestFiles) - - - - - MaxSpeed - true - true - NDEBUG;%(PreprocessorDefinitions) - $(ProjectDir);$(ProjectDir)..\WindowsPackageManager\;%(AdditionalIncludeDirectories) - $(ProjectDir);$(ProjectDir)..\WindowsPackageManager\;%(AdditionalIncludeDirectories) - $(ProjectDir);$(ProjectDir)..\WindowsPackageManager\;%(AdditionalIncludeDirectories) - $(ProjectDir);$(ProjectDir)..\WindowsPackageManager\;%(AdditionalIncludeDirectories) - true - true - true - true - Guard - Guard - Guard - Guard - stdcpp17 - stdcpp17 - stdcpp17 - stdcpp17 - true - true - true - true - false - false - false - false + $(ProjectDir);$(ProjectDir)..\WindowsPackageManager\;%(AdditionalIncludeDirectories) - - Console - true - true - false - %(AdditionalDependencies) - /debug:full /debugtype:cv,fixup /incremental:no %(AdditionalOptions) - /debug:full /debugtype:cv,fixup /incremental:no %(AdditionalOptions) - /debug:full /debugtype:cv,fixup /incremental:no %(AdditionalOptions) - /debug:full /debugtype:cv,fixup /incremental:no %(AdditionalOptions) - - - $(ProjectDir)..\manifest\shared.manifest %(AdditionalManifestFiles) - - - $(ProjectDir)..\manifest\shared.manifest %(AdditionalManifestFiles) - - - $(ProjectDir)..\manifest\shared.manifest %(AdditionalManifestFiles) - - $(ProjectDir)..\manifest\shared.manifest %(AdditionalManifestFiles) + $(ProjectDir)..\manifest\shared.manifest %(AdditionalManifestFiles) @@ -277,7 +66,6 @@ - @@ -295,4 +83,4 @@ - + \ No newline at end of file diff --git a/src/AppInstallerCLI/AppInstallerCLI.vcxproj.filters b/src/AppInstallerCLI/AppInstallerCLI.vcxproj.filters index 9afaafe5a0..a15ae016c4 100644 --- a/src/AppInstallerCLI/AppInstallerCLI.vcxproj.filters +++ b/src/AppInstallerCLI/AppInstallerCLI.vcxproj.filters @@ -20,7 +20,6 @@ - \ No newline at end of file diff --git a/src/AppInstallerCLI/PropertySheet.props b/src/AppInstallerCLI/PropertySheet.props deleted file mode 100644 index c6b0691ddd..0000000000 --- a/src/AppInstallerCLI/PropertySheet.props +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/src/AppInstallerCLICore/AppInstallerCLICore.vcxproj b/src/AppInstallerCLICore/AppInstallerCLICore.vcxproj index 04ebb3e393..d32974a462 100644 --- a/src/AppInstallerCLICore/AppInstallerCLICore.vcxproj +++ b/src/AppInstallerCLICore/AppInstallerCLICore.vcxproj @@ -2,17 +2,9 @@ - true - true - true 15.0 {1c6e0108-2860-4b17-9f7e-fa5c6c1f3d3d} - Win32Proj AppInstallerCLICore - 10.0.22000.0 - 10.0.17763.0 - true - true @@ -65,55 +57,7 @@ x64 - - StaticLibrary - v140 - v141 - v142 - v143 - Unicode - - - true - true - - - false - true - false - - - false - true - false - - - Spectre - - - Spectre - - - Spectre - - - Spectre - - - Spectre - - - Spectre - - - Spectre - - - Spectre - - - @@ -121,220 +65,16 @@ - - - - - - true - $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ - true - true - ..\CodeAnalysis.ruleset - - - true - $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ - true - true - ..\CodeAnalysis.ruleset - - - true - $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ - true - true - ..\CodeAnalysis.ruleset - - - true - $(SolutionDir)x86\$(Configuration)\$(ProjectName)\ - true - true - ..\CodeAnalysis.ruleset - - - false - $(SolutionDir)x86\$(Configuration)\$(ProjectName)\ - true - false - ..\CodeAnalysis.ruleset - - - false - $(SolutionDir)x86\$(Configuration)\$(ProjectName)\ - true - false - ..\CodeAnalysis.ruleset - - - false - $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ - true - false - ..\CodeAnalysis.ruleset - - - false - $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ - true - false - ..\CodeAnalysis.ruleset - - - false - $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ - true - false - ..\CodeAnalysis.ruleset - - - false - $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ - true - false - ..\CodeAnalysis.ruleset - - - false - $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ - true - false - ..\CodeAnalysis.ruleset - - - false - $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ - true - false - ..\CodeAnalysis.ruleset - - Use - pch.h - $(IntDir)pch.pch - _CONSOLE;%(PreprocessorDefinitions) - Level4 - %(AdditionalOptions) /permissive- /bigobj /D _SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING - - - - - Disabled - _DEBUG;%(PreprocessorDefinitions);CLICOREDLLBUILD - $(ProjectDir);$(ProjectDir)..\AppInstallerRepositoryCore;$(ProjectDir)..\AppInstallerRepositoryCore\Public;$(ProjectDir)..\AppInstallerCommonCore\Public;$(ProjectDir)..\AppInstallerSharedLib\Public;$(ProjectDir)..\JsonCppLib\json;$(ProjectDir)..\JsonCppLib;%(AdditionalIncludeDirectories) - $(ProjectDir);$(ProjectDir)..\AppInstallerRepositoryCore;$(ProjectDir)..\AppInstallerRepositoryCore\Public;$(ProjectDir)..\AppInstallerCommonCore\Public;$(ProjectDir)..\AppInstallerSharedLib\Public;$(ProjectDir)..\JsonCppLib\json;$(ProjectDir)..\JsonCppLib;%(AdditionalIncludeDirectories) - $(ProjectDir);$(ProjectDir)..\AppInstallerRepositoryCore;$(ProjectDir)..\AppInstallerRepositoryCore\Public;$(ProjectDir)..\AppInstallerCommonCore\Public;$(ProjectDir)..\AppInstallerSharedLib\Public;$(ProjectDir)..\JsonCppLib\json;$(ProjectDir)..\JsonCppLib;%(AdditionalIncludeDirectories) - true - true - true - true - true - true - true - true - true + + CLICOREDLLBUILD;%(PreprocessorDefinitions); + $(ProjectDir);$(ProjectDir)..\AppInstallerRepositoryCore;$(ProjectDir)..\AppInstallerRepositoryCore\Public;$(ProjectDir)..\AppInstallerCommonCore\Public;$(ProjectDir)..\AppInstallerSharedLib\Public;$(ProjectDir)..\JsonCppLib\json;$(ProjectDir)..\JsonCppLib;%(AdditionalIncludeDirectories) - false - Windows - Windows - Windows + Windows - - - WIN32;%(PreprocessorDefinitions);CLICOREDLLBUILD - $(ProjectDir);$(ProjectDir)..\AppInstallerRepositoryCore;$(ProjectDir)..\AppInstallerRepositoryCore\Public;$(ProjectDir)..\AppInstallerCommonCore\Public;$(ProjectDir)..\AppInstallerSharedLib\Public;$(ProjectDir)..\JsonCppLib\json;$(ProjectDir)..\JsonCppLib;%(AdditionalIncludeDirectories) - true - true - true - - - Windows - - - - - MaxSpeed - true - true - NDEBUG;%(PreprocessorDefinitions);CLICOREDLLBUILD - $(ProjectDir);$(ProjectDir)..\AppInstallerRepositoryCore;$(ProjectDir)..\AppInstallerRepositoryCore\Public;$(ProjectDir)..\AppInstallerCommonCore\Public;$(ProjectDir)..\AppInstallerSharedLib\Public;$(ProjectDir)..\JsonCppLib\json;$(ProjectDir)..\JsonCppLib;%(AdditionalIncludeDirectories) - $(ProjectDir);$(ProjectDir)..\AppInstallerRepositoryCore;$(ProjectDir)..\AppInstallerRepositoryCore\Public;$(ProjectDir)..\AppInstallerCommonCore\Public;$(ProjectDir)..\AppInstallerSharedLib\Public;$(ProjectDir)..\JsonCppLib\json;$(ProjectDir)..\JsonCppLib;%(AdditionalIncludeDirectories) - $(ProjectDir);$(ProjectDir)..\AppInstallerRepositoryCore;$(ProjectDir)..\AppInstallerRepositoryCore\Public;$(ProjectDir)..\AppInstallerCommonCore\Public;$(ProjectDir)..\AppInstallerSharedLib\Public;$(ProjectDir)..\JsonCppLib\json;$(ProjectDir)..\JsonCppLib;%(AdditionalIncludeDirectories) - $(ProjectDir);$(ProjectDir)..\AppInstallerRepositoryCore;$(ProjectDir)..\AppInstallerRepositoryCore\Public;$(ProjectDir)..\AppInstallerCommonCore\Public;$(ProjectDir)..\AppInstallerSharedLib\Public;$(ProjectDir)..\JsonCppLib\json;$(ProjectDir)..\JsonCppLib;%(AdditionalIncludeDirectories) - true - true - true - true - true - true - true - true - false - false - false - false - - - true - true - false - Windows - Windows - Windows - Windows - - - - - MaxSpeed - true - true - NDEBUG;%(PreprocessorDefinitions);CLICOREDLLBUILD - $(ProjectDir);$(ProjectDir)..\AppInstallerRepositoryCore;$(ProjectDir)..\AppInstallerRepositoryCore\Public;$(ProjectDir)..\AppInstallerCommonCore\Public;$(ProjectDir)..\AppInstallerSharedLib\Public;$(ProjectDir)..\JsonCppLib\json;$(ProjectDir)..\JsonCppLib;%(AdditionalIncludeDirectories) - $(ProjectDir);$(ProjectDir)..\AppInstallerRepositoryCore;$(ProjectDir)..\AppInstallerRepositoryCore\Public;$(ProjectDir)..\AppInstallerCommonCore\Public;$(ProjectDir)..\AppInstallerSharedLib\Public;$(ProjectDir)..\JsonCppLib\json;$(ProjectDir)..\JsonCppLib;%(AdditionalIncludeDirectories) - $(ProjectDir);$(ProjectDir)..\AppInstallerRepositoryCore;$(ProjectDir)..\AppInstallerRepositoryCore\Public;$(ProjectDir)..\AppInstallerCommonCore\Public;$(ProjectDir)..\AppInstallerSharedLib\Public;$(ProjectDir)..\JsonCppLib\json;$(ProjectDir)..\JsonCppLib;%(AdditionalIncludeDirectories) - $(ProjectDir);$(ProjectDir)..\AppInstallerRepositoryCore;$(ProjectDir)..\AppInstallerRepositoryCore\Public;$(ProjectDir)..\AppInstallerCommonCore\Public;$(ProjectDir)..\AppInstallerSharedLib\Public;$(ProjectDir)..\JsonCppLib\json;$(ProjectDir)..\JsonCppLib;%(AdditionalIncludeDirectories) - true - true - true - true - true - true - true - true - false - false - false - false - MultiThreaded - MultiThreaded - MultiThreaded - MultiThreaded - - - true - true - false - Windows - Windows - Windows - Windows - - - - - AICLI_DISABLE_TEST_HOOKS;%(PreprocessorDefinitions) - - - - - WINGET_DISABLE_EXPERIMENTAL_FEATURES;%(PreprocessorDefinitions) - - @@ -470,7 +210,6 @@ - diff --git a/src/AppInstallerCLICore/AppInstallerCLICore.vcxproj.filters b/src/AppInstallerCLICore/AppInstallerCLICore.vcxproj.filters index dd08ae6951..e3daeb3ae3 100644 --- a/src/AppInstallerCLICore/AppInstallerCLICore.vcxproj.filters +++ b/src/AppInstallerCLICore/AppInstallerCLICore.vcxproj.filters @@ -405,7 +405,6 @@ - \ No newline at end of file diff --git a/src/AppInstallerCLICore/ExecutionProgress.h b/src/AppInstallerCLICore/ExecutionProgress.h index de49d7e57e..a0052f80b4 100644 --- a/src/AppInstallerCLICore/ExecutionProgress.h +++ b/src/AppInstallerCLICore/ExecutionProgress.h @@ -7,8 +7,6 @@ #include #include -#include - #include #include #include diff --git a/src/AppInstallerCLICore/ExecutionReporter.h b/src/AppInstallerCLICore/ExecutionReporter.h index 2dca92cc93..0c6284f877 100644 --- a/src/AppInstallerCLICore/ExecutionReporter.h +++ b/src/AppInstallerCLICore/ExecutionReporter.h @@ -8,8 +8,6 @@ #include #include -#include - #include #include #include diff --git a/src/AppInstallerCLICore/PropertySheet.props b/src/AppInstallerCLICore/PropertySheet.props deleted file mode 100644 index c6b0691ddd..0000000000 --- a/src/AppInstallerCLICore/PropertySheet.props +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/src/AppInstallerCLICore/Workflows/ArchiveFlow.cpp b/src/AppInstallerCLICore/Workflows/ArchiveFlow.cpp index c273fd827a..704884b6c2 100644 --- a/src/AppInstallerCLICore/Workflows/ArchiveFlow.cpp +++ b/src/AppInstallerCLICore/Workflows/ArchiveFlow.cpp @@ -118,7 +118,7 @@ namespace AppInstaller::CLI::Workflow { AICLI_LOG(CLI, Error, << "Nested installer type not supported: " << installer.NestedInstallerType); context.Reporter.Error() << Resource::String::NestedInstallerNotSupported << std::endl; - AICLI_TERMINATE_CONTEXT(ERROR_NOT_SUPPORTED); + AICLI_TERMINATE_CONTEXT(HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED)); } auto const& nestedInstallerFiles = installer.NestedInstallerFiles; diff --git a/src/AppInstallerCLICore/Workflows/DependenciesFlow.cpp b/src/AppInstallerCLICore/Workflows/DependenciesFlow.cpp index e86788d156..3df766e224 100644 --- a/src/AppInstallerCLICore/Workflows/DependenciesFlow.cpp +++ b/src/AppInstallerCLICore/Workflows/DependenciesFlow.cpp @@ -190,7 +190,9 @@ namespace AppInstaller::CLI::Workflow << GetUserPresentableMessage(hr) << std::endl; } - if (hr == ERROR_SUCCESS_REBOOT_REQUIRED || windowsFeature.GetRestartRequiredStatus() == DismRestartType::DismRestartRequired) + // ERROR_SUCCESS_REBOOT_REQUIRED is not an HResult, but that's what DismEnableFeature returns. + // Cast it to HResult (instead of using HRESULT_FROM_WIN32) to avoid warning about comparing semantically different types. + if (hr == static_cast(ERROR_SUCCESS_REBOOT_REQUIRED) || windowsFeature.GetRestartRequiredStatus() == DismRestartType::DismRestartRequired) { rebootRequired = true; } diff --git a/src/AppInstallerCLICore/pch.h b/src/AppInstallerCLICore/pch.h index 50a37a2cc0..027ce5ff97 100644 --- a/src/AppInstallerCLICore/pch.h +++ b/src/AppInstallerCLICore/pch.h @@ -42,11 +42,12 @@ #include #pragma warning( push ) -#pragma warning ( disable : 6001 6285 6340 6388 ) +#pragma warning ( disable : 6001 6285 6340 6388 6553 ) #include #include #include #include +#include #pragma warning( pop ) #include diff --git a/src/AppInstallerCLIE2ETests/AppInstallerCLIE2ETests.csproj b/src/AppInstallerCLIE2ETests/AppInstallerCLIE2ETests.csproj index e2288ba35e..19ca7b9115 100644 --- a/src/AppInstallerCLIE2ETests/AppInstallerCLIE2ETests.csproj +++ b/src/AppInstallerCLIE2ETests/AppInstallerCLIE2ETests.csproj @@ -16,10 +16,6 @@ 1591 - - true - - diff --git a/src/AppInstallerCLIPackage/AppInstallerCLIPackage.wapproj b/src/AppInstallerCLIPackage/AppInstallerCLIPackage.wapproj index 54617a52fd..0489ebf4f5 100644 --- a/src/AppInstallerCLIPackage/AppInstallerCLIPackage.wapproj +++ b/src/AppInstallerCLIPackage/AppInstallerCLIPackage.wapproj @@ -51,8 +51,6 @@ 6aa3791a-0713-4548-a357-87a323e7ac3a - 10.0.22000.0 - 10.0.17763.0 en-US false ..\AppInstallerCLI\AppInstallerCLI.vcxproj @@ -96,6 +94,8 @@ copy "$(TargetDir)\resources.pri" "$(ProjectDir)\..\$(Platform)\$(Configuration)\AppInstallerCLI\resources.pri" copy "$(TargetDir)\resources.pri" "$(TargetDir)\AppInstallerCLI\resources.pri" + 10.0.17763.0 + 10.0.22000.0 win10-arm @@ -114,7 +114,6 @@ $(SolutionDir) $(OutputPath)\..\..\..\.. - @@ -144,21 +143,16 @@ true - - - %(WinGetAdditionalPackageFile.PackagePath) - - %(WinGetAdditionalPackageFile.PackagePath)\%(WinGetAdditionalPackageFile.RecursiveDir)%(WinGetAdditionalPackageFile.Filename)%(WinGetAdditionalPackageFile.Extension) diff --git a/src/AppInstallerCLITests/AppInstallerCLITests.vcxproj b/src/AppInstallerCLITests/AppInstallerCLITests.vcxproj index 8656043127..ec099b1398 100644 --- a/src/AppInstallerCLITests/AppInstallerCLITests.vcxproj +++ b/src/AppInstallerCLITests/AppInstallerCLITests.vcxproj @@ -2,16 +2,10 @@ - true - true true - true 15.0 {89b1aab4-2bbc-4b65-9ed7-a01d5cf88230} - Win32Proj AppInstallerCLITests - 10.0.22000.0 - 10.0.17763.0 AppInstallerCLITests @@ -35,24 +29,8 @@ Application - v140 - v141 - v142 - v143 - Unicode - - - true - true - - - false - true - false - - @@ -62,119 +40,20 @@ - - - - - - true - $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ - - - true - $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ - - - true - $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ - - - true - $(SolutionDir)x86\$(Configuration)\$(ProjectName)\ - - - false - $(SolutionDir)x86\$(Configuration)\$(ProjectName)\ - - - false - $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ - - - false - $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ - - - false - $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ - - - Use - pch.h - $(IntDir)pch.pch - _CONSOLE;WIN32_LEAN_AND_MEAN;WINRT_LEAN_AND_MEAN;%(PreprocessorDefinitions) - Level4 - %(AdditionalOptions) /permissive- /bigobj /D _SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING - - - Disabled - _NO_ASYNCRTIMP;_DEBUG;%(PreprocessorDefinitions) - $(MSBuildThisFileDirectory)..\AppInstallerCommonCore;$(MSBuildThisFileDirectory)..\AppInstallerRepositoryCore\Public;$(MSBuildThisFileDirectory)..\AppInstallerRepositoryCore;$(MSBuildThisFileDirectory)..\AppInstallerCommonCore\Public;$(MSBuildThisFileDirectory)..\AppInstallerSharedLib\Public;$(MSBuildThisFileDirectory)..\AppInstallerCLICore\Public;$(MSBuildThisFileDirectory)..\AppInstallerCLICore;$(ProjectDir)..\JsonCppLib;$(ProjectDir)..\cpprestsdk\cpprestsdk\Release\include;%(AdditionalIncludeDirectories) - true - - - Console - false - wininet.lib;shell32.lib;winsqlite3.lib;shlwapi.lib;icuuc.lib;icuin.lib;urlmon.lib;Advapi32.lib;winhttp.lib;onecoreuap.lib;msi.lib;%(AdditionalDependencies) - - - $(ProjectDir)..\manifest\shared.manifest - - - copy "$(ProjectDir)..\AppInstallerCLIPackage\bin\$(PlatformTarget)\$(configuration)\resources.pri" "$(TargetDir)\resources.pri" - - - - - _NO_ASYNCRTIMP;WIN32;%(PreprocessorDefinitions) - $(MSBuildThisFileDirectory)..\AppInstallerCommonCore;$(MSBuildThisFileDirectory)..\AppInstallerRepositoryCore\Public;$(MSBuildThisFileDirectory)..\AppInstallerRepositoryCore;$(MSBuildThisFileDirectory)..\AppInstallerCommonCore\Public;$(MSBuildThisFileDirectory)..\AppInstallerSharedLib\Public;$(MSBuildThisFileDirectory)..\AppInstallerCLICore\Public;$(MSBuildThisFileDirectory)..\AppInstallerCLICore;$(ProjectDir)..\JsonCppLib;$(ProjectDir)..\cpprestsdk\cpprestsdk\Release\include;%(AdditionalIncludeDirectories) - true + _NO_ASYNCRTIMP;%(PreprocessorDefinitions) + $(MSBuildThisFileDirectory)..\AppInstallerCommonCore;$(MSBuildThisFileDirectory)..\AppInstallerRepositoryCore\Public;$(MSBuildThisFileDirectory)..\AppInstallerRepositoryCore;$(MSBuildThisFileDirectory)..\AppInstallerCommonCore\Public;$(MSBuildThisFileDirectory)..\AppInstallerSharedLib\Public;$(MSBuildThisFileDirectory)..\AppInstallerCLICore\Public;$(MSBuildThisFileDirectory)..\AppInstallerCLICore;$(ProjectDir)..\JsonCppLib;$(ProjectDir)..\cpprestsdk\cpprestsdk\Release\include;%(AdditionalIncludeDirectories) - wininet.lib;shell32.lib;winsqlite3.lib;shlwapi.lib;icuuc.lib;icuin.lib;urlmon.lib;Advapi32.lib;winhttp.lib;onecoreuap.lib;msi.lib;%(AdditionalDependencies) + wininet.lib;shell32.lib;winsqlite3.lib;shlwapi.lib;icuuc.lib;icuin.lib;urlmon.lib;Advapi32.lib;winhttp.lib;onecoreuap.lib;msi.lib;%(AdditionalDependencies) - $(ProjectDir)..\manifest\shared.manifest + $(ProjectDir)..\manifest\shared.manifest - copy "$(ProjectDir)..\AppInstallerCLIPackage\bin\$(PlatformTarget)\$(configuration)\resources.pri" "$(TargetDir)\resources.pri" - - - - - MaxSpeed - true - true - _NO_ASYNCRTIMP;NDEBUG;%(PreprocessorDefinitions) - $(MSBuildThisFileDirectory)..\AppInstallerCommonCore;$(MSBuildThisFileDirectory)..\AppInstallerRepositoryCore\Public;$(MSBuildThisFileDirectory)..\AppInstallerRepositoryCore;$(MSBuildThisFileDirectory)..\AppInstallerCommonCore\Public;$(MSBuildThisFileDirectory)..\AppInstallerSharedLib\Public;$(MSBuildThisFileDirectory)..\AppInstallerCLICore\Public;$(MSBuildThisFileDirectory)..\AppInstallerCLICore;$(ProjectDir)..\JsonCppLib;$(ProjectDir)..\cpprestsdk\cpprestsdk\Release\include;%(AdditionalIncludeDirectories) - $(MSBuildThisFileDirectory)..\AppInstallerCommonCore;$(MSBuildThisFileDirectory)..\AppInstallerRepositoryCore\Public;$(MSBuildThisFileDirectory)..\AppInstallerRepositoryCore;$(MSBuildThisFileDirectory)..\AppInstallerCommonCore\Public;$(MSBuildThisFileDirectory)..\AppInstallerSharedLib\Public;$(MSBuildThisFileDirectory)..\AppInstallerCLICore\Public;$(MSBuildThisFileDirectory)..\AppInstallerCLICore;$(ProjectDir)..\JsonCppLib;$(ProjectDir)..\cpprestsdk\cpprestsdk\Release\include;%(AdditionalIncludeDirectories) - true - true - - - Console - true - true - false - wininet.lib;shell32.lib;winsqlite3.lib;shlwapi.lib;icuuc.lib;icuin.lib;urlmon.lib;Advapi32.lib;winhttp.lib;onecoreuap.lib;msi.lib;%(AdditionalDependencies) - wininet.lib;shell32.lib;winsqlite3.lib;shlwapi.lib;icuuc.lib;icuin.lib;urlmon.lib;Advapi32.lib;winhttp.lib;onecoreuap.lib;msi.lib;%(AdditionalDependencies) - /debug:full /debugtype:cv,fixup /incremental:no %(AdditionalOptions) - /debug:full /debugtype:cv,fixup /incremental:no %(AdditionalOptions) - - - $(ProjectDir)..\manifest\shared.manifest - - - $(ProjectDir)..\manifest\shared.manifest - - - copy "$(ProjectDir)..\AppInstallerCLIPackage\bin\$(PlatformTarget)\$(configuration)\resources.pri" "$(TargetDir)\resources.pri" - - - copy "$(ProjectDir)..\AppInstallerCLIPackage\bin\$(PlatformTarget)\$(configuration)\resources.pri" "$(TargetDir)\resources.pri" + copy "$(ProjectDir)..\AppInstallerCLIPackage\bin\$(PlatformTarget)\$(configuration)\resources.pri" "$(TargetDir)\resources.pri" @@ -377,7 +256,6 @@ true - true diff --git a/src/AppInstallerCLITests/AppInstallerCLITests.vcxproj.filters b/src/AppInstallerCLITests/AppInstallerCLITests.vcxproj.filters index 38e6e57cf1..dd1bad055b 100644 --- a/src/AppInstallerCLITests/AppInstallerCLITests.vcxproj.filters +++ b/src/AppInstallerCLITests/AppInstallerCLITests.vcxproj.filters @@ -301,7 +301,6 @@ - diff --git a/src/AppInstallerCLITests/CompositeSource.cpp b/src/AppInstallerCLITests/CompositeSource.cpp index e3eebbca9f..1ea4f93afc 100644 --- a/src/AppInstallerCLITests/CompositeSource.cpp +++ b/src/AppInstallerCLITests/CompositeSource.cpp @@ -743,7 +743,7 @@ TEST_CASE("CompositeSource_AvailableSearchFailure", "[CompositeSource]") } catch (...) {} - REQUIRE(searchFailure == expectedHR); + REQUIRE((searchFailure == expectedHR)); } TEST_CASE("CompositeSource_InstalledToAvailableCorrelationSearchFailure", "[CompositeSource]") @@ -779,7 +779,7 @@ TEST_CASE("CompositeSource_InstalledToAvailableCorrelationSearchFailure", "[Comp } catch (...) {} - REQUIRE(searchFailure == expectedHR); + REQUIRE((searchFailure == expectedHR)); } TEST_CASE("CompositeSource_InstalledAvailableSearchFailure", "[CompositeSource]") @@ -823,7 +823,7 @@ TEST_CASE("CompositeSource_InstalledAvailableSearchFailure", "[CompositeSource]" } catch (...) {} - REQUIRE(searchFailure == expectedHR); + REQUIRE((searchFailure == expectedHR)); } TEST_CASE("CompositeSource_TrackingPackageFound", "[CompositeSource]") diff --git a/src/AppInstallerCLITests/Correlation.cpp b/src/AppInstallerCLITests/Correlation.cpp index 1b364ad06d..2f07d42aac 100644 --- a/src/AppInstallerCLITests/Correlation.cpp +++ b/src/AppInstallerCLITests/Correlation.cpp @@ -27,7 +27,7 @@ struct TestCase std::string ARPName; std::string ARPPublisher; - bool IsMatch; + bool IsMatch = false; }; // Definition of a collection of test cases that we evaluate @@ -43,10 +43,10 @@ struct DataSet // Thresholds for considering a run of an heuristic against // this data set "good". // Values are ratios to the total number of test cases - double RequiredTrueMatchRatio; - double RequiredTrueMismatchRatio; - double RequiredFalseMatchRatio; - double RequiredFalseMismatchRatio; + double RequiredTrueMatchRatio = 0; + double RequiredTrueMismatchRatio = 0; + double RequiredFalseMatchRatio = 0; + double RequiredFalseMismatchRatio = 0; }; // Aggregate result of running an heuristic against a data set. @@ -264,9 +264,12 @@ DataSet GetDataSet_WithNoise() // It is useful for comparing multiple algorithms, but for // regular testing we need only check that the chosen algorithm // performs well. +#pragma warning( push ) +#pragma warning ( disable : 26444 ) // Don't declare local variables with no name TEMPLATE_TEST_CASE("Correlation_MeasureAlgorithmPerformance", "[correlation][.]", EmptyMatchConfidenceAlgorithm, WordsEditDistanceMatchConfidenceAlgorithm) +#pragma warning( push ) { // Each section loads a different data set, // and then they are all handled the same diff --git a/src/AppInstallerCLITests/InstallFlow.cpp b/src/AppInstallerCLITests/InstallFlow.cpp index 7e684b5f78..dd8ee3df92 100644 --- a/src/AppInstallerCLITests/InstallFlow.cpp +++ b/src/AppInstallerCLITests/InstallFlow.cpp @@ -161,7 +161,7 @@ TEST_CASE("InstallFlowNonZeroExitCode", "[InstallFlow][workflow]") INFO(installOutput.str()); // Verify Installer is called and parameters are passed in. - REQUIRE(context.GetTerminationHR() == S_OK); + REQUIRE_SUCCEEDED(context); REQUIRE(std::filesystem::exists(installResultPath.GetPath())); std::ifstream installResultFile(installResultPath.GetPath()); REQUIRE(installResultFile.is_open()); @@ -186,7 +186,7 @@ TEST_CASE("InstallFlow_InstallationNotes", "[InstallFlow][workflow]") INFO(installOutput.str()); // Verify installation notes are displayed - REQUIRE(context.GetTerminationHR() == S_OK); + REQUIRE_SUCCEEDED(context); REQUIRE(std::filesystem::exists(installResultPath.GetPath())); REQUIRE(installOutput.str().find("testInstallationNotes") != std::string::npos); } @@ -209,7 +209,7 @@ TEST_CASE("InstallFlow_UnsupportedArguments_Warn", "[InstallFlow][workflow]") INFO(installOutput.str()); // Verify unsupported arguments warn message is shown - REQUIRE(context.GetTerminationHR() == S_OK); + REQUIRE_SUCCEEDED(context); REQUIRE(std::filesystem::exists(installResultPath.GetPath())); REQUIRE(installOutput.str().find(Resource::LocString(Resource::String::UnsupportedArgument).get()) != std::string::npos); REQUIRE(installOutput.str().find("-o,--log") != std::string::npos); @@ -232,7 +232,7 @@ TEST_CASE("InstallFlow_UnsupportedArguments_Error", "[InstallFlow][workflow]") INFO(installOutput.str()); // Verify unsupported arguments error message is shown - REQUIRE(context.GetTerminationHR() == APPINSTALLER_CLI_ERROR_UNSUPPORTED_ARGUMENT); + REQUIRE_TERMINATED_WITH(context, APPINSTALLER_CLI_ERROR_UNSUPPORTED_ARGUMENT); REQUIRE(!std::filesystem::exists(installResultPath.GetPath())); REQUIRE(installOutput.str().find(Resource::LocString(Resource::String::UnsupportedArgument).get()) != std::string::npos); REQUIRE(installOutput.str().find("-l,--location") != std::string::npos); @@ -254,7 +254,7 @@ TEST_CASE("InstallFlow_UnsupportedArguments_NotProvided") INFO(installOutput.str()); // Verify unsupported arguments error message is not shown when not provided - REQUIRE(context.GetTerminationHR() == S_OK); + REQUIRE_SUCCEEDED(context); REQUIRE(std::filesystem::exists(installResultPath.GetPath())); REQUIRE(installOutput.str().find(Resource::LocString(Resource::String::UnsupportedArgument).get()) == std::string::npos); REQUIRE(installOutput.str().find("-o,--log") == std::string::npos); @@ -389,7 +389,7 @@ TEST_CASE("InstallFlow_Zip_UnsupportedNestedInstaller", "[InstallFlow][workflow] install.Execute(context); INFO(installOutput.str()); - REQUIRE_TERMINATED_WITH(context, ERROR_NOT_SUPPORTED); + REQUIRE_TERMINATED_WITH(context, HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED)); // Verify Installer was not called REQUIRE(!std::filesystem::exists(installResultPath.GetPath())); @@ -716,166 +716,131 @@ TEST_CASE("PortableInstallFlow_MachineScope", "[InstallFlow][workflow]") TEST_CASE("ShellExecuteHandlerInstallerArgs", "[InstallFlow][workflow]") { + std::ostringstream installOutput; + TestContext context{ installOutput, std::cin }; + auto previousThreadGlobals = context.SetForCurrentThread(); + Manifest manifest; + std::vector expectedArgs; + std::vector forbiddenArgs; + std::optional exactArgs; + + SECTION("MSI | No CLI args | No manifest switches") { - std::ostringstream installOutput; - TestContext context{ installOutput, std::cin }; - auto previousThreadGlobals = context.SetForCurrentThread(); // Default Msi type with no args passed in, no switches specified in manifest - auto manifest = YamlParser::CreateFromPath(TestDataFile("InstallerArgTest_Msi_NoSwitches.yaml")); - context.Add(manifest); - context.Add(manifest.Installers.at(0)); + manifest = YamlParser::CreateFromPath(TestDataFile("InstallerArgTest_Msi_NoSwitches.yaml")); context.Add(TestDataFile("AppInstallerTestExeInstaller.exe")); - context << GetInstallerArgs; - std::string installerArgs = context.Get(); - REQUIRE(installerArgs.find("/passive") != std::string::npos); - REQUIRE(installerArgs.find(FileLogger::DefaultPrefix()) != std::string::npos); - REQUIRE(installerArgs.find(manifest.Id) != std::string::npos); - REQUIRE(installerArgs.find(manifest.Version) != std::string::npos); + expectedArgs.emplace_back("/passive"); + expectedArgs.emplace_back(FileLogger::DefaultPrefix()); + expectedArgs.emplace_back(manifest.Id); + expectedArgs.emplace_back(manifest.Version); } - + SECTION("MSI | With CLI args | No manifest switches") { - std::ostringstream installOutput; - TestContext context{ installOutput, std::cin }; - auto previousThreadGlobals = context.SetForCurrentThread(); // Msi type with /silent and /log and /custom and /installlocation, no switches specified in manifest - auto manifest = YamlParser::CreateFromPath(TestDataFile("InstallerArgTest_Msi_NoSwitches.yaml")); + manifest = YamlParser::CreateFromPath(TestDataFile("InstallerArgTest_Msi_NoSwitches.yaml")); context.Args.AddArg(Execution::Args::Type::Silent); context.Args.AddArg(Execution::Args::Type::Log, "MyLog.log"sv); context.Args.AddArg(Execution::Args::Type::InstallLocation, "MyDir"sv); - context.Add(manifest); - context.Add(manifest.Installers.at(0)); - context << GetInstallerArgs; - std::string installerArgs = context.Get(); - REQUIRE(installerArgs.find("/quiet") != std::string::npos); - REQUIRE(installerArgs.find("/log \"MyLog.log\"") != std::string::npos); - REQUIRE(installerArgs.find("TARGETDIR=\"MyDir\"") != std::string::npos); + expectedArgs.emplace_back("/quiet"); + expectedArgs.emplace_back("/log \"MyLog.log\""); + expectedArgs.emplace_back("TARGETDIR=\"MyDir\""); } - + SECTION("MSI | With CLI args | With manifest switches") { - std::ostringstream installOutput; - TestContext context{ installOutput, std::cin }; - auto previousThreadGlobals = context.SetForCurrentThread(); // Msi type with /silent and /log and /custom and /installlocation, switches specified in manifest - auto manifest = YamlParser::CreateFromPath(TestDataFile("InstallerArgTest_Msi_WithSwitches.yaml")); + manifest = YamlParser::CreateFromPath(TestDataFile("InstallerArgTest_Msi_WithSwitches.yaml")); context.Args.AddArg(Execution::Args::Type::Silent); context.Args.AddArg(Execution::Args::Type::Log, "MyLog.log"sv); context.Args.AddArg(Execution::Args::Type::InstallLocation, "MyDir"sv); - context.Add(manifest); - context.Add(manifest.Installers.at(0)); - context << GetInstallerArgs; - std::string installerArgs = context.Get(); - REQUIRE(installerArgs.find("/mysilent") != std::string::npos); // Use declaration in manifest - REQUIRE(installerArgs.find("/mylog=\"MyLog.log\"") != std::string::npos); // Use declaration in manifest - REQUIRE(installerArgs.find("/mycustom") != std::string::npos); // Use declaration in manifest - REQUIRE(installerArgs.find("/myinstalldir=\"MyDir\"") != std::string::npos); // Use declaration in manifest + expectedArgs.emplace_back("/mysilent"); // Use declaration in manifest + expectedArgs.emplace_back("/mylog=\"MyLog.log\""); // Use declaration in manifest + expectedArgs.emplace_back("/mycustom"); // Use declaration in manifest + expectedArgs.emplace_back("/myinstalldir=\"MyDir\""); // Use declaration in manifest } - + SECTION("Inno | No CLI args | No manifest switches") { - std::ostringstream installOutput; - TestContext context{ installOutput, std::cin }; - auto previousThreadGlobals = context.SetForCurrentThread(); // Default Inno type with no args passed in, no switches specified in manifest - auto manifest = YamlParser::CreateFromPath(TestDataFile("InstallerArgTest_Inno_NoSwitches.yaml")); - context.Add(manifest); - context.Add(manifest.Installers.at(0)); + manifest = YamlParser::CreateFromPath(TestDataFile("InstallerArgTest_Inno_NoSwitches.yaml")); context.Add(TestDataFile("AppInstallerTestExeInstaller.exe")); - context << GetInstallerArgs; - std::string installerArgs = context.Get(); - REQUIRE(installerArgs.find("/SILENT") != std::string::npos); - REQUIRE(installerArgs.find(FileLogger::DefaultPrefix()) != std::string::npos); - REQUIRE(installerArgs.find(manifest.Id) != std::string::npos); - REQUIRE(installerArgs.find(manifest.Version) != std::string::npos); + expectedArgs.emplace_back("/SILENT"); + expectedArgs.emplace_back(FileLogger::DefaultPrefix()); + expectedArgs.emplace_back(manifest.Id); + expectedArgs.emplace_back(manifest.Version); } - + SECTION("Inno | With CLI args | No manifest switches") { - std::ostringstream installOutput; - TestContext context{ installOutput, std::cin }; - auto previousThreadGlobals = context.SetForCurrentThread(); // Inno type with /silent and /log and /custom and /installlocation, no switches specified in manifest - auto manifest = YamlParser::CreateFromPath(TestDataFile("InstallerArgTest_Inno_NoSwitches.yaml")); + manifest = YamlParser::CreateFromPath(TestDataFile("InstallerArgTest_Inno_NoSwitches.yaml")); context.Args.AddArg(Execution::Args::Type::Silent); context.Args.AddArg(Execution::Args::Type::Log, "MyLog.log"sv); context.Args.AddArg(Execution::Args::Type::InstallLocation, "MyDir"sv); - context.Add(manifest); - context.Add(manifest.Installers.at(0)); - context << GetInstallerArgs; - std::string installerArgs = context.Get(); - REQUIRE(installerArgs.find("/VERYSILENT") != std::string::npos); - REQUIRE(installerArgs.find("/LOG=\"MyLog.log\"") != std::string::npos); - REQUIRE(installerArgs.find("/DIR=\"MyDir\"") != std::string::npos); + expectedArgs.emplace_back("/VERYSILENT"); + expectedArgs.emplace_back("/LOG=\"MyLog.log\""); + expectedArgs.emplace_back("/DIR=\"MyDir\""); } - + SECTION("Inno | With CLI args | With manifest switches") { - std::ostringstream installOutput; - TestContext context{ installOutput, std::cin }; - auto previousThreadGlobals = context.SetForCurrentThread(); // Inno type with /silent and /log and /custom and /installlocation, switches specified in manifest - auto manifest = YamlParser::CreateFromPath(TestDataFile("InstallerArgTest_Inno_WithSwitches.yaml")); + manifest = YamlParser::CreateFromPath(TestDataFile("InstallerArgTest_Inno_WithSwitches.yaml")); context.Args.AddArg(Execution::Args::Type::Silent); context.Args.AddArg(Execution::Args::Type::Log, "MyLog.log"sv); context.Args.AddArg(Execution::Args::Type::InstallLocation, "MyDir"sv); - context.Add(manifest); - context.Add(manifest.Installers.at(0)); - context << GetInstallerArgs; - std::string installerArgs = context.Get(); - REQUIRE(installerArgs.find("/mysilent") != std::string::npos); // Use declaration in manifest - REQUIRE(installerArgs.find("/mylog=\"MyLog.log\"") != std::string::npos); // Use declaration in manifest - REQUIRE(installerArgs.find("/mycustom") != std::string::npos); // Use declaration in manifest - REQUIRE(installerArgs.find("/myinstalldir=\"MyDir\"") != std::string::npos); // Use declaration in manifest + expectedArgs.emplace_back("/mysilent"); // Use declaration in manifest + expectedArgs.emplace_back("/mylog=\"MyLog.log\""); // Use declaration in manifest + expectedArgs.emplace_back("/mycustom"); // Use declaration in manifest + expectedArgs.emplace_back("/myinstalldir=\"MyDir\""); // Use declaration in manifest } - + SECTION("Inno | With CLI args | With manifest switches | With --custom arg") { - std::ostringstream installOutput; - TestContext context{ installOutput, std::cin }; - auto previousThreadGlobals = context.SetForCurrentThread(); // Inno type with /silent and /log and /custom and /installlocation, switches specified in manifest and --custom argument used in cli - auto manifest = YamlParser::CreateFromPath(TestDataFile("InstallerArgTest_Inno_WithSwitches.yaml")); + manifest = YamlParser::CreateFromPath(TestDataFile("InstallerArgTest_Inno_WithSwitches.yaml")); context.Args.AddArg(Execution::Args::Type::Silent); context.Args.AddArg(Execution::Args::Type::Log, "MyLog.log"sv); context.Args.AddArg(Execution::Args::Type::InstallLocation, "MyDir"sv); context.Args.AddArg(Execution::Args::Type::CustomSwitches, "/MyAppendedSwitch"sv); - context.Add(manifest); - context.Add(manifest.Installers.at(0)); - context << GetInstallerArgs; - std::string installerArgs = context.Get(); - REQUIRE(installerArgs.find("/mysilent") != std::string::npos); // Use declaration in manifest - REQUIRE(installerArgs.find("/mylog=\"MyLog.log\"") != std::string::npos); // Use declaration in manifest - REQUIRE(installerArgs.find("/mycustom") != std::string::npos); // Use declaration in manifest - REQUIRE(installerArgs.find("/myinstalldir=\"MyDir\"") != std::string::npos); // Use declaration in manifest - REQUIRE(installerArgs.find("/MyAppendedSwitch") != std::string::npos); // Use declaration from argument + expectedArgs.emplace_back("/mysilent"); // Use declaration in manifest + expectedArgs.emplace_back("/mylog=\"MyLog.log\""); // Use declaration in manifest + expectedArgs.emplace_back("/mycustom"); // Use declaration in manifest + expectedArgs.emplace_back("/myinstalldir=\"MyDir\""); // Use declaration in manifest + expectedArgs.emplace_back("/MyAppendedSwitch"); // Use declaration from argument } - + SECTION("Inno | With CLI args | With manifest switches | With whitespace --custom arg") { - std::ostringstream installOutput; - TestContext context{ installOutput, std::cin }; - auto previousThreadGlobals = context.SetForCurrentThread(); // Inno type with /silent and /log and /custom and /installlocation, switches specified in manifest and whitespace-only --custom argument used in cli - auto manifest = YamlParser::CreateFromPath(TestDataFile("InstallerArgTest_Inno_WithSwitches.yaml")); + manifest = YamlParser::CreateFromPath(TestDataFile("InstallerArgTest_Inno_WithSwitches.yaml")); context.Args.AddArg(Execution::Args::Type::Silent); context.Args.AddArg(Execution::Args::Type::CustomSwitches, "\t"sv); - context.Add(manifest); - context.Add(manifest.Installers.at(0)); - context << GetInstallerArgs; - std::string installerArgs = context.Get(); - REQUIRE(installerArgs.find("/mysilent") != std::string::npos); // Use declaration in manifest - REQUIRE(installerArgs.find("\t") == std::string::npos); // Whitespace only Custom switches should not be appended + expectedArgs.emplace_back("/mysilent"); // Use declaration in manifest + forbiddenArgs.emplace_back("\t"); // Whitespace only Custom switches should not be appended } - + SECTION("Inno | With CLI args | With manifest switches | With --override arg") { - std::ostringstream installOutput; - TestContext context{ installOutput, std::cin }; - auto previousThreadGlobals = context.SetForCurrentThread(); // Override switch specified. The whole arg passed to installer is overridden. - auto manifest = YamlParser::CreateFromPath(TestDataFile("InstallerArgTest_Inno_WithSwitches.yaml")); + manifest = YamlParser::CreateFromPath(TestDataFile("InstallerArgTest_Inno_WithSwitches.yaml")); context.Args.AddArg(Execution::Args::Type::Silent); context.Args.AddArg(Execution::Args::Type::Log, "MyLog.log"sv); context.Args.AddArg(Execution::Args::Type::InstallLocation, "MyDir"sv); context.Args.AddArg(Execution::Args::Type::Override, "/OverrideEverything"sv); - context.Add(manifest); - context.Add(manifest.Installers.at(0)); - context << GetInstallerArgs; - std::string installerArgs = context.Get(); - REQUIRE(installerArgs == "/OverrideEverything"); // Use value specified in override switch + exactArgs = "/OverrideEverything"; // Use value specified in override switch + } + + context.Add(manifest); + context.Add(manifest.Installers.at(0)); + context << GetInstallerArgs; + std::string installerArgs = context.Get(); + for (const auto& expectedArg : expectedArgs) + { + REQUIRE(installerArgs.find(expectedArg) != std::string::npos); + } + + for (const auto& forbiddenArg : forbiddenArgs) + { + REQUIRE(installerArgs.find(forbiddenArg) == std::string::npos); + } + + if (exactArgs) + { + REQUIRE(installerArgs == *exactArgs); } } diff --git a/src/AppInstallerCLITests/PropertySheet.props b/src/AppInstallerCLITests/PropertySheet.props deleted file mode 100644 index b0c622690f..0000000000 --- a/src/AppInstallerCLITests/PropertySheet.props +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/src/AppInstallerCLITests/SourceFlow.cpp b/src/AppInstallerCLITests/SourceFlow.cpp index 6581f92a82..5e0223320d 100644 --- a/src/AppInstallerCLITests/SourceFlow.cpp +++ b/src/AppInstallerCLITests/SourceFlow.cpp @@ -59,8 +59,7 @@ TEST_CASE("SourceAddFlow_Agreement", "[SourceAddFlow][workflow]") REQUIRE(sourceAddOutput.str().find("https://test") != std::string::npos); REQUIRE(sourceAddOutput.str().find(Resource::LocString(Resource::String::SourceAgreementsMarketMessage).get()) != std::string::npos); - // Verify Installer is called. - REQUIRE(context.GetTerminationHR() == S_OK); + REQUIRE_SUCCEEDED(context); } TEST_CASE("SourceAddFlow_Agreement_Prompt_Yes", "[SourceAddFlow][workflow]") @@ -85,8 +84,7 @@ TEST_CASE("SourceAddFlow_Agreement_Prompt_Yes", "[SourceAddFlow][workflow]") REQUIRE(sourceAddOutput.str().find("https://test") != std::string::npos); REQUIRE(sourceAddOutput.str().find(Resource::LocString(Resource::String::SourceAgreementsMarketMessage).get()) != std::string::npos); - // Verify Installer is called. - REQUIRE(context.GetTerminationHR() == S_OK); + REQUIRE_SUCCEEDED(context); } TEST_CASE("SourceAddFlow_Agreement_Prompt_No", "[SourceAddFlow][workflow]") @@ -111,8 +109,7 @@ TEST_CASE("SourceAddFlow_Agreement_Prompt_No", "[SourceAddFlow][workflow]") REQUIRE(sourceAddOutput.str().find("https://test") != std::string::npos); REQUIRE(sourceAddOutput.str().find(Resource::LocString(Resource::String::SourceAgreementsMarketMessage).get()) != std::string::npos); - // Verify Installer is called. - REQUIRE(context.GetTerminationHR() == APPINSTALLER_CLI_ERROR_SOURCE_AGREEMENTS_NOT_ACCEPTED); + REQUIRE_TERMINATED_WITH(context, APPINSTALLER_CLI_ERROR_SOURCE_AGREEMENTS_NOT_ACCEPTED); } TEST_CASE("OpenSource_WithCustomHeader", "[OpenSource][CustomHeader]") diff --git a/src/AppInstallerCLITests/Sources.cpp b/src/AppInstallerCLITests/Sources.cpp index f35ea9ed45..b23e93ed9a 100644 --- a/src/AppInstallerCLITests/Sources.cpp +++ b/src/AppInstallerCLITests/Sources.cpp @@ -1065,7 +1065,7 @@ TEST_CASE("RepoSources_OpenMultipleWithSingleFailure", "[sources]") } catch (...) {} - REQUIRE(openFailure == FailingSourcesTestSource::FailingHR); + REQUIRE((openFailure == FailingSourcesTestSource::FailingHR)); } TEST_CASE("RepoSources_OpenMultipleWithTotalFailure", "[sources]") diff --git a/src/AppInstallerCLITests/TestCommon.h b/src/AppInstallerCLITests/TestCommon.h index 5866068eed..f420ec5438 100644 --- a/src/AppInstallerCLITests/TestCommon.h +++ b/src/AppInstallerCLITests/TestCommon.h @@ -5,7 +5,6 @@ #include #include #include -#include #include #include diff --git a/src/AppInstallerCLITests/TestConfiguration.h b/src/AppInstallerCLITests/TestConfiguration.h index 0d18770f54..e2637f76ba 100644 --- a/src/AppInstallerCLITests/TestConfiguration.h +++ b/src/AppInstallerCLITests/TestConfiguration.h @@ -84,7 +84,7 @@ namespace TestCommon winrt::Windows::Foundation::DateTime PublishedDateValue; winrt::Windows::Foundation::DateTime PublishedDate() const { return PublishedDateValue; } - bool IsLocalValue; + bool IsLocalValue = false; bool IsLocal() const { return IsLocalValue; } winrt::hstring AuthorValue; @@ -99,7 +99,7 @@ namespace TestCommon winrt::Windows::Foundation::Collections::IVector SettingsValue; winrt::Windows::Foundation::Collections::IVectorView Settings() const { return (SettingsValue ? SettingsValue.GetView() : nullptr); } - bool IsPublicValue; + bool IsPublicValue = false; bool IsPublic() const { return IsPublicValue; } }; diff --git a/src/AppInstallerCLITests/TestRestRequestHandler.h b/src/AppInstallerCLITests/TestRestRequestHandler.h index 33e33ab650..b521eab980 100644 --- a/src/AppInstallerCLITests/TestRestRequestHandler.h +++ b/src/AppInstallerCLITests/TestRestRequestHandler.h @@ -1,7 +1,11 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #pragma once + +#pragma warning( push ) +#pragma warning ( disable : 26439 26495 ) #include +#pragma warning( pop ) class TestRestRequestHandler : public web::http::http_pipeline_stage { diff --git a/src/AppInstallerCLITests/TestSettings.h b/src/AppInstallerCLITests/TestSettings.h index fc7132a36e..c95a3dd21f 100644 --- a/src/AppInstallerCLITests/TestSettings.h +++ b/src/AppInstallerCLITests/TestSettings.h @@ -3,7 +3,6 @@ #pragma once #include #include -#include #include namespace TestCommon diff --git a/src/AppInstallerCLITests/UninstallFlow.cpp b/src/AppInstallerCLITests/UninstallFlow.cpp index 480c830e41..caeafc51c6 100644 --- a/src/AppInstallerCLITests/UninstallFlow.cpp +++ b/src/AppInstallerCLITests/UninstallFlow.cpp @@ -169,7 +169,7 @@ TEST_CASE("UninstallFlow_UninstallExeNotFound", "[UninstallFlow][workflow]") // Verify Uninstaller is not called. REQUIRE(!std::filesystem::exists(uninstallResultPath.GetPath())); REQUIRE(uninstallOutput.str().find(Resource::LocString(Resource::String::NoInstalledPackageFound).get()) != std::string::npos); - REQUIRE(context.GetTerminationHR() == APPINSTALLER_CLI_ERROR_NO_APPLICATIONS_FOUND); + REQUIRE_TERMINATED_WITH(context, APPINSTALLER_CLI_ERROR_NO_APPLICATIONS_FOUND); } TEST_CASE("UninstallFlow_UninstallMultiple", "[UninstallFlow][workflow][MultiQuery]") diff --git a/src/AppInstallerCLITests/UpdateFlow.cpp b/src/AppInstallerCLITests/UpdateFlow.cpp index 56406fcf01..3d9832196f 100644 --- a/src/AppInstallerCLITests/UpdateFlow.cpp +++ b/src/AppInstallerCLITests/UpdateFlow.cpp @@ -80,7 +80,7 @@ TEST_CASE("UpdateFlow_UpdateWithManifestAppNotInstalled", "[UpdateFlow][workflow // Verify Installer is not called. REQUIRE(!std::filesystem::exists(updateResultPath.GetPath())); REQUIRE(updateOutput.str().find(Resource::LocString(Resource::String::NoInstalledPackageFound).get()) != std::string::npos); - REQUIRE(context.GetTerminationHR() == APPINSTALLER_CLI_ERROR_NO_APPLICATIONS_FOUND); + REQUIRE_TERMINATED_WITH(context, APPINSTALLER_CLI_ERROR_NO_APPLICATIONS_FOUND); } TEST_CASE("UpdateFlow_UpdateWithManifestVersionAlreadyInstalled", "[UpdateFlow][workflow]") @@ -101,7 +101,7 @@ TEST_CASE("UpdateFlow_UpdateWithManifestVersionAlreadyInstalled", "[UpdateFlow][ REQUIRE(!std::filesystem::exists(updateResultPath.GetPath())); REQUIRE(updateOutput.str().find(Resource::LocString(Resource::String::UpdateNoPackagesFound).get()) != std::string::npos); REQUIRE(updateOutput.str().find(Resource::LocString(Resource::String::UpdateNoPackagesFoundReason).get()) != std::string::npos); - REQUIRE(context.GetTerminationHR() == APPINSTALLER_CLI_ERROR_UPDATE_NOT_APPLICABLE); + REQUIRE_TERMINATED_WITH(context, APPINSTALLER_CLI_ERROR_UPDATE_NOT_APPLICABLE); } TEST_CASE("UpdateFlow_UpdateExe", "[UpdateFlow][workflow]") @@ -232,7 +232,7 @@ TEST_CASE("UpdateFlow_UpdateExeWithUnsupportedArgs", "[UpdateFlow][workflow]") INFO(updateOutput.str()); // Verify unsupported arguments error message is shown - REQUIRE(context.GetTerminationHR() == APPINSTALLER_CLI_ERROR_UNSUPPORTED_ARGUMENT); + REQUIRE_TERMINATED_WITH(context, APPINSTALLER_CLI_ERROR_UNSUPPORTED_ARGUMENT); REQUIRE(!std::filesystem::exists(updateResultPath.GetPath())); REQUIRE(updateOutput.str().find(Resource::LocString(Resource::String::UnsupportedArgument).get()) != std::string::npos); REQUIRE(updateOutput.str().find("-l,--location") != std::string::npos); @@ -256,7 +256,7 @@ TEST_CASE("UpdateFlow_UnknownVersion", "[UpdateFlow][workflow]") INFO(updateOutput.str()); // Verify help message is shown the user to use --include-unknown - REQUIRE(context.GetTerminationHR() == APPINSTALLER_CLI_ERROR_UPDATE_NOT_APPLICABLE); + REQUIRE_TERMINATED_WITH(context, APPINSTALLER_CLI_ERROR_UPDATE_NOT_APPLICABLE); REQUIRE(!std::filesystem::exists(updateResultPath.GetPath())); REQUIRE(updateOutput.str().find(Resource::LocString(Resource::String::UpgradeUnknownVersionExplanation).get()) != std::string::npos); } @@ -408,7 +408,7 @@ TEST_CASE("UpdateFlow_UpdateExeLatestAlreadyInstalled", "[UpdateFlow][workflow]" REQUIRE(!std::filesystem::exists(updateResultPath.GetPath())); REQUIRE(updateOutput.str().find(Resource::LocString(Resource::String::UpdateNoPackagesFound).get()) != std::string::npos); REQUIRE(updateOutput.str().find(Resource::LocString(Resource::String::UpdateNoPackagesFoundReason).get()) != std::string::npos); - REQUIRE(context.GetTerminationHR() == APPINSTALLER_CLI_ERROR_UPDATE_NOT_APPLICABLE); + REQUIRE_TERMINATED_WITH(context, APPINSTALLER_CLI_ERROR_UPDATE_NOT_APPLICABLE); } TEST_CASE("UpdateFlow_UpdateExeInstallerTypeNotApplicable", "[UpdateFlow][workflow]") @@ -428,7 +428,7 @@ TEST_CASE("UpdateFlow_UpdateExeInstallerTypeNotApplicable", "[UpdateFlow][workfl // Verify Installer is not called. REQUIRE(!std::filesystem::exists(updateResultPath.GetPath())); REQUIRE(updateOutput.str().find(Resource::LocString(Resource::String::UpgradeDifferentInstallTechnologyInNewerVersions).get()) != std::string::npos); - REQUIRE(context.GetTerminationHR() == APPINSTALLER_CLI_ERROR_UPDATE_NOT_APPLICABLE); + REQUIRE_TERMINATED_WITH(context, APPINSTALLER_CLI_ERROR_UPDATE_NOT_APPLICABLE); } TEST_CASE("UpdateFlow_UpdateExeInstallerTypeNotApplicableSpecificVersion", "[UpdateFlow][workflow]") @@ -449,7 +449,7 @@ TEST_CASE("UpdateFlow_UpdateExeInstallerTypeNotApplicableSpecificVersion", "[Upd // Verify Installer is not called. REQUIRE(!std::filesystem::exists(updateResultPath.GetPath())); REQUIRE(updateOutput.str().find(Resource::LocString(Resource::String::UpgradeDifferentInstallTechnology).get()) != std::string::npos); - REQUIRE(context.GetTerminationHR() == APPINSTALLER_CLI_ERROR_UPDATE_NOT_APPLICABLE); + REQUIRE_TERMINATED_WITH(context, APPINSTALLER_CLI_ERROR_UPDATE_NOT_APPLICABLE); } TEST_CASE("UpdateFlow_UpdateExeWithDifferentInstalledType", "[UpdateFlow][workflow]") @@ -469,7 +469,7 @@ TEST_CASE("UpdateFlow_UpdateExeWithDifferentInstalledType", "[UpdateFlow][workfl INFO(updateOutput.str()); // Verify Installer is called. - REQUIRE(context.GetTerminationHR() == S_OK); + REQUIRE_SUCCEEDED(context); REQUIRE(std::filesystem::exists(updateResultPath.GetPath())); } @@ -491,7 +491,7 @@ TEST_CASE("UpdateFlow_UpdateExeSpecificVersionNotFound", "[UpdateFlow][workflow] // Verify Installer is not called. REQUIRE(!std::filesystem::exists(updateResultPath.GetPath())); REQUIRE(updateOutput.str().find(Resource::LocString(Resource::String::GetManifestResultVersionNotFound("1.2.3.4"_liv)).get()) != std::string::npos); - REQUIRE(context.GetTerminationHR() == APPINSTALLER_CLI_ERROR_NO_MANIFEST_FOUND); + REQUIRE_TERMINATED_WITH(context, APPINSTALLER_CLI_ERROR_NO_MANIFEST_FOUND); } TEST_CASE("UpdateFlow_UpdateExeSpecificVersionNotApplicable", "[UpdateFlow][workflow]") @@ -513,7 +513,7 @@ TEST_CASE("UpdateFlow_UpdateExeSpecificVersionNotApplicable", "[UpdateFlow][work // Verify Installer is not called. REQUIRE(!std::filesystem::exists(updateResultPath.GetPath())); REQUIRE(updateOutput.str().find(Resource::LocString(Resource::String::UpgradeDifferentInstallTechnology).get()) != std::string::npos); - REQUIRE(context.GetTerminationHR() == APPINSTALLER_CLI_ERROR_UPDATE_NOT_APPLICABLE); + REQUIRE_TERMINATED_WITH(context, APPINSTALLER_CLI_ERROR_UPDATE_NOT_APPLICABLE); } TEST_CASE("UpdateFlow_UpdateAllApplicable", "[UpdateFlow][workflow]") @@ -845,7 +845,7 @@ TEST_CASE("UpdateFlow_RequireExplicit", "[UpdateFlow][workflow]") } // Command should always succeed - REQUIRE(context.GetTerminationHR() == S_OK); + REQUIRE_SUCCEEDED(context); } TEST_CASE("InstallFlow_FoundInstalledAndUpgradeAvailable", "[UpdateFlow][workflow]") @@ -892,7 +892,7 @@ TEST_CASE("InstallFlow_FoundInstalledAndUpgradeAvailable_WithNoUpgrade", "[Updat // Verify Installer is not called. REQUIRE(!std::filesystem::exists(installResultPath.GetPath())); REQUIRE(installOutput.str().find(Resource::LocString(Resource::String::PackageAlreadyInstalled).get()) != std::string::npos); - REQUIRE(context.GetTerminationHR() == APPINSTALLER_CLI_ERROR_PACKAGE_ALREADY_INSTALLED); + REQUIRE_TERMINATED_WITH(context, APPINSTALLER_CLI_ERROR_PACKAGE_ALREADY_INSTALLED); } TEST_CASE("InstallFlow_FoundInstalledAndUpgradeNotAvailable", "[UpdateFlow][workflow]") @@ -913,7 +913,7 @@ TEST_CASE("InstallFlow_FoundInstalledAndUpgradeNotAvailable", "[UpdateFlow][work REQUIRE(!std::filesystem::exists(installResultPath.GetPath())); REQUIRE(installOutput.str().find(Resource::LocString(Resource::String::UpdateNoPackagesFound).get()) != std::string::npos); REQUIRE(installOutput.str().find(Resource::LocString(Resource::String::UpdateNoPackagesFoundReason).get()) != std::string::npos); - REQUIRE(context.GetTerminationHR() == APPINSTALLER_CLI_ERROR_UPDATE_NOT_APPLICABLE); + REQUIRE_TERMINATED_WITH(context, APPINSTALLER_CLI_ERROR_UPDATE_NOT_APPLICABLE); } TEST_CASE("UpdateFlow_UpdateAll_ForwardArgs", "[UpdateFlow][workflow]") diff --git a/src/AppInstallerCLITests/WindowsFeature.cpp b/src/AppInstallerCLITests/WindowsFeature.cpp index 0f00b55658..671bd7ad69 100644 --- a/src/AppInstallerCLITests/WindowsFeature.cpp +++ b/src/AppInstallerCLITests/WindowsFeature.cpp @@ -39,7 +39,7 @@ TEST_CASE("InstallFlow_WindowsFeatureDoesNotExist", "[windowsFeature]") install.Execute(context); INFO(installOutput.str()); - REQUIRE(context.GetTerminationHR() == APPINSTALLER_CLI_ERROR_INSTALL_MISSING_DEPENDENCY); + REQUIRE_TERMINATED_WITH(context, APPINSTALLER_CLI_ERROR_INSTALL_MISSING_DEPENDENCY); REQUIRE(!std::filesystem::exists(installResultPath.GetPath())); REQUIRE(installOutput.str().find(Resource::LocString(Resource::String::WindowsFeatureNotFound(LocIndView{ "testFeature1" })).get()) != std::string::npos); @@ -79,7 +79,7 @@ TEST_CASE("InstallFlow_FailedToEnableWindowsFeature", "[windowsFeature]") install.Execute(context); INFO(installOutput.str()); - REQUIRE(context.GetTerminationHR() == dismErrorResult); + REQUIRE_TERMINATED_WITH(context, dismErrorResult); REQUIRE(!std::filesystem::exists(installResultPath.GetPath())); REQUIRE(installOutput.str().find(Resource::LocString(Resource::String::FailedToEnableWindowsFeatureOverrideRequired).get()) != std::string::npos); } @@ -119,7 +119,7 @@ TEST_CASE("InstallFlow_FailedToEnableWindowsFeature_Force", "[windowsFeature]") INFO(installOutput.str()); // Verify Installer is called and parameters are passed in. - REQUIRE(context.GetTerminationHR() == ERROR_SUCCESS); + REQUIRE_SUCCEEDED(context); REQUIRE(installOutput.str().find(Resource::LocString(Resource::String::FailedToEnableWindowsFeature(testFeatureDisplayName, LocIndView{ "testFeature1" })).get()) != std::string::npos); REQUIRE(installOutput.str().find(Resource::LocString(Resource::String::FailedToEnableWindowsFeature(testFeatureDisplayName, LocIndView{ "testFeature2" })).get()) != std::string::npos); REQUIRE(installOutput.str().find(Resource::LocString(Resource::String::FailedToEnableWindowsFeatureOverridden).get()) != std::string::npos); @@ -162,7 +162,7 @@ TEST_CASE("InstallFlow_RebootRequired", "[windowsFeature]") install.Execute(context); INFO(installOutput.str()); - REQUIRE(context.GetTerminationHR() == APPINSTALLER_CLI_ERROR_INSTALL_REBOOT_REQUIRED_TO_INSTALL); + REQUIRE_TERMINATED_WITH(context, APPINSTALLER_CLI_ERROR_INSTALL_REBOOT_REQUIRED_TO_INSTALL); REQUIRE(!std::filesystem::exists(installResultPath.GetPath())); REQUIRE(installOutput.str().find(Resource::LocString(Resource::String::RebootRequiredToEnableWindowsFeatureOverrideRequired).get()) != std::string::npos); } @@ -200,7 +200,7 @@ TEST_CASE("InstallFlow_RebootRequired_Force", "[windowsFeature]") INFO(installOutput.str()); // Verify Installer is called and parameters are passed in. - REQUIRE(context.GetTerminationHR() == ERROR_SUCCESS); + REQUIRE_SUCCEEDED(context); REQUIRE(installOutput.str().find(Resource::LocString(Resource::String::RebootRequiredToEnableWindowsFeatureOverridden).get()) != std::string::npos); REQUIRE(std::filesystem::exists(installResultPath.GetPath())); std::ifstream installResultFile(installResultPath.GetPath()); diff --git a/src/AppInstallerCLITests/WorkflowCommon.h b/src/AppInstallerCLITests/WorkflowCommon.h index 8ff394806a..2589b83907 100644 --- a/src/AppInstallerCLITests/WorkflowCommon.h +++ b/src/AppInstallerCLITests/WorkflowCommon.h @@ -11,7 +11,10 @@ #define REQUIRE_TERMINATED_WITH(_context_,_hr_) \ REQUIRE(_context_.IsTerminated()); \ - REQUIRE(_hr_ == _context_.GetTerminationHR()) + REQUIRE(( (_hr_) == (_context_).GetTerminationHR() )) + +#define REQUIRE_SUCCEEDED(_context_) \ + REQUIRE(( S_OK == (_context_).GetTerminationHR() )) namespace TestCommon { diff --git a/src/AppInstallerCLITests/YamlManifest.cpp b/src/AppInstallerCLITests/YamlManifest.cpp index 9a313931a2..fa7ced6a42 100644 --- a/src/AppInstallerCLITests/YamlManifest.cpp +++ b/src/AppInstallerCLITests/YamlManifest.cpp @@ -393,7 +393,12 @@ void CopyTestDataFilesToFolder(const std::vector& testDataFiles, co } } +// Function uses too much stack space. +// We should be okay here since this is called from tests and it doesn't do calls that are too complicated +#pragma warning( push ) +#pragma warning ( disable : 6262 ) void VerifyV1ManifestContent(const Manifest& manifest, bool isSingleton, ManifestVer manifestVer = { s_ManifestVersionV1 }) +#pragma warning( pop ) { REQUIRE(manifest.Id == "microsoft.msixsdk"); REQUIRE(manifest.Version == "1.7.32"); diff --git a/src/AppInstallerCLITests/main.cpp b/src/AppInstallerCLITests/main.cpp index d38da19342..3b64ac269c 100644 --- a/src/AppInstallerCLITests/main.cpp +++ b/src/AppInstallerCLITests/main.cpp @@ -1,11 +1,8 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. + #define CATCH_CONFIG_RUNNER -#include -#include -#include -#include -#include +#include "pch.h" #include #include diff --git a/src/AppInstallerCLITests/pch.h b/src/AppInstallerCLITests/pch.h index fdceff3fea..8719dacb19 100644 --- a/src/AppInstallerCLITests/pch.h +++ b/src/AppInstallerCLITests/pch.h @@ -11,7 +11,10 @@ #include #include +#pragma warning( push ) +#pragma warning ( disable : 26439 26451 26495 ) #include +#pragma warning( pop ) #include @@ -20,10 +23,14 @@ #include #include +#pragma warning( push ) +#pragma warning ( disable : 6001 6553 6387 6388 28193 28196 ) #include #include +#include #include #include +#pragma warning( push ) #include #include @@ -39,3 +46,11 @@ #include #include #include + +// The compiler complains about MarketsInfo::ExcludedMarkets being uninitialized, +// only in this project for some reason. +// Adding = {} didn't fix it, so disabling warning here. +#pragma warning( push ) +#pragma warning ( disable : 26495 ) +#include +#pragma warning( pop ) \ No newline at end of file diff --git a/src/AppInstallerCommonCore/AppInstallerCommonCore.vcxproj b/src/AppInstallerCommonCore/AppInstallerCommonCore.vcxproj index d00dcf04bd..f92f8eede6 100644 --- a/src/AppInstallerCommonCore/AppInstallerCommonCore.vcxproj +++ b/src/AppInstallerCommonCore/AppInstallerCommonCore.vcxproj @@ -2,17 +2,9 @@ - true - true - true 15.0 {5890d6ed-7c3b-40f3-b436-b54f640d9e65} - Win32Proj AppInstallerLoggingCore - 10.0.22000.0 - 10.0.17763.0 - true - true @@ -69,61 +61,7 @@ x64 - - StaticLibrary - v140 - v141 - v142 - v143 - Unicode - - - true - true - - - false - true - false - - - false - true - false - - - false - false - false - true - - - Spectre - - - Spectre - - - Spectre - - - Spectre - - - Spectre - - - Spectre - - - Spectre - - - Spectre - - - @@ -133,248 +71,16 @@ - - - - - - true - $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ - true - true - ..\CodeAnalysis.ruleset - - - true - $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ - true - true - ..\CodeAnalysis.ruleset - - - true - $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ - true - true - ..\CodeAnalysis.ruleset - - - true - $(SolutionDir)x86\$(Configuration)\$(ProjectName)\ - true - true - ..\CodeAnalysis.ruleset - - - false - $(SolutionDir)x86\$(Configuration)\$(ProjectName)\ - true - false - ..\CodeAnalysis.ruleset - - - false - $(SolutionDir)x86\$(Configuration)\$(ProjectName)\ - true - false - ..\CodeAnalysis.ruleset - - - false - $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ - true - false - ..\CodeAnalysis.ruleset - - - false - $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ - true - false - ..\CodeAnalysis.ruleset - - - false - $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ - - - false - $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ - true - false - ..\CodeAnalysis.ruleset - - - false - $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ - true - false - ..\CodeAnalysis.ruleset - - - false - $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ - true - false - ..\CodeAnalysis.ruleset - - - false - $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ - true - false - ..\CodeAnalysis.ruleset - - - Use - pch.h - $(IntDir)pch.pch - _CONSOLE;%(PreprocessorDefinitions) - Level4 - %(AdditionalOptions) /permissive- /D _SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING - - - Disabled - _NO_ASYNCRTIMP;_DEBUG;%(PreprocessorDefinitions);CLICOREDLLBUILD - $(ProjectDir);$(ProjectDir)Public;$(ProjectDir)Telemetry;$(ProjectDir)..\AppInstallerSharedLib;$(ProjectDir)..\AppInstallerSharedLib\Public;$(ProjectDir)..\binver;$(ProjectDir)..\YamlCppLib\libyaml\include;$(ProjectDir)..\cpprestsdk\cpprestsdk\Release\include;$(ProjectDir)..\JsonCppLib;$(ProjectDir)..\PureLib\pure;%(AdditionalIncludeDirectories) - $(ProjectDir);$(ProjectDir)Public;$(ProjectDir)Telemetry;$(ProjectDir)..\AppInstallerSharedLib;$(ProjectDir)..\AppInstallerSharedLib\Public;$(ProjectDir)..\binver;$(ProjectDir)..\YamlCppLib\libyaml\include;$(ProjectDir)..\cpprestsdk\cpprestsdk\Release\include;$(ProjectDir)..\JsonCppLib;$(ProjectDir)..\PureLib\pure;%(AdditionalIncludeDirectories) - $(ProjectDir);$(ProjectDir)Public;$(ProjectDir)Telemetry;$(ProjectDir)..\AppInstallerSharedLib;$(ProjectDir)..\AppInstallerSharedLib\Public;$(ProjectDir)..\binver;$(ProjectDir)..\YamlCppLib\libyaml\include;$(ProjectDir)..\cpprestsdk\cpprestsdk\Release\include;$(ProjectDir)..\JsonCppLib;$(ProjectDir)..\PureLib\pure;%(AdditionalIncludeDirectories) - true - true - true - true - true - true - true - true - true - - - false - Windows - Windows - Windows - - - - - _NO_ASYNCRTIMP;WIN32;%(PreprocessorDefinitions);CLICOREDLLBUILD - $(ProjectDir);$(ProjectDir)Public;$(ProjectDir)Telemetry;$(ProjectDir)..\AppInstallerSharedLib;$(ProjectDir)..\AppInstallerSharedLib\Public;$(ProjectDir)..\binver;$(ProjectDir)..\YamlCppLib\libyaml\include;$(ProjectDir)..\cpprestsdk\cpprestsdk\Release\include;$(ProjectDir)..\JsonCppLib;$(ProjectDir)..\PureLib\pure;%(AdditionalIncludeDirectories) - true - true - true - - - Windows - - - - - MaxSpeed - true - true - _NO_ASYNCRTIMP;NDEBUG;%(PreprocessorDefinitions);CLICOREDLLBUILD - $(ProjectDir);$(ProjectDir)Public;$(ProjectDir)Telemetry;$(ProjectDir)..\AppInstallerSharedLib;$(ProjectDir)..\AppInstallerSharedLib\Public;$(ProjectDir)..\binver;$(ProjectDir)..\YamlCppLib\libyaml\include;$(ProjectDir)..\cpprestsdk\cpprestsdk\Release\include;$(ProjectDir)..\PureLib\pure;$(ProjectDir)..\JsonCppLib;%(AdditionalIncludeDirectories) - $(ProjectDir);$(ProjectDir)Public;$(ProjectDir)Telemetry;$(ProjectDir)..\AppInstallerSharedLib;$(ProjectDir)..\AppInstallerSharedLib\Public;$(ProjectDir)..\binver;$(ProjectDir)..\YamlCppLib\libyaml\include;$(ProjectDir)..\cpprestsdk\cpprestsdk\Release\include;$(ProjectDir)..\PureLib\pure;$(ProjectDir)..\JsonCppLib;%(AdditionalIncludeDirectories) - $(ProjectDir);$(ProjectDir)Public;$(ProjectDir)Telemetry;$(ProjectDir)..\AppInstallerSharedLib;$(ProjectDir)..\AppInstallerSharedLib\Public;$(ProjectDir)..\binver;$(ProjectDir)..\YamlCppLib\libyaml\include;$(ProjectDir)..\cpprestsdk\cpprestsdk\Release\include;$(ProjectDir)..\PureLib\pure;$(ProjectDir)..\JsonCppLib;%(AdditionalIncludeDirectories) - $(ProjectDir);$(ProjectDir)Public;$(ProjectDir)Telemetry;$(ProjectDir)..\AppInstallerSharedLib;$(ProjectDir)..\AppInstallerSharedLib\Public;$(ProjectDir)..\binver;$(ProjectDir)..\YamlCppLib\libyaml\include;$(ProjectDir)..\cpprestsdk\cpprestsdk\Release\include;$(ProjectDir)..\PureLib\pure;$(ProjectDir)..\JsonCppLib;%(AdditionalIncludeDirectories) - true - true - true - true - true - true - true - true - false - false - false - false - - - true - true - false - Windows - Windows - Windows - Windows - - - - - MaxSpeed - true - true - _NO_ASYNCRTIMP;NDEBUG;%(PreprocessorDefinitions);CLICOREDLLBUILD - $(ProjectDir);$(ProjectDir)Public;$(ProjectDir)Telemetry;$(ProjectDir)..\AppInstallerSharedLib;$(ProjectDir)..\AppInstallerSharedLib\Public;$(ProjectDir)..\binver;$(ProjectDir)..\YamlCppLib\libyaml\include;$(ProjectDir)..\cpprestsdk\cpprestsdk\Release\include;$(ProjectDir)..\PureLib\pure;$(ProjectDir)..\JsonCppLib;%(AdditionalIncludeDirectories) - $(ProjectDir);$(ProjectDir)Public;$(ProjectDir)Telemetry;$(ProjectDir)..\AppInstallerSharedLib;$(ProjectDir)..\AppInstallerSharedLib\Public;$(ProjectDir)..\binver;$(ProjectDir)..\YamlCppLib\libyaml\include;$(ProjectDir)..\cpprestsdk\cpprestsdk\Release\include;$(ProjectDir)..\PureLib\pure;$(ProjectDir)..\JsonCppLib;%(AdditionalIncludeDirectories) - $(ProjectDir);$(ProjectDir)Public;$(ProjectDir)Telemetry;$(ProjectDir)..\AppInstallerSharedLib;$(ProjectDir)..\AppInstallerSharedLib\Public;$(ProjectDir)..\binver;$(ProjectDir)..\YamlCppLib\libyaml\include;$(ProjectDir)..\cpprestsdk\cpprestsdk\Release\include;$(ProjectDir)..\PureLib\pure;$(ProjectDir)..\JsonCppLib;%(AdditionalIncludeDirectories) - $(ProjectDir);$(ProjectDir)Public;$(ProjectDir)Telemetry;$(ProjectDir)..\AppInstallerSharedLib;$(ProjectDir)..\AppInstallerSharedLib\Public;$(ProjectDir)..\binver;$(ProjectDir)..\YamlCppLib\libyaml\include;$(ProjectDir)..\cpprestsdk\cpprestsdk\Release\include;$(ProjectDir)..\PureLib\pure;$(ProjectDir)..\JsonCppLib;%(AdditionalIncludeDirectories) - true - true - true - true - true - true - true - true - false - false - false - false - MultiThreaded - MultiThreaded - MultiThreaded - MultiThreaded - - - true - true - false - Windows - Windows - Windows - Windows - - - - - MaxSpeed - true - true - _NO_ASYNCRTIMP;NDEBUG;%(PreprocessorDefinitions);CLICOREDLLBUILD;WINGET_DISABLE_FOR_FUZZING - $(ProjectDir);$(ProjectDir)Public;$(ProjectDir)Telemetry;$(ProjectDir)..\AppInstallerSharedLib;$(ProjectDir)..\AppInstallerSharedLib\Public;$(ProjectDir)..\binver;$(ProjectDir)..\YamlCppLib\libyaml\include;$(ProjectDir)..\cpprestsdk\cpprestsdk\Release\include;$(ProjectDir)..\JsonCppLib;%(AdditionalIncludeDirectories) - true - stdcpp17 - MultiThreaded - %(AdditionalOptions) /fsanitize-coverage=inline-8bit-counters /fsanitize-coverage=edge /fsanitize-coverage=trace-cmp /fsanitize-coverage=trace-div + _NO_ASYNCRTIMP;CLICOREDLLBUILD;%(PreprocessorDefinitions) + $(ProjectDir);$(ProjectDir)Public;$(ProjectDir)Telemetry;$(ProjectDir)..\AppInstallerSharedLib;$(ProjectDir)..\AppInstallerSharedLib\Public;$(ProjectDir)..\binver;$(ProjectDir)..\YamlCppLib\libyaml\include;$(ProjectDir)..\cpprestsdk\cpprestsdk\Release\include;$(ProjectDir)..\JsonCppLib;$(ProjectDir)..\PureLib\pure;%(AdditionalIncludeDirectories) - true - true - false Windows - - - AICLI_DISABLE_TEST_HOOKS;%(PreprocessorDefinitions) - - - - - WINGET_DISABLE_EXPERIMENTAL_FEATURES;%(PreprocessorDefinitions) - - - - - WINGET_ENABLE_RELEASE_BUILD;%(PreprocessorDefinitions) - - @@ -498,7 +204,6 @@ - diff --git a/src/AppInstallerCommonCore/AppInstallerCommonCore.vcxproj.filters b/src/AppInstallerCommonCore/AppInstallerCommonCore.vcxproj.filters index 2f69d23e33..6241c59311 100644 --- a/src/AppInstallerCommonCore/AppInstallerCommonCore.vcxproj.filters +++ b/src/AppInstallerCommonCore/AppInstallerCommonCore.vcxproj.filters @@ -337,7 +337,6 @@ - \ No newline at end of file diff --git a/src/AppInstallerCommonCore/Archive.cpp b/src/AppInstallerCommonCore/Archive.cpp index 9d5f9c5896..590d666a36 100644 --- a/src/AppInstallerCommonCore/Archive.cpp +++ b/src/AppInstallerCommonCore/Archive.cpp @@ -7,7 +7,7 @@ #pragma warning( push ) #pragma warning ( disable : 4189 4244 26451 ) #include -#pragma warning ( pop ) +#pragma warning( pop ) namespace AppInstaller::Archive { diff --git a/src/AppInstallerCommonCore/Downloader.cpp b/src/AppInstallerCommonCore/Downloader.cpp index be43976703..91da2bd739 100644 --- a/src/AppInstallerCommonCore/Downloader.cpp +++ b/src/AppInstallerCommonCore/Downloader.cpp @@ -27,8 +27,8 @@ namespace AppInstaller::Utility bool computeHash) { // For AICLI_LOG usages with string literals. - #pragma warning(push) - #pragma warning(disable:26449) + #pragma warning( push ) + #pragma warning ( disable : 26449 ) AICLI_LOG(Core, Info, << "WinINet downloading from url: " << url); @@ -136,7 +136,7 @@ namespace AppInstaller::Utility AICLI_LOG(Core, Info, << "Download completed."); - #pragma warning(pop) + #pragma warning( pop ) return result; } diff --git a/src/AppInstallerCommonCore/PropertySheet.props b/src/AppInstallerCommonCore/PropertySheet.props deleted file mode 100644 index c6b0691ddd..0000000000 --- a/src/AppInstallerCommonCore/PropertySheet.props +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/src/AppInstallerCommonCore/Public/AppInstallerProgress.h b/src/AppInstallerCommonCore/Public/AppInstallerProgress.h index 316b374ec8..0e069f28f5 100644 --- a/src/AppInstallerCommonCore/Public/AppInstallerProgress.h +++ b/src/AppInstallerCommonCore/Public/AppInstallerProgress.h @@ -1,7 +1,12 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #pragma once + +#pragma warning( push ) +#pragma warning ( disable : 6553 ) #include +#pragma warning( pop ) + #include #include #include diff --git a/src/AppInstallerCommonCore/Public/AppInstallerSynchronization.h b/src/AppInstallerCommonCore/Public/AppInstallerSynchronization.h index 44794ccde0..4a7e99d7ac 100644 --- a/src/AppInstallerCommonCore/Public/AppInstallerSynchronization.h +++ b/src/AppInstallerCommonCore/Public/AppInstallerSynchronization.h @@ -3,7 +3,6 @@ #pragma once #include #include -#include #include #include diff --git a/src/AppInstallerCommonCore/Public/AppInstallerTelemetry.h b/src/AppInstallerCommonCore/Public/AppInstallerTelemetry.h index 25176bb800..e5f355835a 100644 --- a/src/AppInstallerCommonCore/Public/AppInstallerTelemetry.h +++ b/src/AppInstallerCommonCore/Public/AppInstallerTelemetry.h @@ -2,7 +2,6 @@ // Licensed under the MIT License. #pragma once #include -#include #include #include diff --git a/src/AppInstallerCommonCore/Public/winget/Certificates.h b/src/AppInstallerCommonCore/Public/winget/Certificates.h index 83c78af1de..c55afdbe33 100644 --- a/src/AppInstallerCommonCore/Public/winget/Certificates.h +++ b/src/AppInstallerCommonCore/Public/winget/Certificates.h @@ -1,10 +1,15 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #pragma once + #include -#include +#pragma warning( push ) +#pragma warning ( disable : 6553 ) #include +#pragma warning( pop ) + +#include #include #include diff --git a/src/AppInstallerCommonCore/Public/winget/FolderFileWatcher.h b/src/AppInstallerCommonCore/Public/winget/FolderFileWatcher.h index cbf26b7bff..80aacb9d39 100644 --- a/src/AppInstallerCommonCore/Public/winget/FolderFileWatcher.h +++ b/src/AppInstallerCommonCore/Public/winget/FolderFileWatcher.h @@ -3,7 +3,7 @@ #pragma once #include #pragma warning( push ) -#pragma warning ( disable : 6387 28196 ) +#pragma warning ( disable : 6001 6387 28196 ) #include #pragma warning( pop ) diff --git a/src/AppInstallerCommonCore/Public/winget/ManagedFile.h b/src/AppInstallerCommonCore/Public/winget/ManagedFile.h index 7288c828a7..a4ff1daaa4 100644 --- a/src/AppInstallerCommonCore/Public/winget/ManagedFile.h +++ b/src/AppInstallerCommonCore/Public/winget/ManagedFile.h @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #pragma once -#include #include namespace AppInstaller::Utility diff --git a/src/AppInstallerCommonCore/Public/winget/ManifestValidation.h b/src/AppInstallerCommonCore/Public/winget/ManifestValidation.h index 52aa910680..85a07f549a 100644 --- a/src/AppInstallerCommonCore/Public/winget/ManifestValidation.h +++ b/src/AppInstallerCommonCore/Public/winget/ManifestValidation.h @@ -5,7 +5,6 @@ #include #include -#include #include namespace YAML { class Node; } diff --git a/src/AppInstallerCommonCore/Public/winget/Registry.h b/src/AppInstallerCommonCore/Public/winget/Registry.h index fcbae166f2..1c2e6a7dc6 100644 --- a/src/AppInstallerCommonCore/Public/winget/Registry.h +++ b/src/AppInstallerCommonCore/Public/winget/Registry.h @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #pragma once -#include - #include #include #include diff --git a/src/AppInstallerCommonCore/pch.h b/src/AppInstallerCommonCore/pch.h index 9157ecef44..ded24704cf 100644 --- a/src/AppInstallerCommonCore/pch.h +++ b/src/AppInstallerCommonCore/pch.h @@ -61,7 +61,7 @@ #include #pragma warning( push ) -#pragma warning ( disable : 6001 6285 6287 6340 6387 6388 26451 26495 28196 ) +#pragma warning ( disable : 6001 6285 6287 6340 6387 6388 6553 26451 26495 28196 ) #include #include #include diff --git a/src/AppInstallerRepositoryCore/AppInstallerRepositoryCore.vcxproj b/src/AppInstallerRepositoryCore/AppInstallerRepositoryCore.vcxproj index 8e947566e8..b2712c085d 100644 --- a/src/AppInstallerRepositoryCore/AppInstallerRepositoryCore.vcxproj +++ b/src/AppInstallerRepositoryCore/AppInstallerRepositoryCore.vcxproj @@ -2,17 +2,9 @@ - true - true - true 15.0 {5eb88068-5fb9-4e69-89b2-72dbc5e068f9} - Win32Proj AppInstallerRepositoryCore - 10.0.22000.0 - 10.0.17763.0 - true - true @@ -65,268 +57,17 @@ x64 - - StaticLibrary - v140 - v141 - v142 - v143 - Unicode - - - true - true - - - false - true - false - - - false - true - false - - - Spectre - - - Spectre - - - Spectre - - - Spectre - - - Spectre - - - Spectre - - - Spectre - - - Spectre - - - - - - - - - true - $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ - true - true - ..\CodeAnalysis.ruleset - - - true - $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ - true - true - ..\CodeAnalysis.ruleset - - - true - $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ - true - true - ..\CodeAnalysis.ruleset - - - true - $(SolutionDir)x86\$(Configuration)\$(ProjectName)\ - true - true - ..\CodeAnalysis.ruleset - - - false - $(SolutionDir)x86\$(Configuration)\$(ProjectName)\ - true - false - ..\CodeAnalysis.ruleset - - - false - $(SolutionDir)x86\$(Configuration)\$(ProjectName)\ - true - false - ..\CodeAnalysis.ruleset - - - false - $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ - true - false - ..\CodeAnalysis.ruleset - - - false - $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ - true - false - ..\CodeAnalysis.ruleset - - - false - $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ - true - false - ..\CodeAnalysis.ruleset - - - false - $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ - true - false - ..\CodeAnalysis.ruleset - - - false - $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ - true - false - ..\CodeAnalysis.ruleset - - - false - $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ - true - false - ..\CodeAnalysis.ruleset - - Use - pch.h - $(IntDir)pch.pch - _CONSOLE;%(PreprocessorDefinitions) - Level4 - %(AdditionalOptions) /permissive- /bigobj /D _SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING - - - - - Disabled - _NO_ASYNCRTIMP;_DEBUG;%(PreprocessorDefinitions);CLICOREDLLBUILD - $(ProjectDir);$(ProjectDir)\Public;$(ProjectDir)..\AppInstallerCommonCore\Public;$(ProjectDir)..\AppInstallerSharedLib\Public;$(ProjectDir)..\JsonCppLib;$(ProjectDir)..\cpprestsdk\cpprestsdk\Release\include;%(AdditionalIncludeDirectories) - $(ProjectDir);$(ProjectDir)\Public;$(ProjectDir)..\AppInstallerCommonCore\Public;$(ProjectDir)..\AppInstallerSharedLib\Public;$(ProjectDir)..\JsonCppLib;$(ProjectDir)..\cpprestsdk\cpprestsdk\Release\include;%(AdditionalIncludeDirectories) - $(ProjectDir);$(ProjectDir)\Public;$(ProjectDir)..\AppInstallerCommonCore\Public;$(ProjectDir)..\AppInstallerSharedLib\Public;$(ProjectDir)..\JsonCppLib;$(ProjectDir)..\cpprestsdk\cpprestsdk\Release\include;%(AdditionalIncludeDirectories) - true - true - true - true - true - true - true - true - true - - - false - Windows - Windows - Windows - - - - - _NO_ASYNCRTIMP;WIN32;%(PreprocessorDefinitions);CLICOREDLLBUILD - $(ProjectDir);$(ProjectDir)\Public;$(ProjectDir)..\AppInstallerCommonCore\Public;$(ProjectDir)..\AppInstallerSharedLib\Public;$(ProjectDir)..\JsonCppLib;$(ProjectDir)..\cpprestsdk\cpprestsdk\Release\include;%(AdditionalIncludeDirectories) - true - true - true - - - Windows - - - - - MaxSpeed - true - true - _NO_ASYNCRTIMP;NDEBUG;%(PreprocessorDefinitions);CLICOREDLLBUILD - $(ProjectDir);$(ProjectDir)\Public;$(ProjectDir)..\AppInstallerCommonCore\Public;$(ProjectDir)..\AppInstallerSharedLib\Public;$(ProjectDir)..\JsonCppLib;$(ProjectDir)..\cpprestsdk\cpprestsdk\Release\include;%(AdditionalIncludeDirectories) - $(ProjectDir);$(ProjectDir)\Public;$(ProjectDir)..\AppInstallerCommonCore\Public;$(ProjectDir)..\AppInstallerSharedLib\Public;$(ProjectDir)..\JsonCppLib;$(ProjectDir)..\cpprestsdk\cpprestsdk\Release\include;%(AdditionalIncludeDirectories) - $(ProjectDir);$(ProjectDir)\Public;$(ProjectDir)..\AppInstallerCommonCore\Public;$(ProjectDir)..\AppInstallerSharedLib\Public;$(ProjectDir)..\JsonCppLib;$(ProjectDir)..\cpprestsdk\cpprestsdk\Release\include;%(AdditionalIncludeDirectories) - $(ProjectDir);$(ProjectDir)\Public;$(ProjectDir)..\AppInstallerCommonCore\Public;$(ProjectDir)..\AppInstallerSharedLib\Public;$(ProjectDir)..\JsonCppLib;$(ProjectDir)..\cpprestsdk\cpprestsdk\Release\include;%(AdditionalIncludeDirectories) - true - true - true - true - true - true - true - true - false - false - false - false - - - true - true - false - Windows - Windows - Windows - Windows - - - - - MaxSpeed - true - true - _NO_ASYNCRTIMP;NDEBUG;%(PreprocessorDefinitions);CLICOREDLLBUILD - $(ProjectDir);$(ProjectDir)\Public;$(ProjectDir)..\AppInstallerCommonCore\Public;$(ProjectDir)..\AppInstallerSharedLib\Public;$(ProjectDir)..\JsonCppLib;$(ProjectDir)..\cpprestsdk\cpprestsdk\Release\include;%(AdditionalIncludeDirectories) - $(ProjectDir);$(ProjectDir)\Public;$(ProjectDir)..\AppInstallerCommonCore\Public;$(ProjectDir)..\AppInstallerSharedLib\Public;$(ProjectDir)..\JsonCppLib;$(ProjectDir)..\cpprestsdk\cpprestsdk\Release\include;%(AdditionalIncludeDirectories) - $(ProjectDir);$(ProjectDir)\Public;$(ProjectDir)..\AppInstallerCommonCore\Public;$(ProjectDir)..\AppInstallerSharedLib\Public;$(ProjectDir)..\JsonCppLib;$(ProjectDir)..\cpprestsdk\cpprestsdk\Release\include;%(AdditionalIncludeDirectories) - $(ProjectDir);$(ProjectDir)\Public;$(ProjectDir)..\AppInstallerCommonCore\Public;$(ProjectDir)..\AppInstallerSharedLib\Public;$(ProjectDir)..\JsonCppLib;$(ProjectDir)..\cpprestsdk\cpprestsdk\Release\include;%(AdditionalIncludeDirectories) - true - true - true - true - true - true - true - true - false - false - false - false - MultiThreaded - MultiThreaded - MultiThreaded - MultiThreaded - - - true - true - false - Windows - Windows - Windows - Windows - - - - - AICLI_DISABLE_TEST_HOOKS;%(PreprocessorDefinitions) + _NO_ASYNCRTIMP;CLICOREDLLBUILD;%(PreprocessorDefinitions) + $(ProjectDir);$(ProjectDir)\Public;$(ProjectDir)..\AppInstallerCommonCore\Public;$(ProjectDir)..\AppInstallerSharedLib\Public;$(ProjectDir)..\JsonCppLib;$(ProjectDir)..\cpprestsdk\cpprestsdk\Release\include;%(AdditionalIncludeDirectories) @@ -432,18 +173,7 @@ - NotUsing - NotUsing - NotUsing - NotUsing - NotUsing - NotUsing - NotUsing - NotUsing - NotUsing - NotUsing - NotUsing - NotUsing + NotUsing @@ -516,7 +246,6 @@ - diff --git a/src/AppInstallerRepositoryCore/AppInstallerRepositoryCore.vcxproj.filters b/src/AppInstallerRepositoryCore/AppInstallerRepositoryCore.vcxproj.filters index 8284f78c24..08619b83cf 100644 --- a/src/AppInstallerRepositoryCore/AppInstallerRepositoryCore.vcxproj.filters +++ b/src/AppInstallerRepositoryCore/AppInstallerRepositoryCore.vcxproj.filters @@ -580,7 +580,6 @@ - Microsoft diff --git a/src/AppInstallerRepositoryCore/Microsoft/ARPHelper.h b/src/AppInstallerRepositoryCore/Microsoft/ARPHelper.h index 3c0b4ac77b..94e779fc69 100644 --- a/src/AppInstallerRepositoryCore/Microsoft/ARPHelper.h +++ b/src/AppInstallerRepositoryCore/Microsoft/ARPHelper.h @@ -5,7 +5,6 @@ #include #include #include -#include #include diff --git a/src/AppInstallerRepositoryCore/Microsoft/Schema/MetadataTable.h b/src/AppInstallerRepositoryCore/Microsoft/Schema/MetadataTable.h index 5205a270d2..f4ecff442e 100644 --- a/src/AppInstallerRepositoryCore/Microsoft/Schema/MetadataTable.h +++ b/src/AppInstallerRepositoryCore/Microsoft/Schema/MetadataTable.h @@ -3,7 +3,6 @@ #pragma once #include "SQLiteWrapper.h" -#include #include namespace AppInstaller::Repository::Microsoft::Schema diff --git a/src/AppInstallerRepositoryCore/PropertySheet.props b/src/AppInstallerRepositoryCore/PropertySheet.props deleted file mode 100644 index c6b0691ddd..0000000000 --- a/src/AppInstallerRepositoryCore/PropertySheet.props +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/src/AppInstallerRepositoryCore/SQLiteWrapper.cpp b/src/AppInstallerRepositoryCore/SQLiteWrapper.cpp index 38b88d6982..c4aebfa23b 100644 --- a/src/AppInstallerRepositoryCore/SQLiteWrapper.cpp +++ b/src/AppInstallerRepositoryCore/SQLiteWrapper.cpp @@ -4,8 +4,6 @@ #include "SQLiteWrapper.h" #include "ICU/SQLiteICU.h" -#include - using namespace std::string_view_literals; // Enable this to have all Statement constructions output the associated query plan. diff --git a/src/AppInstallerRepositoryCore/SQLiteWrapper.h b/src/AppInstallerRepositoryCore/SQLiteWrapper.h index 3a5913ce95..d23952b1bd 100644 --- a/src/AppInstallerRepositoryCore/SQLiteWrapper.h +++ b/src/AppInstallerRepositoryCore/SQLiteWrapper.h @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #pragma once -#include -#include #include #include diff --git a/src/AppInstallerRepositoryCore/pch.h b/src/AppInstallerRepositoryCore/pch.h index 09c622c1b2..32167f7b02 100644 --- a/src/AppInstallerRepositoryCore/pch.h +++ b/src/AppInstallerRepositoryCore/pch.h @@ -12,7 +12,7 @@ #include #pragma warning( push ) -#pragma warning ( disable : 6001 6340 6387 6388 26495 28196 ) +#pragma warning ( disable : 6001 6340 6387 6388 6553 26495 28196 ) #include #include #include diff --git a/src/AppInstallerSharedLib/AppInstallerSharedLib.vcxproj b/src/AppInstallerSharedLib/AppInstallerSharedLib.vcxproj index 1dd577f99f..00ac52caf9 100644 --- a/src/AppInstallerSharedLib/AppInstallerSharedLib.vcxproj +++ b/src/AppInstallerSharedLib/AppInstallerSharedLib.vcxproj @@ -2,16 +2,8 @@ - true - true - true 15.0 {F3F6E699-BC5D-4950-8A05-E49DD9EB0D51} - Win32Proj - 10.0.22000.0 - 10.0.17763.0 - true - true @@ -68,323 +60,18 @@ x64 - - StaticLibrary - v140 - v141 - v142 - v143 - Unicode - - - true - true - - - false - true - false - - - false - true - false - - - false - false - false - true - - - Spectre - - - Spectre - - - Spectre - - - Spectre - - - Spectre - - - Spectre - - - Spectre - - - Spectre - - - - - - - - - true - $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ - true - true - ..\CodeAnalysis.ruleset - - - true - $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ - true - true - ..\CodeAnalysis.ruleset - - - true - $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ - true - true - ..\CodeAnalysis.ruleset - - - true - $(SolutionDir)x86\$(Configuration)\$(ProjectName)\ - true - true - ..\CodeAnalysis.ruleset - - - false - $(SolutionDir)x86\$(Configuration)\$(ProjectName)\ - true - false - ..\CodeAnalysis.ruleset - - - false - $(SolutionDir)x86\$(Configuration)\$(ProjectName)\ - true - false - ..\CodeAnalysis.ruleset - - - false - $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ - true - false - ..\CodeAnalysis.ruleset - - - false - $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ - true - false - ..\CodeAnalysis.ruleset - - - false - $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ - - - false - $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ - true - false - ..\CodeAnalysis.ruleset - - - false - $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ - true - false - ..\CodeAnalysis.ruleset - - - false - $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ - true - false - ..\CodeAnalysis.ruleset - - - false - $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ - true - false - ..\CodeAnalysis.ruleset - - Use - pch.h - $(IntDir)pch.pch - _CONSOLE;%(PreprocessorDefinitions) - Level4 - %(AdditionalOptions) /permissive- /D _SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING - - - - - Disabled - _NO_ASYNCRTIMP;_DEBUG;%(PreprocessorDefinitions);CLICOREDLLBUILD - $(ProjectDir);$(ProjectDir)Public;$(ProjectDir)Telemetry;$(ProjectDir)..\binver;$(ProjectDir)..\YamlCppLib\libyaml\include;$(ProjectDir)..\cpprestsdk\cpprestsdk\Release\include;$(ProjectDir)..\JsonCppLib;$(ProjectDir)..\PureLib\pure;%(AdditionalIncludeDirectories) - $(ProjectDir);$(ProjectDir)Public;$(ProjectDir)Telemetry;$(ProjectDir)..\binver;$(ProjectDir)..\YamlCppLib\libyaml\include;$(ProjectDir)..\cpprestsdk\cpprestsdk\Release\include;$(ProjectDir)..\JsonCppLib;$(ProjectDir)..\PureLib\pure;%(AdditionalIncludeDirectories) - $(ProjectDir);$(ProjectDir)Public;$(ProjectDir)Telemetry;$(ProjectDir)..\binver;$(ProjectDir)..\YamlCppLib\libyaml\include;$(ProjectDir)..\cpprestsdk\cpprestsdk\Release\include;$(ProjectDir)..\JsonCppLib;$(ProjectDir)..\PureLib\pure;%(AdditionalIncludeDirectories) - true - true - true - true - true - true - true - true - true - false - false - false - false - false - - - false - Windows - Windows - Windows - - - - - _NO_ASYNCRTIMP;WIN32;%(PreprocessorDefinitions);CLICOREDLLBUILD - $(ProjectDir);$(ProjectDir)Public;$(ProjectDir)Telemetry;$(ProjectDir)..\binver;$(ProjectDir)..\YamlCppLib\libyaml\include;$(ProjectDir)..\cpprestsdk\cpprestsdk\Release\include;$(ProjectDir)..\JsonCppLib;$(ProjectDir)..\PureLib\pure;%(AdditionalIncludeDirectories) - true - true - true - false - false - - - Windows - - - - - MaxSpeed - true - true - _NO_ASYNCRTIMP;NDEBUG;%(PreprocessorDefinitions);CLICOREDLLBUILD - $(ProjectDir);$(ProjectDir)Public;$(ProjectDir)Telemetry;$(ProjectDir)..\binver;$(ProjectDir)..\YamlCppLib\libyaml\include;$(ProjectDir)..\cpprestsdk\cpprestsdk\Release\include;$(ProjectDir)..\PureLib\pure;$(ProjectDir)..\JsonCppLib;%(AdditionalIncludeDirectories) - $(ProjectDir);$(ProjectDir)Public;$(ProjectDir)Telemetry;$(ProjectDir)..\binver;$(ProjectDir)..\YamlCppLib\libyaml\include;$(ProjectDir)..\cpprestsdk\cpprestsdk\Release\include;$(ProjectDir)..\PureLib\pure;$(ProjectDir)..\JsonCppLib;%(AdditionalIncludeDirectories) - $(ProjectDir);$(ProjectDir)Public;$(ProjectDir)Telemetry;$(ProjectDir)..\binver;$(ProjectDir)..\YamlCppLib\libyaml\include;$(ProjectDir)..\cpprestsdk\cpprestsdk\Release\include;$(ProjectDir)..\PureLib\pure;$(ProjectDir)..\JsonCppLib;%(AdditionalIncludeDirectories) - $(ProjectDir);$(ProjectDir)Public;$(ProjectDir)Telemetry;$(ProjectDir)..\binver;$(ProjectDir)..\YamlCppLib\libyaml\include;$(ProjectDir)..\cpprestsdk\cpprestsdk\Release\include;$(ProjectDir)..\PureLib\pure;$(ProjectDir)..\JsonCppLib;%(AdditionalIncludeDirectories) - true - true - true - true - true - true - true - true - false - false - false - false - false - false - false - false - - - true - true - false - Windows - Windows - Windows - Windows - - - - - MaxSpeed - true - true - _NO_ASYNCRTIMP;NDEBUG;%(PreprocessorDefinitions);CLICOREDLLBUILD - $(ProjectDir);$(ProjectDir)Public;$(ProjectDir)Telemetry;$(ProjectDir)..\binver;$(ProjectDir)..\YamlCppLib\libyaml\include;$(ProjectDir)..\cpprestsdk\cpprestsdk\Release\include;$(ProjectDir)..\PureLib\pure;$(ProjectDir)..\JsonCppLib;%(AdditionalIncludeDirectories) - $(ProjectDir);$(ProjectDir)Public;$(ProjectDir)Telemetry;$(ProjectDir)..\binver;$(ProjectDir)..\YamlCppLib\libyaml\include;$(ProjectDir)..\cpprestsdk\cpprestsdk\Release\include;$(ProjectDir)..\PureLib\pure;$(ProjectDir)..\JsonCppLib;%(AdditionalIncludeDirectories) - $(ProjectDir);$(ProjectDir)Public;$(ProjectDir)Telemetry;$(ProjectDir)..\binver;$(ProjectDir)..\YamlCppLib\libyaml\include;$(ProjectDir)..\cpprestsdk\cpprestsdk\Release\include;$(ProjectDir)..\PureLib\pure;$(ProjectDir)..\JsonCppLib;%(AdditionalIncludeDirectories) - $(ProjectDir);$(ProjectDir)Public;$(ProjectDir)Telemetry;$(ProjectDir)..\binver;$(ProjectDir)..\YamlCppLib\libyaml\include;$(ProjectDir)..\cpprestsdk\cpprestsdk\Release\include;$(ProjectDir)..\PureLib\pure;$(ProjectDir)..\JsonCppLib;%(AdditionalIncludeDirectories) - true - true - true - true - true - true - true - true - false - false - false - false - false - false - false - false - MultiThreaded - MultiThreaded - MultiThreaded - MultiThreaded - - - true - true - false - Windows - Windows - Windows - Windows - - - - - MaxSpeed - true - true - _NO_ASYNCRTIMP;NDEBUG;%(PreprocessorDefinitions);CLICOREDLLBUILD;WINGET_DISABLE_FOR_FUZZING - $(ProjectDir);$(ProjectDir)Public;$(ProjectDir)Telemetry;$(ProjectDir)..\binver;$(ProjectDir)..\YamlCppLib\libyaml\include;$(ProjectDir)..\cpprestsdk\cpprestsdk\Release\include;$(ProjectDir)..\JsonCppLib;%(AdditionalIncludeDirectories) - true - stdcpp17 - MultiThreaded - %(AdditionalOptions) /fsanitize-coverage=inline-8bit-counters /fsanitize-coverage=edge /fsanitize-coverage=trace-cmp /fsanitize-coverage=trace-div - false - - - true - true - false - Windows - - - - - AICLI_DISABLE_TEST_HOOKS;%(PreprocessorDefinitions) - - - - - WINGET_DISABLE_EXPERIMENTAL_FEATURES;%(PreprocessorDefinitions) - - - - - WINGET_ENABLE_RELEASE_BUILD;%(PreprocessorDefinitions) + _NO_ASYNCRTIMP;CLICOREDLLBUILD;%(PreprocessorDefinitions) + $(ProjectDir);$(ProjectDir)Public;$(ProjectDir)Telemetry;$(ProjectDir)..\binver;$(ProjectDir)..\YamlCppLib\libyaml\include;$(ProjectDir)..\cpprestsdk\cpprestsdk\Release\include;$(ProjectDir)..\JsonCppLib;$(ProjectDir)..\PureLib\pure;%(AdditionalIncludeDirectories) + false @@ -426,7 +113,6 @@ - diff --git a/src/AppInstallerSharedLib/AppInstallerSharedLib.vcxproj.filters b/src/AppInstallerSharedLib/AppInstallerSharedLib.vcxproj.filters index 71ffd3661a..af61b2039a 100644 --- a/src/AppInstallerSharedLib/AppInstallerSharedLib.vcxproj.filters +++ b/src/AppInstallerSharedLib/AppInstallerSharedLib.vcxproj.filters @@ -117,7 +117,6 @@ - \ No newline at end of file diff --git a/src/AppInstallerSharedLib/PropertySheet.props b/src/AppInstallerSharedLib/PropertySheet.props deleted file mode 100644 index c6b0691ddd..0000000000 --- a/src/AppInstallerSharedLib/PropertySheet.props +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/src/AppInstallerSharedLib/pch.h b/src/AppInstallerSharedLib/pch.h index 622d3220cf..a563331b3d 100644 --- a/src/AppInstallerSharedLib/pch.h +++ b/src/AppInstallerSharedLib/pch.h @@ -41,7 +41,7 @@ #include #pragma warning( push ) -#pragma warning ( disable : 6001 6285 6287 6340 6387 6388 26495 28196 ) +#pragma warning ( disable : 6001 6285 6287 6340 6387 6388 6553 26495 28196 ) #include #include #include diff --git a/src/AppInstallerTestExeInstaller/AppInstallerTestExeInstaller.vcxproj b/src/AppInstallerTestExeInstaller/AppInstallerTestExeInstaller.vcxproj index 8c55233101..2471d71910 100644 --- a/src/AppInstallerTestExeInstaller/AppInstallerTestExeInstaller.vcxproj +++ b/src/AppInstallerTestExeInstaller/AppInstallerTestExeInstaller.vcxproj @@ -3,12 +3,7 @@ 15.0 {6CB84692-5994-407D-B9BD-9216AF77FE83} - Win32Proj AppInstallerTestExeInstaller - 10.0.22000.0 - 10.0.17763.0 - true - true @@ -47,107 +42,24 @@ Application - v140 - v141 - v142 - v143 - Unicode - - - true - $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ - - - true - $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ - - - true - $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ - - - true - $(SolutionDir)x86\$(Configuration)\$(ProjectName)\ - - - false - $(SolutionDir)x86\$(Configuration)\$(ProjectName)\ - - - false - $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ - - - false - $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ - - - false - $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ - - - - - NotUsing - pch.h - $(IntDir)pch.pch - _CONSOLE;%(PreprocessorDefinitions) - Level4 - %(AdditionalOptions) /permissive- /bigobj /Zi - Disabled - _DEBUG;%(PreprocessorDefinitions) - true - true - true - stdcpp17 - stdcpp17 - stdcpp17 MultiThreadedDebugDLL - - Console - false - - - - WIN32;%(PreprocessorDefinitions) - true - stdcpp17 - - - - - MaxSpeed - true - true - NDEBUG;%(PreprocessorDefinitions) - true - true - true - true - stdcpp17 - stdcpp17 - stdcpp17 - stdcpp17 - + - Console - true - true - false + Advapi32.lib;%(AdditionalDependencies) diff --git a/src/AppInstallerTestExeInstaller/main.cpp b/src/AppInstallerTestExeInstaller/main.cpp index a7c7535135..36b35fc36b 100644 --- a/src/AppInstallerTestExeInstaller/main.cpp +++ b/src/AppInstallerTestExeInstaller/main.cpp @@ -93,25 +93,25 @@ void WriteToUninstallRegistry( out << "Successfully opened registry key" << std::endl; // Set Display Name Property Value - if (LONG res = RegSetValueEx(hkey, L"DisplayName", NULL, REG_SZ, (LPBYTE)displayName.c_str(), (DWORD)(displayName.length() + 1) * sizeof(wchar_t)) != ERROR_SUCCESS) + if (LONG res = RegSetValueEx(hkey, L"DisplayName", NULL, REG_SZ, (LPBYTE)displayName.c_str(), (DWORD)((displayName.length() + 1) * sizeof(wchar_t))) != ERROR_SUCCESS) { out << "Failed to write DisplayName value. Error Code: " << res << std::endl; } // Set Display Version Property Value - if (LONG res = RegSetValueEx(hkey, L"DisplayVersion", NULL, REG_SZ, (LPBYTE)displayVersion.c_str(), (DWORD)(displayVersion.length() + 1) * sizeof(wchar_t)) != ERROR_SUCCESS) + if (LONG res = RegSetValueEx(hkey, L"DisplayVersion", NULL, REG_SZ, (LPBYTE)displayVersion.c_str(), (DWORD)((displayVersion.length() + 1) * sizeof(wchar_t))) != ERROR_SUCCESS) { out << "Failed to write DisplayVersion value. Error Code: " << res << std::endl; } // Set Publisher Property Value - if (LONG res = RegSetValueEx(hkey, L"Publisher", NULL, REG_SZ, (LPBYTE)publisher, (DWORD)(wcslen(publisher) + 1) * sizeof(wchar_t)) != ERROR_SUCCESS) + if (LONG res = RegSetValueEx(hkey, L"Publisher", NULL, REG_SZ, (LPBYTE)publisher, (DWORD)((wcslen(publisher) + 1) * sizeof(wchar_t))) != ERROR_SUCCESS) { out << "Failed to write Publisher value. Error Code: " << res << std::endl; } // Set UninstallString Property Value - if (LONG res = RegSetValueEx(hkey, L"UninstallString", NULL, REG_EXPAND_SZ, (LPBYTE)uninstallString.c_str(), (DWORD)(uninstallString.length() + 1) * sizeof(wchar_t)) != ERROR_SUCCESS) + if (LONG res = RegSetValueEx(hkey, L"UninstallString", NULL, REG_EXPAND_SZ, (LPBYTE)uninstallString.c_str(), (DWORD)((uninstallString.length() + 1) * sizeof(wchar_t))) != ERROR_SUCCESS) { out << "Failed to write UninstallString value. Error Code: " << res << std::endl; } @@ -123,7 +123,7 @@ void WriteToUninstallRegistry( } // Set InstallLocation Property Value - if (LONG res = RegSetValueEx(hkey, L"InstallLocation", NULL, REG_SZ, (LPBYTE)installLocation.c_str(), (DWORD)(installLocation.length() + 1) * sizeof(wchar_t)) != ERROR_SUCCESS) + if (LONG res = RegSetValueEx(hkey, L"InstallLocation", NULL, REG_SZ, (LPBYTE)installLocation.c_str(), (DWORD)((installLocation.length() + 1) * sizeof(wchar_t))) != ERROR_SUCCESS) { out << "Failed to write InstallLocation value. Error Code: " << res << std::endl; } diff --git a/src/Directory.Build.props b/src/Directory.Build.props new file mode 100644 index 0000000000..100f55967c --- /dev/null +++ b/src/Directory.Build.props @@ -0,0 +1,180 @@ + + + + + + true + true + true + true + true + true + + + + + + + false + + + + TurnOffAllWarnings + false + + + + Spectre + + + + true + Guard + + + true + + + + + + + + + + true + + + + + + true + true + true + Win32Proj + 10.0.22000.0 + 10.0.17763.0 + true + true + + $(MSBuildThisFileDirectory) + + + + StaticLibrary + v140 + v141 + v142 + v143 + Unicode + + + false + true + false + false + + + true + true + true + $(SolutionDir)CodeAnalysis.ruleset + true + + + false + false + false + + true + + + + $(SolutionDir)x86\$(Configuration)\$(MSBuildProjectName)\ + + + $(SolutionDir)$(Platform)\$(Configuration)\$(MSBuildProjectName)\ + + + + + Spectre + + + + true + Guard + + + true + + + + + + stdcpp17 + + %(AdditionalOptions) /bigobj + + Use + pch.h + $(IntDir)pch.pch + + Level4 + true + + true + + AICLI_DISABLE_TEST_HOOKS;%(PreprocessorDefinitions) + WINGET_DISABLE_EXPERIMENTAL_FEATURES;%(PreprocessorDefinitions) + WINGET_ENABLE_RELEASE_BUILD;%(PreprocessorDefinitions) + USE_PROD_CLSIDS;%(PreprocessorDefinitions) + USE_PROD_WINGET_SERVER;%(PreprocessorDefinitions) + + + Console + false + + + + + WIN32;%(PreprocessorDefinitions) + + + + + MaxSpeed + true + true + NDEBUG;%(PreprocessorDefinitions) + MultiThreaded + + + true + true + /debug:full /debugtype:cv,fixup /incremental:no %(AdditionalOptions) + + + + + Disabled + _DEBUG;%(PreprocessorDefinitions) + + true + + + + + MultiThreaded + %(AdditionalOptions) /fsanitize-coverage=inline-8bit-counters /fsanitize-coverage=edge /fsanitize-coverage=trace-cmp /fsanitize-coverage=trace-div + + + + + \ No newline at end of file diff --git a/src/IndexCreationTool/IndexCreationTool.csproj b/src/IndexCreationTool/IndexCreationTool.csproj index 05b04b2b03..a5964604c7 100644 --- a/src/IndexCreationTool/IndexCreationTool.csproj +++ b/src/IndexCreationTool/IndexCreationTool.csproj @@ -3,7 +3,6 @@ Exe net6.0 - $(SolutionDir)$(Platform)\$(Configuration)\IndexCreationTool\ x64;x86 diff --git a/src/LocalhostWebServer/LocalhostWebServer.csproj b/src/LocalhostWebServer/LocalhostWebServer.csproj index 90f2342421..7f31460151 100644 --- a/src/LocalhostWebServer/LocalhostWebServer.csproj +++ b/src/LocalhostWebServer/LocalhostWebServer.csproj @@ -2,7 +2,6 @@ net6.0 - $(SolutionDir)$(Platform)\$(Configuration)\LocalhostWebServer\ x64;x86 diff --git a/src/Microsoft.Management.Configuration.Processor/Microsoft.Management.Configuration.Processor.csproj b/src/Microsoft.Management.Configuration.Processor/Microsoft.Management.Configuration.Processor.csproj index e5537a8d41..97dbee9069 100644 --- a/src/Microsoft.Management.Configuration.Processor/Microsoft.Management.Configuration.Processor.csproj +++ b/src/Microsoft.Management.Configuration.Processor/Microsoft.Management.Configuration.Processor.csproj @@ -19,14 +19,6 @@ Debug;Release;ReleaseStatic - - true - - - - true - - true 10.0.19041.0 @@ -68,7 +60,7 @@ - + diff --git a/src/Microsoft.Management.Configuration.Projection/.editorconfig b/src/Microsoft.Management.Configuration.Projection/.editorconfig new file mode 100644 index 0000000000..0ff1f73305 --- /dev/null +++ b/src/Microsoft.Management.Configuration.Projection/.editorconfig @@ -0,0 +1,4 @@ +[*.cs] +# CsWinRT produces files violating this rule +# CA2257: Members defined on an interface with the 'DynamicInterfaceCastableImplementationAttribute' should be 'static' +dotnet_diagnostic.CA2257.severity = none \ No newline at end of file diff --git a/src/Microsoft.Management.Configuration.Projection/Microsoft.Management.Configuration.Projection.csproj b/src/Microsoft.Management.Configuration.Projection/Microsoft.Management.Configuration.Projection.csproj index e0bbc21b16..18e72a8554 100644 --- a/src/Microsoft.Management.Configuration.Projection/Microsoft.Management.Configuration.Projection.csproj +++ b/src/Microsoft.Management.Configuration.Projection/Microsoft.Management.Configuration.Projection.csproj @@ -21,6 +21,14 @@ None + + + + + + + + diff --git a/src/Microsoft.Management.Configuration.UnitTests/Helpers/Errors.cs b/src/Microsoft.Management.Configuration.UnitTests/Helpers/Errors.cs index 553db9fa0d..a293d11df3 100644 --- a/src/Microsoft.Management.Configuration.UnitTests/Helpers/Errors.cs +++ b/src/Microsoft.Management.Configuration.UnitTests/Helpers/Errors.cs @@ -7,7 +7,7 @@ namespace Microsoft.Management.Configuration.UnitTests.Helpers { /// - /// Contains the error codes used by Microsoft.Management.Configuration + /// Contains the error codes used by Microsoft.Management.Configuration. /// internal static class Errors { diff --git a/src/Microsoft.Management.Configuration.UnitTests/Helpers/TelemetryEvent.cs b/src/Microsoft.Management.Configuration.UnitTests/Helpers/TelemetryEvent.cs index f4163e3489..25afdbc6be 100644 --- a/src/Microsoft.Management.Configuration.UnitTests/Helpers/TelemetryEvent.cs +++ b/src/Microsoft.Management.Configuration.UnitTests/Helpers/TelemetryEvent.cs @@ -29,7 +29,9 @@ public class TelemetryEvent /// public const string ConfigProcessingSummaryName = "ConfigProcessingSummary"; +// Two different analyzers complain about this #pragma warning disable SA1600 // Elements should be documented +#pragma warning disable CS1591 // Elements should be documented // Shared fields public const string SetID = "SetID"; @@ -57,6 +59,7 @@ public class TelemetryEvent public const string AppliesRun = "AppliesRun"; public const string AppliesFailed = "AppliesFailed"; #pragma warning restore SA1600 // Elements should be documented +#pragma warning restore CS1591 // Elements should be documented /// /// Initializes a new instance of the class. diff --git a/src/Microsoft.Management.Configuration.UnitTests/Microsoft.Management.Configuration.UnitTests.csproj b/src/Microsoft.Management.Configuration.UnitTests/Microsoft.Management.Configuration.UnitTests.csproj index 679ba79949..c1fd8e96c1 100644 --- a/src/Microsoft.Management.Configuration.UnitTests/Microsoft.Management.Configuration.UnitTests.csproj +++ b/src/Microsoft.Management.Configuration.UnitTests/Microsoft.Management.Configuration.UnitTests.csproj @@ -7,6 +7,7 @@ x64;x86;arm64 $(SolutionDir)$(Platform)\$(Configuration)\$(MSBuildProjectName)\ win10-x64;win10-x86;win10-arm;win10-arm64 + true diff --git a/src/Microsoft.Management.Configuration.UnitTests/Tests/DscModuleV2Tests.cs b/src/Microsoft.Management.Configuration.UnitTests/Tests/DscModuleV2Tests.cs index 2f472074db..16eb0f983c 100644 --- a/src/Microsoft.Management.Configuration.UnitTests/Tests/DscModuleV2Tests.cs +++ b/src/Microsoft.Management.Configuration.UnitTests/Tests/DscModuleV2Tests.cs @@ -425,8 +425,6 @@ public void InvokeTestResource_ResourceDoesntExist() /// /// Calls Invoke-DscResource Set. /// - /// Setting value. - /// Expected reboot required. [Fact] public void InvokeSetResource_Test() { diff --git a/src/Microsoft.Management.Configuration/ExceptionResultHelpers.h b/src/Microsoft.Management.Configuration/ExceptionResultHelpers.h index 51720f11b1..b3cf1dd398 100644 --- a/src/Microsoft.Management.Configuration/ExceptionResultHelpers.h +++ b/src/Microsoft.Management.Configuration/ExceptionResultHelpers.h @@ -3,6 +3,7 @@ #pragma once #include #include +#include namespace winrt::Microsoft::Management::Configuration::implementation { diff --git a/src/Microsoft.Management.Configuration/Microsoft.Management.Configuration.vcxproj b/src/Microsoft.Management.Configuration/Microsoft.Management.Configuration.vcxproj index 87f4d54396..a8321ef68a 100644 --- a/src/Microsoft.Management.Configuration/Microsoft.Management.Configuration.vcxproj +++ b/src/Microsoft.Management.Configuration/Microsoft.Management.Configuration.vcxproj @@ -2,10 +2,7 @@ - true - true true - true {CA460806-5E41-4E97-9A3D-1D74B433B663} Microsoft.Management.Configuration Microsoft.Management.Configuration @@ -13,9 +10,6 @@ 14.0 10.0 10.0.19041.0 - 10.0.17763.0 - true - true @@ -70,65 +64,26 @@ DynamicLibrary - v140 - v141 - v142 - v143 - Unicode false true - - true - true - - - false - true - false - Spectre - - - false - true - false - Spectre - - - - - - - $(VC_IncludePath);$(WindowsSDK_IncludePath); - $(SolutionDir)$(PlatformTarget)\$(Configuration)\$(ProjectName)\ $(PlatformTarget)\$(Configuration)\ $(RootNamespace) - true - true - ..\CodeAnalysis.ruleset - Use - pch.h - $(IntDir)pch.pch - Level4 - %(AdditionalOptions) /bigobj - true - true _WINRT_DLL;WIN32_LEAN_AND_MEAN;WINRT_LEAN_AND_MEAN;%(PreprocessorDefinitions) $(WindowsSDK_WindowsMetadata);$(AdditionalUsingDirectories) $(ProjectDir);$(ProjectDir)..\AppInstallerSharedLib\Public;%(AdditionalIncludeDirectories) + false - Console - false Microsoft_Management_Configuration.def $(OutDir)$(ProjectName).winmd Advapi32.lib;%(AdditionalDependencies) @@ -136,59 +91,7 @@ - _DEBUG;%(PreprocessorDefinitions) $(OutDir)$(TargetName)Debug.pdb - false - false - false - false - false - false - false - false - - - - - NDEBUG;%(PreprocessorDefinitions) - false - false - false - false - Guard - Guard - Guard - Guard - - - true - true - - - - - NDEBUG;%(PreprocessorDefinitions) - false - false - false - false - MultiThreaded - MultiThreaded - MultiThreaded - MultiThreaded - Guard - Guard - Guard - Guard - - - true - true - - - - - AICLI_DISABLE_TEST_HOOKS;%(PreprocessorDefinitions) @@ -263,7 +166,6 @@ - diff --git a/src/Microsoft.Management.Configuration/Microsoft.Management.Configuration.vcxproj.filters b/src/Microsoft.Management.Configuration/Microsoft.Management.Configuration.vcxproj.filters index d7016d4397..97e18e526b 100644 --- a/src/Microsoft.Management.Configuration/Microsoft.Management.Configuration.vcxproj.filters +++ b/src/Microsoft.Management.Configuration/Microsoft.Management.Configuration.vcxproj.filters @@ -187,7 +187,6 @@ - diff --git a/src/Microsoft.Management.Configuration/PropertySheet.props b/src/Microsoft.Management.Configuration/PropertySheet.props deleted file mode 100644 index e34141b019..0000000000 --- a/src/Microsoft.Management.Configuration/PropertySheet.props +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/src/Microsoft.Management.Configuration/pch.h b/src/Microsoft.Management.Configuration/pch.h index 6ad465fc7a..d0acfee61e 100644 --- a/src/Microsoft.Management.Configuration/pch.h +++ b/src/Microsoft.Management.Configuration/pch.h @@ -7,9 +7,11 @@ #include #pragma warning( push ) -#pragma warning ( disable : 4467 6388) +#pragma warning( disable : 4324 4467 6388 6553 ) +// 4324 Allow use of alignment specifiers // 4467 Allow use of uuid attribute for com object creation. // 6388 Allow CreateInstance. +// 6553 Allow annotation to value type #include #include #pragma warning( pop ) diff --git a/src/Microsoft.Management.Deployment.InProc/Microsoft.Management.Deployment.InProc.vcxproj b/src/Microsoft.Management.Deployment.InProc/Microsoft.Management.Deployment.InProc.vcxproj index cb70c82ae9..b81582b740 100644 --- a/src/Microsoft.Management.Deployment.InProc/Microsoft.Management.Deployment.InProc.vcxproj +++ b/src/Microsoft.Management.Deployment.InProc/Microsoft.Management.Deployment.InProc.vcxproj @@ -2,17 +2,9 @@ - true - true - true 15.0 - Win32Proj {9ac3c6a4-1875-4d3e-bf9c-c31e81eff6b4} MicrosoftManagementDeploymentInProc - 10.0.22000.0 - 10.0.17763.0 - true - true false @@ -68,341 +60,22 @@ DynamicLibrary - v140 - v141 - v142 - v143 - Unicode - - - true - true - - - false - true - false - - - false - true - false - - - Spectre - - - Spectre - - - Spectre - - - Spectre - - - Spectre - - - Spectre - - - Spectre - - - Spectre - - - - - - - - - - true - $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ - true - true - ..\CodeAnalysis.ruleset - - - true - $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ - true - true - ..\CodeAnalysis.ruleset - - - true - $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ - true - true - ..\CodeAnalysis.ruleset - - - true - $(SolutionDir)x86\$(Configuration)\$(ProjectName)\ - true - true - ..\CodeAnalysis.ruleset - - - false - $(SolutionDir)x86\$(Configuration)\$(ProjectName)\ - true - false - ..\CodeAnalysis.ruleset - - - false - $(SolutionDir)x86\$(Configuration)\$(ProjectName)\ - true - false - ..\CodeAnalysis.ruleset - - - false - $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ - true - false - ..\CodeAnalysis.ruleset - - - false - $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ - true - false - ..\CodeAnalysis.ruleset - - - false - $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ - true - false - ..\CodeAnalysis.ruleset - - - false - $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ - true - false - ..\CodeAnalysis.ruleset - - - false - $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ - true - false - ..\CodeAnalysis.ruleset - - - false - $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ - true - false - ..\CodeAnalysis.ruleset - - Use - pch.h - $(IntDir)pch.pch - _CONSOLE;%(PreprocessorDefinitions) - Level4 - %(AdditionalOptions) /permissive- /bigobj /D _SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING - - - - - Disabled - _DEBUG;%(PreprocessorDefinitions) - $(ProjectDir)..\WindowsPackageManager;%(AdditionalIncludeDirectories) - $(ProjectDir)..\WindowsPackageManager;%(AdditionalIncludeDirectories) - $(ProjectDir)..\WindowsPackageManager;%(AdditionalIncludeDirectories) - true - true - true - false - false - false - stdcpp17 - stdcpp17 - stdcpp17 - true - true - true - true - true - true + $(ProjectDir)..\WindowsPackageManager;%(AdditionalIncludeDirectories) false - Windows - Windows - Windows - Windows - Source.def - Source.def - Source.def - Source.def - wininet.lib;shell32.lib;winsqlite3.lib;shlwapi.lib;icuuc.lib;icuin.lib;urlmon.lib;Advapi32.lib;winhttp.lib;onecoreuap.lib;msi.lib;%(AdditionalDependencies) + Source.def + wininet.lib;shell32.lib;winsqlite3.lib;shlwapi.lib;icuuc.lib;icuin.lib;urlmon.lib;Advapi32.lib;winhttp.lib;onecoreuap.lib;msi.lib;%(AdditionalDependencies) - $(ProjectDir)..\manifest\shared.manifest %(AdditionalManifestFiles) - - - $(ProjectDir)..\manifest\shared.manifest %(AdditionalManifestFiles) - - - $(ProjectDir)..\manifest\shared.manifest %(AdditionalManifestFiles) - - - - - WIN32;%(PreprocessorDefinitions) - $(ProjectDir)..\WindowsPackageManager;%(AdditionalIncludeDirectories) - true - false - stdcpp17 - true - true - - - $(ProjectDir)..\manifest\shared.manifest %(AdditionalManifestFiles) - - - - - MaxSpeed - true - true - NDEBUG;%(PreprocessorDefinitions) - $(ProjectDir)..\WindowsPackageManager;%(AdditionalIncludeDirectories) - $(ProjectDir)..\WindowsPackageManager;%(AdditionalIncludeDirectories) - $(ProjectDir)..\WindowsPackageManager;%(AdditionalIncludeDirectories) - $(ProjectDir)..\WindowsPackageManager;%(AdditionalIncludeDirectories) - true - true - true - true - Guard - Guard - Guard - Guard - stdcpp17 - stdcpp17 - stdcpp17 - stdcpp17 - true - true - true - true - false - false - false - false - - - true - true - false - Windows - Windows - Windows - Windows - Source.def - Source.def - Source.def - Source.def - wininet.lib;shell32.lib;winsqlite3.lib;shlwapi.lib;icuuc.lib;icuin.lib;urlmon.lib;Advapi32.lib;winhttp.lib;onecoreuap.lib;msi.lib;%(AdditionalDependencies) - /debug:full /debugtype:cv,fixup /incremental:no %(AdditionalOptions) - /debug:full /debugtype:cv,fixup /incremental:no %(AdditionalOptions) - /debug:full /debugtype:cv,fixup /incremental:no %(AdditionalOptions) - /debug:full /debugtype:cv,fixup /incremental:no %(AdditionalOptions) - - - $(ProjectDir)..\manifest\shared.manifest %(AdditionalManifestFiles) - - - $(ProjectDir)..\manifest\shared.manifest %(AdditionalManifestFiles) - - - $(ProjectDir)..\manifest\shared.manifest %(AdditionalManifestFiles) - - - $(ProjectDir)..\manifest\shared.manifest %(AdditionalManifestFiles) - - - - - MaxSpeed - true - true - NDEBUG;%(PreprocessorDefinitions) - $(ProjectDir)..\WindowsPackageManager;%(AdditionalIncludeDirectories) - $(ProjectDir)..\WindowsPackageManager;%(AdditionalIncludeDirectories) - $(ProjectDir)..\WindowsPackageManager;%(AdditionalIncludeDirectories) - $(ProjectDir)..\WindowsPackageManager;%(AdditionalIncludeDirectories) - true - true - true - true - Guard - Guard - Guard - Guard - stdcpp17 - stdcpp17 - stdcpp17 - stdcpp17 - true - true - true - true - false - false - false - false - MultiThreaded - MultiThreaded - MultiThreaded - MultiThreaded - - - true - true - false - Windows - Windows - Windows - Windows - Source.def - Source.def - Source.def - Source.def - wininet.lib;shell32.lib;winsqlite3.lib;shlwapi.lib;icuuc.lib;icuin.lib;urlmon.lib;Advapi32.lib;winhttp.lib;onecoreuap.lib;msi.lib;%(AdditionalDependencies) - /debug:full /debugtype:cv,fixup /incremental:no %(AdditionalOptions) - /debug:full /debugtype:cv,fixup /incremental:no %(AdditionalOptions) - /debug:full /debugtype:cv,fixup /incremental:no %(AdditionalOptions) - /debug:full /debugtype:cv,fixup /incremental:no %(AdditionalOptions) - - - $(ProjectDir)..\manifest\shared.manifest %(AdditionalManifestFiles) - - - $(ProjectDir)..\manifest\shared.manifest %(AdditionalManifestFiles) - - - $(ProjectDir)..\manifest\shared.manifest %(AdditionalManifestFiles) - - - $(ProjectDir)..\manifest\shared.manifest %(AdditionalManifestFiles) + $(ProjectDir)..\manifest\shared.manifest %(AdditionalManifestFiles) @@ -421,7 +94,6 @@ - diff --git a/src/Microsoft.Management.Deployment.InProc/Microsoft.Management.Deployment.InProc.vcxproj.filters b/src/Microsoft.Management.Deployment.InProc/Microsoft.Management.Deployment.InProc.vcxproj.filters index 3b66a402ed..ac74adfc2c 100644 --- a/src/Microsoft.Management.Deployment.InProc/Microsoft.Management.Deployment.InProc.vcxproj.filters +++ b/src/Microsoft.Management.Deployment.InProc/Microsoft.Management.Deployment.InProc.vcxproj.filters @@ -29,7 +29,6 @@ - Source Files diff --git a/src/Microsoft.Management.Deployment.InProc/PropertySheet.props b/src/Microsoft.Management.Deployment.InProc/PropertySheet.props deleted file mode 100644 index c6b0691ddd..0000000000 --- a/src/Microsoft.Management.Deployment.InProc/PropertySheet.props +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/src/Microsoft.Management.Deployment.Projection/.editorconfig b/src/Microsoft.Management.Deployment.Projection/.editorconfig new file mode 100644 index 0000000000..0ff1f73305 --- /dev/null +++ b/src/Microsoft.Management.Deployment.Projection/.editorconfig @@ -0,0 +1,4 @@ +[*.cs] +# CsWinRT produces files violating this rule +# CA2257: Members defined on an interface with the 'DynamicInterfaceCastableImplementationAttribute' should be 'static' +dotnet_diagnostic.CA2257.severity = none \ No newline at end of file diff --git a/src/Microsoft.Management.Deployment.Projection/Microsoft.Management.Deployment.Projection.csproj b/src/Microsoft.Management.Deployment.Projection/Microsoft.Management.Deployment.Projection.csproj index e7a73c50f4..7206eb978b 100644 --- a/src/Microsoft.Management.Deployment.Projection/Microsoft.Management.Deployment.Projection.csproj +++ b/src/Microsoft.Management.Deployment.Projection/Microsoft.Management.Deployment.Projection.csproj @@ -27,4 +27,12 @@ True + + + + + + + + diff --git a/src/Microsoft.Management.Deployment/Converters.cpp b/src/Microsoft.Management.Deployment/Converters.cpp index e35f43bdfc..134afd55e6 100644 --- a/src/Microsoft.Management.Deployment/Converters.cpp +++ b/src/Microsoft.Management.Deployment/Converters.cpp @@ -312,11 +312,11 @@ namespace winrt::Microsoft::Management::Deployment::implementation { switch (scope) { - case winrt::Microsoft::Management::Deployment::PackageInstallScope::Any: + case winrt::Microsoft::Management::Deployment::PackageUninstallScope::Any: return ::AppInstaller::Manifest::ScopeEnum::Unknown; - case winrt::Microsoft::Management::Deployment::PackageInstallScope::User: + case winrt::Microsoft::Management::Deployment::PackageUninstallScope::User: return ::AppInstaller::Manifest::ScopeEnum::User; - case winrt::Microsoft::Management::Deployment::PackageInstallScope::System: + case winrt::Microsoft::Management::Deployment::PackageUninstallScope::System: return ::AppInstaller::Manifest::ScopeEnum::Machine; } diff --git a/src/Microsoft.Management.Deployment/Helpers.cpp b/src/Microsoft.Management.Deployment/Helpers.cpp index 8adfb3fc36..c1904bca38 100644 --- a/src/Microsoft.Management.Deployment/Helpers.cpp +++ b/src/Microsoft.Management.Deployment/Helpers.cpp @@ -2,8 +2,16 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #include "pch.h" + +#pragma warning ( push ) +// 6001 - use of uninitialized memory in wil/result.h +// 6388 - *data might not be '0' in wil/result.h +// 6553 - annotation to value type +#pragma warning ( disable : 6001 6388 6553 ) #include #include +#pragma warning ( pop ) + #include #include #include diff --git a/src/Microsoft.Management.Deployment/Microsoft.Management.Deployment.vcxproj b/src/Microsoft.Management.Deployment/Microsoft.Management.Deployment.vcxproj index bf837ad368..b42e9da40e 100644 --- a/src/Microsoft.Management.Deployment/Microsoft.Management.Deployment.vcxproj +++ b/src/Microsoft.Management.Deployment/Microsoft.Management.Deployment.vcxproj @@ -2,20 +2,13 @@ - true - true true - true {1cc41a9a-ae66-459d-9210-1e572dd7be69} Microsoft.Management.Deployment Microsoft.Management.Deployment en-US 14.0 10.0 - 10.0.22000.0 - 10.0.17763.0 - true - true -library Microsoft_Management_Deployment @@ -70,68 +63,31 @@ - StaticLibrary - v140 - v141 - v142 - v143 - Unicode false - - true - true - - - false - true - false - Spectre - - - false - true - false - Spectre - - - - - - - $(VC_IncludePath);$(WindowsSDK_IncludePath); - $(SolutionDir)$(PlatformTarget)\$(Configuration)\$(ProjectName)\ $(PlatformTarget)\$(Configuration)\ $(RootNamespace).Server - true - false - ..\CodeAnalysis.ruleset - Use - pch.h - $(IntDir)pch.pch - Level4 - %(AdditionalOptions) /bigobj - true - true _WINRT_DLL;WIN32_LEAN_AND_MEAN;WINRT_LEAN_AND_MEAN;%(PreprocessorDefinitions) $(WindowsSDK_WindowsMetadata);$(AdditionalUsingDirectories) $(ProjectDir)..\AppInstallerCLICore;$(ProjectDir);$(ProjectDir)..\AppInstallerRepositoryCore;$(ProjectDir)..\AppInstallerRepositoryCore\Public;$(ProjectDir)..\AppInstallerCommonCore\Public;$(ProjectDir)..\AppInstallerSharedLib\Public;$(ProjectDir)..\JsonCppLib\json;$(ProjectDir)..\JsonCppLib;%(AdditionalIncludeDirectories) + + false - Console - false Microsoft_Management_Deployment.def $(OutDir)$(ProjectName).winmd AppInstallerCLICore.lib;AppInstallerCommonCore.lib;AppInstallerRepositoryCore.lib;JsonCppLib.lib;YamlCppLib.lib;cpprestsdk.lib;wininet.lib;shell32.lib;winsqlite3.lib;shlwapi.lib;icuuc.lib;icuin.lib;urlmon.lib;Advapi32.lib;winhttp.lib;pure.lib%(AdditionalDependencies) @@ -139,37 +95,9 @@ - _DEBUG;%(PreprocessorDefinitions) $(OutDir)$(TargetName)Debug.pdb - - - NDEBUG;%(PreprocessorDefinitions) - - - true - true - - - - - NDEBUG;%(PreprocessorDefinitions) - MultiThreaded - MultiThreaded - MultiThreaded - MultiThreaded - - - true - true - - - - - USE_PROD_CLSIDS;%(PreprocessorDefinitions) - - @@ -242,7 +170,6 @@ - diff --git a/src/Microsoft.Management.Deployment/Microsoft.Management.Deployment.vcxproj.filters b/src/Microsoft.Management.Deployment/Microsoft.Management.Deployment.vcxproj.filters index f524c0c6b7..25a4033500 100644 --- a/src/Microsoft.Management.Deployment/Microsoft.Management.Deployment.vcxproj.filters +++ b/src/Microsoft.Management.Deployment/Microsoft.Management.Deployment.vcxproj.filters @@ -73,7 +73,6 @@ - diff --git a/src/Microsoft.Management.Deployment/PropertySheet.props b/src/Microsoft.Management.Deployment/PropertySheet.props deleted file mode 100644 index e34141b019..0000000000 --- a/src/Microsoft.Management.Deployment/PropertySheet.props +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/src/PowerShell/Microsoft.WinGet.Configuration.Cmdlets/Microsoft.WinGet.Configuration.Cmdlets.csproj b/src/PowerShell/Microsoft.WinGet.Configuration.Cmdlets/Microsoft.WinGet.Configuration.Cmdlets.csproj index 72342c1265..ca88d6ffa6 100644 --- a/src/PowerShell/Microsoft.WinGet.Configuration.Cmdlets/Microsoft.WinGet.Configuration.Cmdlets.csproj +++ b/src/PowerShell/Microsoft.WinGet.Configuration.Cmdlets/Microsoft.WinGet.Configuration.Cmdlets.csproj @@ -13,14 +13,6 @@ Debug;Release;ReleaseStatic - - true - - - - true - - diff --git a/src/PowerShell/Microsoft.WinGet.Configuration.Engine/Microsoft.WinGet.Configuration.Engine.csproj b/src/PowerShell/Microsoft.WinGet.Configuration.Engine/Microsoft.WinGet.Configuration.Engine.csproj index d3569d6269..0aeff2d22a 100644 --- a/src/PowerShell/Microsoft.WinGet.Configuration.Engine/Microsoft.WinGet.Configuration.Engine.csproj +++ b/src/PowerShell/Microsoft.WinGet.Configuration.Engine/Microsoft.WinGet.Configuration.Engine.csproj @@ -12,14 +12,6 @@ Debug;Release;ReleaseStatic - - true - - - - true - - @@ -45,19 +37,4 @@ - - - True - True - Resources.resx - - - - - - ResXFileCodeGenerator - Resources.Designer.cs - - - diff --git a/src/Valijson/valijson/include/valijson/constraints/concrete_constraints.hpp b/src/Valijson/valijson/include/valijson/constraints/concrete_constraints.hpp index 55cc1248a3..2bacda1dbf 100644 --- a/src/Valijson/valijson/include/valijson/constraints/concrete_constraints.hpp +++ b/src/Valijson/valijson/include/valijson/constraints/concrete_constraints.hpp @@ -28,7 +28,7 @@ #ifdef _MSC_VER #pragma warning( push ) -#pragma warning( disable : 4702 ) +#pragma warning (disable : 4702 ) #endif namespace valijson { diff --git a/src/Valijson/valijson/include/valijson/internal/json_pointer.hpp b/src/Valijson/valijson/include/valijson/internal/json_pointer.hpp index b290c02a2c..75b788ee34 100644 --- a/src/Valijson/valijson/include/valijson/internal/json_pointer.hpp +++ b/src/Valijson/valijson/include/valijson/internal/json_pointer.hpp @@ -13,7 +13,7 @@ #ifdef _MSC_VER #pragma warning( push ) -#pragma warning( disable : 4702 ) +#pragma warning (disable : 4702 ) #endif namespace valijson { diff --git a/src/Valijson/valijson/include/valijson/validation_visitor.hpp b/src/Valijson/valijson/include/valijson/validation_visitor.hpp index cd4442d7c7..1b7ed0462c 100644 --- a/src/Valijson/valijson/include/valijson/validation_visitor.hpp +++ b/src/Valijson/valijson/include/valijson/validation_visitor.hpp @@ -15,7 +15,7 @@ #ifdef _MSC_VER #pragma warning( push ) -#pragma warning( disable : 4702 ) +#pragma warning ( disable : 4702 ) #endif namespace valijson { diff --git a/src/WinGetServer/PropertySheet.props b/src/WinGetServer/PropertySheet.props deleted file mode 100644 index 273b9fbfed..0000000000 --- a/src/WinGetServer/PropertySheet.props +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/src/WinGetServer/WinGetServer.vcxproj b/src/WinGetServer/WinGetServer.vcxproj index dde774aa01..b76d363625 100644 --- a/src/WinGetServer/WinGetServer.vcxproj +++ b/src/WinGetServer/WinGetServer.vcxproj @@ -1,18 +1,10 @@ - true - true true - true 15.0 {2b00d362-ac92-41f3-a8d2-5b1599bdca01} - Win32Proj WinGetServer - 10.0.22000.0 - 10.0.17763.0 - true - true WinGetServer WindowsPackageManagerServer @@ -53,53 +45,19 @@ Application - v140 - v141 - v142 - v143 - Unicode - - - true - true - - - false - true - false - Spectre - - - - - - - - - $(SolutionDir)$(PlatformTarget)\$(Configuration)\$(ProjectName)\ $(PlatformTarget)\$(Configuration)\ $(OutDir)..\Microsoft.Management.Deployment;$(OutDir)..\AppInstallerCLICore;$(OutDir)..\JsonCppLib;$(OutDir)..\AppInstallerRepositoryCore;$(OutDir)..\YamlCppLib;$(OutDir)..\AppInstallerCommonCore;$(OutDir)..\cpprestsdk;$(LibraryPath) - true - false - ..\CodeAnalysis.ruleset NotUsing - pch.h - $(IntDir)pch.pch _CONSOLE;WIN32_LEAN_AND_MEAN;WINRT_LEAN_AND_MEAN;%(PreprocessorDefinitions) - Level4 - %(AdditionalOptions) /permissive- /bigobj - true - true - true $(ProjectDir)..\WindowsPackageManager;%(AdditionalIncludeDirectories) @@ -109,51 +67,11 @@ Rpcrt4.lib;Advapi32.lib;Shell32.lib;Ole32.lib;%(AdditionalDependencies) - - - Disabled - _DEBUG;%(PreprocessorDefinitions) - stdcpp17 - stdcpp17 - stdcpp17 - - - - - WIN32;%(PreprocessorDefinitions) - stdcpp17 - - WIN32;_ARM_;%(PreprocessorDefinitions) - - - MaxSpeed - true - true - NDEBUG;%(PreprocessorDefinitions) - stdcpp17 - stdcpp17 - stdcpp17 - stdcpp17 - - - true - true - /debug:full /debugtype:cv,fixup /incremental:no %(AdditionalOptions) - /debug:full /debugtype:cv,fixup /incremental:no %(AdditionalOptions) - /debug:full /debugtype:cv,fixup /incremental:no %(AdditionalOptions) - /debug:full /debugtype:cv,fixup /incremental:no %(AdditionalOptions) - - - - - USE_PROD_WINGET_SERVER;%(PreprocessorDefinitions) - - @@ -164,7 +82,6 @@ - diff --git a/src/WinGetServer/WinGetServer.vcxproj.filters b/src/WinGetServer/WinGetServer.vcxproj.filters index 71519a4d9d..fd1082cdd8 100644 --- a/src/WinGetServer/WinGetServer.vcxproj.filters +++ b/src/WinGetServer/WinGetServer.vcxproj.filters @@ -37,7 +37,6 @@ - diff --git a/src/WinGetServer/WinMain.cpp b/src/WinGetServer/WinMain.cpp index 1ec630bb95..64bc7bc7fa 100644 --- a/src/WinGetServer/WinMain.cpp +++ b/src/WinGetServer/WinMain.cpp @@ -2,7 +2,7 @@ // Licensed under the MIT License. #define NOMINMAX #pragma warning( push ) -#pragma warning ( disable : 6001 6388 6553) +#pragma warning ( disable : 6001 6388 6553 ) #include #include #pragma warning( pop ) diff --git a/src/WinGetUtil/PropertySheet.props b/src/WinGetUtil/PropertySheet.props deleted file mode 100644 index c6b0691ddd..0000000000 --- a/src/WinGetUtil/PropertySheet.props +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/src/WinGetUtil/WinGetUtil.vcxproj b/src/WinGetUtil/WinGetUtil.vcxproj index 6eee1c1f13..f1e7d1cec3 100644 --- a/src/WinGetUtil/WinGetUtil.vcxproj +++ b/src/WinGetUtil/WinGetUtil.vcxproj @@ -2,17 +2,9 @@ - true - true - true 15.0 {FB313532-38B0-4676-9303-AB200AA13576} - Win32Proj WinGetUtil - 10.0.22000.0 - 10.0.17763.0 - true - true @@ -51,32 +43,6 @@ DynamicLibrary - v140 - v141 - v142 - v143 - Unicode - - - true - true - - - false - true - false - - - Spectre - - - Spectre - - - Spectre - - - Spectre @@ -88,203 +54,19 @@ - - - - - - true - $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ - true - true - ..\CodeAnalysis.ruleset - - - true - $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ - true - true - ..\CodeAnalysis.ruleset - - - true - $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ - true - true - ..\CodeAnalysis.ruleset - - - true - $(SolutionDir)x86\$(Configuration)\$(ProjectName)\ - true - true - ..\CodeAnalysis.ruleset - - - false - $(SolutionDir)x86\$(Configuration)\$(ProjectName)\ - true - false - ..\CodeAnalysis.ruleset - - - false - $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ - true - false - ..\CodeAnalysis.ruleset - - - false - $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ - true - false - ..\CodeAnalysis.ruleset - - - false - $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ - true - false - ..\CodeAnalysis.ruleset - - Use - pch.h - $(IntDir)pch.pch - _CONSOLE;%(PreprocessorDefinitions) - Level4 - %(AdditionalOptions) /permissive- /bigobj /D _SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING - - - - - Disabled - _DEBUG;%(PreprocessorDefinitions);CLICOREDLLBUILD - $(ProjectDir);$(ProjectDir)..\AppInstallerCommonCore;$(ProjectDir)..\AppInstallerRepositoryCore;$(ProjectDir)..\AppInstallerRepositoryCore\Public;$(ProjectDir)..\AppInstallerCommonCore\Public;$(ProjectDir)..\AppInstallerSharedLib\Public;$(ProjectDir)..\cpprestsdk\cpprestsdk\Release\include;$(ProjectDir)..\JsonCppLib;$(ProjectDir)..\JsonCppLib\json;%(AdditionalIncludeDirectories) - $(ProjectDir);$(ProjectDir)..\AppInstallerCommonCore;$(ProjectDir)..\AppInstallerRepositoryCore;$(ProjectDir)..\AppInstallerRepositoryCore\Public;$(ProjectDir)..\AppInstallerCommonCore\Public;$(ProjectDir)..\AppInstallerSharedLib\Public;$(ProjectDir)..\cpprestsdk\cpprestsdk\Release\include;$(ProjectDir)..\JsonCppLib;$(ProjectDir)..\JsonCppLib\json;%(AdditionalIncludeDirectories) - $(ProjectDir);$(ProjectDir)..\AppInstallerCommonCore;$(ProjectDir)..\AppInstallerRepositoryCore;$(ProjectDir)..\AppInstallerRepositoryCore\Public;$(ProjectDir)..\AppInstallerCommonCore\Public;$(ProjectDir)..\AppInstallerSharedLib\Public;$(ProjectDir)..\cpprestsdk\cpprestsdk\Release\include;$(ProjectDir)..\JsonCppLib;$(ProjectDir)..\JsonCppLib\json;%(AdditionalIncludeDirectories) - true - true - true - false - false - false - true - true - true - true - true - true + %(PreprocessorDefinitions);CLICOREDLLBUILD + Windows + $(ProjectDir);$(ProjectDir)..\AppInstallerCommonCore;$(ProjectDir)..\AppInstallerRepositoryCore;$(ProjectDir)..\AppInstallerRepositoryCore\Public;$(ProjectDir)..\AppInstallerCommonCore\Public;$(ProjectDir)..\AppInstallerSharedLib\Public;$(ProjectDir)..\cpprestsdk\cpprestsdk\Release\include;$(ProjectDir)..\JsonCppLib;$(ProjectDir)..\JsonCppLib\json;%(AdditionalIncludeDirectories) - false - Windows - Windows - Windows - Source.def - Source.def - Source.def - wininet.lib;shell32.lib;winsqlite3.lib;shlwapi.lib;icuuc.lib;icuin.lib;urlmon.lib;Advapi32.lib;winhttp.lib;onecoreuap.lib;msi.lib;%(AdditionalDependencies) - wininet.lib;shell32.lib;winsqlite3.lib;shlwapi.lib;icuuc.lib;icuin.lib;urlmon.lib;Advapi32.lib;winhttp.lib;onecoreuap.lib;msi.lib;%(AdditionalDependencies) - wininet.lib;shell32.lib;winsqlite3.lib;shlwapi.lib;icuuc.lib;icuin.lib;urlmon.lib;Advapi32.lib;winhttp.lib;onecoreuap.lib;msi.lib;%(AdditionalDependencies) - winsqlite3.dll;icuuc.dll;icuin.dll;%(DelayLoadDLLs) - winsqlite3.dll;icuuc.dll;icuin.dll;%(DelayLoadDLLs) - winsqlite3.dll;icuuc.dll;icuin.dll;%(DelayLoadDLLs) + Source.def + wininet.lib;shell32.lib;winsqlite3.lib;shlwapi.lib;icuuc.lib;icuin.lib;urlmon.lib;Advapi32.lib;winhttp.lib;onecoreuap.lib;msi.lib;%(AdditionalDependencies) + winsqlite3.dll;icuuc.dll;icuin.dll;%(DelayLoadDLLs) - $(ProjectDir)..\manifest\shared.manifest %(AdditionalManifestFiles) - - - $(ProjectDir)..\manifest\shared.manifest %(AdditionalManifestFiles) - - - $(ProjectDir)..\manifest\shared.manifest %(AdditionalManifestFiles) - - - - - WIN32;%(PreprocessorDefinitions);CLICOREDLLBUILD - $(ProjectDir);$(ProjectDir)..\AppInstallerCommonCore;$(ProjectDir)..\AppInstallerRepositoryCore;$(ProjectDir)..\AppInstallerRepositoryCore\Public;$(ProjectDir)..\AppInstallerCommonCore\Public;$(ProjectDir)..\AppInstallerSharedLib\Public;$(ProjectDir)..\cpprestsdk\cpprestsdk\Release\include;$(ProjectDir)..\JsonCppLib;$(ProjectDir)..\JsonCppLib\json;%(AdditionalIncludeDirectories) - true - false - true - true - - - Windows - Source.def - wininet.lib;shell32.lib;winsqlite3.lib;shlwapi.lib;icuuc.lib;icuin.lib;urlmon.lib;Advapi32.lib;winhttp.lib;onecoreuap.lib;msi.lib;%(AdditionalDependencies) - winsqlite3.dll;icuuc.dll;icuin.dll;%(DelayLoadDLLs) - - - $(ProjectDir)..\manifest\shared.manifest %(AdditionalManifestFiles) - - - - - MaxSpeed - true - true - NDEBUG;%(PreprocessorDefinitions);CLICOREDLLBUILD - $(ProjectDir);$(ProjectDir)..\AppInstallerCommonCore;$(ProjectDir)..\AppInstallerRepositoryCore;$(ProjectDir)..\AppInstallerRepositoryCore\Public;$(ProjectDir)..\AppInstallerCommonCore\Public;$(ProjectDir)..\AppInstallerSharedLib\Public;$(ProjectDir)..\cpprestsdk\cpprestsdk\Release\include;$(ProjectDir)..\JsonCppLib;%(AdditionalIncludeDirectories) - $(ProjectDir);$(ProjectDir)..\AppInstallerCommonCore;$(ProjectDir)..\AppInstallerRepositoryCore;$(ProjectDir)..\AppInstallerRepositoryCore\Public;$(ProjectDir)..\AppInstallerCommonCore\Public;$(ProjectDir)..\AppInstallerSharedLib\Public;$(ProjectDir)..\cpprestsdk\cpprestsdk\Release\include;$(ProjectDir)..\JsonCppLib;%(AdditionalIncludeDirectories) - $(ProjectDir);$(ProjectDir)..\AppInstallerCommonCore;$(ProjectDir)..\AppInstallerRepositoryCore;$(ProjectDir)..\AppInstallerRepositoryCore\Public;$(ProjectDir)..\AppInstallerCommonCore\Public;$(ProjectDir)..\AppInstallerSharedLib\Public;$(ProjectDir)..\cpprestsdk\cpprestsdk\Release\include;$(ProjectDir)..\JsonCppLib;%(AdditionalIncludeDirectories) - $(ProjectDir);$(ProjectDir)..\AppInstallerCommonCore;$(ProjectDir)..\AppInstallerRepositoryCore;$(ProjectDir)..\AppInstallerRepositoryCore\Public;$(ProjectDir)..\AppInstallerCommonCore\Public;$(ProjectDir)..\AppInstallerSharedLib\Public;$(ProjectDir)..\cpprestsdk\cpprestsdk\Release\include;$(ProjectDir)..\JsonCppLib;%(AdditionalIncludeDirectories) - true - true - true - true - Guard - Guard - Guard - Guard - true - true - true - true - false - false - false - false - - - true - true - false - Windows - Windows - Windows - Windows - Source.def - Source.def - Source.def - Source.def - wininet.lib;shell32.lib;winsqlite3.lib;shlwapi.lib;icuuc.lib;icuin.lib;urlmon.lib;Advapi32.lib;winhttp.lib;onecoreuap.lib;msi.lib;%(AdditionalDependencies) - wininet.lib;shell32.lib;winsqlite3.lib;shlwapi.lib;icuuc.lib;icuin.lib;urlmon.lib;Advapi32.lib;winhttp.lib;onecoreuap.lib;msi.lib;%(AdditionalDependencies) - wininet.lib;shell32.lib;winsqlite3.lib;shlwapi.lib;icuuc.lib;icuin.lib;urlmon.lib;Advapi32.lib;winhttp.lib;onecoreuap.lib;msi.lib;%(AdditionalDependencies) - wininet.lib;shell32.lib;winsqlite3.lib;shlwapi.lib;icuuc.lib;icuin.lib;urlmon.lib;Advapi32.lib;winhttp.lib;onecoreuap.lib;msi.lib;%(AdditionalDependencies) - winsqlite3.dll;icuuc.dll;icuin.dll;%(DelayLoadDLLs) - winsqlite3.dll;icuuc.dll;icuin.dll;%(DelayLoadDLLs) - winsqlite3.dll;icuuc.dll;icuin.dll;%(DelayLoadDLLs) - winsqlite3.dll;icuuc.dll;icuin.dll;%(DelayLoadDLLs) - /debug:full /debugtype:cv,fixup /incremental:no %(AdditionalOptions) - /debug:full /debugtype:cv,fixup /incremental:no %(AdditionalOptions) - /debug:full /debugtype:cv,fixup /incremental:no %(AdditionalOptions) - /debug:full /debugtype:cv,fixup /incremental:no %(AdditionalOptions) - - - $(ProjectDir)..\manifest\shared.manifest %(AdditionalManifestFiles) - - - $(ProjectDir)..\manifest\shared.manifest %(AdditionalManifestFiles) - - - $(ProjectDir)..\manifest\shared.manifest %(AdditionalManifestFiles) - - - $(ProjectDir)..\manifest\shared.manifest %(AdditionalManifestFiles) + $(ProjectDir)..\manifest\shared.manifest %(AdditionalManifestFiles) @@ -299,7 +81,6 @@ - diff --git a/src/WinGetUtil/WinGetUtil.vcxproj.filters b/src/WinGetUtil/WinGetUtil.vcxproj.filters index 529885e975..b908318335 100644 --- a/src/WinGetUtil/WinGetUtil.vcxproj.filters +++ b/src/WinGetUtil/WinGetUtil.vcxproj.filters @@ -31,7 +31,6 @@ - Source Files diff --git a/src/WinGetUtil/pch.h b/src/WinGetUtil/pch.h index 0de0f60cd9..c6046a8129 100644 --- a/src/WinGetUtil/pch.h +++ b/src/WinGetUtil/pch.h @@ -6,7 +6,7 @@ #include #pragma warning( push ) -#pragma warning ( disable : 6001 6340 6387 6388 26495 28196 ) +#pragma warning ( disable : 6001 6340 6387 6388 6553 26495 28196 ) #include #include #include diff --git a/src/WinGetYamlFuzzing/WinGetYamlFuzzing.vcxproj b/src/WinGetYamlFuzzing/WinGetYamlFuzzing.vcxproj index bf2a6ca306..33f01c6b01 100644 --- a/src/WinGetYamlFuzzing/WinGetYamlFuzzing.vcxproj +++ b/src/WinGetYamlFuzzing/WinGetYamlFuzzing.vcxproj @@ -12,31 +12,16 @@ 16.0 - Win32Proj {1622da16-914f-4f57-a259-d5169003cc8c} WinGetYamlFuzzing 10.0 - + Application - false - v142 - false - Unicode - true - - - Application - false - v142 - v143 - false - Unicode + false - - @@ -46,55 +31,17 @@ - - - false - - - false - - + - Level3 - true - true - true - NDEBUG;_CONSOLE;WINGET_DISABLE_FOR_FUZZING;%(PreprocessorDefinitions) + WINGET_DISABLE_FOR_FUZZING;%(PreprocessorDefinitions) true - stdcpp17 $(ProjectDir)..\AppInstallerCommonCore\Public;%(AdditionalIncludeDirectories) - MultiThreaded - /fsanitize-coverage=inline-8bit-counters /fsanitize-coverage=edge /fsanitize-coverage=trace-cmp /fsanitize-coverage=trace-div %(AdditionalOptions) - Console - true - true true YOUR_LLVM_BUILT_LIBFUZZER.lib;legacy_stdio_definitions.lib;libsancov.lib;icuuc.lib;icuin.lib;urlmon.lib;Bcrypt.lib;%(AdditionalDependencies) - - - Level3 - true - true - true - _DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - stdcpp17 - $(ProjectDir)..\AppInstallerCommonCore\Public;%(AdditionalIncludeDirectories) - MultiThreadedDebugDLL - Disabled - - - Console - true - true - true - icuuc.lib;icuin.lib;urlmon.lib;Bcrypt.lib;%(AdditionalDependencies) - - diff --git a/src/WindowsPackageManager/PropertySheet.props b/src/WindowsPackageManager/PropertySheet.props deleted file mode 100644 index c6b0691ddd..0000000000 --- a/src/WindowsPackageManager/PropertySheet.props +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/src/WindowsPackageManager/WindowsPackageManager.vcxproj b/src/WindowsPackageManager/WindowsPackageManager.vcxproj index 33bd425ef1..e7ca8f4745 100644 --- a/src/WindowsPackageManager/WindowsPackageManager.vcxproj +++ b/src/WindowsPackageManager/WindowsPackageManager.vcxproj @@ -2,17 +2,9 @@ - true - true - true 15.0 {2046B5AF-666D-4CE8-8D3E-C32C57908A56} - Win32Proj WindowsPackageManager - 10.0.22000.0 - 10.0.17763.0 - true - true false . @@ -70,53 +62,8 @@ DynamicLibrary - v140 - v141 - v142 - v143 - Unicode - - - true - true - - - false - true - false - - - false - true - false - - - Spectre - - - Spectre - - - Spectre - - - Spectre - - - Spectre - - - Spectre - - - Spectre - - - Spectre - - @@ -127,287 +74,18 @@ - - - - - - true - $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ - true - true - ..\CodeAnalysis.ruleset - - - true - $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ - true - true - ..\CodeAnalysis.ruleset - - - true - $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ - true - true - ..\CodeAnalysis.ruleset - - - true - $(SolutionDir)x86\$(Configuration)\$(ProjectName)\ - true - true - ..\CodeAnalysis.ruleset - - - false - $(SolutionDir)x86\$(Configuration)\$(ProjectName)\ - true - false - ..\CodeAnalysis.ruleset - - - false - $(SolutionDir)x86\$(Configuration)\$(ProjectName)\ - true - false - ..\CodeAnalysis.ruleset - - - false - $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ - true - false - ..\CodeAnalysis.ruleset - - - false - $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ - true - false - ..\CodeAnalysis.ruleset - - - false - $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ - true - false - ..\CodeAnalysis.ruleset - - - false - $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ - true - false - ..\CodeAnalysis.ruleset - - - false - $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ - true - false - ..\CodeAnalysis.ruleset - - - false - $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ - true - false - ..\CodeAnalysis.ruleset - NotUsing - _CONSOLE;%(PreprocessorDefinitions) - Level4 - %(AdditionalOptions) /permissive- /bigobj /D _SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING - - - - - Disabled - _DEBUG;%(PreprocessorDefinitions) - $(ProjectDir);$(ProjectDir)..\AppInstallerCLICore\Public\;$(ProjectDir)..\AppInstallerRepositoryCore;$(ProjectDir)..\AppInstallerCommonCore\Public;$(ProjectDir)..\AppInstallerSharedLib\Public;$(ProjectDir)..\JsonCppLib\json;$(ProjectDir)..\Microsoft.Management.Deployment\Public;%(AdditionalIncludeDirectories) - $(ProjectDir);$(ProjectDir)..\AppInstallerCLICore\Public\;$(ProjectDir)..\AppInstallerRepositoryCore;$(ProjectDir)..\AppInstallerCommonCore\Public;$(ProjectDir)..\AppInstallerSharedLib\Public;$(ProjectDir)..\JsonCppLib\json;$(ProjectDir)..\Microsoft.Management.Deployment\Public;%(AdditionalIncludeDirectories) - $(ProjectDir);$(ProjectDir)..\AppInstallerCLICore\Public\;$(ProjectDir)..\AppInstallerRepositoryCore;$(ProjectDir)..\AppInstallerCommonCore\Public;$(ProjectDir)..\AppInstallerSharedLib\Public;$(ProjectDir)..\JsonCppLib\json;$(ProjectDir)..\Microsoft.Management.Deployment\Public;%(AdditionalIncludeDirectories) - true - true - true - false - false - false - stdcpp17 - stdcpp17 - stdcpp17 - true - true - true - true - true - true - - - false - Windows - Windows - Windows - Windows - Source.def - Source.def - Source.def - Source.def - wininet.lib;shell32.lib;winsqlite3.lib;shlwapi.lib;icuuc.lib;icuin.lib;urlmon.lib;Advapi32.lib;winhttp.lib;onecoreuap.lib;msi.lib;%(AdditionalDependencies) - - - $(ProjectDir)..\manifest\shared.manifest %(AdditionalManifestFiles) - - - $(ProjectDir)..\manifest\shared.manifest %(AdditionalManifestFiles) - - - $(ProjectDir)..\manifest\shared.manifest %(AdditionalManifestFiles) - - - - - WIN32;%(PreprocessorDefinitions) - $(ProjectDir);$(ProjectDir)..\AppInstallerCLICore\Public\;$(ProjectDir)..\AppInstallerRepositoryCore;$(ProjectDir)..\AppInstallerCommonCore\Public;$(ProjectDir)..\AppInstallerSharedLib\Public;$(ProjectDir)..\JsonCppLib\json;$(ProjectDir)..\Microsoft.Management.Deployment\Public;%(AdditionalIncludeDirectories) - true - false - stdcpp17 - true - true - - - $(ProjectDir)..\manifest\shared.manifest %(AdditionalManifestFiles) - - - - - MaxSpeed - true - true - NDEBUG;%(PreprocessorDefinitions) - $(ProjectDir);$(ProjectDir)..\AppInstallerCLICore\Public\;$(ProjectDir)..\AppInstallerRepositoryCore;$(ProjectDir)..\AppInstallerCommonCore\Public;$(ProjectDir)..\AppInstallerSharedLib\Public;$(ProjectDir)..\Microsoft.Management.Deployment\Public;%(AdditionalIncludeDirectories) - $(ProjectDir);$(ProjectDir)..\AppInstallerCLICore\Public\;$(ProjectDir)..\AppInstallerRepositoryCore;$(ProjectDir)..\AppInstallerCommonCore\Public;$(ProjectDir)..\AppInstallerSharedLib\Public;$(ProjectDir)..\Microsoft.Management.Deployment\Public;%(AdditionalIncludeDirectories) - $(ProjectDir);$(ProjectDir)..\AppInstallerCLICore\Public\;$(ProjectDir)..\AppInstallerRepositoryCore;$(ProjectDir)..\AppInstallerCommonCore\Public;$(ProjectDir)..\AppInstallerSharedLib\Public;$(ProjectDir)..\Microsoft.Management.Deployment\Public;%(AdditionalIncludeDirectories) - $(ProjectDir);$(ProjectDir)..\AppInstallerCLICore\Public\;$(ProjectDir)..\AppInstallerRepositoryCore;$(ProjectDir)..\AppInstallerCommonCore\Public;$(ProjectDir)..\AppInstallerSharedLib\Public;$(ProjectDir)..\Microsoft.Management.Deployment\Public;%(AdditionalIncludeDirectories) - true - true - true - true - Guard - Guard - Guard - Guard - stdcpp17 - stdcpp17 - stdcpp17 - stdcpp17 - true - true - true - true - false - false - false - false - - - true - true - false - Windows - Windows - Windows - Windows - Source.def - Source.def - Source.def - Source.def - wininet.lib;shell32.lib;winsqlite3.lib;shlwapi.lib;icuuc.lib;icuin.lib;urlmon.lib;Advapi32.lib;winhttp.lib;onecoreuap.lib;msi.lib;%(AdditionalDependencies) - /debug:full /debugtype:cv,fixup /incremental:no %(AdditionalOptions) - /debug:full /debugtype:cv,fixup /incremental:no %(AdditionalOptions) - /debug:full /debugtype:cv,fixup /incremental:no %(AdditionalOptions) - /debug:full /debugtype:cv,fixup /incremental:no %(AdditionalOptions) - - - $(ProjectDir)..\manifest\shared.manifest %(AdditionalManifestFiles) - - - $(ProjectDir)..\manifest\shared.manifest %(AdditionalManifestFiles) - - - $(ProjectDir)..\manifest\shared.manifest %(AdditionalManifestFiles) - - - $(ProjectDir)..\manifest\shared.manifest %(AdditionalManifestFiles) - - - - - MaxSpeed - true - true - NDEBUG;%(PreprocessorDefinitions) - $(ProjectDir);$(ProjectDir)..\AppInstallerCLICore\Public\;$(ProjectDir)..\AppInstallerRepositoryCore;$(ProjectDir)..\AppInstallerCommonCore\Public;$(ProjectDir)..\AppInstallerSharedLib\Public;$(ProjectDir)..\Microsoft.Management.Deployment\Public;%(AdditionalIncludeDirectories) - $(ProjectDir);$(ProjectDir)..\AppInstallerCLICore\Public\;$(ProjectDir)..\AppInstallerRepositoryCore;$(ProjectDir)..\AppInstallerCommonCore\Public;$(ProjectDir)..\AppInstallerSharedLib\Public;$(ProjectDir)..\Microsoft.Management.Deployment\Public;%(AdditionalIncludeDirectories) - $(ProjectDir);$(ProjectDir)..\AppInstallerCLICore\Public\;$(ProjectDir)..\AppInstallerRepositoryCore;$(ProjectDir)..\AppInstallerCommonCore\Public;$(ProjectDir)..\AppInstallerSharedLib\Public;$(ProjectDir)..\Microsoft.Management.Deployment\Public;%(AdditionalIncludeDirectories) - $(ProjectDir);$(ProjectDir)..\AppInstallerCLICore\Public\;$(ProjectDir)..\AppInstallerRepositoryCore;$(ProjectDir)..\AppInstallerCommonCore\Public;$(ProjectDir)..\AppInstallerSharedLib\Public;$(ProjectDir)..\Microsoft.Management.Deployment\Public;%(AdditionalIncludeDirectories) - true - true - true - true - Guard - Guard - Guard - Guard - stdcpp17 - stdcpp17 - stdcpp17 - stdcpp17 - true - true - true - true - false - false - false - false - MultiThreaded - MultiThreaded - MultiThreaded - MultiThreaded + $(ProjectDir);$(ProjectDir)..\AppInstallerCLICore\Public\;$(ProjectDir)..\AppInstallerRepositoryCore;$(ProjectDir)..\AppInstallerCommonCore\Public;$(ProjectDir)..\AppInstallerSharedLib\Public;$(ProjectDir)..\JsonCppLib\json;$(ProjectDir)..\Microsoft.Management.Deployment\Public;%(AdditionalIncludeDirectories) - true - true - false - Windows - Windows - Windows - Windows - Source.def - Source.def - Source.def - Source.def - wininet.lib;shell32.lib;winsqlite3.lib;shlwapi.lib;icuuc.lib;icuin.lib;urlmon.lib;Advapi32.lib;winhttp.lib;onecoreuap.lib;msi.lib;%(AdditionalDependencies) - /debug:full /debugtype:cv,fixup /incremental:no %(AdditionalOptions) - /debug:full /debugtype:cv,fixup /incremental:no %(AdditionalOptions) - /debug:full /debugtype:cv,fixup /incremental:no %(AdditionalOptions) - /debug:full /debugtype:cv,fixup /incremental:no %(AdditionalOptions) + Windows + Source.def + wininet.lib;shell32.lib;winsqlite3.lib;shlwapi.lib;icuuc.lib;icuin.lib;urlmon.lib;Advapi32.lib;winhttp.lib;onecoreuap.lib;msi.lib;%(AdditionalDependencies) - $(ProjectDir)..\manifest\shared.manifest %(AdditionalManifestFiles) - - - $(ProjectDir)..\manifest\shared.manifest %(AdditionalManifestFiles) - - - $(ProjectDir)..\manifest\shared.manifest %(AdditionalManifestFiles) - - - $(ProjectDir)..\manifest\shared.manifest %(AdditionalManifestFiles) + $(ProjectDir)..\manifest\shared.manifest %(AdditionalManifestFiles) @@ -419,7 +97,6 @@ - diff --git a/src/WindowsPackageManager/WindowsPackageManager.vcxproj.filters b/src/WindowsPackageManager/WindowsPackageManager.vcxproj.filters index 03f4182bba..62f3afb7d6 100644 --- a/src/WindowsPackageManager/WindowsPackageManager.vcxproj.filters +++ b/src/WindowsPackageManager/WindowsPackageManager.vcxproj.filters @@ -28,7 +28,6 @@ - Source Files