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. Using "RegisterFileType" in Qt Installer Framework
Forum Updated to NodeBB v4.3 + New Features

Using "RegisterFileType" in Qt Installer Framework

Scheduled Pinned Locked Moved Qt Creator and other tools
7 Posts 5 Posters 3.7k 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.
  • M Offline
    M Offline
    mcleary
    wrote on last edited by
    #1

    I'm trying to create an installer that register a file extension. So I'm using the following commnad in my install script:

    @component.addOperation("RegisterFileType", "prp", "@TargetDir@/@ProductName@.exe");@

    But how can I provide the file being opened to my application? I didn't found anything in the "documentation":http://qt-project.org/doc/qtinstallerframework-1.5/operations.html

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mcleary
      wrote on last edited by
      #2

      I also would like to know how to provide an icon. The "registerfileextension" example do this:

      @component.createOperations();
      var iconId = 0;
      var notepadPath = installer.environmentVariable("SystemRoot") + "\notepad.exe";

      var isRegisterFileChecked = component.userInterface("RegisterFileCheckBoxesForm").RegisterFileCheckBox.checked;
      if (installer.value("os") === "win") {
          component.addOperation("RegisterFileType",
                                 component.unusalFileType,
                                 notepadPath + " '%1'",
                                 "QInstaller Framework example file type",
                                 "text/plain",
                                 notepadPath + "," + iconId,
                                 "ProgId=QtProject.QtInstallerFramework." + component.unusalFileType);
      }
      component.addOperation("Move", "@TargetDir@/registeredfile", component.registeredFile);@
      

      But how can I provide my own ico file?

      1 Reply Last reply
      0
      • M Offline
        M Offline
        mcleary
        wrote on last edited by
        #3

        Ok. After digging a bit I found my answers.

        • How to provide the file being opened to the command in "RegisterFileType"?
        • '%1' like in the example above
        • How to provide an icon for the file being registered
        • The icon must be in "TargetDir" or it must be some default icon file.
        A 1 Reply Last reply
        0
        • Q Offline
          Q Offline
          qxoz
          wrote on last edited by
          #4

          Hi mcleary.
          Thank you for sharing this solution. It would be great if you add doc notes for that.

          1 Reply Last reply
          0
          • K Offline
            K Offline
            kiro
            wrote on last edited by
            #5

            The registering works nicely for me with QtIFW 1.5, but is there a possibility to select my application as the DEFAULT application the file type is opened with? When an application has already registered the extension is stays the default application... :/

            1 Reply Last reply
            0
            • F Offline
              F Offline
              frankiefrank
              wrote on last edited by
              #6

              Thanks for this post and answer!

              Also interested in kiro's question.

              "Roads? Where we're going, we don't need roads."

              1 Reply Last reply
              0
              • M mcleary

                Ok. After digging a bit I found my answers.

                • How to provide the file being opened to the command in "RegisterFileType"?
                • '%1' like in the example above
                • How to provide an icon for the file being registered
                • The icon must be in "TargetDir" or it must be some default icon file.
                A Offline
                A Offline
                Amarjit123
                wrote on last edited by
                #7

                @mcleary Can you please provide the zip source code , as i am not able to make a running application out of it.

                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