Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct


    Qt World Summit: Early-Bird Tickets

    Solved Creating start menu shortcut using Qt installer framework

    General and Desktop
    windows 7 installer
    2
    4
    4382
    Loading More Posts
    • 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.
    • Ratzz
      Ratzz last edited by Ratzz

      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 Reply Quote 0
      • Ratzz
        Ratzz last edited by 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);
            
        
        		
        

        --Alles ist gut.

        K 1 Reply Last reply Reply Quote 2
        • K
          koahnig @Ratzz last edited by koahnig

          @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)

          Ratzz 1 Reply Last reply Reply Quote 0
          • Ratzz
            Ratzz @koahnig last edited by

            @koahnig
            Yes .

            --Alles ist gut.

            1 Reply Last reply Reply Quote 0
            • First post
              Last post