Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6075237
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:28:19+00:00 2026-05-23T10:28:19+00:00

I have to deploy a Qt Application on the following environments: Mac OS/X (>=

  • 0

I have to deploy a Qt Application on the following environments:

  • Mac OS/X (>= Tiger 10.4 Intel Based, up to Snow Leopard 10.6.+)
  • Windows XP
  • Windows Vista
  • Windows 7

I need a common access directory to put the License File, and I need every user of the machine to have read/write access to it – not only the administrator.

I checked many Qt functions like the following:

QString QDir::homePath()
QDir QDir::home ()
QString QDir::rootPath ()
QString QDir::tempPath ()

…but they all seem to return either user-specific or too-general paths.

Is there any Qt specific function to get a common “Applications Path”?

I ‘ve started to think about creating my own function taking into account the OS version,
but even in this case I feel a bit lost.
Do you know any good source to find what should be an appropriate path for each one for the OS I mentioned above?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T10:28:20+00:00Added an answer on May 23, 2026 at 10:28 am

    This is an answer to my own question,
    but I ‘ll wait to see if there is any better solutions.
    (maybe there is a Qt function I missed).

    I did the following hack using the QSettings class
    (@thequark: +1 for the inspiration):

    ---------------------------------------------
    QString orgName = "fooOrg";
    QString appName = "fooApp";
    QSettings qsettings(QSettings::IniFormat, QSettings::SystemScope, orgName, appName);
    QString iniFilepath = qsettings.fileName();
    QString commAppPath = iniFilepath.left(iniFilepath.length() - 
                                           QString("/fooOrg/fooApp.ini").length());
    ---------------------------------------------
    

    As you can see, I don’t really use the QSettings object but
    I just get its filepath to see where Qt is going to store it.

    It’s important to use:

    • QSettings::IniFormat: Because we are
      interested in a file – not e.g. a
      Windows registry position
    • QSettings::SystemScope: Because we want a machine specific and not
      a user-specific path

    The above code yields the following results for (1) iniFilepath (2) commAppPath variables and the various O/S:

    Mac Snow Leopard 10.6.7

    1. /Library/Preferences/Qt/fooOrg/fooApp.ini
    2. /Library/Preferences/Qt

    Windows XP-SP3

    1. C:/Documents And Settings/All Users/Application Data/fooOrg/fooApp.ini
    2. C:/Documents And Settings/All Users/Application Data

    Windows 7 (64) and Windows Vista SP2

    1. C:/ProgramData/fooOrg/fooApp.ini
    2. C:/ProgramData

    Although it’s a hack, I think it’s a good solution
    involving only internal Qt calls and not using any O/S specific functions.

    If you have any better idea… please let me know.

    EDIT – PS: In Mac OS-X the directory “/Library/Preferences” is not writable for a non-admin user. I finally used the directory “/Users/Shared”.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have to deploy our application on a Windows 2008 64 bit server. As
I have several deployment projects. In order to deploy an application, I need to
I have deployed an ASP.NET MVC application following the article How to: Deploy an
I have to deploy my ASP.NET application into two seperated IIS servers. My application
I have a question about how to deploy WPF application into a PC without
Hi I am trying to deploy an application using webstart. I have a requirement
I have to to deploy a Ruby on Rails application to an tomcat application
We have an application we're trying to deploy on both 64 bit and 32
I have Richfaces application which I deploy to Glassfish v3. For many weeks (almost)
I have application written in Visual Studio 2008 which I deploy with ClickOnce to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.