diff options
Diffstat (limited to 'packaging-tools/configurations/pkg_510/qt.510.win32_mingw47.essentials/meta/installscript.qs')
-rw-r--r-- | packaging-tools/configurations/pkg_510/qt.510.win32_mingw47.essentials/meta/installscript.qs | 131 |
1 files changed, 131 insertions, 0 deletions
diff --git a/packaging-tools/configurations/pkg_510/qt.510.win32_mingw47.essentials/meta/installscript.qs b/packaging-tools/configurations/pkg_510/qt.510.win32_mingw47.essentials/meta/installscript.qs new file mode 100644 index 000000000..7a41f4ddc --- /dev/null +++ b/packaging-tools/configurations/pkg_510/qt.510.win32_mingw47.essentials/meta/installscript.qs @@ -0,0 +1,131 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the release tools of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +// constructor +function Component() +{ +} + +function createShortcuts() +{ + var qtStringVersion = "5.1.0"; + // Create a batch file with the development environment + var component_root_path = installer.value("TargetDir") + "%TARGET_INSTALL_DIR%"; + component_root_path = component_root_path.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;@MINGW47_DIR@\\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@/5.1.0/MinGW 4.7/Qt " + qtStringVersion + " for Desktop (MinGW 4.7).lnk", + "/A /Q /K " + batchFileName); + // Assistant + component.addOperation( "CreateShortcut", + component_root_path + "/bin/assistant.exe", + "@StartMenuDir@/5.1.0/MinGW 4.7/Assistant.lnk"); + + // Designer + component.addOperation( "CreateShortcut", + component_root_path + "/bin/designer.exe", + "@StartMenuDir@/5.1.0/MinGW 4.7/Designer.lnk"); + + // Linguist + component.addOperation( "CreateShortcut", + component_root_path + "/bin/linguist.exe", + "@StartMenuDir@/5.1.0/MinGW 4.7/Linguist.lnk"); + + + // Examples & Demos + //component.addOperation( "CreateShortcut", + // component_root_path + "/bin/qtdemo.exe", + // "@StartMenuDir@/5.1.0/MinGW 4.7/Examples & Demos.lnk"); +} + +Component.prototype.beginInstallation = function() +{ + installer.setValue(component.name + "_qtpath", "@TargetDir@" + "%TARGET_INSTALL_DIR%"); +} + +Component.prototype.createOperations = function() +{ + component.createOperations(); + + if (installer.value("os") == "win") { + try { + var qtPath = "@TargetDir@" + "%TARGET_INSTALL_DIR%"; + var qmakeBinary = "@TargetDir@" + "%TARGET_INSTALL_DIR%/bin/qmake.exe"; + addInitQtPatchOperation(component, "windows", qtPath, qmakeBinary, "qt5"); + + // Create a batch file and shortcuts with the development environment + createShortcuts(); + + if (installer.value("SDKToolBinary") == "") + return; + + var tcId = "ProjectExplorer.ToolChain.Mingw:" + component.name; + component.addOperation("Execute", + new Array("{0}", "@SDKToolBinary@", "addTC", "--id", tcId, "--name", "MinGW 4.7 32bit", "--path", "@MINGW47_DIR@\\bin\\g++.exe", "--abi", "x86-windows-msys-pe-32bit", "--supportedAbis", "x86-windows-msys-pe-32bit")); + + component.addOperation("Execute", + new Array("{0}", "@SDKToolBinary@", "addQt", "--id", component.name, "--name", "Qt 5.1.0 MinGW 32bit", "--type", "Qt4ProjectManager.QtVersion.Desktop", "--qmake", qmakeBinary)); + + component.addOperation("Execute", + new Array("{0}", "@SDKToolBinary@", "addKit", "--id", component.name + "_kit", "--name", "Desktop Qt 5.1.0 MinGW 32bit", "--toolchain", tcId, "--qt", component.name, "--debuggerengine", "1", "--debugger", "@MINGW47_DIR@\\bin\\gdb.exe", "--devicetype", "Desktop")); + + } catch( e ) { + print( e ); + } + } +} |