comparison ui/createinstallerdialog.h @ 571:6c4fff146999

Implement codesigning in the administrator tool
author Andre Heinecke <aheinecke@intevation.de>
date Fri, 23 May 2014 16:17:18 +0000
parents f6371e9c959a
children 49168bcb02e2
comparison
equal deleted inserted replaced
570:c9d296f04995 571:6c4fff146999
11 #include <QDialog> 11 #include <QDialog>
12 #include <QMainWindow> 12 #include <QMainWindow>
13 #include <QLineEdit> 13 #include <QLineEdit>
14 #include <QProcess> 14 #include <QProcess>
15 #include <QProgressDialog> 15 #include <QProgressDialog>
16 #include <QDir>
16 /** 17 /**
17 * @file createinstallerdialog.h 18 * @file createinstallerdialog.h
18 * @brief The dialog to show settings and create an installer. 19 * @brief The dialog to show settings and create an installer.
19 */ 20 */
20 21
21 class QListWidget; 22 class QListWidget;
23 class QTemporaryDir;
22 24
23 class CreateInstallerDialog : public QDialog 25 class CreateInstallerDialog : public QDialog
24 { 26 {
25 Q_OBJECT 27 Q_OBJECT
26 public: 28 public:
36 QLineEdit *mBinaryFolder; 38 QLineEdit *mBinaryFolder;
37 QLineEdit *mSaveFile; 39 QLineEdit *mSaveFile;
38 40
39 QProcess mNSISProc; 41 QProcess mNSISProc;
40 QProgressDialog mProgress; 42 QProgressDialog mProgress;
43 QString mInstallerPath;
44 QTemporaryDir *mCurrentWorkingDir;
41 45
42 /** @brief show an error message with QMessageBox 46 /** @brief show an error message with QMessageBox
43 * 47 *
44 * @param [in] msg The message to show 48 * @param [in] msg The message to show
45 */ 49 */
47 51
48 private slots: 52 private slots:
49 void openCertificateSelect(); 53 void openCertificateSelect();
50 void openFolderSelect(); 54 void openFolderSelect();
51 void openSaveLocation(); 55 void openSaveLocation();
56
57 /**@brief entry point for installer creation
58 *
59 * check the selected parameters (certificate / folder etc.) and
60 * create the nsis installer. This also creates the signatures. */
52 void createInstaller(); 61 void createInstaller();
62
63 /**@brief Create tempoary dir with signed binaries from sourcedir
64 *
65 * Copies all files from the sourceDir to a temporary directory
66 * and signs all .exe files in that directory.
67 *
68 * The caller needs to delete the temporary directory. If an error
69 * occurs NULL is returned.
70 *
71 * @param[in] sourceDir the directory with the binaries to sign
72 * @returns a pointer to a temporary dir containing the signed binaries
73 * or NULL.
74 */
75 QTemporaryDir *codesignBinaries(const QDir& sourceDir);
76
77 /**@brief Sign a file with the codesigning certificate from mCertFile
78 *
79 * Calls osslsigncode to sign the file pointed to in filePath.
80 * The signing operation is logged.
81 *
82 * Sign information (hash algo / publisher / url) can be set at
83 * build time or in the settings with the variables:
84 *
85 * sign_hash # the hash algorithm to use. Values are the same as in singtool
86 * sign_publisher # the publisher information
87 * sign_url # the product url to use in the signature
88 *
89 * @param[in] filePath the absolute path to the file.
90 * @returns true on success, false on error
91 */
92 bool signFile(QString filePath);
53 93
54 /* Slots for the creator process */ 94 /* Slots for the creator process */
55 void processError(QProcess::ProcessError error); 95 void processError(QProcess::ProcessError error);
56 void processFinished(int exitCode, QProcess::ExitStatus exitStatus); 96 void processFinished(int exitCode, QProcess::ExitStatus exitStatus);
57 }; 97 };

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