commit 636254065a5c2f1ff7af8cd8909176703645649d parent 7775eba19bacd2dd78dba1c6773e55b141fde982 Author: Easton Pillay <easton@planeteaston.com> Date: Fri, 19 Nov 2021 17:26:57 -0600 Updated solution to build under Visual Studio 2022 (#1720) Diffstat:
21 files changed, 53 insertions(+), 15 deletions(-)
diff --git a/src/AppInstallerCLI/AppInstallerCLI.vcxproj b/src/AppInstallerCLI/AppInstallerCLI.vcxproj @@ -54,6 +54,7 @@ <PlatformToolset>v140</PlatformToolset> <PlatformToolset Condition="'$(VisualStudioVersion)' == '15.0'">v141</PlatformToolset> <PlatformToolset Condition="'$(VisualStudioVersion)' == '16.0'">v142</PlatformToolset> + <PlatformToolset Condition="'$(VisualStudioVersion)' == '17.0'">v143</PlatformToolset> <CharacterSet>Unicode</CharacterSet> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration"> diff --git a/src/AppInstallerCLICore/AppInstallerCLICore.vcxproj b/src/AppInstallerCLICore/AppInstallerCLICore.vcxproj @@ -54,6 +54,7 @@ <PlatformToolset>v140</PlatformToolset> <PlatformToolset Condition="'$(VisualStudioVersion)' == '15.0'">v141</PlatformToolset> <PlatformToolset Condition="'$(VisualStudioVersion)' == '16.0'">v142</PlatformToolset> + <PlatformToolset Condition="'$(VisualStudioVersion)' == '17.0'">v143</PlatformToolset> <CharacterSet>Unicode</CharacterSet> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration"> diff --git a/src/AppInstallerCLICore/Workflows/ImportExportFlow.cpp b/src/AppInstallerCLICore/Workflows/ImportExportFlow.cpp @@ -163,7 +163,7 @@ namespace AppInstaller::CLI::Workflow void ReadImportFile(Execution::Context& context) { - std::ifstream importFile{ context.Args.GetArg(Execution::Args::Type::ImportFile) }; + std::ifstream importFile(Utility::ConvertToUTF16(context.Args.GetArg(Execution::Args::Type::ImportFile))); THROW_LAST_ERROR_IF(importFile.fail()); Json::Value jsonRoot; diff --git a/src/AppInstallerCLITests/AppInstallerCLITests.vcxproj b/src/AppInstallerCLITests/AppInstallerCLITests.vcxproj @@ -38,6 +38,7 @@ <PlatformToolset>v140</PlatformToolset> <PlatformToolset Condition="'$(VisualStudioVersion)' == '15.0'">v141</PlatformToolset> <PlatformToolset Condition="'$(VisualStudioVersion)' == '16.0'">v142</PlatformToolset> + <PlatformToolset Condition="'$(VisualStudioVersion)' == '17.0'">v143</PlatformToolset> <CharacterSet>Unicode</CharacterSet> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration"> diff --git a/src/AppInstallerCLITests/NameNormalization.cpp b/src/AppInstallerCLITests/NameNormalization.cpp @@ -13,11 +13,11 @@ using namespace AppInstaller::Utility; // copy the file(s) back to the git managed location to update. TEST_CASE("NameNorm_Update_Database_Initial", "[.]") { - std::ifstream namesStream(TestCommon::TestDataFile("InputNames.txt")); + std::ifstream namesStream(TestCommon::TestDataFile("InputNames.txt").GetPath()); REQUIRE(namesStream); - std::ifstream publishersStream(TestCommon::TestDataFile("InputPublishers.txt")); + std::ifstream publishersStream(TestCommon::TestDataFile("InputPublishers.txt").GetPath()); REQUIRE(publishersStream); - std::ofstream resultsStream(TestCommon::TestDataFile("NormalizationInitialIdsUpdate.txt"), std::ofstream::out | std::ofstream::trunc | std::ofstream::binary); + std::ofstream resultsStream(TestCommon::TestDataFile("NormalizationInitialIdsUpdate.txt").GetPath(), std::ofstream::out | std::ofstream::trunc | std::ofstream::binary); REQUIRE(resultsStream); // Far larger than any one value; hopefully @@ -60,11 +60,11 @@ TEST_CASE("NameNorm_Update_Database_Initial", "[.]") // source. TEST_CASE("NameNorm_Database_Initial", "[name_norm]") { - std::ifstream namesStream(TestCommon::TestDataFile("InputNames.txt")); + std::ifstream namesStream(TestCommon::TestDataFile("InputNames.txt").GetPath()); REQUIRE(namesStream); - std::ifstream publishersStream(TestCommon::TestDataFile("InputPublishers.txt")); + std::ifstream publishersStream(TestCommon::TestDataFile("InputPublishers.txt").GetPath()); REQUIRE(publishersStream); - std::ifstream resultsStream(TestCommon::TestDataFile("NormalizationInitialIds.txt")); + std::ifstream resultsStream(TestCommon::TestDataFile("NormalizationInitialIds.txt").GetPath()); REQUIRE(resultsStream); // Far larger than any one value; hopefully diff --git a/src/AppInstallerCLITests/YamlManifest.cpp b/src/AppInstallerCLITests/YamlManifest.cpp @@ -122,7 +122,7 @@ TEST_CASE("ReadPreviewGoodManifestAndVerifyContents", "[ManifestValidation]") REQUIRE(localization1.Get<Localization::LicenseUrl>() == "https://github.com/microsoft/msix-packaging/blob/master/LICENSE-es-MX"); // Stream hash - std::ifstream stream(manifestFile, std::ios_base::in | std::ios_base::binary); + std::ifstream stream(manifestFile.GetPath(), std::ios_base::in | std::ios_base::binary); REQUIRE(!stream.fail()); auto manifestHash = SHA256::ComputeHash(stream); REQUIRE(manifestHash.size() == manifest.StreamSha256.size()); diff --git a/src/AppInstallerCommonCore/AppInstallerCommonCore.vcxproj b/src/AppInstallerCommonCore/AppInstallerCommonCore.vcxproj @@ -58,6 +58,7 @@ <PlatformToolset>v140</PlatformToolset> <PlatformToolset Condition="'$(VisualStudioVersion)' == '15.0'">v141</PlatformToolset> <PlatformToolset Condition="'$(VisualStudioVersion)' == '16.0'">v142</PlatformToolset> + <PlatformToolset Condition="'$(VisualStudioVersion)' == '17.0'">v143</PlatformToolset> <CharacterSet>Unicode</CharacterSet> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration"> diff --git a/src/AppInstallerCommonCore/Downloader.cpp b/src/AppInstallerCommonCore/Downloader.cpp @@ -1,5 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. + #include "pch.h" #include "Public/AppInstallerErrors.h" #include "Public/AppInstallerRuntime.h" @@ -22,6 +23,10 @@ namespace AppInstaller::Utility IProgressCallback& progress, bool computeHash) { + // For AICLI_LOG usages with string literals. + #pragma warning(push) + #pragma warning(disable:26449) + AICLI_LOG(Core, Info, << "WinINet downloading from url: " << url); wil::unique_hinternet session(InternetOpenA( @@ -126,6 +131,8 @@ namespace AppInstaller::Utility AICLI_LOG(Core, Info, << "Download completed."); + #pragma warning(pop) + return result; } diff --git a/src/AppInstallerRepositoryCore/AppInstallerRepositoryCore.vcxproj b/src/AppInstallerRepositoryCore/AppInstallerRepositoryCore.vcxproj @@ -54,6 +54,7 @@ <PlatformToolset>v140</PlatformToolset> <PlatformToolset Condition="'$(VisualStudioVersion)' == '15.0'">v141</PlatformToolset> <PlatformToolset Condition="'$(VisualStudioVersion)' == '16.0'">v142</PlatformToolset> + <PlatformToolset Condition="'$(VisualStudioVersion)' == '17.0'">v143</PlatformToolset> <CharacterSet>Unicode</CharacterSet> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration"> diff --git a/src/AppInstallerTestExeInstaller/AppInstallerTestExeInstaller.vcxproj b/src/AppInstallerTestExeInstaller/AppInstallerTestExeInstaller.vcxproj @@ -50,6 +50,7 @@ <PlatformToolset>v140</PlatformToolset> <PlatformToolset Condition="'$(VisualStudioVersion)' == '15.0'">v141</PlatformToolset> <PlatformToolset Condition="'$(VisualStudioVersion)' == '16.0'">v142</PlatformToolset> + <PlatformToolset Condition="'$(VisualStudioVersion)' == '17.0'">v143</PlatformToolset> <CharacterSet>Unicode</CharacterSet> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> diff --git a/src/JsonCppLib/JsonCppLib.vcxproj b/src/JsonCppLib/JsonCppLib.vcxproj @@ -49,38 +49,45 @@ <ConfigurationType>StaticLibrary</ConfigurationType> <UseDebugLibraries>true</UseDebugLibraries> <PlatformToolset>v142</PlatformToolset> + <PlatformToolset Condition="'$(VisualStudioVersion)' == '17.0'">v143</PlatformToolset> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> <ConfigurationType>StaticLibrary</ConfigurationType> <UseDebugLibraries>false</UseDebugLibraries> <PlatformToolset>v142</PlatformToolset> + <PlatformToolset Condition="'$(VisualStudioVersion)' == '17.0'">v143</PlatformToolset> <SpectreMitigation>Spectre</SpectreMitigation> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> <ConfigurationType>StaticLibrary</ConfigurationType> <UseDebugLibraries>true</UseDebugLibraries> <PlatformToolset>v142</PlatformToolset> + <PlatformToolset Condition="'$(VisualStudioVersion)' == '17.0'">v143</PlatformToolset> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration"> <ConfigurationType>StaticLibrary</ConfigurationType> <UseDebugLibraries>true</UseDebugLibraries> <PlatformToolset>v142</PlatformToolset> + <PlatformToolset Condition="'$(VisualStudioVersion)' == '17.0'">v143</PlatformToolset> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration"> <ConfigurationType>StaticLibrary</ConfigurationType> <UseDebugLibraries>true</UseDebugLibraries> <PlatformToolset>v142</PlatformToolset> + <PlatformToolset Condition="'$(VisualStudioVersion)' == '17.0'">v143</PlatformToolset> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> <ConfigurationType>StaticLibrary</ConfigurationType> <UseDebugLibraries>false</UseDebugLibraries> <PlatformToolset>v142</PlatformToolset> - <SpectreMitigation>Spectre</SpectreMitigation> + <PlatformToolset Condition="'$(VisualStudioVersion)' == '17.0'">v143</PlatformToolset> + <SpectreMitigation>Spectre</SpectreMitigation> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Fuzzing|x64'" Label="Configuration"> <ConfigurationType>StaticLibrary</ConfigurationType> <UseDebugLibraries>false</UseDebugLibraries> - <PlatformToolset>v142</PlatformToolset> + <PlatformToolset>v142</PlatformToolset> + <PlatformToolset Condition="'$(VisualStudioVersion)' == '17.0'">v143</PlatformToolset> <EnableASAN>true</EnableASAN> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration"> @@ -93,7 +100,8 @@ <ConfigurationType>StaticLibrary</ConfigurationType> <UseDebugLibraries>false</UseDebugLibraries> <PlatformToolset>v142</PlatformToolset> - <SpectreMitigation>Spectre</SpectreMitigation> + <PlatformToolset Condition="'$(VisualStudioVersion)' == '17.0'">v143</PlatformToolset> + <SpectreMitigation>Spectre</SpectreMitigation> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <ImportGroup Label="ExtensionSettings"> diff --git a/src/Microsoft.Management.Deployment.Client/Microsoft.Management.Deployment.Client.vcxproj b/src/Microsoft.Management.Deployment.Client/Microsoft.Management.Deployment.Client.vcxproj @@ -57,6 +57,7 @@ <PlatformToolset>v140</PlatformToolset> <PlatformToolset Condition="'$(VisualStudioVersion)' == '15.0'">v141</PlatformToolset> <PlatformToolset Condition="'$(VisualStudioVersion)' == '16.0'">v142</PlatformToolset> + <PlatformToolset Condition="'$(VisualStudioVersion)' == '17.0'">v143</PlatformToolset> <CharacterSet>Unicode</CharacterSet> <GenerateManifest>false</GenerateManifest> <DesktopCompatible>true</DesktopCompatible> diff --git a/src/Microsoft.Management.Deployment.Server.Test/Microsoft.Management.Deployment.Server.Test.vcxproj b/src/Microsoft.Management.Deployment.Server.Test/Microsoft.Management.Deployment.Server.Test.vcxproj @@ -57,6 +57,7 @@ <PlatformToolset>v140</PlatformToolset> <PlatformToolset Condition="'$(VisualStudioVersion)' == '15.0'">v141</PlatformToolset> <PlatformToolset Condition="'$(VisualStudioVersion)' == '16.0'">v142</PlatformToolset> + <PlatformToolset Condition="'$(VisualStudioVersion)' == '17.0'">v143</PlatformToolset> <CharacterSet>Unicode</CharacterSet> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration"> diff --git a/src/Microsoft.Management.Deployment/Microsoft.Management.Deployment.vcxproj b/src/Microsoft.Management.Deployment/Microsoft.Management.Deployment.vcxproj @@ -56,6 +56,7 @@ <PlatformToolset>v140</PlatformToolset> <PlatformToolset Condition="'$(VisualStudioVersion)' == '15.0'">v141</PlatformToolset> <PlatformToolset Condition="'$(VisualStudioVersion)' == '16.0'">v142</PlatformToolset> + <PlatformToolset Condition="'$(VisualStudioVersion)' == '17.0'">v143</PlatformToolset> <CharacterSet>Unicode</CharacterSet> <GenerateManifest>false</GenerateManifest> </PropertyGroup> diff --git a/src/WinGetServer/WinGetServer.vcxproj b/src/WinGetServer/WinGetServer.vcxproj @@ -57,6 +57,7 @@ <PlatformToolset>v140</PlatformToolset> <PlatformToolset Condition="'$(VisualStudioVersion)' == '15.0'">v141</PlatformToolset> <PlatformToolset Condition="'$(VisualStudioVersion)' == '16.0'">v142</PlatformToolset> + <PlatformToolset Condition="'$(VisualStudioVersion)' == '17.0'">v143</PlatformToolset> <CharacterSet>Unicode</CharacterSet> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration"> diff --git a/src/WinGetUtil/WinGetUtil.vcxproj b/src/WinGetUtil/WinGetUtil.vcxproj @@ -54,6 +54,7 @@ <PlatformToolset>v140</PlatformToolset> <PlatformToolset Condition="'$(VisualStudioVersion)' == '15.0'">v141</PlatformToolset> <PlatformToolset Condition="'$(VisualStudioVersion)' == '16.0'">v142</PlatformToolset> + <PlatformToolset Condition="'$(VisualStudioVersion)' == '17.0'">v143</PlatformToolset> <CharacterSet>Unicode</CharacterSet> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration"> diff --git a/src/WinGetYamlFuzzing/WinGetYamlFuzzing.vcxproj b/src/WinGetYamlFuzzing/WinGetYamlFuzzing.vcxproj @@ -30,6 +30,7 @@ <ConfigurationType>Application</ConfigurationType> <UseDebugLibraries>false</UseDebugLibraries> <PlatformToolset>v142</PlatformToolset> + <PlatformToolset Condition="'$(VisualStudioVersion)' == '17.0'">v143</PlatformToolset> <WholeProgramOptimization>false</WholeProgramOptimization> <CharacterSet>Unicode</CharacterSet> </PropertyGroup> diff --git a/src/WindowsPackageManager/WindowsPackageManager.vcxproj b/src/WindowsPackageManager/WindowsPackageManager.vcxproj @@ -55,6 +55,7 @@ <PlatformToolset>v140</PlatformToolset> <PlatformToolset Condition="'$(VisualStudioVersion)' == '15.0'">v141</PlatformToolset> <PlatformToolset Condition="'$(VisualStudioVersion)' == '16.0'">v142</PlatformToolset> + <PlatformToolset Condition="'$(VisualStudioVersion)' == '17.0'">v143</PlatformToolset> <CharacterSet>Unicode</CharacterSet> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration"> diff --git a/src/YamlCppLib/YamlCppLib.vcxproj b/src/YamlCppLib/YamlCppLib.vcxproj @@ -82,6 +82,7 @@ <PlatformToolset>v140</PlatformToolset> <PlatformToolset Condition="'$(VisualStudioVersion)' == '15.0'">v141</PlatformToolset> <PlatformToolset Condition="'$(VisualStudioVersion)' == '16.0'">v142</PlatformToolset> + <PlatformToolset Condition="'$(VisualStudioVersion)' == '17.0'">v143</PlatformToolset> <CharacterSet>Unicode</CharacterSet> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> diff --git a/src/cpprestsdk/cpprestsdk.vcxproj b/src/cpprestsdk/cpprestsdk.vcxproj @@ -47,25 +47,29 @@ <ConfigurationType>StaticLibrary</ConfigurationType> <UseDebugLibraries>true</UseDebugLibraries> <PlatformToolset>v142</PlatformToolset> + <PlatformToolset Condition="'$(VisualStudioVersion)' == '17.0'">v143</PlatformToolset> <CharacterSet>Unicode</CharacterSet> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> <ConfigurationType>StaticLibrary</ConfigurationType> <UseDebugLibraries>false</UseDebugLibraries> <PlatformToolset>v142</PlatformToolset> - <CharacterSet>Unicode</CharacterSet> + <PlatformToolset Condition="'$(VisualStudioVersion)' == '17.0'">v143</PlatformToolset> + <CharacterSet>Unicode</CharacterSet> <SpectreMitigation>Spectre</SpectreMitigation> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> <ConfigurationType>StaticLibrary</ConfigurationType> <UseDebugLibraries>true</UseDebugLibraries> <PlatformToolset>v142</PlatformToolset> - <CharacterSet>Unicode</CharacterSet> + <PlatformToolset Condition="'$(VisualStudioVersion)' == '17.0'">v143</PlatformToolset> + <CharacterSet>Unicode</CharacterSet> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> <ConfigurationType>StaticLibrary</ConfigurationType> <UseDebugLibraries>false</UseDebugLibraries> <PlatformToolset>v142</PlatformToolset> + <PlatformToolset Condition="'$(VisualStudioVersion)' == '17.0'">v143</PlatformToolset> <CharacterSet>Unicode</CharacterSet> <SpectreMitigation>Spectre</SpectreMitigation> </PropertyGroup> @@ -73,25 +77,29 @@ <ConfigurationType>StaticLibrary</ConfigurationType> <UseDebugLibraries>true</UseDebugLibraries> <PlatformToolset>v142</PlatformToolset> - <CharacterSet>Unicode</CharacterSet> + <PlatformToolset Condition="'$(VisualStudioVersion)' == '17.0'">v143</PlatformToolset> + <CharacterSet>Unicode</CharacterSet> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration"> <ConfigurationType>StaticLibrary</ConfigurationType> <UseDebugLibraries>true</UseDebugLibraries> <PlatformToolset>v142</PlatformToolset> + <PlatformToolset Condition="'$(VisualStudioVersion)' == '17.0'">v143</PlatformToolset> <CharacterSet>Unicode</CharacterSet> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration"> <ConfigurationType>StaticLibrary</ConfigurationType> <UseDebugLibraries>false</UseDebugLibraries> <PlatformToolset>v142</PlatformToolset> - <CharacterSet>Unicode</CharacterSet> + <PlatformToolset Condition="'$(VisualStudioVersion)' == '17.0'">v143</PlatformToolset> + <CharacterSet>Unicode</CharacterSet> <SpectreMitigation>Spectre</SpectreMitigation> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration"> <ConfigurationType>StaticLibrary</ConfigurationType> <UseDebugLibraries>false</UseDebugLibraries> <PlatformToolset>v142</PlatformToolset> + <PlatformToolset Condition="'$(VisualStudioVersion)' == '17.0'">v143</PlatformToolset> <CharacterSet>Unicode</CharacterSet> <SpectreMitigation>Spectre</SpectreMitigation> </PropertyGroup> diff --git a/tools/SampleWinGetUWPCaller/AppInstallerCaller/AppInstallerCaller.vcxproj b/tools/SampleWinGetUWPCaller/AppInstallerCaller/AppInstallerCaller.vcxproj @@ -57,6 +57,7 @@ <PlatformToolset>v140</PlatformToolset> <PlatformToolset Condition="'$(VisualStudioVersion)' == '15.0'">v141</PlatformToolset> <PlatformToolset Condition="'$(VisualStudioVersion)' == '16.0'">v142</PlatformToolset> + <PlatformToolset Condition="'$(VisualStudioVersion)' == '17.0'">v143</PlatformToolset> <CharacterSet>Unicode</CharacterSet> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration">