finish auto-installer
authorKonrad Rosenbaum <konrad@silmor.de>
Wed, 14 Aug 2013 15:57:53 +0000 (17:57 +0200)
committerKonrad Rosenbaum <konrad@silmor.de>
Wed, 14 Aug 2013 15:57:53 +0000 (17:57 +0200)
.gitignore
magicsmoke.aurora
mainapp/mainapp.pro
src/main.cpp
src/main.h
src/smoke.pro
taurus

index 0f15957..b1d7698 100644 (file)
@@ -7,9 +7,6 @@
 #Build files, libs, executables
 libQtZip*.*
 Makefile*
-msmoke
-msmoke.exe
-msmoke.app
 .ctmp
 core
 core.*
@@ -44,6 +41,8 @@ debian/*log
 debian/*substvars
 debian/magicsmoke2-*
 bin/*
+magicsmoke.xml
+*.zip
 
 #Unit Test Environment
 tests/apache/*pid
index 6abd186..69a34d0 100644 (file)
@@ -2,7 +2,7 @@
         <!-- 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">
@@ -42,7 +45,7 @@
         <!-- 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*
@@ -53,7 +56,7 @@
                                 libQt5Xml.so*
                                 libQt5Svg.so*
                         </Files>
-                        <Files buildbase="./plugins">
+                        <Files buildbase="./plugins" exclude="*.debug">
                                 platforms/*.so
                                 platforminputcontexts/*.so
                                 imageformats/*.so
@@ -87,9 +90,4 @@
                         </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>
index f3a0d25..8edd67d 100644 (file)
@@ -34,3 +34,11 @@ linux-g++* {
   #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
+}
index da5d776..12a88fc 100644 (file)
@@ -356,10 +356,40 @@ void MApplication::initialize()
 
 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()
 {
index 42d5ad7..98e2556 100644 (file)
@@ -75,6 +75,15 @@ class MAGICSMOKE_EXPORT MApplication:public QApplication
                 ///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;
index 97d046f..b9ca79d 100644 (file)
@@ -49,3 +49,10 @@ include(wob/wob.pri)
 #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
+}
diff --git a/taurus b/taurus
index 8db2c64..98700f9 160000 (submodule)
--- a/taurus
+++ b/taurus
@@ -1 +1 @@
-Subproject commit 8db2c6440c48b05426855aa64a1ce7673a754e2f
+Subproject commit 98700f93f1c6bb32761da38b7d5b8d2a71da91ef