From 24f80387449aeaf11938a2503a8cae67dd697bf4 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Thu, 16 Sep 2021 13:20:03 -0500 Subject: [PATCH 1/3] fix: fix the toolset versions for vs2017 and vs2019 https://github.com/jberezanski/ChocolateyPackages/issues/117#issuecomment-921071306 --- src/msvc/msvc.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/msvc/msvc.ts b/src/msvc/msvc.ts index 2ac15a9c..cd0e6df0 100644 --- a/src/msvc/msvc.ts +++ b/src/msvc/msvc.ts @@ -43,19 +43,19 @@ export async function setupMSVC( exportVariable("VCTargetsPath", VCTargetsPath) } } else if (version === "2017") { - toolset = "15.9.38.0" - await setupChocoPack("visualstudio2017buildtools", toolset, [ + toolset = "14.16" + await setupChocoPack("visualstudio2017buildtools", "15.9.38.0", [ "--package-parameters", "add Microsoft.VisualStudio.Workload.NativeDesktop --includeRecommended --passive", ]) - VCTargetsPath = "C:/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/MSBuild/Microsoft/VC/v150" + VCTargetsPath = "C:/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/VC/Tools/MSVC/14.16" // TODO verify path } else if (version === "2019") { - toolset = "16.11.2.0" - await setupChocoPack("visualstudio2019buildtools", toolset, [ + toolset = "14.29.30133" + await setupChocoPack("visualstudio2019buildtools", "16.11.2.0", [ "--package-parameters", "add Microsoft.VisualStudio.Workload.NativeDesktop --includeRecommended --passive", ]) - VCTargetsPath = "C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/MSBuild/Microsoft/VC/v160" + VCTargetsPath = "C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.29.30133" } if (VCTargetsPath !== undefined && existsSync(VCTargetsPath)) { exportVariable("VCTargetsPath", VCTargetsPath) From 3f0939b85c3c7d42ecb7434bf4334751bdec18fe Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Fri, 17 Sep 2021 05:53:39 -0500 Subject: [PATCH 2/3] fix: use --add to add msvc workloads https://github.com/jberezanski/ChocolateyPackages/blob/master/chocolatey-visualstudio.extension/EXAMPLES.md#add-the-data-workload-to-all-installed-vs-2017-communityprofessionalenterprise-instances-downloading-needed-files-from-the-internet-only-required-components-webdeploy-and-the-visualstudiodata-component-will-be-added --- src/msvc/msvc.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/msvc/msvc.ts b/src/msvc/msvc.ts index cd0e6df0..c4ffeef3 100644 --- a/src/msvc/msvc.ts +++ b/src/msvc/msvc.ts @@ -46,14 +46,14 @@ export async function setupMSVC( toolset = "14.16" await setupChocoPack("visualstudio2017buildtools", "15.9.38.0", [ "--package-parameters", - "add Microsoft.VisualStudio.Workload.NativeDesktop --includeRecommended --passive", + "--add Microsoft.VisualStudio.Workload.NativeDesktop --includeRecommended --passive", ]) VCTargetsPath = "C:/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/VC/Tools/MSVC/14.16" // TODO verify path } else if (version === "2019") { toolset = "14.29.30133" await setupChocoPack("visualstudio2019buildtools", "16.11.2.0", [ "--package-parameters", - "add Microsoft.VisualStudio.Workload.NativeDesktop --includeRecommended --passive", + "--add Microsoft.VisualStudio.Workload.NativeDesktop --includeRecommended --passive", ]) VCTargetsPath = "C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.29.30133" } From ed2713efc570d77bede781d739c7f8146f7d0084 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Fri, 17 Sep 2021 06:04:38 -0500 Subject: [PATCH 3/3] fix: quote the arguments --- src/msvc/msvc.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/msvc/msvc.ts b/src/msvc/msvc.ts index c4ffeef3..b88a2306 100644 --- a/src/msvc/msvc.ts +++ b/src/msvc/msvc.ts @@ -46,14 +46,14 @@ export async function setupMSVC( toolset = "14.16" await setupChocoPack("visualstudio2017buildtools", "15.9.38.0", [ "--package-parameters", - "--add Microsoft.VisualStudio.Workload.NativeDesktop --includeRecommended --passive", + "'--add Microsoft.VisualStudio.Workload.NativeDesktop --includeRecommended --passive'", ]) VCTargetsPath = "C:/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/VC/Tools/MSVC/14.16" // TODO verify path } else if (version === "2019") { toolset = "14.29.30133" await setupChocoPack("visualstudio2019buildtools", "16.11.2.0", [ "--package-parameters", - "--add Microsoft.VisualStudio.Workload.NativeDesktop --includeRecommended --passive", + "'--add Microsoft.VisualStudio.Workload.NativeDesktop --includeRecommended --passive'", ]) VCTargetsPath = "C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.29.30133" }