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. Passing target directory from QT Installer to the Application
Forum Updated to NodeBB v4.3 + New Features

Passing target directory from QT Installer to the Application

Scheduled Pinned Locked Moved Solved Installation and Deployment
8 Posts 4 Posters 987 Views 2 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.
  • faiszalkhanF Offline
    faiszalkhanF Offline
    faiszalkhan
    wrote on last edited by
    #1

    I am planning to deploy my application to macOS and Windows. Upon reading the documentation of QT Installer Framework, I understand that I can provide a default installation path in the config xml which the user can overwrite.

    In my application, I want to generate license files based on the installation path decided by the user. Hence, I need to have the installation path selected by the user passed to the application.

    Is there a way that I can get the target installation directory selected by the user in the application.

    Thanks.

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by mrjj
      #2

      Hi
      Just thinking out loud here.
      Do you really need to pass the path to your app?

      in your app
      qDebug() << "App path : " << qApp->applicationDirPath();

      should tell you where 'you' were installed.
      So if the license files are not there, then you can read the path and generate it on the first run.

      1 Reply Last reply
      1
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi,

        One thing to take into account: if installed properly, you won't be able to write anything in the application folder as their location shall be read-only and on macOS you shall not modify the application bundle content. You should rather store the license file in an application specific storage path provided by QStandardPaths.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        mrjjM faiszalkhanF 2 Replies Last reply
        3
        • SGaistS SGaist

          Hi,

          One thing to take into account: if installed properly, you won't be able to write anything in the application folder as their location shall be read-only and on macOS you shall not modify the application bundle content. You should rather store the license file in an application specific storage path provided by QStandardPaths.

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @SGaist
          hi
          A very good point that might also hold true for other platforms as well.
          Also, care should be taken that the location used for "generate license "
          is not affected by the user changing the Os language after app is installed.

          JonBJ 1 Reply Last reply
          0
          • mrjjM mrjj

            @SGaist
            hi
            A very good point that might also hold true for other platforms as well.
            Also, care should be taken that the location used for "generate license "
            is not affected by the user changing the Os language after app is installed.

            JonBJ Offline
            JonBJ Offline
            JonB
            wrote on last edited by
            #5

            @mrjj said in Passing target directory from QT Installer to the Application:

            A very good point that might also hold true for other platforms as well.

            Depending, if you do a "proper" install under Windows it will go into \Program Files ... and under Linux into /usr/.... Neither of which are writeable by your average user, so this is not just a Mac issue :)

            1 Reply Last reply
            2
            • SGaistS SGaist

              Hi,

              One thing to take into account: if installed properly, you won't be able to write anything in the application folder as their location shall be read-only and on macOS you shall not modify the application bundle content. You should rather store the license file in an application specific storage path provided by QStandardPaths.

              faiszalkhanF Offline
              faiszalkhanF Offline
              faiszalkhan
              wrote on last edited by
              #6

              @SGaist @mrjj When I check the writable locations available on macOS with QStandardPaths, I only get user specific path :
              "/Users/faisalkhan/Library/Application Support/Fairlinx/RapidFSM/"

              Which tells me that the files would not be available system wide : To other users.

              QStandardPaths with AppDataLocation shows a system wide path such as:
              "/Library/Application Support/Fairlinx/RapidFSM/" as non-writable path.

              Any workaround you would suggest to write the files to the later location.

              Thanks.

              1 Reply Last reply
              0
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #7

                You have to request higher privileges from your user to be able to write there.

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                faiszalkhanF 1 Reply Last reply
                2
                • SGaistS SGaist

                  You have to request higher privileges from your user to be able to write there.

                  faiszalkhanF Offline
                  faiszalkhanF Offline
                  faiszalkhan
                  wrote on last edited by
                  #8

                  @SGaist Thanks.

                  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