Qt Installer Framework: Add startup-menu item and desktop icon under Windows
Unsolved
Installation and Deployment
-
I have attempted to create an installer via Qt Installer Framework (v4.5) which installs the application and adds a start-menu item and desktop icon.
I created the following folders and files to create the package (as explained in the Qt Tutorial):
- config | + config.xml + installscript.qs + appicon.ico + winicon.ico - packages | +- Apples | + <data and meta folders> +- Oranges + <data and meta folders>
Contents of
config/config.xml
:<?xml version="1.0" encoding="UTF-8"?> <Installer> <Name>Fruits</Name> <Version>22.0</Version> <Title>Fruits 22.0</Title> <Publisher>Fruit Factory</Publisher> <ProductUrl>https://fruitproject.com</ProductUrl> <InstallerApplicationIcon>appicon.ico</InstallerApplicationIcon> <InstallerWindowIcon>winicon.ico</InstallerWindowIcon> <StartMenuDir>FruitMenu</StartMenuDir> <TargetDir>C:/Fruits-22.0</TargetDir> <ControlScript>installscript.qs</ControlScript> </Installer>
Contents of
config/installscript.qs
:function Component() { // default constructor } Component.prototype.createOperations = function () { component.createOperations(); component.addOperation("CreateShortcut", "@TargetDir@/bin/Apples.exe", "@DesktopDir@/Apples.lnk", "workingDirectory=@TargetDir@/bin", "iconPath=@TargetDir@/bin/Apples.exe", "iconId=0", "description=Open Apples"); component.addOperation("CreateShortcut", "@TargetDir@/bin/Apples.exe", "@StartMenuDir@/Apples.lnk", "workingDirectory=@TargetDir@/bin", "iconPath=@TargetDir@/bin/Apples.exe", "iconId=0", "description=Open Apples"); }
I create the package on the command line via
binarycreator.exe -c config/config.xml -p packages fruit_installer.exe
under Windows 10 Pro (version 22H2).
The created installer
fruit_installer.exe
runs and installs the files into the appropriate folders, yet it neither creates a startup-menu item, nor a desktop shortcut.Please let me know how to amend the config file or the control script to create a startup-menu item and a desktop shortcut.