Permalink
Browse files

Simplified installer targets for Windows.

- Use qmake INSTALLS to copy files
  • Loading branch information...
1 parent 5fd3d4f commit f667bc5ddf90dce511391a0aff57a7cb3fe736ca @till213 till213 committed Feb 14, 2011
View
@@ -6,7 +6,7 @@ win32 {
include(Distribution_Windows.pri)
}
-distribution.depends = all
+distribution.depends = install
installer.depends = distribution
View
@@ -1,55 +1,37 @@
#include(Common.pri)
QT_BIN_DIR = $$[QT_INSTALL_BINS]
-QT_BIN_DIR = $$replace(QT_BIN_DIR, /, \\)
QT_PLUGINS_DIR = $$[QT_INSTALL_PLUGINS]
-QT_PLUGINS_DIR = $$replace(QT_PLUGINS_DIR, /, \\)
CONFIG(debug, debug|release) {
- BIN_DIR = bin\\debug
DIST_DIR = dist
QT_CORE = QtCored4.dll
QT_GUI = QtGuid4.dll
QT_IMAGE_JPEG = qjpegd4.dll
QT_IMAGE_TIFF = qtiffd4.dll
QT_IMAGE_GIF = qgifd4.dll
- message(Distribution: DEBUG $${APP_NAME} with $${QT_BIN_DIR} and $${QT_PLUGINS_DIR})
+ message(Installer: DEBUG $${APP_NAME} with $${QT_BIN_DIR} and $${QT_PLUGINS_DIR})
} else {
- BIN_DIR = bin\\release
DIST_DIR = dist
QT_CORE = QtCore4.dll
QT_GUI = QtGui4.dll
QT_IMAGE_JPEG = qjpeg4.dll
QT_IMAGE_TIFF = qtiff4.dll
QT_IMAGE_GIF = qgif4.dll
- message(Distribution: RELEASE $${APP_NAME} with $${QT_BIN_DIR} and $${QT_PLUGINS_DIR})
+ message(Installer: RELEASE $${APP_NAME} with $${QT_BIN_DIR} and $${QT_PLUGINS_DIR})
}
#
-# Distribution
+# INSTALLS
#
-# Remove previous dist
-distribution.commands += rmdir /S /Q "$${DIST_DIR}" &
-distribution.commands += mkdir "$${DIST_DIR}" &&
+qt_lib.files = "$${QT_BIN_DIR}/$${QT_CORE}" "$${QT_BIN_DIR}/$${QT_GUI}" "$${QT_BIN_DIR}/libgcc_s_dw2-1.dll" "$${QT_BIN_DIR}/mingwm10.dll"
+qt_lib.path = "$${DIST_DIR}"
-# Copy application libraries from 'bin' to 'dist'
-distribution.commands += xcopy "$${BIN_DIR}\\*$${VERSION_MAJ}.dll" "$${DIST_DIR}" &&
+qt_img_plugins.files = "$${QT_PLUGINS_DIR}/imageformats/$${QT_IMAGE_JPEG}" "$${QT_PLUGINS_DIR}/imageformats/$${QT_IMAGE_TIFF}" "$${QT_PLUGINS_DIR}/imageformats/$${QT_IMAGE_GIF}"
+qt_img_plugins.path = "$${DIST_DIR}/imageformats"
-# Copy application binary from 'bin' to 'dist'
-distribution.commands += xcopy "$${BIN_DIR}\\$${APP_NAME}.exe" "$${DIST_DIR}" &&
-
-# Copy Qt libraries
-distribution.commands += xcopy "$${QT_BIN_DIR}\\$${QT_CORE}" "$${DIST_DIR}" &&
-distribution.commands += xcopy "$${QT_BIN_DIR}\\$${QT_GUI}" "$${DIST_DIR}" &&
-distribution.commands += xcopy "$${QT_BIN_DIR}\\libgcc_s_dw2-1.dll" "$${DIST_DIR}" &&
-distribution.commands += xcopy "$${QT_BIN_DIR}\\mingwm10.dll" "$${DIST_DIR}" &&
-
-# Copy Qt plugins
-distribution.commands += mkdir "$${DIST_DIR}\\imageformats" &&
-distribution.commands += xcopy "$${QT_PLUGINS_DIR}\\imageformats\\$${QT_IMAGE_JPEG}" "$${DIST_DIR}\\imageformats" &&
-distribution.commands += xcopy "$${QT_PLUGINS_DIR}\\imageformats\\$${QT_IMAGE_TIFF}" "$${DIST_DIR}\\imageformats" &&
-distribution.commands += xcopy "$${QT_PLUGINS_DIR}\\imageformats\\$${QT_IMAGE_GIF}" "$${DIST_DIR}\\imageformats"
+INSTALLS += qt_lib qt_img_plugins
#
# Installer
@@ -62,8 +44,8 @@ distribution.commands += xcopy "$${QT_PLUGINS_DIR}\\imageformats\\$${QT_IMAGE_GI
CONFIG(debug, debug|release) {
message("Installer: skipping this build step. Target 'Installer' can only be done in RELEASE mode.")
} else {
- installer.commands = candle.exe -nologo "Installer\\Windows\\Screenie.wxs" -out "Installer\\Windows\\Screenie.wixobj" -ext WixUIExtension &&
- installer.commands += light.exe -nologo "Installer\\Windows\\Screenie.wixobj" -out "Installer\\Windows\\Screenie.msi" -ext WixUIExtension
+ installer.commands = candle.exe -nologo "Installer/Windows/Screenie.wxs" -out "Installer/Windows/Screenie.wixobj" -ext WixUIExtension &&
+ installer.commands += light.exe -nologo "Installer/Windows/Screenie.wixobj" -out "Installer/Windows/Screenie-$${VERSION}.msi" -ext WixUIExtension
}
View
@@ -34,6 +34,9 @@ CONFIG(debug, debug|release) {
INCLUDEPATH += GeneratedFiles/release
}
+target.path = $$PWD/../dist
+INSTALLS += target
+
unix:linux* {
QMAKE_CXXFLAGS += -Wall -Woverloaded-virtual -Wno-deprecated -Wuninitialized -O
QMAKE_CFLAGS += -Wstrict-prototypes -Wmissing-prototypes
View
@@ -21,3 +21,4 @@ macx {
message(Building $$TARGET in release mode)
}
}
+
@@ -743,13 +743,15 @@ void MainWindow::on_aboutAction_triggered()
QString description = tr("A fancy screenshot composer");
QString authors1 = tr("Developed by Till Oliver Knoll");
QString authors2 = tr("Idea by Ariya Hidayat");
- QString versionNumber = tr("Version %1").arg(version.toString());
+ QString versionString = tr("Version %1").arg(Version::getUserVersion());
QString aboutText = QString("<b>") + Version::getApplicationName() + "</b><br />" +
description + "<br /><br />" +
- authors1 + "<br />" +
+ "<font style=\"font-weight:normal;\">" + authors1 + "<br />" +
authors2 + "<br /><br />" +
- Version::getApplicationName() + "\"" + Version::getCodeName() + "\"<br />" +
- versionNumber;
+ Version::getApplicationName() + "<br />" +
+ versionString + "<br />" +
+ "\"" + Version::getCodeName() + "\"</font><br />" +
+ "<font style=\"font-weight:normal;color:#aaa;\">" + version.toString() + "</font>";
QMessageBox::about(this, tr("About %1").arg(Version::getApplicationName()), aboutText);
}
@@ -283,7 +283,7 @@
<x>0</x>
<y>0</y>
<width>448</width>
- <height>22</height>
+ <height>20</height>
</rect>
</property>
<widget class="QMenu" name="menu_File">
@@ -418,6 +418,9 @@
<property name="text">
<string>&amp;Export Image</string>
</property>
+ <property name="toolTip">
+ <string>Export Image ...</string>
+ </property>
</action>
<action name="aboutQtAction">
<property name="text">
@@ -41,6 +41,7 @@ class VersionPrivate
static const int Minor;
static const int Subminor;
static const QString CodeName;
+ static const QString UserVersion;
static const QString ApplicationTitle;
};
@@ -49,7 +50,8 @@ const int VersionPrivate::Major = 1;
const int VersionPrivate::Minor = 0;
const int VersionPrivate::Subminor = 0;
const QString VersionPrivate::CodeName = QString("Anarchic Amoeba");
-const QString VersionPrivate::ApplicationTitle = "Screenie"; // note: no translation here (i18n)
+const QString VersionPrivate::UserVersion = QString("11.02");
+const QString VersionPrivate::ApplicationTitle = QString("Screenie"); // note: no translation here (i18n)
// public
@@ -141,6 +143,11 @@ QString Version::getCodeName()
return VersionPrivate::CodeName;
}
+QString Version::getUserVersion()
+{
+ return VersionPrivate::UserVersion;
+}
+
QString Version::getApplicationName()
{
return VersionPrivate::ApplicationTitle;
View
@@ -111,6 +111,15 @@ class Version
UTILS_API static QString getCodeName();
/*!
+ * A "fancy user readable version" which follows the pattern yy.mm.
+ *
+ * Example: 11.02 (= "released February 2011")
+ *
+ * \return a QString containing the "user readable version"
+ */
+ UTILS_API static QString getUserVersion();
+
+ /*!
* Returns the application name which can be displayed in dialog captions.
*
* \return a QString containing the application name

0 comments on commit f667bc5

Please sign in to comment.