summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorTim Jenssen <tim.jenssen@digia.com>2013-02-27 12:26:18 +0100
committerKai Koehne <kai.koehne@digia.com>2013-02-28 15:53:31 +0100
commite5055c0a7c3db96a816b85070b366fa1675f0680 (patch)
treeab329939368aee468a2824f6771ca3696dbd7b98 /examples
parente094c0c0fa72d6b51e3d583374985efb614804db (diff)
Example for registering a Start Menu entry
Change-Id: I993d1e8b64ea9265d8e06b1f565d5d0504aedd61 Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com> Reviewed-by: Niels Weber <niels.weber@digia.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/startmenu/README6
-rw-r--r--examples/startmenu/config/config.xml10
-rw-r--r--examples/startmenu/packages/org.qtproject.ifw.example/data/README.txt2
-rw-r--r--examples/startmenu/packages/org.qtproject.ifw.example/meta/installscript.qs14
-rw-r--r--examples/startmenu/packages/org.qtproject.ifw.example/meta/package.xml9
5 files changed, 41 insertions, 0 deletions
diff --git a/examples/startmenu/README b/examples/startmenu/README
new file mode 100644
index 000000000..aa0a0268b
--- /dev/null
+++ b/examples/startmenu/README
@@ -0,0 +1,6 @@
+Shows how to add an entry to the Windows start menu.
+
+Generate installer with
+
+binarycreator --offline-only -c config/config.xml -p packages start_menu_installer
+
diff --git a/examples/startmenu/config/config.xml b/examples/startmenu/config/config.xml
new file mode 100644
index 000000000..9a06186d3
--- /dev/null
+++ b/examples/startmenu/config/config.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Installer>
+ <Name>Start Menu Shortcut Example</Name>
+ <Version>1.0.0</Version>
+ <Title>Start Menu Shortcut Example</Title>
+ <Publisher>Qt-Project</Publisher>
+ <!-- Directory name is used in component.xml -->
+ <StartMenuDir>Qt Installer Framework Example</StartMenuDir>
+ <TargetDir>@homeDir@/IFWStartMenuExample</TargetDir>
+</Installer>
diff --git a/examples/startmenu/packages/org.qtproject.ifw.example/data/README.txt b/examples/startmenu/packages/org.qtproject.ifw.example/data/README.txt
new file mode 100644
index 000000000..e35ab831d
--- /dev/null
+++ b/examples/startmenu/packages/org.qtproject.ifw.example/data/README.txt
@@ -0,0 +1,2 @@
+This file can be opened through the start menu, "Qt Installer Framework Example" section!
+
diff --git a/examples/startmenu/packages/org.qtproject.ifw.example/meta/installscript.qs b/examples/startmenu/packages/org.qtproject.ifw.example/meta/installscript.qs
new file mode 100644
index 000000000..d3ed7edec
--- /dev/null
+++ b/examples/startmenu/packages/org.qtproject.ifw.example/meta/installscript.qs
@@ -0,0 +1,14 @@
+function Component()
+{
+ // default constructor
+}
+
+Component.prototype.createOperations = function()
+{
+ // call default implementation to actually install README.txt!
+ component.createOperations();
+
+ if (installer.value("os") === "win") {
+ component.addOperation("CreateShortcut", "@TargetDir@/README.txt", "@StartMenuDir@/README.lnk");
+ }
+}
diff --git a/examples/startmenu/packages/org.qtproject.ifw.example/meta/package.xml b/examples/startmenu/packages/org.qtproject.ifw.example/meta/package.xml
new file mode 100644
index 000000000..31a2beb6a
--- /dev/null
+++ b/examples/startmenu/packages/org.qtproject.ifw.example/meta/package.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Package>
+ <Name>org.qtproject.ifw.example</Name>
+ <DisplayName>README.txt</DisplayName>
+ <Description>A README.txt, accessible through a start menu entry.</Description>
+ <ReleaseDate>2013-01-01</ReleaseDate>
+ <Version>1.0.0-1</Version>
+ <Script>installscript.qs</Script>
+</Package>