author | Eckhart Koeppen <eckhart.koppen@nokia.com> |
Thu, 08 Apr 2010 14:19:33 +0300 | |
branch | RCL_3 |
changeset 7 | 3f74d0d4af4c |
parent 4 | 3b1da2848fc7 |
permissions | -rw-r--r-- |
0 | 1 |
/**************************************************************************** |
2 |
** |
|
4
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
3 |
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
0 | 4 |
** All rights reserved. |
5 |
** Contact: Nokia Corporation (qt-info@nokia.com) |
|
6 |
** |
|
7 |
** This file is part of the tools applications of the Qt Toolkit. |
|
8 |
** |
|
9 |
** $QT_BEGIN_LICENSE:LGPL$ |
|
10 |
** No Commercial Usage |
|
11 |
** This file contains pre-release code and may not be distributed. |
|
12 |
** You may use this file in accordance with the terms and conditions |
|
13 |
** contained in the Technology Preview License Agreement accompanying |
|
14 |
** this package. |
|
15 |
** |
|
16 |
** GNU Lesser General Public License Usage |
|
17 |
** Alternatively, this file may be used under the terms of the GNU Lesser |
|
18 |
** General Public License version 2.1 as published by the Free Software |
|
19 |
** Foundation and appearing in the file LICENSE.LGPL included in the |
|
20 |
** packaging of this file. Please review the following information to |
|
21 |
** ensure the GNU Lesser General Public License version 2.1 requirements |
|
22 |
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. |
|
23 |
** |
|
24 |
** In addition, as a special exception, Nokia gives you certain additional |
|
25 |
** rights. These rights are described in the Nokia Qt LGPL Exception |
|
26 |
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. |
|
27 |
** |
|
28 |
** If you have questions regarding the use of this file, please contact |
|
29 |
** Nokia at qt-info@nokia.com. |
|
30 |
** |
|
31 |
** |
|
32 |
** |
|
33 |
** |
|
34 |
** |
|
35 |
** |
|
36 |
** |
|
37 |
** |
|
38 |
** $QT_END_LICENSE$ |
|
39 |
** |
|
40 |
****************************************************************************/ |
|
41 |
||
42 |
#include "tools.h" |
|
43 |
||
44 |
#include <QDir> |
|
45 |
#include <QFile> |
|
46 |
#include <QByteArray> |
|
47 |
||
48 |
||
49 |
// std stuff ------------------------------------ |
|
50 |
#include <iostream> |
|
51 |
#include <windows.h> |
|
52 |
#include <conio.h> |
|
53 |
#define NUMBER_OF_PARTS 7 |
|
54 |
||
55 |
std::ostream &operator<<(std::ostream &s, const QString &val); // defined in configureapp.cpp |
|
56 |
using namespace std; |
|
57 |
||
58 |
void Tools::checkLicense(QMap<QString,QString> &dictionary, QMap<QString,QString> &licenseInfo, |
|
59 |
const QString &path) |
|
60 |
{ |
|
61 |
if (dictionary[ "BUILDNOKIA" ] == "yes") { |
|
62 |
dictionary["EDITION"] = "NokiaInternalBuild"; |
|
63 |
dictionary["LICENSE_FILE"] = ""; // No License for nokia developers |
|
64 |
dictionary["QT_EDITION"] = "QT_EDITION_OPENSOURCE"; |
|
65 |
return; // No license key checking in internal builds |
|
66 |
} |
|
67 |
||
68 |
QString tpLicense = dictionary["QT_SOURCE_TREE"] + "/LICENSE.PREVIEW.OPENSOURCE"; |
|
69 |
if (QFile::exists(tpLicense)) { |
|
70 |
dictionary["EDITION"] = "Preview"; |
|
71 |
dictionary["LICENSE FILE"] = tpLicense; |
|
72 |
dictionary["QT_EDITION"] = "QT_EDITION_OPENSOURCE"; |
|
73 |
return; // No license key checking in Tech Preview |
|
74 |
} |
|
75 |
tpLicense = dictionary["QT_SOURCE_TREE"] + "/LICENSE.PREVIEW.COMMERCIAL"; |
|
76 |
if (QFile::exists(tpLicense)) { |
|
77 |
dictionary["EDITION"] = "Preview"; |
|
78 |
dictionary["LICENSE FILE"] = tpLicense; |
|
79 |
dictionary["QT_EDITION"] = "QT_EDITION_DESKTOP"; |
|
80 |
return; // No license key checking in Tech Preview |
|
81 |
} |
|
82 |
||
83 |
// Read in the license file |
|
84 |
QFile licenseFile(path); |
|
85 |
if( !path.isEmpty() && licenseFile.open( QFile::ReadOnly ) ) { |
|
86 |
cout << "Reading license file in....." << qPrintable(path) << endl; |
|
87 |
||
88 |
QString buffer = licenseFile.readLine(1024); |
|
89 |
while (!buffer.isEmpty()) { |
|
90 |
if( buffer[ 0 ] != '#' ) { |
|
91 |
QStringList components = buffer.split( '=' ); |
|
92 |
if ( components.size() >= 2 ) { |
|
93 |
QStringList::Iterator it = components.begin(); |
|
94 |
QString key = (*it++).trimmed().replace( "\"", QString() ).toUpper(); |
|
95 |
QString value = (*it++).trimmed().replace( "\"", QString() ); |
|
96 |
licenseInfo[ key ] = value; |
|
97 |
} |
|
98 |
} |
|
99 |
// read next line |
|
100 |
buffer = licenseFile.readLine(1024); |
|
101 |
} |
|
102 |
licenseFile.close(); |
|
103 |
} else { |
|
104 |
cout << "License file not found in " << QDir::homePath() << endl; |
|
105 |
cout << "Please put the Qt license file, '.qt-license' in your home " |
|
106 |
<< "directory and run configure again."; |
|
107 |
dictionary["DONE"] = "error"; |
|
108 |
return; |
|
109 |
} |
|
110 |
||
111 |
// Verify license info... |
|
112 |
QString licenseKey = licenseInfo["LICENSEKEYEXT"]; |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
113 |
QByteArray clicenseKey = licenseKey.toLatin1(); |
0 | 114 |
//We check the licence |
115 |
static const char * const SEP = "-"; |
|
116 |
char *licenseParts[NUMBER_OF_PARTS]; |
|
117 |
int partNumber = 0; |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
118 |
for (char *part = strtok(clicenseKey.data(), SEP); part != 0; part = strtok(0, SEP)) |
0 | 119 |
licenseParts[partNumber++] = part; |
120 |
if (partNumber < (NUMBER_OF_PARTS-1)) { |
|
121 |
dictionary["DONE"] = "error"; |
|
122 |
cout << "License file does not contain proper license key." <<partNumber<< endl; |
|
123 |
return; |
|
124 |
} |
|
125 |
||
126 |
char products = licenseParts[0][0]; |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
127 |
char* platforms = licenseParts[1]; |
0 | 128 |
char* licenseSchema = licenseParts[2]; |
129 |
char licenseFeatures = licenseParts[3][0]; |
|
130 |
||
131 |
// Determine edition --------------------------------------------------------------------------- |
|
132 |
QString licenseType; |
|
133 |
if (strcmp(licenseSchema,"F4M") == 0) { |
|
134 |
licenseType = "Commercial"; |
|
135 |
if (products == 'F') { |
|
136 |
dictionary["EDITION"] = "Universal"; |
|
137 |
dictionary["QT_EDITION"] = "QT_EDITION_UNIVERSAL"; |
|
138 |
} else if (products == 'B') { |
|
139 |
dictionary["EDITION"] = "FullFramework"; |
|
140 |
dictionary["QT_EDITION"] = "QT_EDITION_DESKTOP"; |
|
141 |
} else { |
|
142 |
dictionary["EDITION"] = "GUIFramework"; |
|
143 |
dictionary["QT_EDITION"] = "QT_EDITION_DESKTOPLIGHT"; |
|
144 |
} |
|
145 |
} else if (strcmp(licenseSchema,"Z4M") == 0 || strcmp(licenseSchema,"R4M") == 0 || strcmp(licenseSchema,"Q4M") == 0) { |
|
146 |
if (products == 'B') { |
|
147 |
dictionary["EDITION"] = "Evaluation"; |
|
148 |
dictionary["QT_EDITION"] = "QT_EDITION_EVALUATION"; |
|
7
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
149 |
licenseType = "Evaluation"; |
0 | 150 |
} |
151 |
} |
|
152 |
||
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
153 |
if (platforms[2] == 'L') { |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
154 |
static const char src[] = "8NPQRTZ"; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
155 |
static const char dst[] = "UCWX9M7"; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
156 |
const char *p = strchr(src, platforms[1]); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
157 |
platforms[1] = dst[p - src]; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
158 |
} |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
159 |
|
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
160 |
#define PL(a,b) (int(a)+int(b)*256) |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
161 |
int platformCode = PL(platforms[0],platforms[1]); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
162 |
switch (platformCode) { |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
163 |
case PL('X','9'): |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
164 |
case PL('X','C'): |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
165 |
case PL('X','U'): |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
166 |
case PL('X','W'): |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
167 |
case PL('X','M'): // old license key |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
168 |
dictionary["LICENSE_EXTENSION"] = "-ALLOS"; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
169 |
break; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
170 |
|
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
171 |
case PL('6', 'M'): |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
172 |
case PL('8', 'M'): |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
173 |
case PL('K', 'M'): // old license key |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
174 |
case PL('N', '7'): |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
175 |
case PL('N', '9'): |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
176 |
case PL('N', 'X'): |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
177 |
case PL('S', '9'): |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
178 |
case PL('S', 'C'): |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
179 |
case PL('S', 'U'): |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
180 |
case PL('S', 'W'): |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
181 |
dictionary["LICENSE_EXTENSION"] = "-EMBEDDED"; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
182 |
if (dictionary["PLATFORM NAME"].contains("Windows CE") |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
183 |
&& platformCode != PL('6', 'M') && platformCode != PL('S', '9') |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
184 |
&& platformCode != PL('S', 'C') && platformCode != PL('S', 'U') |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
185 |
&& platformCode != PL('S', 'W') && platformCode != PL('K', 'M')) { |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
186 |
dictionary["DONE"] = "error"; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
187 |
} else if (dictionary["PLATFORM NAME"].contains("Symbian") |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
188 |
&& platformCode != PL('N', '9') && platformCode != PL('S', '9') |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
189 |
&& platformCode != PL('S', 'C') && platformCode != PL('S', 'U') |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
190 |
&& platformCode != PL('S', 'W')) { |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
191 |
dictionary["DONE"] = "error"; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
192 |
} |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
193 |
break; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
194 |
case PL('R', 'M'): |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
195 |
case PL('F', 'M'): |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
196 |
dictionary["LICENSE_EXTENSION"] = "-DESKTOP"; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
197 |
if (!dictionary["PLATFORM NAME"].endsWith("Windows")) { |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
198 |
dictionary["DONE"] = "error"; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
199 |
} |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
200 |
break; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
201 |
default: |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
202 |
dictionary["DONE"] = "error"; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
203 |
break; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
204 |
} |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
205 |
#undef PL |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
206 |
|
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
207 |
if (dictionary.value("DONE") == "error") { |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
208 |
cout << "You are not licensed for the " << dictionary["PLATFORM NAME"] << " platform." << endl << endl; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
209 |
cout << "Please contact qt-info@nokia.com to upgrade your license" << endl; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
210 |
cout << "to include the " << dictionary["PLATFORM NAME"] << " platform, or install the" << endl; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
211 |
cout << "Qt Open Source Edition if you intend to develop free software." << endl; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
212 |
return; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
213 |
} |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
214 |
|
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
215 |
// Override for evaluation licenses |
7
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
216 |
if (dictionary["EDITION"] == "Evaluation") |
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
217 |
dictionary["LICENSE_EXTENSION"] = "-EVALUATION"; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
218 |
|
0 | 219 |
if (QFile::exists(dictionary["QT_SOURCE_TREE"] + "/.LICENSE")) { |
220 |
// Generic, no-suffix license |
|
221 |
dictionary["LICENSE_EXTENSION"] = QString(); |
|
222 |
} else if (dictionary["LICENSE_EXTENSION"].isEmpty()) { |
|
223 |
cout << "License file does not contain proper license key." << endl; |
|
224 |
dictionary["DONE"] = "error"; |
|
225 |
} |
|
226 |
if (licenseType.isEmpty() |
|
227 |
|| dictionary["EDITION"].isEmpty() |
|
228 |
|| dictionary["QT_EDITION"].isEmpty()) { |
|
229 |
cout << "License file does not contain proper license key." << endl; |
|
230 |
dictionary["DONE"] = "error"; |
|
231 |
return; |
|
232 |
} |
|
233 |
||
234 |
// copy one of .LICENSE-*(-US) to LICENSE |
|
235 |
QString toLicenseFile = dictionary["QT_SOURCE_TREE"] + "/LICENSE"; |
|
236 |
QString fromLicenseFile = dictionary["QT_SOURCE_TREE"] + "/.LICENSE" + dictionary["LICENSE_EXTENSION"]; |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
237 |
if (licenseFeatures == 'B' || licenseFeatures == 'G' |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
238 |
|| licenseFeatures == 'L' || licenseFeatures == 'Y') |
0 | 239 |
fromLicenseFile += "-US"; |
240 |
||
241 |
if (!CopyFile((wchar_t*)QDir::toNativeSeparators(fromLicenseFile).utf16(), |
|
242 |
(wchar_t*)QDir::toNativeSeparators(toLicenseFile).utf16(), FALSE)) { |
|
243 |
cout << "Failed to copy license file (" << fromLicenseFile << ")"; |
|
244 |
dictionary["DONE"] = "error"; |
|
245 |
return; |
|
246 |
} |
|
247 |
dictionary["LICENSE FILE"] = toLicenseFile; |
|
248 |
} |
|
249 |