Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Qt Installer Framework. How to create shortcut on the Windows desktop?
Forum Updated to NodeBB v4.3 + New Features

Qt Installer Framework. How to create shortcut on the Windows desktop?

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
5 Posts 2 Posters 3.1k Views 1 Watching
  • 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.
  • S Offline
    S Offline
    Sinbad
    wrote on last edited by
    #1

    My code:

    Component.prototype.createOperations = function()
    {
    	component.createOperations();
    
    	if (systemInfo.productType === "windows") {
    			component.addOperation("CreateShortcut", "@TargetDir@/Constructor.exe", "@DesktopDir@/Конструктор.lnk", "iconPath=@TargetDir@/icn_constructor.ICO");				
    	}
    }
    

    But sometimes i see this:
    alt text
    I guess this is because the icon was not in the @TargetDir@ when the shortcut was created. How to fix that?

    K 1 Reply Last reply
    0
    • S Sinbad

      My code:

      Component.prototype.createOperations = function()
      {
      	component.createOperations();
      
      	if (systemInfo.productType === "windows") {
      			component.addOperation("CreateShortcut", "@TargetDir@/Constructor.exe", "@DesktopDir@/Конструктор.lnk", "iconPath=@TargetDir@/icn_constructor.ICO");				
      	}
      }
      

      But sometimes i see this:
      alt text
      I guess this is because the icon was not in the @TargetDir@ when the shortcut was created. How to fix that?

      K Offline
      K Offline
      koahnig
      wrote on last edited by
      #2

      @Sinbad

      Looks fine to me.

      The only differences I have with the code I am using is:
      a "workingDirectory" is also declared and the icon is already part of the exe and therefore loaded from the exe.

      Vote the answer(s) that helped you to solve your issue(s)

      1 Reply Last reply
      1
      • S Offline
        S Offline
        Sinbad
        wrote on last edited by
        #3
        component.addOperation("CreateShortcut", "@TargetDir@/Constructor.exe", "@DesktopDir@/Конструктор.lnk", "workingDirectory=@TargetDir@");
        
        K 1 Reply Last reply
        1
        • S Sinbad
          component.addOperation("CreateShortcut", "@TargetDir@/Constructor.exe", "@DesktopDir@/Конструктор.lnk", "workingDirectory=@TargetDir@");
          
          K Offline
          K Offline
          koahnig
          wrote on last edited by koahnig
          #4

          @Sinbad

          That is apparently another possiblity.
          I have a duplication then with

          component.addOperation("CreateShortcut",  "@TargetDir@/Constructor.exe", "@DesktopDir@/Конструктор.lnk", "workingDirectory=@TargetDir@", "iconPath=@TargetDir@/Constructor.exe");
          

          for your case

          Vote the answer(s) that helped you to solve your issue(s)

          1 Reply Last reply
          1
          • S Offline
            S Offline
            Sinbad
            wrote on last edited by Sinbad
            #5

            Sometimes, it works. But somtimes i need to refresh the desktop to see app icons. Maybe it's beacouse I need to create 3 icons, not just one?

            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