summaryrefslogtreecommitdiffstats
path: root/examples/modifyextract
diff options
context:
space:
mode:
Diffstat (limited to 'examples/modifyextract')
-rw-r--r--examples/modifyextract/README6
-rw-r--r--examples/modifyextract/config/config.xml9
-rw-r--r--examples/modifyextract/packages/org.qtproject.ifw.example.modifyextract/data/my_content/test.txt1
-rw-r--r--examples/modifyextract/packages/org.qtproject.ifw.example.modifyextract/meta/installscript.js12
-rw-r--r--examples/modifyextract/packages/org.qtproject.ifw.example.modifyextract/meta/package.xml8
5 files changed, 36 insertions, 0 deletions
diff --git a/examples/modifyextract/README b/examples/modifyextract/README
new file mode 100644
index 000000000..60c3588d4
--- /dev/null
+++ b/examples/modifyextract/README
@@ -0,0 +1,6 @@
+Create an installer that uses the extract archive hook to modify the target path.
+
+Generate installer with
+
+binarycreator --offline-only -c config/config.xml -p packages installer
+
diff --git a/examples/modifyextract/config/config.xml b/examples/modifyextract/config/config.xml
new file mode 100644
index 000000000..bb2c18ce4
--- /dev/null
+++ b/examples/modifyextract/config/config.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Installer>
+ <Name>Modify extract Installer Example</Name>
+ <Version>1.0.0</Version>
+ <Title>Modify extract Installer Example</Title>
+ <Publisher>Qt-Project</Publisher>
+ <StartMenuDir>Qt Installer Framework Example</StartMenuDir>
+ <TargetDir>@homeDir@/IFWModifyExtractInstallerExample</TargetDir>
+</Installer>
diff --git a/examples/modifyextract/packages/org.qtproject.ifw.example.modifyextract/data/my_content/test.txt b/examples/modifyextract/packages/org.qtproject.ifw.example.modifyextract/data/my_content/test.txt
new file mode 100644
index 000000000..4be609dcc
--- /dev/null
+++ b/examples/modifyextract/packages/org.qtproject.ifw.example.modifyextract/data/my_content/test.txt
@@ -0,0 +1 @@
+test test test test test test test test \ No newline at end of file
diff --git a/examples/modifyextract/packages/org.qtproject.ifw.example.modifyextract/meta/installscript.js b/examples/modifyextract/packages/org.qtproject.ifw.example.modifyextract/meta/installscript.js
new file mode 100644
index 000000000..59f5ee2bc
--- /dev/null
+++ b/examples/modifyextract/packages/org.qtproject.ifw.example.modifyextract/meta/installscript.js
@@ -0,0 +1,12 @@
+function Component()
+{
+}
+
+Component.prototype.createOperationsForArchive = function(archive)
+{
+ // don't use the default operation
+ // component.createOperationsForArchive(archive);
+
+ // add an extract operation with a modified path
+ component.addOperation("Extract", archive, "@TargetDir@/extractToAnotherPath");
+}
diff --git a/examples/modifyextract/packages/org.qtproject.ifw.example.modifyextract/meta/package.xml b/examples/modifyextract/packages/org.qtproject.ifw.example.modifyextract/meta/package.xml
new file mode 100644
index 000000000..b6b007067
--- /dev/null
+++ b/examples/modifyextract/packages/org.qtproject.ifw.example.modifyextract/meta/package.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0"?>
+<Package>
+ <DisplayName>modify extract operation</DisplayName>
+ <Description>A component that uses a hook to modify the extract operation.</Description>
+ <Version>1.0.1</Version>
+ <ReleaseDate>2013-02-27</ReleaseDate>
+ <Script>installscript.js</Script>
+</Package>