diff options
author | Orkun Tokdemir <[email protected]> | 2024-12-16 10:31:34 +0100 |
---|---|---|
committer | Orkun Tokdemir <[email protected]> | 2024-12-18 13:08:29 +0000 |
commit | 59417385447fe43ced8aa1245e42b713acb318bb (patch) | |
tree | 490229a5e8df126bb57fed5ae9752e2a3418b785 | |
parent | 6adb26b51318b6bd6ee01b7cd5881da9afba82df (diff) |
qt-ui: Check also for `qmake.bat` in the Qt installation directory1.1.0
Some Qt installations do not have `qmake.exe` but `qmake.bat` instead.
This commit adds a check for `qmake.bat` in the Qt installation
directory.
Fixes: VSCODEEXT-117
Change-Id: I2d4aa5fdda216739be16bc3a95867496d2817561
Reviewed-by: Joerg Bornemann <[email protected]>
(cherry picked from commit e69b51c7caa1e4f05ea4e7d98b1de7647d6dff73)
-rw-r--r-- | qt-lib/src/util.ts | 18 | ||||
-rw-r--r-- | qt-ui/src/util.ts | 3 |
2 files changed, 17 insertions, 4 deletions
diff --git a/qt-lib/src/util.ts b/qt-lib/src/util.ts index 4f07479..573a8e0 100644 --- a/qt-lib/src/util.ts +++ b/qt-lib/src/util.ts @@ -66,10 +66,20 @@ export function isMultiWorkspace(): boolean { } export async function locateQmakeExeFilePath(selectedQtPath: string) { - return ( - (await existing(path.join(selectedQtPath, 'bin', 'qmake' + OSExeSuffix))) || - (await existing(path.join(selectedQtPath, 'bin', 'qmake6' + OSExeSuffix))) - ); + const qmakeVersions = ['qmake', 'qmake6']; + const suffixes = [OSExeSuffix]; + if (IsWindows) { + suffixes.push('.bat'); + } + for (const qmake of qmakeVersions) { + for (const suffix of suffixes) { + const qmakePath = path.join(selectedQtPath, 'bin', qmake + suffix); + if (await exists(qmakePath)) { + return qmakePath; + } + } + } + return undefined; } export function compareVersions(version1: string, version2: string) { diff --git a/qt-ui/src/util.ts b/qt-ui/src/util.ts index ded5ed5..a0f2553 100644 --- a/qt-ui/src/util.ts +++ b/qt-ui/src/util.ts @@ -58,6 +58,9 @@ export async function locateDesigner(selectedQtPath: string) { return designerExePath; } const qmakeExePath = await locateQmakeExeFilePath(selectedQtPath); + if (!qmakeExePath) { + return ''; + } const designer = extractDesignerExePathFromQtPath(qmakeExePath); if (await designer) { return designer; |