From 9b47b1575a84a35a6037d0f13649789c6298cc89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Mu=C4=87ko?= Date: Tue, 27 Sep 2022 23:10:46 +0200 Subject: McuSupport: 3rd party packages creation tests Change-Id: I0f9ed6c49b28007c617627525fc081ae9152e3f1 Reviewed-by: hjk --- src/plugins/mcusupport/mcusupportsdk.cpp | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'src/plugins/mcusupport/mcusupportsdk.cpp') diff --git a/src/plugins/mcusupport/mcusupportsdk.cpp b/src/plugins/mcusupport/mcusupportsdk.cpp index f9213d00f7..b3f3a570cf 100644 --- a/src/plugins/mcusupport/mcusupportsdk.cpp +++ b/src/plugins/mcusupport/mcusupportsdk.cpp @@ -361,15 +361,12 @@ McuPackagePtr createStm32CubeProgrammerPackage(const SettingsHandler::Ptr &setti { FilePath defaultPath; const QString cubePath = "STMicroelectronics/STM32Cube/STM32CubeProgrammer"; - if (HostOsInfo::isWindowsHost()) { - const FilePath programPath = findInProgramFiles(cubePath); - if (!programPath.isEmpty()) - defaultPath = programPath; - } else { - const FilePath programPath = FileUtils::homePath() / cubePath; - if (programPath.exists()) - defaultPath = programPath; - } + if (HostOsInfo::isWindowsHost()) + defaultPath = findInProgramFiles(cubePath) / "bin"; + else + defaultPath = FileUtils::homePath() / cubePath / "bin"; + if (!defaultPath.exists()) + FilePath defaultPath = {}; const FilePath detectionPath = FilePath::fromUserInput( QLatin1String(Utils::HostOsInfo::isWindowsHost() ? "/bin/STM32_Programmer_CLI.exe" @@ -386,8 +383,7 @@ McuPackagePtr createStm32CubeProgrammerPackage(const SettingsHandler::Ptr &setti {}, // versions "https://www.st.com/en/development-tools/stm32cubeprog.html", // download url nullptr, // version detector - true, // add to path - "/bin" // relative path modifier + true // add to path )}; } -- cgit v1.2.1