summary refs log tree commit diff
path: root/deploy/installer/controlscript.qs
diff options
context:
space:
mode:
Diffstat (limited to 'deploy/installer/controlscript.qs')
-rw-r--r--deploy/installer/controlscript.qs25
1 files changed, 25 insertions, 0 deletions
diff --git a/deploy/installer/controlscript.qs b/deploy/installer/controlscript.qs
new file mode 100644
index 00000000..a53c3e99
--- /dev/null
+++ b/deploy/installer/controlscript.qs
@@ -0,0 +1,25 @@
+/**
+ * Source: http://stackoverflow.com/questions/21389105/qt-installer-framework-offline-update-how
+ */
+
+function Controller()
+{
+}
+
+Controller.prototype.TargetDirectoryPageCallback = function()
+{
+    var widget = gui.currentPageWidget();
+    widget.TargetDirectoryLineEdit.textChanged.connect( this, Controller.prototype.targetChanged );
+    Controller.prototype.targetChanged( widget.TargetDirectoryLineEdit.text );
+}
+
+Controller.prototype.targetChanged = function( text )
+{
+    if( text != "" && installer.fileExists(text + "/components.xml") )
+	{
+        if( QMessageBox.question("PreviousInstallation", "Previous installation detected", "Do you want to uninstall the previous installation?", QMessageBox.Yes | QMessageBox.No) == QMessageBox.Yes )
+		{
+            installer.execute( text+"/maintenancetool.exe", new Array("--script", text+"/uninstall.qs") )
+		}
+    }
+}