Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Creating start menu shortcut using Qt installer framework

Creating start menu shortcut using Qt installer framework

Scheduled Pinned Locked Moved Solved General and Desktop
windows 7installer
4 Posts 2 Posters 4.9k 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.
  • RatzzR Offline
    RatzzR Offline
    Ratzz
    wrote on last edited by Ratzz
    #1

    I am trying to create shortcut of a folder in the start menu of my application using Qt-framework installer . I have used this code in my installscript.qs i am able to get the shortcut of it in my start menu ( as shown for notepad). Is it possible to get the folder for the same using installer framework ??? (shown for notepad )

    Component.prototype.createmenuOperations = function()
    {
        component.createOperations();
    
        if (systemInfo.productType === "windows") {
            component.addOperation("CreateShortcut", "@TargetDir@/App.exe", "@StartMenuDir@/App.lnk",
                "workingDirectory=@TargetDir@", "iconPath=@TargetDir@/App.ico");
        }
    }
    

    and i have also tried

    Component.prototype.createmenuOperations = function()
    {
        component.createOperations();
    
        if (systemInfo.productType === "windows") {
            component.addOperation("CreateShortcut", "@TargetDir@", "@StartMenuDir@/App.lnk",
                "workingDirectory=@TargetDir@", "iconPath=@TargetDir@/App.ico");
        }
    }
    

    --Alles ist gut.

    1 Reply Last reply
    0
    • RatzzR Offline
      RatzzR Offline
      Ratzz
      wrote on last edited by Ratzz
      #2

      I have added these to my installscript.qs which creates a folder of my application .

      Component.prototype.createOperations = function()
      {
          try {
              // call the base create operations function
              component.createOperations();
              if (installer.value("os") == "win") { 
                  try {
      component.addOperation("CreateShortcut", "@TargetDir@/App.exe", "@StartMenuDir@/App.lnk", "workingDirectory=@TargetDir@", "iconPath=@TargetDir@/App.ico");
                  } catch (e) {
                      // Do nothing if key doesn't exist
                  }
              }
          } catch (e) {
              print(e);
          
      
      		
      

      --Alles ist gut.

      K 1 Reply Last reply
      2
      • RatzzR Ratzz

        I have added these to my installscript.qs which creates a folder of my application .

        Component.prototype.createOperations = function()
        {
            try {
                // call the base create operations function
                component.createOperations();
                if (installer.value("os") == "win") { 
                    try {
        component.addOperation("CreateShortcut", "@TargetDir@/App.exe", "@StartMenuDir@/App.lnk", "workingDirectory=@TargetDir@", "iconPath=@TargetDir@/App.ico");
                    } catch (e) {
                        // Do nothing if key doesn't exist
                    }
                }
            } catch (e) {
                print(e);
            
        
        		
        
        K Offline
        K Offline
        koahnig
        wrote on last edited by koahnig
        #3

        @Ratzz
        Did this solve your issue?

        [edit: koahnig] Found the example in the installer framework and I am able to create shortcut now.

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

        RatzzR 1 Reply Last reply
        0
        • K koahnig

          @Ratzz
          Did this solve your issue?

          [edit: koahnig] Found the example in the installer framework and I am able to create shortcut now.

          RatzzR Offline
          RatzzR Offline
          Ratzz
          wrote on last edited by
          #4

          @koahnig
          Yes .

          --Alles ist gut.

          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