Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Qt Installer Framework: Add startup-menu item and desktop icon under Windows
Forum Updated to NodeBB v4.3 + New Features

Qt Installer Framework: Add startup-menu item and desktop icon under Windows

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
1 Posts 1 Posters 265 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    AlQuemiste
    wrote on last edited by
    #1

    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.

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved