aboutsummaryrefslogtreecommitdiffstats
path: root/SQLiteStudio3/UpdateSQLiteStudio
diff options
context:
space:
mode:
Diffstat (limited to 'SQLiteStudio3/UpdateSQLiteStudio')
-rw-r--r--SQLiteStudio3/UpdateSQLiteStudio/UpdateSQLiteStudio.exe.manifest19
-rw-r--r--SQLiteStudio3/UpdateSQLiteStudio/UpdateSQLiteStudio.pro39
-rw-r--r--SQLiteStudio3/UpdateSQLiteStudio/main.cpp49
-rw-r--r--SQLiteStudio3/UpdateSQLiteStudio/windows.manifest.autosave19
-rw-r--r--SQLiteStudio3/UpdateSQLiteStudio/windows.rc3
5 files changed, 129 insertions, 0 deletions
diff --git a/SQLiteStudio3/UpdateSQLiteStudio/UpdateSQLiteStudio.exe.manifest b/SQLiteStudio3/UpdateSQLiteStudio/UpdateSQLiteStudio.exe.manifest
new file mode 100644
index 0000000..54081e5
--- /dev/null
+++ b/SQLiteStudio3/UpdateSQLiteStudio/UpdateSQLiteStudio.exe.manifest
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
+ <assemblyIdentity version="3.0.0.0" processorArchitecture="X86"
+ name="pl.sqlitestudio.UpdateSQLiteStudio" type="win32" />
+ <description>SQLiteStudio updater</description>
+ <dependency />
+ <!-- Identify the application security requirements. -->
+ <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
+ <security>
+ <requestedPrivileges>
+ <requestedExecutionLevel
+ level="requireAdministrator"
+ uiAccess="false"/>
+ </requestedPrivileges>
+ </security>
+ </trustInfo>
+ <!-- padding to four-byte multiple file size including the byte order mark -->
+ <!-- padding 123 -->
+</assembly>
diff --git a/SQLiteStudio3/UpdateSQLiteStudio/UpdateSQLiteStudio.pro b/SQLiteStudio3/UpdateSQLiteStudio/UpdateSQLiteStudio.pro
new file mode 100644
index 0000000..93a7a59
--- /dev/null
+++ b/SQLiteStudio3/UpdateSQLiteStudio/UpdateSQLiteStudio.pro
@@ -0,0 +1,39 @@
+#-------------------------------------------------
+#
+# Project created by QtCreator 2014-08-29T20:30:14
+#
+#-------------------------------------------------
+
+include($$PWD/../dirs.pri)
+include($$PWD/../utils.pri)
+
+QT += core
+QT -= gui
+
+TARGET = UpdateSQLiteStudio
+#CONFIG += console
+CONFIG -= app_bundle
+
+CONFIG += c++11
+QMAKE_CXXFLAGS += -pedantic
+
+LIBS += -lcoreSQLiteStudio
+
+TEMPLATE = app
+
+linux|portable {
+ QMAKE_LFLAGS += -Wl,-rpath,./lib
+}
+
+
+win32: {
+ RC_FILE = windows.rc
+}
+
+SOURCES += main.cpp
+
+OTHER_FILES += \
+ windows.rc \
+ UpdateSQLiteStudio.exe.manifest
+
+HEADERS +=
diff --git a/SQLiteStudio3/UpdateSQLiteStudio/main.cpp b/SQLiteStudio3/UpdateSQLiteStudio/main.cpp
new file mode 100644
index 0000000..e5730d3
--- /dev/null
+++ b/SQLiteStudio3/UpdateSQLiteStudio/main.cpp
@@ -0,0 +1,49 @@
+#include "services/updatemanager.h"
+#include <QCoreApplication>
+#include <QStringList>
+#include <QDebug>
+#include <QTimer>
+#include <QDir>
+#include <QTextStream>
+
+int main(int argc, char *argv[])
+{
+ QCoreApplication app(argc, argv);
+
+ QString path = app.applicationDirPath() + QLatin1Char('/') + UpdateManager::WIN_INSTALL_FILE;
+ QFile installFile(path);
+ if (QFileInfo(path).isReadable())
+ {
+ installFile.open(QIODevice::ReadOnly);
+ QTextStream inStr(&installFile);
+ QString option = inStr.readLine();
+ QString backupDir = inStr.readLine();
+ QString appDir = inStr.readLine();
+ installFile.close();
+ installFile.remove();
+
+ QString tempDir = app.applicationDirPath();
+ if (option == UpdateManager::UPDATE_OPTION_NAME)
+ {
+ bool res = UpdateManager::executeFinalStep(tempDir, backupDir, appDir);
+ if (res)
+ {
+ QFile doneFile(appDir + QLatin1Char('/') + UpdateManager::WIN_UPDATE_DONE_FILE);
+ doneFile.open(QIODevice::WriteOnly);
+ doneFile.close();
+ }
+ else
+ qCritical() << QString("Could not execute final step with root priviledges: %1").arg(UpdateManager::getStaticErrorMessage());
+ }
+ else
+ {
+ qCritical() << QString("Option passed to updater not matched: '%1' != '%2'").arg(option, UpdateManager::UPDATE_OPTION_NAME);
+ }
+ }
+ else
+ {
+ qCritical() << QString("Updater installation file (%1) was not readable.").arg(path);
+ }
+
+ return 0;
+}
diff --git a/SQLiteStudio3/UpdateSQLiteStudio/windows.manifest.autosave b/SQLiteStudio3/UpdateSQLiteStudio/windows.manifest.autosave
new file mode 100644
index 0000000..788fba6
--- /dev/null
+++ b/SQLiteStudio3/UpdateSQLiteStudio/windows.manifest.autosave
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
+ <assemblyIdentity version="2.0.0.0" processorArchitecture="X86"
+ name="gokulnathvc.coolapp" type="win32" />
+ <description>Gokulnathvc Really Cool App</description>
+ <dependency />
+ <!-- Identify the application security requirements. -->
+ <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
+ <security>
+ <requestedPrivileges>
+ <requestedExecutionLevel
+ level="asInvoker"
+ uiAccess="false"/>
+ </requestedPrivileges>
+ </security>
+ </trustInfo>
+ <!-- padding to four-byte multiple file size including the byte order mark -->
+ <!-- padding 123 -->
+</assembly> \ No newline at end of file
diff --git a/SQLiteStudio3/UpdateSQLiteStudio/windows.rc b/SQLiteStudio3/UpdateSQLiteStudio/windows.rc
new file mode 100644
index 0000000..1e4ed25
--- /dev/null
+++ b/SQLiteStudio3/UpdateSQLiteStudio/windows.rc
@@ -0,0 +1,3 @@
+#include <windows.h>
+
+CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "UpdateSQLiteStudio.exe.manifest"