/**************************************************************************** ** ** Copyright (C) 2025 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the release tools of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3 as published by the Free Software ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ // constructor function Component() { // add dependency to mocwrapper to install it first if (installer.componentByName("mocwrapper")) component.addDependency("mocwrapper"); } function createShortcuts() { var qtStringVersion = "6.10.0"; var minGwVersion = "17.0.6"; var linkPostfix = qtStringVersion + " (llvm-mingw " + minGwVersion + " 64-bit)"; // Create a batch file with the development environment var component_root_path = installer.value("TargetDir") + "/6.10.0/llvm-mingw_64"; component_root_path = component_root_path.replace(/\//g, "\\"); var mingwInstallDir = installer.value("LLVM_MINGW1706_64_DIR"); mingwInstallDir = mingwInstallDir.replace(/\//g, "\\"); var batchFileName = component_root_path + "\\" + "bin" + "\\" + "qtenv2.bat"; var contentString = "@echo off\r\n"; contentString += "echo Setting up environment for Qt usage...\r\n"; contentString += "set PATH=" + component_root_path + "\\bin;" + mingwInstallDir + "\\bin;%PATH%\r\n"; contentString += "cd /D " + component_root_path + "\r\n"; //contentString += "echo Remember to call vcvarsall.bat to complete environment setup!\r\n"; // Dump batch file component.addOperation("AppendFile", batchFileName, contentString); var windir = installer.environmentVariable("WINDIR"); if (windir == "") { QMessageBox["warning"]( "Error" , "Error", "Could not find windows installation directory"); return; } var cmdLocation = windir + "\\system32\\cmd.exe"; component.addOperation( "CreateShortcut", cmdLocation, "@StartMenuDir@/" + qtStringVersion + "/LLVM MinGW " + minGwVersion + " (64-bit)/Qt " + linkPostfix + ".lnk", "/A /Q /K " + batchFileName); // Assistant component.addOperation( "CreateShortcut", component_root_path + "/bin/assistant.exe", "@StartMenuDir@/" + qtStringVersion + "/LLVM MinGW " + minGwVersion + " (64-bit)/Assistant " + linkPostfix + ".lnk"); // Designer component.addOperation( "CreateShortcut", component_root_path + "/bin/designer.exe", "@StartMenuDir@/" + qtStringVersion + "/LLVM MinGW " + minGwVersion + " (64-bit)/Designer " + linkPostfix + ".lnk"); // Linguist component.addOperation( "CreateShortcut", component_root_path + "/bin/linguist.exe", "@StartMenuDir@/" + qtStringVersion + "/LLVM MinGW " + minGwVersion + " (64-bit)/Linguist " + linkPostfix + ".lnk"); } Component.prototype.createOperations = function() { component.createOperations(); if (installer.value("os") == "win") { try { var qtPath = "@TargetDir@" + "/6.10.0/llvm-mingw_64"; var qmakeBinary = "@TargetDir@" + "/6.10.0/llvm-mingw_64/bin/qmake.exe"; // Create a batch file and shortcuts with the development environment createShortcuts(); if (installer.value("SDKToolBinary") == "") { console.log(component.name + ": Error, SDKToolBinary not found!"); return; } component.addOperation("Execute", ["@SDKToolBinary@", "addQt", "--id", component.name, "--name", "Qt %{Qt:Version} llvm-mingw 64-bit", "--type", "Qt4ProjectManager.QtVersion.Desktop", "--qmake", qmakeBinary, "UNDOEXECUTE", "{0,2}", "@SDKToolBinary@", "rmQt", "--id", component.name]); var kitName = component.name + "_kit"; component.addOperation("Execute", ["@SDKToolBinary@", "addKit", "--id", kitName, "--name", "Desktop Qt %{Qt:Version} llvm-mingw 64-bit", "--Ctoolchain", "@LLVM-MINGW1706_TCID@" + ".clang", "--Cxxtoolchain", "@LLVM-MINGW1706_TCID@" + ".clang++", "--qt", component.name, "--debuggerid", "@LLVM-MINGW1706_DBGID@", "--devicetype", "Desktop", "UNDOEXECUTE", "{0,2}", "@SDKToolBinary@", "rmKit", "--id", kitName]); // create qt.conf file createQtConfFiles(component, installer.value("TargetDir") + "/6.10.0/llvm-mingw_64", "Qt-6.10.0"); // is this OpenSource installation? var isOpenSource = "false"; if (['true', 'yes', '1'].indexOf(isOpenSource) >= 0) { // Do nothing } // install mocwrapper if (installer.componentByName("mocwrapper")) { install_mocwrapper(component, "@TargetDir@" + "/6.10.0/llvm-mingw_64" + "/bin"); // add operation for installing Qt version string file var qtVersionFilePath = installer.value("TargetDir") + "/6.10.0/llvm-mingw_64"; qtVersionFilePath += "/bin/mocwrapper_qt_version"; qtVersionFilePath = installer.toNativeSeparators(qtVersionFilePath); component.addOperation("AppendFile", qtVersionFilePath, "6.10.0"); } } catch(e) { print(e); } } }