BareMetal: Auto-detection of IAR toolchain version 9

The Windows registry node containing the installation path of IAR
workbench changed since version 9 that is the same as the one for
32-bit Windows host. Multiple registry keys will be used to identify
the latest IAR toolchain as well.

Task-number: QTCREATORBUG-28245
Change-Id: I92ed0c10a38e081ca45fcf9e543d902a3e98efc2
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Kwangsub Kim
2022-11-09 16:51:43 +01:00
parent ea01c74d50
commit b4015fc345

View File

@@ -415,10 +415,10 @@ Toolchains IarToolChainFactory::autoDetect(const ToolchainDetector &detector) co
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
QStringList registryNodes;
registryNodes << "HKEY_LOCAL_MACHINE\\SOFTWARE\\IAR Systems\\Embedded Workbench";
#ifdef Q_OS_WIN64 #ifdef Q_OS_WIN64
static const char kRegistryNode[] = "HKEY_LOCAL_MACHINE\\SOFTWARE\\WOW6432Node\\IAR Systems\\Embedded Workbench"; registryNodes << "HKEY_LOCAL_MACHINE\\SOFTWARE\\WOW6432Node\\IAR Systems\\Embedded Workbench";
#else
static const char kRegistryNode[] = "HKEY_LOCAL_MACHINE\\SOFTWARE\\IAR Systems\\Embedded Workbench";
#endif #endif
// Dictionary for know toolchains. // Dictionary for know toolchains.
@@ -446,7 +446,8 @@ Toolchains IarToolChainFactory::autoDetect(const ToolchainDetector &detector) co
{{"EWCR16C"}, {"/cr16c/bin/icccr16c.exe"}}, {{"EWCR16C"}, {"/cr16c/bin/icccr16c.exe"}},
}; };
QSettings registry(kRegistryNode, QSettings::NativeFormat); for (const QString &registryNode : registryNodes) {
QSettings registry(registryNode, QSettings::NativeFormat);
const auto oneLevelGroups = registry.childGroups(); const auto oneLevelGroups = registry.childGroups();
for (const QString &oneLevelKey : oneLevelGroups) { for (const QString &oneLevelKey : oneLevelGroups) {
registry.beginGroup(oneLevelKey); registry.beginGroup(oneLevelKey);
@@ -474,6 +475,7 @@ Toolchains IarToolChainFactory::autoDetect(const ToolchainDetector &detector) co
} }
registry.endGroup(); registry.endGroup();
} }
}
#endif // Q_OS_WIN #endif // Q_OS_WIN