comparison ui/createinstallerdialog.cpp @ 518:31e0a86f5a35

Actually set the arguments for makensis process. Fix escaping
author Andre Heinecke <aheinecke@intevation.de>
date Tue, 29 Apr 2014 09:25:51 +0000
parents 3332db04c77d
children f6371e9c959a
comparison
equal deleted inserted replaced
517:a3e027cd0683 518:31e0a86f5a35
157 QMessageBox::warning(this, tr("Error!"), msg); 157 QMessageBox::warning(this, tr("Error!"), msg);
158 } 158 }
159 159
160 void CreateInstallerDialog::processFinished(int exitCode, QProcess::ExitStatus exitStatus) 160 void CreateInstallerDialog::processFinished(int exitCode, QProcess::ExitStatus exitStatus)
161 { 161 {
162 qDebug() << "Finished: " << mNSISProc.readAll();
162 mProgress.cancel(); 163 mProgress.cancel();
163 } 164 }
164 165
165 void CreateInstallerDialog::processError(QProcess::ProcessError error) 166 void CreateInstallerDialog::processError(QProcess::ProcessError error)
166 { 167 {
168 qDebug() << "Error: " << mNSISProc.readAll();
167 mProgress.cancel(); 169 mProgress.cancel();
168 } 170 }
169 171
170 void CreateInstallerDialog::createInstaller() 172 void CreateInstallerDialog::createInstaller()
171 { 173 {
193 } 195 }
194 196
195 /* Copy windows directory contents to tmpdir */ 197 /* Copy windows directory contents to tmpdir */
196 QStringList arguments; 198 QStringList arguments;
197 mNSISProc.setProgram("makensis"); 199 mNSISProc.setProgram("makensis");
200 mNSISProc.setProcessChannelMode(QProcess::MergedChannels);
198 mNSISProc.setWorkingDirectory(outDir.path()); 201 mNSISProc.setWorkingDirectory(outDir.path());
199 arguments << QString::fromLatin1("-Dfiles_dir=") + binDir.path() + "/windows"; 202 arguments << QString::fromLatin1("-Dfiles_dir=") + binDir.path() + "/windows";
200
201 foreach (const QString &key, keys) { 203 foreach (const QString &key, keys) {
202 arguments << QString::fromLatin1("-D%1=\"%2\"").arg(key, 204 arguments << QString::fromLatin1("-D%1=%2").arg(key,
203 options.value(key, QString()).toString()); 205 options.value(key, QString()).toString());
204 } 206 }
205 207
206 arguments << binDir.path() + "/trustbridge.nsi"; 208 arguments << binDir.path() + "/trustbridge.nsi";
207 209
210 qDebug() << "Starting makensis with arguments: " << arguments;
211 mNSISProc.setArguments(arguments);
208 mNSISProc.start(); 212 mNSISProc.start();
209 mProgress.show(); 213 mProgress.show();
210 214
211 if (!mNSISProc.waitForStarted() || 215 if (!mNSISProc.waitForStarted() ||
212 mNSISProc.state() == QProcess::NotRunning) { 216 mNSISProc.state() == QProcess::NotRunning) {
213 showErrorMessage(tr("Failed to start makensis.\n" 217 showErrorMessage(tr("Failed to start makensis.\n"
214 "Please ensure that makensis is installed and in your PATH variable.")); 218 "Please ensure that makensis is installed and in your PATH variable."));
215 } 219 }
216 220 }
217
218
219
220 }

http://wald.intevation.org/projects/trustbridge/