Commit 7690de0d authored by con's avatar con
Browse files

Sign the sis package (self signed at the moment).

parent 953aeed1
...@@ -273,6 +273,15 @@ S60DeviceRunControl::S60DeviceRunControl(QSharedPointer<RunConfiguration> runCon ...@@ -273,6 +273,15 @@ S60DeviceRunControl::S60DeviceRunControl(QSharedPointer<RunConfiguration> runCon
this, SLOT(makesisProcessFailed())); this, SLOT(makesisProcessFailed()));
connect(m_makesis, SIGNAL(finished(int,QProcess::ExitStatus)), connect(m_makesis, SIGNAL(finished(int,QProcess::ExitStatus)),
this, SLOT(makesisProcessFinished())); this, SLOT(makesisProcessFinished()));
m_signsis = new QProcess(this);
connect(m_signsis, SIGNAL(readyReadStandardError()),
this, SLOT(readStandardError()));
connect(m_signsis, SIGNAL(readyReadStandardOutput()),
this, SLOT(readStandardOutput()));
connect(m_signsis, SIGNAL(error(QProcess::ProcessError)),
this, SLOT(signsisProcessFailed()));
connect(m_signsis, SIGNAL(finished(int,QProcess::ExitStatus)),
this, SLOT(signsisProcessFinished()));
} }
void S60DeviceRunControl::start() void S60DeviceRunControl::start()
...@@ -280,14 +289,16 @@ void S60DeviceRunControl::start() ...@@ -280,14 +289,16 @@ void S60DeviceRunControl::start()
QSharedPointer<S60DeviceRunConfiguration> rc = runConfiguration().dynamicCast<S60DeviceRunConfiguration>(); QSharedPointer<S60DeviceRunConfiguration> rc = runConfiguration().dynamicCast<S60DeviceRunConfiguration>();
Q_ASSERT(!rc.isNull()); Q_ASSERT(!rc.isNull());
Qt4Project *project = qobject_cast<Qt4Project *>(runConfiguration()->project());
m_baseFileName = rc->basePackageFilePath(); m_baseFileName = rc->basePackageFilePath();
m_workingDirectory = QFileInfo(m_baseFileName).absolutePath(); m_workingDirectory = QFileInfo(m_baseFileName).absolutePath();
m_qtDir = project->qtVersion(project->activeBuildConfiguration())->path();
emit started(); emit started();
emit addToOutputWindow(this, tr("Creating %1.sisx ...").arg(QDir::toNativeSeparators(m_baseFileName))); emit addToOutputWindow(this, tr("Creating %1.sisx ...").arg(QDir::toNativeSeparators(m_baseFileName)));
Qt4Project *project = qobject_cast<Qt4Project *>(runConfiguration()->project());
Q_ASSERT(project); Q_ASSERT(project);
m_toolsDirectory = S60Manager::instance()->devices()->deviceForId( m_toolsDirectory = S60Manager::instance()->devices()->deviceForId(
S60Manager::instance()->deviceIdFromDetectionSource( S60Manager::instance()->deviceIdFromDetectionSource(
...@@ -328,23 +339,45 @@ void S60DeviceRunControl::readStandardOutput() ...@@ -328,23 +339,45 @@ void S60DeviceRunControl::readStandardOutput()
} }
void S60DeviceRunControl::makesisProcessFailed() void S60DeviceRunControl::makesisProcessFailed()
{
processFailed("makesis.exe", m_makesis->error());
}
void S60DeviceRunControl::makesisProcessFinished()
{
QString signsisTool = m_toolsDirectory + "/signsis.exe";
QString sisFile = QFileInfo(m_baseFileName + ".sis").fileName();
QString sisxFile = QFileInfo(m_baseFileName + ".sisx").fileName();
QStringList arguments;
arguments << sisFile << sisxFile << (m_qtDir + "/selfsigned.cer") << (m_qtDir + "/selfsigned.key");
m_signsis->setWorkingDirectory(m_workingDirectory);
emit addToOutputWindow(this, QString::fromLatin1("%1 %2").arg(signsisTool, arguments.join(tr(" "))));
m_signsis->start(signsisTool, arguments, QIODevice::ReadOnly);
}
void S60DeviceRunControl::signsisProcessFailed()
{
processFailed("signsis.exe", m_signsis->error());
}
void S60DeviceRunControl::signsisProcessFinished()
{
emit addToOutputWindow(this, tr("Finished."));
emit finished();
}
void S60DeviceRunControl::processFailed(const QString &program, QProcess::ProcessError errorCode)
{ {
QString errorString; QString errorString;
switch (m_makesis->error()) { switch (errorCode) {
case QProcess::FailedToStart: case QProcess::FailedToStart:
errorString = tr("Failed to start makesis.exe."); errorString = tr("Failed to start %1.");
break; break;
case QProcess::Crashed: case QProcess::Crashed:
errorString = tr("makesis.exe has unexpectedly finished."); errorString = tr("%1 has unexpectedly finished.");
break; break;
default: default:
errorString = tr("Some error has occurred while running makesis.exe."); errorString = tr("Some error has occurred while running %1.");
} }
error(this, errorString); error(this, errorString.arg(program));
}
void S60DeviceRunControl::makesisProcessFinished()
{
emit addToOutputWindow(this, tr("Finished."));
emit finished();
} }
...@@ -96,11 +96,16 @@ private slots: ...@@ -96,11 +96,16 @@ private slots:
void readStandardOutput(); void readStandardOutput();
void makesisProcessFailed(); void makesisProcessFailed();
void makesisProcessFinished(); void makesisProcessFinished();
void signsisProcessFailed();
void signsisProcessFinished();
private: private:
void processFailed(const QString &program, QProcess::ProcessError errorCode);
QString m_baseFileName; QString m_baseFileName;
QString m_workingDirectory; QString m_workingDirectory;
QString m_toolsDirectory; QString m_toolsDirectory;
QString m_qtDir;
QProcess *m_makesis; QProcess *m_makesis;
QProcess *m_signsis; QProcess *m_signsis;
QProcess *m_install; QProcess *m_install;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment