From b1c81326de13cbf2a690ce41ebb090cdd475696a Mon Sep 17 00:00:00 2001 From: Chris Lalancette Date: Fri, 26 Jun 2020 11:36:24 -0400 Subject: [PATCH] Windows: Add in registry key that is expected for ROS 2 Chocolatey. (#205) The comment has more information about why. Signed-off-by: Chris Lalancette Co-authored-by: Emerson Knapp <537409+emersonknapp@users.noreply.github.com> --- dist/index.js | 9 ++++++++- src/package_manager/chocolatey.ts | 7 +++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/dist/index.js b/dist/index.js index c54e8e79a..cc7fa0849 100644 --- a/dist/index.js +++ b/dist/index.js @@ -4208,6 +4208,13 @@ exports.installChocoDependencies = installChocoDependencies; function downloadAndInstallRos2NugetPackages() { return __awaiter(this, void 0, void 0, function* () { yield utils.exec("wget", ["--quiet"].concat(ros2ChocolateyPackagesUrl)); + // The ROS 2 NUGET Chocolatey packages expect a registry entry of + // HKCU\SOFTWARE\Kitware\CMake to exist; if it doesn't, they don't + // properly register themselves with CMake and thus downstream software + // can't properly find them. The Windows image that is currently available + // to GitHub actions (https://github.com/actions/virtual-environments/blob/win19/20200608.1/images/win/Windows2019-Readme.md) + // doesn't seem to have this key, so add it by hand here. + yield utils.exec("reg", ["add", "HKCU\\SOFTWARE\\Kitware\\CMake", "/f"]); return utils.exec("choco", chocoCommandLine.concat("--source", ".").concat(ros2ChocolateyPackages)); }); } @@ -5923,4 +5930,4 @@ exports.runOsX = runOsX; /***/ }) -/******/ }); \ No newline at end of file +/******/ }); diff --git a/src/package_manager/chocolatey.ts b/src/package_manager/chocolatey.ts index cc3821689..a09f0c0f5 100644 --- a/src/package_manager/chocolatey.ts +++ b/src/package_manager/chocolatey.ts @@ -47,6 +47,13 @@ export async function installChocoDependencies(): Promise { */ export async function downloadAndInstallRos2NugetPackages(): Promise { await utils.exec("wget", ["--quiet"].concat(ros2ChocolateyPackagesUrl)); + // The ROS 2 NUGET Chocolatey packages expect a registry entry of + // HKCU\SOFTWARE\Kitware\CMake to exist; if it doesn't, they don't + // properly register themselves with CMake and thus downstream software + // can't properly find them. The Windows image that is currently available + // to GitHub actions (https://github.com/actions/virtual-environments/blob/win19/20200608.1/images/win/Windows2019-Readme.md) + // doesn't seem to have this key, so add it by hand here. + await utils.exec("reg", ["add", "HKCU\\SOFTWARE\\Kitware\\CMake", "/f"]); return utils.exec( "choco", chocoCommandLine.concat("--source", ".").concat(ros2ChocolateyPackages)