#Build files, libs, executables
libQtZip*.*
Makefile*
-msmoke
-msmoke.exe
-msmoke.app
.ctmp
core
core.*
debian/*substvars
debian/magicsmoke2-*
bin/*
+magicsmoke.xml
+*.zip
#Unit Test Environment
tests/apache/*pid
<!-- build/meta file: installDate==buildDate, it is changed during installation -->
<CurrentVersion buildDate="2013-01-21" installDate="2013-01-22" version="1.99beta" mrv="199-20130121"/>
<!-- in the build/meta file this is a template for config, it is copied to the installation -->
- <Settings baseurl="http://localhost/~konrad" indexfile="magicsmoke.xml" pollinterval="30"/>
+ <Settings baseurl="http://localhost/~konrad" indexfile="magicsmoke.xml" pollinterval="30" fulltargetdir="dist-*"/>
<!-- this is the build file version: tell the system how to compile each distri
the name is changed to include the platform if you include a * at that position
os="..." - operating system, "linux", "windows", "any", "all"
any=same for all OS, separate archive files
all=same for all OS, just one archive file for all of them
- prepare="..." - optional script or command executed before archiving
-->
- <Platform os="linux" prepare="strip *">
- magicsmoke
- gpg
- lib*.so*
+ <Platform os="linux">
+ <Files exclude="*.debug">
+ magicsmoke
+ gpg
+ lib*.so*
+ </Files>
</Platform>
<Platform os="windows">
- *.exe
- *.dll
+ <Files>
+ *.exe
+ *.dll
+ </Files>
</Platform>
</ArchiveSource>
<ArchiveSource name="distkeys.zip" buildbase="install-gpg" zipbase="aurora-gpg">
<!-- this one uses pipe-syntax to get to the main path and it also uses additional <Files> tags to drill deeper -->
<ArchiveSource name="qtlibs-*.zip" buildbase="|qmake -query QT_INSTALL_PREFIX">
<Platform os="linux">
- <Files buildbase="./lib">
+ <Files buildbase="./lib" exclude="*.debug">
libQt5Core.so*
libQt5Gui.so*
libQt5Network.so*
libQt5Xml.so*
libQt5Svg.so*
</Files>
- <Files buildbase="./plugins">
+ <Files buildbase="./plugins" exclude="*.debug">
platforms/*.so
platforminputcontexts/*.so
imageformats/*.so
</Files>
</Platform>
</ArchiveSource>
-
- <!-- this is the result in the meta or installed file -->
- <Archive name="magicsmoke-linux-x86.zip" size="12345678" sha1sum="1635ecd482608a93d522a11326e22409ff7d255d" os="linux" cpu="x86"/>
- <Archive name="distkeys.zip" size="1234" sha1sum="d255d1635ecd482608a93d522a11326e22409ff7" os="linux" cpu="all"/>
- <Archive name="magicsmoke-windows-x86.zip" size="15675670" sha1sum="522a11326e22163482608a93d409ff7d255d5ecd" os="windows" cpu="x86"/>
</AuroraInfo>
#make sure we find our libs
QMAKE_LFLAGS += -Wl,-rpath,\'\$$ORIGIN\'
}
+#protect the stack
+QMAKE_CFLAGS += -fstack-protector-all -Wstack-protector
+QMAKE_CXXFLAGS += -fstack-protector-all -Wstack-protector
+
+#ASLR for windows
+win32 {
+ QMAKE_LFLAGS += -Wl,--nxcompat -Wl,--dynamicbase
+}
void MApplication::initUpdater()
{
- updater=new Aurora;
- //TODO: read a local XML file to set Aurora
+ updater=new Aurora(applicationDirPath()+"/magicsmoke.xml",this);
+ connect(updater,SIGNAL(newVersionAvailable(QString)),this,SLOT(updateReadyDownload(QString)));
+ connect(updater,SIGNAL(readyForInstallation()),this,SLOT(updaterReadyInstall()));
+ connect(updater,SIGNAL(installationFinished()),this,SLOT(updaterCompleted()));
+ connect(updater,SIGNAL(downloadFailed()),this,SLOT(updaterFailed()));
+ connect(updater,SIGNAL(installationFailed()),this,SLOT(updaterFailed()));
+ //we ignore all errors that happen prior to successful verification, since they
+ //would create too much noise
}
+void MApplication::updateReadyDownload(const QString& v)
+{
+ qDebug()<<"Asking for Download permission";
+ QMessageBox::StandardButton r=QMessageBox::question(0,tr("New Update"),tr("A new version of MagicSmoke is available. Do you want to download the new version %1?").arg(v),QMessageBox::Yes|QMessageBox::No,QMessageBox::Yes);
+ if(r==QMessageBox::Yes)
+ updater->startDownload();
+}
+
+void MApplication::updaterReadyInstall()
+{
+ QMessageBox::Button r=QMessageBox::question(0,tr("New Update"),tr("A new version of MagicSmoke is ready for installation. Do you want to install?"),QMessageBox::Yes|QMessageBox::No,QMessageBox::Yes);
+ if(r==QMessageBox::Yes)
+ updater->startInstallation();
+}
+
+void MApplication::updaterCompleted()
+{
+ QMessageBox::information(0,tr("Update Complete"),tr("A new version of MagicSmoke has been installed. It will be used the next time you start MagicSmoke."));
+}
+
+void MApplication::updaterFailed()
+{
+ QMessageBox::warning(0,tr("Update Failed"),tr("An update of MagicSmoke failed."));
+}
QString MApplication::dataDir()
{
///initialize the updater
void initUpdater();
+ ///updater is ready for download
+ void updateReadyDownload(const QString&);
+ ///updater is ready for install
+ void updaterReadyInstall();
+ ///update complete
+ void updaterCompleted();
+ ///something failed for the updater
+ void updaterFailed();
+
private:
EFilter *ef=nullptr;
QTranslator*qttrans=nullptr,*mstrans=nullptr;
#make sure dependencies are found
DEPENDPATH += $$INCLUDEPATH
LIBS += -L$$PWD/../bin
+
+#protect the stack
+QMAKE_CFLAGS += -fstack-protector-all -Wstack-protector
+QMAKE_CXXFLAGS += -fstack-protector-all -Wstack-protector
+win32 {
+ QMAKE_LFLAGS += -Wl,--nxcompat
+}
-Subproject commit 8db2c6440c48b05426855aa64a1ce7673a754e2f
+Subproject commit 98700f93f1c6bb32761da38b7d5b8d2a71da91ef