diff --git a/src/gcc/gcc.ts b/src/gcc/gcc.ts index db43174d..fe31008f 100644 --- a/src/gcc/gcc.ts +++ b/src/gcc/gcc.ts @@ -21,6 +21,8 @@ export async function setupGcc(version: string, _setupCppDir: string, arch: stri } else if (arch === "ia32" && existsSync("C:/tools/mingw32/bin")) { binDir = "C:/tools/mingw32/bin" addPath(binDir) + } else if (existsSync("C:/ProgramData/Chocolatey/bin/g++.exe")) { + binDir = "C:/ProgramData/Chocolatey/bin/g++.exe" } break } diff --git a/src/utils/setup/setupChocoPack.ts b/src/utils/setup/setupChocoPack.ts index a2f3813f..abda5867 100644 --- a/src/utils/setup/setupChocoPack.ts +++ b/src/utils/setup/setupChocoPack.ts @@ -1,4 +1,5 @@ /* eslint-disable require-atomic-updates */ +import { addPath } from "@actions/core" import { exec } from "@actions/exec" import which from "which" import { setupChocolatey } from "../../chocolatey/chocolatey" @@ -24,5 +25,7 @@ export async function setupChocoPack(name: string, version?: string, args: strin throw new Error(`Failed to install ${name} ${version}`) } - return { binDir: "C:/ProgramData/Chocolatey/bin/" } + const binDir = "C:/ProgramData/Chocolatey/bin/" + addPath(binDir) + return { binDir } }